diff --git a/apps/red-ui/src/app/app-routing.module.ts b/apps/red-ui/src/app/app-routing.module.ts index bf29d8918..23d068454 100644 --- a/apps/red-ui/src/app/app-routing.module.ts +++ b/apps/red-ui/src/app/app-routing.module.ts @@ -1,29 +1,14 @@ -import { AuthErrorComponent } from './screens/auth-error/auth-error.component'; -import { AuthGuard } from './auth/auth.guard'; -import { PdfViewerScreenComponent } from './screens/pdf-viewer-screen/pdf-viewer-screen.component'; -import { CompositeRouteGuard } from './utils/composite-route.guard'; -import { RedRoleGuard } from './auth/red-role.guard'; -import { HtmlDebugScreenComponent } from './screens/html-debug-screen/html-debug-screen.component'; -import { BaseScreenComponent } from './screens/base-screen/base-screen.component'; -import { ProjectListingScreenComponent } from './screens/project-listing-screen/project-listing-screen.component'; -import { AppStateGuard } from './state/app-state.guard'; -import { ProjectOverviewScreenComponent } from './screens/project-overview-screen/project-overview-screen.component'; -import { FilePreviewScreenComponent } from './screens/file/file-preview-screen/file-preview-screen.component'; -import { DownloadsListScreenComponent } from './screens/downloads-list-screen/downloads-list-screen.component'; -import { RuleSetsListingScreenComponent } from './screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component'; -import { DictionaryListingScreenComponent } from './screens/admin/dictionary-listing-screen/dictionary-listing-screen.component'; -import { DictionaryOverviewScreenComponent } from './screens/admin/dictionary-overview-screen/dictionary-overview-screen.component'; -import { PendingChangesGuard } from './utils/can-deactivate.guard'; -import { RulesScreenComponent } from './screens/admin/rules-screen/rules-screen.component'; -import { FileAttributesListingScreenComponent } from './screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component'; -import { WatermarkScreenComponent } from './screens/admin/watermark-screen/watermark-screen.component'; -import { DefaultColorsScreenComponent } from './screens/admin/default-colors-screen/default-colors-screen.component'; -import { UserListingScreenComponent } from './screens/admin/user-listing-screen/user-listing-screen.component'; -import { LicenseInformationScreenComponent } from './screens/admin/license-information-screen/license-information-screen.component'; -import { DigitalSignatureScreenComponent } from './screens/admin/digital-signature-screen/digital-signature-screen.component'; -import { AuditScreenComponent } from './screens/admin/audit-screen/audit-screen.component'; +import { AuthErrorComponent } from './components/auth-error/auth-error.component'; +import { AuthGuard } from './modules/auth/auth.guard'; +import { PdfViewerScreenComponent } from './components/pdf-viewer-screen/pdf-viewer-screen.component'; +import { CompositeRouteGuard } from './guards/composite-route.guard'; +import { RedRoleGuard } from './modules/auth/red-role.guard'; +import { HtmlDebugScreenComponent } from './components/html-debug-screen/html-debug-screen.component'; +import { BaseScreenComponent } from './components/base-screen/base-screen.component'; import { RouterModule } from '@angular/router'; import { NgModule } from '@angular/core'; +import { DownloadsListScreenComponent } from './components/downloads-list-screen/downloads-list-screen.component'; +import { AppStateGuard } from './state/app-state.guard'; const routes = [ { @@ -52,156 +37,23 @@ const routes = [ routeGuards: [AuthGuard, RedRoleGuard] } }, - { - path: 'ui', + path: 'ui/admin', component: BaseScreenComponent, - children: [ - { - path: 'projects', - component: ProjectListingScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'projects/:projectId', - component: ProjectOverviewScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'projects/:projectId/file/:fileId', - component: FilePreviewScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'downloads', - component: DownloadsListScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'admin', - children: [ - { path: '', redirectTo: 'project-templates', pathMatch: 'full' }, - { - path: 'project-templates', - children: [ - { - path: '', - component: RuleSetsListingScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: ':ruleSetId', - children: [ - { - path: 'dictionaries', - children: [ - { - path: '', - component: DictionaryListingScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: ':type', - component: DictionaryOverviewScreenComponent, - canActivate: [CompositeRouteGuard], - canDeactivate: [PendingChangesGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - } - ] - }, - { - path: 'rules', - component: RulesScreenComponent, - canActivate: [CompositeRouteGuard], - canDeactivate: [PendingChangesGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'file-attributes', - component: FileAttributesListingScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'watermark', - component: WatermarkScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'default-colors', - component: DefaultColorsScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { path: '', redirectTo: 'dictionaries', pathMatch: 'full' } - ] - } - ] - }, - { - path: 'users', - component: UserListingScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'license-info', - component: LicenseInformationScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'digital-signature', - component: DigitalSignatureScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - }, - { - path: 'audit', - component: AuditScreenComponent, - canActivate: [CompositeRouteGuard], - data: { - routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] - } - } - ] - } - ] + loadChildren: () => import('./modules/admin/admin.module').then((m) => m.AdminModule) + }, + { + path: 'ui/projects', + component: BaseScreenComponent, + loadChildren: () => import('./modules/projects/projects.module').then((m) => m.ProjectsModule) + }, + { + path: 'downloads', + component: DownloadsListScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } } ]; diff --git a/apps/red-ui/src/app/app.component.ts b/apps/red-ui/src/app/app.component.ts index 565113202..2fd4f50a0 100644 --- a/apps/red-ui/src/app/app.component.ts +++ b/apps/red-ui/src/app/app.component.ts @@ -1,5 +1,5 @@ import { Component, ViewContainerRef } from '@angular/core'; -import { AppLoadStateService } from './utils/app-load-state.service'; +import { AppLoadStateService } from './services/app-load-state.service'; declare var ace; diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index f56c0f802..b9142f7a1 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -3,243 +3,57 @@ import { APP_INITIALIZER, NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { ActivatedRoute, Router } from '@angular/router'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http'; -import { BaseScreenComponent } from './screens/base-screen/base-screen.component'; -import { ProjectListingScreenComponent } from './screens/project-listing-screen/project-listing-screen.component'; -import { ProjectOverviewScreenComponent } from './screens/project-overview-screen/project-overview-screen.component'; -import { MatToolbarModule } from '@angular/material/toolbar'; +import { BaseScreenComponent } from './components/base-screen/base-screen.component'; import { ApiModule } from '@redaction/red-ui-http'; -import { ApiPathInterceptorService } from './interceptor/api-path-interceptor.service'; -import { MatButtonModule } from '@angular/material/button'; +import { ApiPathInterceptor } from './utils/api-path-interceptor'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { MatMenuModule } from '@angular/material/menu'; import { languageInitializer } from './i18n/language.initializer'; import { LanguageService } from './i18n/language.service'; import { MomentDateAdapter } from '@angular/material-moment-adapter'; -import { MatIconModule } from '@angular/material/icon'; -import { IconsModule } from './icons/icons.module'; -import { AddEditProjectDialogComponent } from './dialogs/add-edit-project-dialog/add-edit-project-dialog.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { ConfirmationDialogComponent } from './dialogs/confirmation-dialog/confirmation-dialog.component'; -import { FilePreviewScreenComponent } from './screens/file/file-preview-screen/file-preview-screen.component'; -import { PdfViewerComponent } from './screens/file/pdf-viewer/pdf-viewer.component'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { NgpSortModule } from 'ngp-sort-pipe'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; import { ToastrModule } from 'ngx-toastr'; import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '../environments/environment'; -import { AuthModule } from './auth/auth.module'; -import { FileUploadDownloadModule } from './upload-download/file-upload-download.module'; -import { FullPageLoadingIndicatorComponent } from './components/full-page-loading-indicator/full-page-loading-indicator.component'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { InitialsAvatarComponent } from './components/initials-avatar/initials-avatar.component'; -import { StatusBarComponent } from './components/status-bar/status-bar.component'; -import { LogoComponent } from './logo/logo.component'; -import { SimpleDoughnutChartComponent } from './components/simple-doughnut-chart/simple-doughnut-chart.component'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { AnnotationIconComponent } from './components/annotation-icon/annotation-icon.component'; -import { AuthErrorComponent } from './screens/auth-error/auth-error.component'; -import { MatListModule } from '@angular/material/list'; -import { AssignOwnerDialogComponent } from './dialogs/assign-owner-dialog/assign-owner-dialog.component'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core'; -import { MatInputModule } from '@angular/material/input'; -import { HumanizePipe } from './utils/humanize.pipe'; -import { CommentsComponent } from './components/comments/comments.component'; -import { ManualAnnotationDialogComponent } from './dialogs/manual-redaction-dialog/manual-annotation-dialog.component'; +import { AuthModule } from './modules/auth/auth.module'; +import { LogoComponent } from './components/logo/logo.component'; +import { AuthErrorComponent } from './components/auth-error/auth-error.component'; +import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; import { ToastComponent } from './components/toast/toast.component'; -import { FilterComponent } from './components/filter/filter.component'; -import { TableColNameComponent } from './components/table-col-name/table-col-name.component'; -import { ProjectDetailsComponent } from './components/project-details/project-details.component'; -import { PageIndicatorComponent } from './screens/file/page-indicator/page-indicator.component'; -import { NeedsWorkBadgeComponent } from './components/needs-work-badge/needs-work-badge.component'; -import { ProjectListingEmptyComponent } from './components/empty-states/project-listing-empty/project-listing-empty.component'; -import { AnnotationActionsComponent } from './screens/file/annotation-actions/annotation-actions.component'; -import { ProjectListingDetailsComponent } from './components/project-listing-details/project-listing-details.component'; -import { FileActionsComponent } from './components/file-actions/file-actions.component'; -import { TypeAnnotationIconComponent } from './components/type-annotation-icon/type-annotation-icon.component'; -import { TypeFilterComponent } from './components/type-filter/type-filter.component'; -import { DictionaryAnnotationIconComponent } from './components/dictionary-annotation-icon/dictionary-annotation-icon.component'; -import { ProjectOverviewBulkActionsComponent } from './components/bulk-actions/project-overview-bulk-actions.component'; import { HttpCacheInterceptor } from '@redaction/red-cache'; -import { HiddenActionComponent } from './components/hidden-action/hidden-action.component'; -import { IconButtonComponent } from './components/buttons/icon-button/icon-button.component'; -import { UserButtonComponent } from './components/buttons/user-button/user-button.component'; -import { CircleButtonComponent } from './components/buttons/circle-button/circle-button.component'; -import { ChevronButtonComponent } from './components/buttons/chevron-button/chevron-button.component'; -import { DictionaryListingScreenComponent } from './screens/admin/dictionary-listing-screen/dictionary-listing-screen.component'; -import { SyncWidthDirective } from './utils/sync-width.directive'; -import { AddEditDictionaryDialogComponent } from './dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component'; -import { DictionaryOverviewScreenComponent } from './screens/admin/dictionary-overview-screen/dictionary-overview-screen.component'; -import { ColorPickerModule } from 'ngx-color-picker'; -import { AceEditorModule } from 'ng2-ace-editor'; -import { TeamMembersComponent } from './components/team-members/team-members.component'; -import { AdminBreadcrumbsComponent } from './components/admin-page-header/admin-breadcrumbs.component'; -import { UserListingScreenComponent } from './screens/admin/user-listing-screen/user-listing-screen.component'; import { NotificationsComponent } from './components/notifications/notifications.component'; -import { RulesScreenComponent } from './screens/admin/rules-screen/rules-screen.component'; -import { WatermarkScreenComponent } from './screens/admin/watermark-screen/watermark-screen.component'; -import { PdfViewerScreenComponent } from './screens/pdf-viewer-screen/pdf-viewer-screen.component'; -import { HtmlDebugScreenComponent } from './screens/html-debug-screen/html-debug-screen.component'; -import { ProjectListingActionsComponent } from './components/project-listing-actions/project-listing-actions.component'; -import { HasScrollbarDirective } from './utils/has-scrollbar.directive'; -import { RuleSetsListingScreenComponent } from './screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component'; -import { AddEditRuleSetDialogComponent } from './dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component'; -import { RuleSetActionsComponent } from './components/rule-set-actions/rule-set-actions.component'; -import { TabsComponent } from './components/rule-set-view-switch/tabs.component'; -import { MatSliderModule } from '@angular/material/slider'; -import { OverwriteFilesDialogComponent } from './dialogs/overwrite-files-dialog/overwrite-files-dialog.component'; +import { PdfViewerScreenComponent } from './components/pdf-viewer-screen/pdf-viewer-screen.component'; +import { HtmlDebugScreenComponent } from './components/html-debug-screen/html-debug-screen.component'; import { KeycloakService } from 'keycloak-angular'; -import { FileDownloadBtnComponent } from './components/buttons/file-download-btn/file-download-btn.component'; -import { LicenseInformationScreenComponent } from './screens/admin/license-information-screen/license-information-screen.component'; -import { DefaultColorsScreenComponent } from './screens/admin/default-colors-screen/default-colors-screen.component'; -import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component'; -import { DownloadsListScreenComponent } from './screens/downloads-list-screen/downloads-list-screen.component'; -import { DigitalSignatureScreenComponent } from './screens/admin/digital-signature-screen/digital-signature-screen.component'; -import { ScrollingModule } from '@angular/cdk/scrolling'; -import { RemoveAnnotationsDialogComponent } from './dialogs/remove-annotations-dialog/remove-annotations-dialog.component'; -import { NgxChartsModule } from '@swimlane/ngx-charts'; -import { ComboChartComponent, ComboSeriesVerticalComponent } from './components/combo-chart'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { ForceRedactionDialogComponent } from './dialogs/force-redaction-dialog/force-redaction-dialog.component'; -import { AuditScreenComponent } from './screens/admin/audit-screen/audit-screen.component'; -import { PaginationComponent } from './components/pagination/pagination.component'; -import { FileAttributesListingScreenComponent } from './screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component'; -import { SearchInputComponent } from './components/search-input/search-input.component'; +import { DownloadsListScreenComponent } from './components/downloads-list-screen/downloads-list-screen.component'; import { AppRoutingModule } from './app-routing.module'; -import { AddEditFileAttributeDialogComponent } from './dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; -import { ConfirmDeleteFileAttributeDialogComponent } from './dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component'; -import { DocumentInfoDialogComponent } from './dialogs/document-info-dialog/document-info-dialog.component'; -import { DocumentInfoComponent } from './components/document-info/document-info.component'; -import { FileWorkloadComponent } from './components/file-workload/file-workload.component'; +import { SharedModule } from './modules/shared/shared.module'; +import { FileUploadDownloadModule } from './modules/upload-download/file-upload-download.module'; export function HttpLoaderFactory(httpClient: HttpClient) { return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json'); } -const matImports = [ - MatDialogModule, - MatNativeDateModule, - MatToolbarModule, - MatButtonModule, - MatSlideToggleModule, - MatSliderModule, - MatMenuModule, - MatIconModule, - MatTooltipModule, - MatSnackBarModule, - MatTabsModule, - MatButtonToggleModule, - MatFormFieldModule, - MatProgressSpinnerModule, - MatCheckboxModule, - MatListModule, - MatDatepickerModule, - MatInputModule, - MatSelectModule, - MatSidenavModule -]; +const screens = [BaseScreenComponent, PdfViewerScreenComponent, HtmlDebugScreenComponent, DownloadsListScreenComponent]; + +const components = [AppComponent, LogoComponent, AuthErrorComponent, ToastComponent, NotificationsComponent, ...screens]; @NgModule({ - declarations: [ - AppComponent, - BaseScreenComponent, - ProjectListingScreenComponent, - ProjectOverviewScreenComponent, - AddEditProjectDialogComponent, - ConfirmationDialogComponent, - OverwriteFilesDialogComponent, - FilePreviewScreenComponent, - PdfViewerComponent, - AssignOwnerDialogComponent, - FullPageLoadingIndicatorComponent, - InitialsAvatarComponent, - StatusBarComponent, - LogoComponent, - SimpleDoughnutChartComponent, - ManualAnnotationDialogComponent, - ForceRedactionDialogComponent, - AnnotationIconComponent, - AuthErrorComponent, - HumanizePipe, - CommentsComponent, - ToastComponent, - FilterComponent, - TableColNameComponent, - ProjectDetailsComponent, - PageIndicatorComponent, - NeedsWorkBadgeComponent, - ProjectListingEmptyComponent, - AnnotationActionsComponent, - ProjectListingEmptyComponent, - ProjectListingDetailsComponent, - FileActionsComponent, - TypeAnnotationIconComponent, - TypeFilterComponent, - DictionaryAnnotationIconComponent, - ProjectOverviewBulkActionsComponent, - FileActionsComponent, - HiddenActionComponent, - IconButtonComponent, - UserButtonComponent, - CircleButtonComponent, - ChevronButtonComponent, - DictionaryListingScreenComponent, - RuleSetsListingScreenComponent, - AddEditRuleSetDialogComponent, - SyncWidthDirective, - HasScrollbarDirective, - AddEditDictionaryDialogComponent, - DictionaryOverviewScreenComponent, - TeamMembersComponent, - AdminBreadcrumbsComponent, - UserListingScreenComponent, - NotificationsComponent, - RulesScreenComponent, - WatermarkScreenComponent, - PdfViewerScreenComponent, - HtmlDebugScreenComponent, - FileDownloadBtnComponent, - ProjectListingActionsComponent, - RuleSetActionsComponent, - TabsComponent, - LicenseInformationScreenComponent, - DefaultColorsScreenComponent, - EditColorDialogComponent, - DownloadsListScreenComponent, - DigitalSignatureScreenComponent, - RemoveAnnotationsDialogComponent, - ComboChartComponent, - ComboSeriesVerticalComponent, - AuditScreenComponent, - PaginationComponent, - FileAttributesListingScreenComponent, - SearchInputComponent, - AddEditFileAttributeDialogComponent, - ConfirmDeleteFileAttributeDialogComponent, - DocumentInfoDialogComponent, - DocumentInfoComponent, - FileWorkloadComponent - ], + declarations: [...components], imports: [ BrowserModule, BrowserAnimationsModule, - FormsModule, - ReactiveFormsModule, + SharedModule, + FileUploadDownloadModule, HttpClientModule, AuthModule, - IconsModule, ApiModule, - NgxChartsModule, + AppRoutingModule, + ToastrModule.forRoot({ + closeButton: true, + enableHtml: true, + toastComponent: ToastComponent + }), TranslateModule.forRoot({ loader: { provide: TranslateLoader, @@ -247,26 +61,13 @@ const matImports = [ deps: [HttpClient] } }), - AppRoutingModule, - NgpSortModule, - ...matImports, - ToastrModule.forRoot({ - closeButton: true, - enableHtml: true, - toastComponent: ToastComponent - }), - FileUploadDownloadModule, - ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), - ColorPickerModule, - AceEditorModule, - ScrollingModule, - MatProgressBarModule + ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }) ], providers: [ { provide: HTTP_INTERCEPTORS, multi: true, - useClass: ApiPathInterceptorService + useClass: ApiPathInterceptor }, { provide: HTTP_INTERCEPTORS, diff --git a/apps/red-ui/src/app/screens/auth-error/auth-error.component.html b/apps/red-ui/src/app/components/auth-error/auth-error.component.html similarity index 64% rename from apps/red-ui/src/app/screens/auth-error/auth-error.component.html rename to apps/red-ui/src/app/components/auth-error/auth-error.component.html index 421a81582..eb7dd22d8 100644 --- a/apps/red-ui/src/app/screens/auth-error/auth-error.component.html +++ b/apps/red-ui/src/app/components/auth-error/auth-error.component.html @@ -1,15 +1,8 @@
+

-

{ this._appLoadStateService.pushLoadingEvent(true); @@ -33,15 +23,10 @@ export class CompositeRouteGuard implements CanActivate { if (canActivateResult instanceof Promise) { canActivateResult = from(canActivateResult); } - if ( - typeof canActivateResult === 'boolean' || - canActivateResult instanceof UrlTree - ) { + if (typeof canActivateResult === 'boolean' || canActivateResult instanceof UrlTree) { canActivateResult = of(canActivateResult); } - const canActivatePipe: Observable = canActivateResult.pipe( - map((m) => !!m) - ); + const canActivatePipe: Observable = canActivateResult.pipe(map((m) => !!m)); compositeCanActivateObservable = compositeCanActivateObservable.pipe( mergeMap((bool) => { if (!bool) { diff --git a/apps/red-ui/src/app/screens/file/model/annotation.permissions.ts b/apps/red-ui/src/app/models/file/annotation.permissions.ts similarity index 97% rename from apps/red-ui/src/app/screens/file/model/annotation.permissions.ts rename to apps/red-ui/src/app/models/file/annotation.permissions.ts index 223d1af7c..64e311f94 100644 --- a/apps/red-ui/src/app/screens/file/model/annotation.permissions.ts +++ b/apps/red-ui/src/app/models/file/annotation.permissions.ts @@ -1,4 +1,4 @@ -import { UserWrapper } from '../../../user/user.service'; +import { UserWrapper } from '../../services/user.service'; import { AnnotationWrapper } from './annotation.wrapper'; export class AnnotationPermissions { diff --git a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts similarity index 100% rename from apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts rename to apps/red-ui/src/app/models/file/annotation.wrapper.ts diff --git a/apps/red-ui/src/app/screens/file/model/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts similarity index 99% rename from apps/red-ui/src/app/screens/file/model/file-data.model.ts rename to apps/red-ui/src/app/models/file/file-data.model.ts index 9655eb8ac..3bcc31bed 100644 --- a/apps/red-ui/src/app/screens/file/model/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -9,7 +9,7 @@ import { ViewedPages } from '@redaction/red-ui-http'; import { FileStatusWrapper } from './file-status.wrapper'; -import { UserWrapper } from '../../../user/user.service'; +import { UserWrapper } from '../../services/user.service'; import { AnnotationWrapper } from './annotation.wrapper'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { ViewMode } from './view-mode'; diff --git a/apps/red-ui/src/app/screens/file/model/file-status.wrapper.ts b/apps/red-ui/src/app/models/file/file-status.wrapper.ts similarity index 98% rename from apps/red-ui/src/app/screens/file/model/file-status.wrapper.ts rename to apps/red-ui/src/app/models/file/file-status.wrapper.ts index 234879708..698fd58fe 100644 --- a/apps/red-ui/src/app/screens/file/model/file-status.wrapper.ts +++ b/apps/red-ui/src/app/models/file/file-status.wrapper.ts @@ -1,5 +1,5 @@ import { FileStatus } from '@redaction/red-ui-http'; -import { StatusSorter } from '../../../utils/sorters/status-sorter'; +import { StatusSorter } from '../../utils/sorters/status-sorter'; export class FileStatusWrapper { constructor(public fileStatus: FileStatus, public reviewerName: string) {} diff --git a/apps/red-ui/src/app/screens/file/model/file-type.ts b/apps/red-ui/src/app/models/file/file-type.ts similarity index 100% rename from apps/red-ui/src/app/screens/file/model/file-type.ts rename to apps/red-ui/src/app/models/file/file-type.ts diff --git a/apps/red-ui/src/app/models/file/manual-annotation-response.ts b/apps/red-ui/src/app/models/file/manual-annotation-response.ts new file mode 100644 index 000000000..c19074328 --- /dev/null +++ b/apps/red-ui/src/app/models/file/manual-annotation-response.ts @@ -0,0 +1,16 @@ +import { ManualRedactionEntryWrapper } from './manual-redaction-entry.wrapper'; +import { ManualAddResponse } from '@redaction/red-ui-http'; + +export class ManualAnnotationResponse { + annotationId; + commentId; + + constructor(public manualRedactionEntryWrapper: ManualRedactionEntryWrapper, public manualAddResponse: ManualAddResponse) { + this.annotationId = manualAddResponse?.annotationId ? manualAddResponse.annotationId : new Date().getTime(); + this.commentId = manualAddResponse?.commentId ? manualAddResponse.commentId : new Date().getTime(); + } + + get dictionary() { + return this.manualRedactionEntryWrapper.manualRedactionEntry.type; + } +} diff --git a/apps/red-ui/src/app/screens/file/model/manual-redaction-entry.wrapper.ts b/apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts similarity index 100% rename from apps/red-ui/src/app/screens/file/model/manual-redaction-entry.wrapper.ts rename to apps/red-ui/src/app/models/file/manual-redaction-entry.wrapper.ts diff --git a/apps/red-ui/src/app/screens/file/model/redaction-log-entry.wrapper.ts b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts similarity index 100% rename from apps/red-ui/src/app/screens/file/model/redaction-log-entry.wrapper.ts rename to apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts diff --git a/apps/red-ui/src/app/screens/file/model/view-mode.ts b/apps/red-ui/src/app/models/file/view-mode.ts similarity index 100% rename from apps/red-ui/src/app/screens/file/model/view-mode.ts rename to apps/red-ui/src/app/models/file/view-mode.ts diff --git a/apps/red-ui/src/app/modules/admin/admin-routing.module.ts b/apps/red-ui/src/app/modules/admin/admin-routing.module.ts new file mode 100644 index 000000000..38a808796 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/admin-routing.module.ts @@ -0,0 +1,134 @@ +import { NgModule } from '@angular/core'; +import { AuthGuard } from '../auth/auth.guard'; +import { CompositeRouteGuard } from '../../guards/composite-route.guard'; +import { RedRoleGuard } from '../auth/red-role.guard'; +import { AppStateGuard } from '../../state/app-state.guard'; +import { RuleSetsListingScreenComponent } from './screens/rule-sets-listing/rule-sets-listing-screen.component'; +import { DictionaryListingScreenComponent } from './screens/dictionary-listing/dictionary-listing-screen.component'; +import { DictionaryOverviewScreenComponent } from './screens/dictionary-overview/dictionary-overview-screen.component'; +import { PendingChangesGuard } from '../../guards/can-deactivate.guard'; +import { RulesScreenComponent } from './screens/rules/rules-screen.component'; +import { FileAttributesListingScreenComponent } from './screens/file-attributes-listing/file-attributes-listing-screen.component'; +import { WatermarkScreenComponent } from './screens/watermark/watermark-screen.component'; +import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component'; +import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component'; +import { LicenseInformationScreenComponent } from './screens/license-information/license-information-screen.component'; +import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component'; +import { AuditScreenComponent } from './screens/audit/audit-screen.component'; +import { RouterModule } from '@angular/router'; + +const routes = [ + { path: '', redirectTo: 'project-templates', pathMatch: 'full' }, + { + path: 'project-templates', + children: [ + { + path: '', + component: RuleSetsListingScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: ':ruleSetId', + children: [ + { + path: 'dictionaries', + children: [ + { + path: '', + component: DictionaryListingScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: ':type', + component: DictionaryOverviewScreenComponent, + canActivate: [CompositeRouteGuard], + canDeactivate: [PendingChangesGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + } + ] + }, + { + path: 'rules', + component: RulesScreenComponent, + canActivate: [CompositeRouteGuard], + canDeactivate: [PendingChangesGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: 'file-attributes', + component: FileAttributesListingScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: 'watermark', + component: WatermarkScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: 'default-colors', + component: DefaultColorsScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { path: '', redirectTo: 'dictionaries', pathMatch: 'full' } + ] + } + ] + }, + { + path: 'users', + component: UserListingScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: 'license-info', + component: LicenseInformationScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: 'digital-signature', + component: DigitalSignatureScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: 'audit', + component: AuditScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AdminRoutingModule {} diff --git a/apps/red-ui/src/app/modules/admin/admin.module.ts b/apps/red-ui/src/app/modules/admin/admin.module.ts new file mode 100644 index 000000000..2ee36ea0a --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/admin.module.ts @@ -0,0 +1,67 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { AdminRoutingModule } from './admin-routing.module'; +import { RulesScreenComponent } from './screens/rules/rules-screen.component'; +import { SharedModule } from '../shared/shared.module'; +import { RuleSetsListingScreenComponent } from './screens/rule-sets-listing/rule-sets-listing-screen.component'; +import { AuditScreenComponent } from './screens/audit/audit-screen.component'; +import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component'; +import { DictionaryListingScreenComponent } from './screens/dictionary-listing/dictionary-listing-screen.component'; +import { DictionaryOverviewScreenComponent } from './screens/dictionary-overview/dictionary-overview-screen.component'; +import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component'; +import { FileAttributesListingScreenComponent } from './screens/file-attributes-listing/file-attributes-listing-screen.component'; +import { LicenseInformationScreenComponent } from './screens/license-information/license-information-screen.component'; +import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component'; +import { WatermarkScreenComponent } from './screens/watermark/watermark-screen.component'; +import { AdminBreadcrumbsComponent } from './components/breadcrumbs/admin-breadcrumbs.component'; +import { RuleSetActionsComponent } from './components/rule-set-actions/rule-set-actions.component'; +import { TabsComponent } from './components/tabs/tabs.component'; +import { AceEditorModule } from 'ng2-ace-editor'; +import { ColorPickerModule } from 'ngx-color-picker'; +import { AddEditFileAttributeDialogComponent } from './dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; +import { AddEditRuleSetDialogComponent } from './dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component'; +import { AddEditDictionaryDialogComponent } from './dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component'; +import { ConfirmDeleteFileAttributeDialogComponent } from './dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component'; +import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component'; +import { ComboChartComponent, ComboSeriesVerticalComponent } from './components/combo-chart'; +import { NgxChartsModule } from '@swimlane/ngx-charts'; +import { AdminDialogService } from './services/admin-dialog-service.service'; + +const dialogs = [ + AddEditRuleSetDialogComponent, + AddEditDictionaryDialogComponent, + AddEditFileAttributeDialogComponent, + ConfirmDeleteFileAttributeDialogComponent, + EditColorDialogComponent +]; + +const screens = [ + RuleSetsListingScreenComponent, + RulesScreenComponent, + AuditScreenComponent, + DefaultColorsScreenComponent, + DictionaryListingScreenComponent, + DictionaryOverviewScreenComponent, + DigitalSignatureScreenComponent, + FileAttributesListingScreenComponent, + LicenseInformationScreenComponent, + UserListingScreenComponent, + WatermarkScreenComponent +]; + +const components = [ + AdminBreadcrumbsComponent, + RuleSetActionsComponent, + TabsComponent, + ComboChartComponent, + ComboSeriesVerticalComponent, + ...dialogs, + ...screens +]; + +@NgModule({ + declarations: [...components], + providers: [AdminDialogService], + imports: [CommonModule, SharedModule, AdminRoutingModule, AceEditorModule, NgxChartsModule, ColorPickerModule] +}) +export class AdminModule {} diff --git a/apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.html b/apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.html similarity index 100% rename from apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.html rename to apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.html diff --git a/apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.scss b/apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.scss similarity index 100% rename from apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.scss rename to apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.scss diff --git a/apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.ts b/apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.ts similarity index 68% rename from apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.ts rename to apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.ts index d81a46fa9..ed49c74a6 100644 --- a/apps/red-ui/src/app/components/admin-page-header/admin-breadcrumbs.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/breadcrumbs/admin-breadcrumbs.component.ts @@ -1,7 +1,7 @@ import { Component, Input } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; -import { UserPreferenceService } from '../../utils/user-preference.service'; -import { PermissionsService } from '../../utils/permissions.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { UserPreferenceService } from '../../../../services/user-preference.service'; +import { PermissionsService } from '../../../../services/permissions.service'; @Component({ selector: 'redaction-admin-breadcrumbs', diff --git a/apps/red-ui/src/app/components/combo-chart/combo-chart.component.html b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.html similarity index 100% rename from apps/red-ui/src/app/components/combo-chart/combo-chart.component.html rename to apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.html diff --git a/apps/red-ui/src/app/components/combo-chart/combo-chart.component.scss b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.scss similarity index 100% rename from apps/red-ui/src/app/components/combo-chart/combo-chart.component.scss rename to apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.scss diff --git a/apps/red-ui/src/app/components/combo-chart/combo-chart.component.ts b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.ts similarity index 100% rename from apps/red-ui/src/app/components/combo-chart/combo-chart.component.ts rename to apps/red-ui/src/app/modules/admin/components/combo-chart/combo-chart.component.ts diff --git a/apps/red-ui/src/app/components/combo-chart/combo-series-vertical.component.ts b/apps/red-ui/src/app/modules/admin/components/combo-chart/combo-series-vertical.component.ts similarity index 100% rename from apps/red-ui/src/app/components/combo-chart/combo-series-vertical.component.ts rename to apps/red-ui/src/app/modules/admin/components/combo-chart/combo-series-vertical.component.ts diff --git a/apps/red-ui/src/app/components/combo-chart/index.ts b/apps/red-ui/src/app/modules/admin/components/combo-chart/index.ts similarity index 100% rename from apps/red-ui/src/app/components/combo-chart/index.ts rename to apps/red-ui/src/app/modules/admin/components/combo-chart/index.ts diff --git a/apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.html b/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.html similarity index 100% rename from apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.html rename to apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.html diff --git a/apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.scss b/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.scss similarity index 100% rename from apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.scss rename to apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.scss diff --git a/apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.ts b/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts similarity index 84% rename from apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.ts rename to apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts index 5f6d4c15a..9591cf183 100644 --- a/apps/red-ui/src/app/components/rule-set-actions/rule-set-actions.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/rule-set-actions/rule-set-actions.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { DialogService } from '../../dialogs/dialog.service'; -import { PermissionsService } from '../../utils/permissions.service'; -import { AppStateService } from '../../state/app-state.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { Router } from '@angular/router'; +import { AdminDialogService } from '../../services/admin-dialog-service.service'; @Component({ selector: 'redaction-rule-set-actions', @@ -14,7 +14,7 @@ export class RuleSetActionsComponent { @Output() loadRuleSetsData = new EventEmitter(); constructor( - private readonly _dialogService: DialogService, + private readonly _dialogService: AdminDialogService, private readonly _appStateService: AppStateService, private readonly _router: Router, public readonly permissionsService: PermissionsService diff --git a/apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.html b/apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.html similarity index 100% rename from apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.html rename to apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.html diff --git a/apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.scss b/apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.scss similarity index 100% rename from apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.scss rename to apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.scss diff --git a/apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.ts b/apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.ts similarity index 83% rename from apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.ts rename to apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.ts index 93307b4c1..a461ecbfc 100644 --- a/apps/red-ui/src/app/components/rule-set-view-switch/tabs.component.ts +++ b/apps/red-ui/src/app/modules/admin/components/tabs/tabs.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { AppStateService } from '../../state/app-state.service'; -import { UserPreferenceService } from '../../utils/user-preference.service'; -import { PermissionsService } from '../../utils/permissions.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { UserPreferenceService } from '../../../../services/user-preference.service'; +import { PermissionsService } from '../../../../services/permissions.service'; @Component({ selector: 'redaction-tabs', diff --git a/apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss similarity index 77% rename from apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss index f13f823c5..c5eefa9a6 100644 --- a/apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .first-row { display: flex; diff --git a/apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts similarity index 96% rename from apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts index d5fcc1b64..7ad52be92 100644 --- a/apps/red-ui/src/app/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts @@ -1,10 +1,10 @@ import { Component, Inject } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { DictionaryControllerService, TypeValue } from '@redaction/red-ui-http'; import { Observable } from 'rxjs'; -import { NotificationService, NotificationType } from '../../notification/notification.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; @Component({ diff --git a/apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.scss rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts similarity index 97% rename from apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts index 2eac7977f..efc1fb506 100644 --- a/apps/red-ui/src/app/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, Inject } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { FileAttributeConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; diff --git a/apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.scss rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts similarity index 97% rename from apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts rename to apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts index 1556eb426..73d38c520 100644 --- a/apps/red-ui/src/app/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import * as moment from 'moment'; diff --git a/apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.scss similarity index 72% rename from apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.scss rename to apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.scss index 7ae5f7b64..910d55c69 100644 --- a/apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.scss +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .dialog-header { color: $primary; diff --git a/apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts similarity index 95% rename from apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts rename to apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts index 1dff590e8..75f80f5b7 100644 --- a/apps/red-ui/src/app/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { FileAttributeConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; diff --git a/apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.html rename to apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.scss b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.scss rename to apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts similarity index 96% rename from apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.ts rename to apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts index 00c52b071..8cfc88482 100644 --- a/apps/red-ui/src/app/dialogs/edit-color-dialog/edit-color-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts @@ -1,7 +1,7 @@ import { Component, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; -import { NotificationService, NotificationType } from '../../notification/notification.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; diff --git a/apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss similarity index 100% rename from apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.scss diff --git a/apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts similarity index 98% rename from apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts index 768be70bd..e096504b9 100644 --- a/apps/red-ui/src/app/screens/admin/audit-screen/audit-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/audit/audit-screen.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { FormBuilder, FormGroup } from '@angular/forms'; import { AuditControllerService, AuditResponse, AuditSearchRequest } from '@redaction/red-ui-http'; import { TranslateService } from '@ngx-translate/core'; diff --git a/apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.scss similarity index 100% rename from apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.scss diff --git a/apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts similarity index 81% rename from apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts index 7fdaf535b..a81ccba03 100644 --- a/apps/red-ui/src/app/screens/admin/default-colors-screen/default-colors-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; -import { AppStateService } from '../../../state/app-state.service'; -import { Colors, DictionaryControllerService, TypeValue } from '@redaction/red-ui-http'; +import { AppStateService } from '../../../../state/app-state.service'; +import { Colors, DictionaryControllerService } from '@redaction/red-ui-http'; import { ActivatedRoute } from '@angular/router'; -import { SortingOption, SortingService } from '../../../utils/sorting.service'; -import { PermissionsService } from '../../../utils/permissions.service'; -import { DialogService } from '../../../dialogs/dialog.service'; +import { SortingOption, SortingService } from '../../../../services/sorting.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { AdminDialogService } from '../../services/admin-dialog-service.service'; @Component({ selector: 'redaction-default-colors-screen', @@ -21,7 +21,7 @@ export class DefaultColorsScreenComponent { private readonly _activatedRoute: ActivatedRoute, private readonly _dictionaryControllerService: DictionaryControllerService, private readonly _sortingService: SortingService, - private readonly _dialogService: DialogService, + private readonly _dialogService: AdminDialogService, public readonly permissionsService: PermissionsService ) { this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId); diff --git a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss similarity index 94% rename from apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss index defb8b5e7..99b012114 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../../assets/styles/red-variables'; -@import '../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; .header-item { padding: 0 16px 0 10px; diff --git a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts similarity index 90% rename from apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts index fd6b9f05a..267e4a401 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/dictionary-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts @@ -1,15 +1,15 @@ import { Component, OnInit } from '@angular/core'; -import { DoughnutChartConfig } from '../../../components/simple-doughnut-chart/simple-doughnut-chart.component'; +import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; import { DictionaryControllerService, TypeValue } from '@redaction/red-ui-http'; -import { SortingOption, SortingService } from '../../../utils/sorting.service'; -import { DialogService } from '../../../dialogs/dialog.service'; -import { AppStateService } from '../../../state/app-state.service'; +import { SortingOption, SortingService } from '../../../../services/sorting.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { tap } from 'rxjs/operators'; import { forkJoin } from 'rxjs'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { debounce } from '../../../utils/debounce'; +import { debounce } from '../../../../utils/debounce'; import { ActivatedRoute } from '@angular/router'; +import { AdminDialogService } from '../../services/admin-dialog-service.service'; @Component({ selector: 'redaction-dictionary-listing-screen', @@ -24,7 +24,7 @@ export class DictionaryListingScreenComponent implements OnInit { public searchForm: FormGroup; constructor( - private readonly _dialogService: DialogService, + private readonly _dialogService: AdminDialogService, private readonly _sortingService: SortingService, private readonly _formBuilder: FormBuilder, private readonly _dictionaryControllerService: DictionaryControllerService, diff --git a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.scss similarity index 95% rename from apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.scss index ac6cfedfd..ebf2d83c1 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../../assets/styles/red-variables'; -@import '../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; .editor-container { height: calc(100% - 50px); diff --git a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts similarity index 96% rename from apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts index 38329c23e..a44aba3be 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts @@ -1,17 +1,17 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { DictionaryControllerService, RuleSetModel, TypeValue } from '@redaction/red-ui-http'; -import { DialogService } from '../../../dialogs/dialog.service'; -import { AppStateService } from '../../../state/app-state.service'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { ActivatedRoute, Router } from '@angular/router'; import { AceEditorComponent } from 'ng2-ace-editor'; -import { debounce } from '../../../utils/debounce'; -import { NotificationService, NotificationType } from '../../../notification/notification.service'; +import { debounce } from '../../../../utils/debounce'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { saveAs } from 'file-saver'; -import { ComponentHasChanges } from '../../../utils/can-deactivate.guard'; +import { ComponentHasChanges } from '../../../../guards/can-deactivate.guard'; import { FormBuilder, FormGroup } from '@angular/forms'; +import { AdminDialogService } from '../../services/admin-dialog-service.service'; declare var ace; @@ -50,7 +50,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple private readonly _notificationService: NotificationService, protected readonly _translateService: TranslateService, private readonly _dictionaryControllerService: DictionaryControllerService, - private readonly _dialogService: DialogService, + private readonly _dialogService: AdminDialogService, private readonly _router: Router, private readonly _activatedRoute: ActivatedRoute, private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss similarity index 97% rename from apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss index 1080cac21..0234418a4 100644 --- a/apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../../assets/styles/red-mixins'; -@import '../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; .left-container { width: 100vw; diff --git a/apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts similarity index 96% rename from apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts index bbeb6b39b..367030168 100644 --- a/apps/red-ui/src/app/screens/admin/digital-signature-screen/digital-signature-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/digital-signature/digital-signature-screen.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; import { DigitalSignature, DigitalSignatureControllerService } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { NotificationService, NotificationType } from '../../../notification/notification.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; -import { PermissionsService } from '../../../utils/permissions.service'; -import { lastIndexOfEnd } from '../../../utils/functions'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { lastIndexOfEnd } from '../../../../utils/functions'; @Component({ selector: 'redaction-digital-signature-screen', diff --git a/apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss similarity index 100% rename from apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.scss diff --git a/apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts similarity index 90% rename from apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts index bd4ba6d31..ffcf6f42b 100644 --- a/apps/red-ui/src/app/screens/admin/file-attributes-listing-screen/file-attributes-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/file-attributes-listing/file-attributes-listing-screen.component.ts @@ -1,12 +1,12 @@ import { Component, OnInit } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { FormBuilder, FormGroup } from '@angular/forms'; import { FileAttributeConfig, FileAttributesControllerService } from '@redaction/red-ui-http'; -import { AppStateService } from '../../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { ActivatedRoute } from '@angular/router'; -import { debounce } from '../../../utils/debounce'; -import { SortingOption, SortingService } from '../../../utils/sorting.service'; -import { DialogService } from '../../../dialogs/dialog.service'; +import { debounce } from '../../../../utils/debounce'; +import { SortingOption, SortingService } from '../../../../services/sorting.service'; +import { AdminDialogService } from '../../services/admin-dialog-service.service'; @Component({ selector: 'redaction-file-attributes-listing-screen', @@ -27,7 +27,7 @@ export class FileAttributesListingScreenComponent implements OnInit { private readonly _fileAttributesService: FileAttributesControllerService, private readonly _appStateService: AppStateService, private readonly _activatedRoute: ActivatedRoute, - private readonly _dialogService: DialogService + private readonly _dialogService: AdminDialogService ) { this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId); diff --git a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.scss similarity index 89% rename from apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.scss index 4e11ec7da..4e08ae65d 100644 --- a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../../assets/styles/red-mixins'; -@import '../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; .left-container { width: 100vw; diff --git a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts similarity index 97% rename from apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts index 1e5081dba..628ae1ffd 100644 --- a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license-information/license-information-screen.component.ts @@ -1,10 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { LicenseReport, LicenseReportControllerService } from '@redaction/red-ui-http'; import { AppConfigService } from '../../../app-config/app-config.service'; import * as moment from 'moment'; import { TranslateService } from '@ngx-translate/core'; -import { Moment } from 'moment'; @Component({ selector: 'redaction-license-information-screen', @@ -75,7 +74,7 @@ export class LicenseInformationScreenComponent implements OnInit { }); } - private async _setMonthlyStats(startDate: Moment, endDate: Moment) { + private async _setMonthlyStats(startDate: moment.Moment, endDate: moment.Moment) { const [startMonth, startYear] = [startDate.month(), startDate.year()]; const [endMonth, endYear] = [endDate.month(), endDate.year()]; moment.locale(this._translateService.currentLang); diff --git a/apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.scss similarity index 93% rename from apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.scss index d86047322..9eba988fc 100644 --- a/apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../../assets/styles/red-variables'; -@import '../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; .header-item { padding: 0 24px 0 10px; diff --git a/apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts similarity index 87% rename from apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts index 06cc809fa..2bdb4f091 100644 --- a/apps/red-ui/src/app/screens/admin/rule-sets-listing-screen/rule-sets-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/rule-sets-listing/rule-sets-listing-screen.component.ts @@ -1,12 +1,12 @@ import { Component, OnInit } from '@angular/core'; -import { SortingOption, SortingService } from '../../../utils/sorting.service'; -import { DialogService } from '../../../dialogs/dialog.service'; -import { AppStateService } from '../../../state/app-state.service'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { SortingOption, SortingService } from '../../../../services/sorting.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { debounce } from '../../../utils/debounce'; +import { debounce } from '../../../../utils/debounce'; import { RuleSetModel } from '@redaction/red-ui-http'; -import { UserPreferenceService } from '../../../utils/user-preference.service'; +import { UserPreferenceService } from '../../../../services/user-preference.service'; +import { AdminDialogService } from '../../services/admin-dialog-service.service'; @Component({ selector: 'redaction-rule-sets-listing-screen', @@ -20,7 +20,7 @@ export class RuleSetsListingScreenComponent implements OnInit { public searchForm: FormGroup; constructor( - private readonly _dialogService: DialogService, + private readonly _dialogService: AdminDialogService, private readonly _sortingService: SortingService, private readonly _formBuilder: FormBuilder, private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.scss similarity index 76% rename from apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.scss index 1e01118db..c8898c41f 100644 --- a/apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-mixins'; .editor-container { width: 100%; diff --git a/apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts similarity index 94% rename from apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts index 21c30d8d9..ca482ad65 100644 --- a/apps/red-ui/src/app/screens/admin/rules-screen/rules-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/rules/rules-screen.component.ts @@ -1,13 +1,13 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { AceEditorComponent } from 'ng2-ace-editor'; import { RulesControllerService, RuleSetModel } from '@redaction/red-ui-http'; -import { NotificationService, NotificationType } from '../../../notification/notification.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { saveAs } from 'file-saver'; -import { ComponentHasChanges } from '../../../utils/can-deactivate.guard'; +import { ComponentHasChanges } from '../../../../guards/can-deactivate.guard'; import { ActivatedRoute } from '@angular/router'; -import { AppStateService } from '../../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; declare var ace; diff --git a/apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss similarity index 100% rename from apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.scss diff --git a/apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts similarity index 85% rename from apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts index f987df0de..81982666c 100644 --- a/apps/red-ui/src/app/screens/admin/user-listing-screen/user-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/user-listing/user-listing-screen.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; -import { UserService } from '../../../user/user.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { UserService } from '../../../../services/user.service'; import { User } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { debounce } from '../../../utils/debounce'; +import { debounce } from '../../../../utils/debounce'; @Component({ selector: 'redaction-user-listing-screen', diff --git a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.html rename to apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.html diff --git a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.scss b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss similarity index 97% rename from apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.scss rename to apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss index 6877969c8..908eb50b2 100644 --- a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .page-header .actions { display: flex; diff --git a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts similarity index 95% rename from apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts rename to apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts index c6f6b89f6..1febbc4fe 100644 --- a/apps/red-ui/src/app/screens/admin/watermark-screen/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts @@ -1,16 +1,16 @@ import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import WebViewer, { WebViewerInstance } from '@pdftron/webviewer'; -import { AppStateService } from '../../../state/app-state.service'; -import { environment } from '../../../../environments/environment'; +import { AppStateService } from '../../../../state/app-state.service'; +import { environment } from '../../../../../environments/environment'; import { HttpClient } from '@angular/common/http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { debounce } from '../../../utils/debounce'; +import { debounce } from '../../../../utils/debounce'; import { WatermarkControllerService, WatermarkModel } from '@redaction/red-ui-http'; -import { NotificationService, NotificationType } from '../../../notification/notification.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { ActivatedRoute } from '@angular/router'; -import { hexToRgb } from '../../../utils/functions'; +import { hexToRgb } from '../../../../utils/functions'; export const DEFAULT_WATERMARK: WatermarkModel = { text: null, diff --git a/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts b/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts new file mode 100644 index 000000000..863217838 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/services/admin-dialog-service.service.ts @@ -0,0 +1,155 @@ +import { Injectable } from '@angular/core'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { + Colors, + DictionaryControllerService, + FileAttributeConfig, + FileManagementControllerService, + FileStatus, + ManualRedactionControllerService, + RuleSetControllerService, + RuleSetModel, + TypeValue +} from '@redaction/red-ui-http'; +import { AddEditFileAttributeDialogComponent } from '../dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; +import { AddEditDictionaryDialogComponent } from '../dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component'; +import { AddEditRuleSetDialogComponent } from '../dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component'; +import { NotificationService, NotificationType } from '../../../services/notification.service'; +import { ConfirmationDialogComponent, ConfirmationDialogInput } from '../../shared/dialogs/confirmation-dialog/confirmation-dialog.component'; +import { ProjectWrapper } from '../../../state/model/project.wrapper'; +import { AppStateService } from '../../../state/app-state.service'; +import { ConfirmDeleteFileAttributeDialogComponent } from '../dialogs/confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component'; +import { EditColorDialogComponent } from '../dialogs/edit-color-dialog/edit-color-dialog.component'; +import { TranslateService } from '@ngx-translate/core'; + +const dialogConfig = { + width: '662px', + maxWidth: '90vw', + autoFocus: false +}; + +@Injectable() +export class AdminDialogService { + constructor( + private readonly _dialog: MatDialog, + private readonly _translateService: TranslateService, + private readonly _appStateService: AppStateService, + private readonly _ruleSetControllerService: RuleSetControllerService, + private readonly _dictionaryControllerService: DictionaryControllerService, + private readonly _fileManagementControllerService: FileManagementControllerService, + private readonly _notificationService: NotificationService, + private readonly _manualRedactionControllerService: ManualRedactionControllerService + ) {} + + public openDeleteDictionaryDialog($event: MouseEvent, dictionary: TypeValue, ruleSetId: string, cb?: Function): MatDialogRef { + $event.stopPropagation(); + const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig); + ref.afterClosed().subscribe(async (result) => { + if (result) { + await this._dictionaryControllerService.deleteType(dictionary.type, ruleSetId).toPromise(); + if (cb) cb(); + } + }); + return ref; + } + + public openDeleteRuleSetDialog($event: MouseEvent, ruleSet: RuleSetModel, cb?: Function): MatDialogRef { + $event.stopPropagation(); + const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig); + ref.afterClosed().subscribe(async (result) => { + if (result) { + await this._ruleSetControllerService.getAllRuleSets(ruleSet.ruleSetId).toPromise(); + if (cb) await cb(); + } + }); + return ref; + } + + public openAddEditDictionaryDialog(dictionary: TypeValue, ruleSetId: string, cb?: Function): MatDialogRef { + const ref = this._dialog.open(AddEditDictionaryDialogComponent, { + ...dialogConfig, + data: { dictionary, ruleSetId }, + autoFocus: true + }); + + ref.afterClosed().subscribe((result) => { + if (result && cb) { + cb(result); + } + }); + + return ref; + } + + public openEditColorsDialog(colors: Colors, colorKey: string, ruleSetId: string, cb?: Function): MatDialogRef { + const ref = this._dialog.open(EditColorDialogComponent, { + ...dialogConfig, + data: { colors, colorKey, ruleSetId }, + autoFocus: true + }); + + ref.afterClosed().subscribe((result) => { + if (result && cb) { + cb(result); + } + }); + + return ref; + } + + public openAddEditRuleSetDialog(ruleSet: RuleSetModel, cb?: Function): MatDialogRef { + const ref = this._dialog.open(AddEditRuleSetDialogComponent, { + ...dialogConfig, + data: ruleSet, + autoFocus: true + }); + + ref.afterClosed().subscribe((result) => { + if (result && cb) { + cb(result); + } + }); + + return ref; + } + + public openAddEditFileAttributeDialog( + fileAttribute: FileAttributeConfig, + ruleSetId: string, + cb?: Function + ): MatDialogRef { + const ref = this._dialog.open(AddEditFileAttributeDialogComponent, { + ...dialogConfig, + data: { fileAttribute, ruleSetId }, + autoFocus: true + }); + + ref.afterClosed().subscribe((result) => { + if (result && cb) { + cb(result); + } + }); + + return ref; + } + + public openConfirmDeleteFileAttributeDialog( + fileAttribute: FileAttributeConfig, + ruleSetId: string, + cb?: Function + ): MatDialogRef { + const ref = this._dialog.open(ConfirmDeleteFileAttributeDialogComponent, { + ...dialogConfig, + data: { fileAttribute, ruleSetId }, + autoFocus: true + }); + + ref.afterClosed().subscribe((result) => { + if (result && cb) { + cb(result); + } + }); + + return ref; + } +} diff --git a/apps/red-ui/src/app/app-config/app-config.module.ts b/apps/red-ui/src/app/modules/app-config/app-config.module.ts similarity index 100% rename from apps/red-ui/src/app/app-config/app-config.module.ts rename to apps/red-ui/src/app/modules/app-config/app-config.module.ts diff --git a/apps/red-ui/src/app/app-config/app-config.service.ts b/apps/red-ui/src/app/modules/app-config/app-config.service.ts similarity index 96% rename from apps/red-ui/src/app/app-config/app-config.service.ts rename to apps/red-ui/src/app/modules/app-config/app-config.service.ts index 789474ca6..c02ae7b04 100644 --- a/apps/red-ui/src/app/app-config/app-config.service.ts +++ b/apps/red-ui/src/app/modules/app-config/app-config.service.ts @@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http'; import { tap } from 'rxjs/operators'; import { Observable } from 'rxjs'; import { Title } from '@angular/platform-browser'; -import { version } from '../../../../../package.json'; +import { version } from '../../../../../../package.json'; export enum AppConfigKey { OAUTH_URL = 'OAUTH_URL', diff --git a/apps/red-ui/src/app/auth/auth.guard.ts b/apps/red-ui/src/app/modules/auth/auth.guard.ts similarity index 87% rename from apps/red-ui/src/app/auth/auth.guard.ts rename to apps/red-ui/src/app/modules/auth/auth.guard.ts index 48ec5ed83..d6b75d7fb 100644 --- a/apps/red-ui/src/app/auth/auth.guard.ts +++ b/apps/red-ui/src/app/modules/auth/auth.guard.ts @@ -1,8 +1,8 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router'; import { KeycloakAuthGuard, KeycloakService } from 'keycloak-angular'; -import { UserService } from '../user/user.service'; -import { AppLoadStateService } from '../utils/app-load-state.service'; +import { UserService } from '../../services/user.service'; +import { AppLoadStateService } from '../../services/app-load-state.service'; @Injectable({ providedIn: 'root' diff --git a/apps/red-ui/src/app/auth/auth.module.ts b/apps/red-ui/src/app/modules/auth/auth.module.ts similarity index 100% rename from apps/red-ui/src/app/auth/auth.module.ts rename to apps/red-ui/src/app/modules/auth/auth.module.ts diff --git a/apps/red-ui/src/app/auth/red-role.guard.ts b/apps/red-ui/src/app/modules/auth/red-role.guard.ts similarity index 92% rename from apps/red-ui/src/app/auth/red-role.guard.ts rename to apps/red-ui/src/app/modules/auth/red-role.guard.ts index fb0e196ff..38d3e1dd1 100644 --- a/apps/red-ui/src/app/auth/red-role.guard.ts +++ b/apps/red-ui/src/app/modules/auth/red-role.guard.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; -import { UserService } from '../user/user.service'; -import { AppLoadStateService } from '../utils/app-load-state.service'; +import { UserService } from '../../services/user.service'; +import { AppLoadStateService } from '../../services/app-load-state.service'; import { Observable } from 'rxjs'; @Injectable({ diff --git a/apps/red-ui/src/app/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts similarity index 100% rename from apps/red-ui/src/app/icons/icons.module.ts rename to apps/red-ui/src/app/modules/icons/icons.module.ts diff --git a/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts b/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts new file mode 100644 index 000000000..79e2e3042 --- /dev/null +++ b/apps/red-ui/src/app/modules/mat-config/mat-config.module.ts @@ -0,0 +1,42 @@ +import { NgModule } from '@angular/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatNativeDateModule } from '@angular/material/core'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatButtonModule } from '@angular/material/button'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; + +const matImports = [ + MatDialogModule, + MatNativeDateModule, + MatToolbarModule, + MatButtonModule, + MatSlideToggleModule, + MatSliderModule, + MatMenuModule, + MatTooltipModule, + MatButtonToggleModule, + MatFormFieldModule, + MatProgressSpinnerModule, + MatCheckboxModule, + MatDatepickerModule, + MatInputModule, + MatSelectModule, + MatProgressBarModule +]; + +@NgModule({ + imports: [...matImports], + exports: [...matImports] +}) +export class MatConfigModule {} diff --git a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.html similarity index 100% rename from apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html rename to apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.html diff --git a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.scss b/apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.scss similarity index 91% rename from apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.scss rename to apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.scss index 0838c2ddc..938102fcd 100644 --- a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .annotation-actions { position: absolute; diff --git a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.ts b/apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.ts similarity index 84% rename from apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.ts rename to apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.ts index bb07606c9..89d1faaf8 100644 --- a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/annotation-actions/annotation-actions.component.ts @@ -1,9 +1,9 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { AnnotationWrapper } from '../model/annotation.wrapper'; -import { AppStateService } from '../../../state/app-state.service'; -import { PermissionsService } from '../../../utils/permissions.service'; -import { AnnotationPermissions } from '../model/annotation.permissions'; -import { AnnotationActionsService } from '../../../utils/annotation-actions.service'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; +import { AppStateService } from '../../../../state/app-state.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { AnnotationPermissions } from '../../../../models/file/annotation.permissions'; +import { AnnotationActionsService } from '../../services/annotation-actions.service'; import { Annotations, WebViewerInstance } from '@pdftron/webviewer'; @Component({ diff --git a/apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.html b/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.html similarity index 100% rename from apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.html rename to apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.html diff --git a/apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.scss b/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.scss similarity index 100% rename from apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.scss rename to apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.scss diff --git a/apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.ts b/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.ts similarity index 88% rename from apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.ts rename to apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.ts index 9c61f246d..7dd2009fc 100644 --- a/apps/red-ui/src/app/components/bulk-actions/project-overview-bulk-actions.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.ts @@ -1,13 +1,13 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; -import { UserService } from '../../user/user.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { UserService } from '../../../../services/user.service'; import { FileManagementControllerService, ReanalysisControllerService } from '@redaction/red-ui-http'; -import { DialogService } from '../../dialogs/dialog.service'; -import { PermissionsService } from '../../utils/permissions.service'; -import { FileStatusWrapper } from '../../screens/file/model/file-status.wrapper'; -import { FileActionService } from '../../screens/file/service/file-action.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; +import { FileActionService } from '../../services/file-action.service'; import { Observable } from 'rxjs'; -import { StatusOverlayService } from '../../upload-download/status-overlay.service'; +import { StatusOverlayService } from '../../../upload-download/services/status-overlay.service'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-project-overview-bulk-actions', @@ -22,7 +22,7 @@ export class ProjectOverviewBulkActionsComponent { constructor( private readonly _appStateService: AppStateService, private readonly _userService: UserService, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _fileManagementControllerService: FileManagementControllerService, private readonly _reanalysisControllerService: ReanalysisControllerService, private readonly _permissionsService: PermissionsService, diff --git a/apps/red-ui/src/app/components/comments/comments.component.html b/apps/red-ui/src/app/modules/projects/components/comments/comments.component.html similarity index 100% rename from apps/red-ui/src/app/components/comments/comments.component.html rename to apps/red-ui/src/app/modules/projects/components/comments/comments.component.html diff --git a/apps/red-ui/src/app/components/comments/comments.component.scss b/apps/red-ui/src/app/modules/projects/components/comments/comments.component.scss similarity index 95% rename from apps/red-ui/src/app/components/comments/comments.component.scss rename to apps/red-ui/src/app/modules/projects/components/comments/comments.component.scss index 127df2bed..cd89c143a 100644 --- a/apps/red-ui/src/app/components/comments/comments.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/comments/comments.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .wrapper { display: flex; diff --git a/apps/red-ui/src/app/components/comments/comments.component.ts b/apps/red-ui/src/app/modules/projects/components/comments/comments.component.ts similarity index 90% rename from apps/red-ui/src/app/components/comments/comments.component.ts rename to apps/red-ui/src/app/modules/projects/components/comments/comments.component.ts index f58485d92..896aa5709 100644 --- a/apps/red-ui/src/app/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/comments/comments.component.ts @@ -1,10 +1,10 @@ import { ChangeDetectorRef, Component, Input } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Comment } from '@redaction/red-ui-http'; -import { ManualAnnotationService } from '../../screens/file/service/manual-annotation.service'; -import { AnnotationWrapper } from '../../screens/file/model/annotation.wrapper'; -import { UserService } from '../../user/user.service'; -import { AppStateService } from '../../state/app-state.service'; +import { ManualAnnotationService } from '../../services/manual-annotation.service'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; +import { UserService } from '../../../../services/user.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { TranslateService } from '@ngx-translate/core'; @Component({ diff --git a/apps/red-ui/src/app/components/document-info/document-info.component.html b/apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.html similarity index 100% rename from apps/red-ui/src/app/components/document-info/document-info.component.html rename to apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.html diff --git a/apps/red-ui/src/app/components/document-info/document-info.component.scss b/apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.scss similarity index 88% rename from apps/red-ui/src/app/components/document-info/document-info.component.scss rename to apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.scss index 0a3a68fc2..3e0d3e4c4 100644 --- a/apps/red-ui/src/app/components/document-info/document-info.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.scss @@ -1,5 +1,5 @@ -@import '../../../assets/styles/red-variables'; -@import '../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; :host { display: block; diff --git a/apps/red-ui/src/app/components/document-info/document-info.component.ts b/apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.ts similarity index 83% rename from apps/red-ui/src/app/components/document-info/document-info.component.ts rename to apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.ts index aea583951..76754ae07 100644 --- a/apps/red-ui/src/app/components/document-info/document-info.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/document-info/document-info.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FileAttributeConfig, FileAttributesControllerService, FileStatus } from '@redaction/red-ui-http'; -import { AppStateService } from '../../state/app-state.service'; -import { DialogService } from '../../dialogs/dialog.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-document-info', @@ -17,7 +17,7 @@ export class DocumentInfoComponent implements OnInit { constructor( private readonly _appStateService: AppStateService, private readonly _fileAttributesService: FileAttributesControllerService, - private readonly _dialogService: DialogService + private readonly _dialogService: ProjectsDialogService ) { this.fileAttributesConfig = this._appStateService.fileAttributesConfig.filter((attr) => attr.visible); } diff --git a/apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.html b/apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.html similarity index 100% rename from apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.html rename to apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.html diff --git a/apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.scss b/apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.scss similarity index 100% rename from apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.scss rename to apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.scss diff --git a/apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.ts b/apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.ts similarity index 85% rename from apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.ts rename to apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.ts index 1cae7a6c4..19a09cd23 100644 --- a/apps/red-ui/src/app/components/empty-states/project-listing-empty/project-listing-empty.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/empty-states/project-listing-empty/project-listing-empty.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Output } from '@angular/core'; -import { UserService } from '../../../user/user.service'; +import { UserService } from '../../../../../services/user.service'; @Component({ selector: 'redaction-project-listing-empty', diff --git a/apps/red-ui/src/app/components/file-actions/file-actions.component.html b/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.html similarity index 100% rename from apps/red-ui/src/app/components/file-actions/file-actions.component.html rename to apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.html diff --git a/apps/red-ui/src/app/components/file-actions/file-actions.component.scss b/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.scss similarity index 100% rename from apps/red-ui/src/app/components/file-actions/file-actions.component.scss rename to apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.scss diff --git a/apps/red-ui/src/app/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.ts similarity index 86% rename from apps/red-ui/src/app/components/file-actions/file-actions.component.ts rename to apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.ts index e03256bc6..682c375e1 100644 --- a/apps/red-ui/src/app/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.ts @@ -1,11 +1,9 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { PermissionsService } from '../../utils/permissions.service'; -import { FileStatusWrapper } from '../../screens/file/model/file-status.wrapper'; -import { DialogService } from '../../dialogs/dialog.service'; -import { AppStateService } from '../../state/app-state.service'; -import { FileActionService } from '../../screens/file/service/file-action.service'; -import { FileAttributesControllerService } from '@redaction/red-ui-http'; -import { DEFAULT_RUL_SET_UUID } from '../../utils/rule-set-default'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; +import { AppStateService } from '../../../../state/app-state.service'; +import { FileActionService } from '../../services/file-action.service'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-file-actions', @@ -23,7 +21,7 @@ export class FileActionsComponent implements OnInit { constructor( public readonly permissionsService: PermissionsService, public readonly appStateService: AppStateService, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _fileActionService: FileActionService ) {} diff --git a/apps/red-ui/src/app/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.html similarity index 100% rename from apps/red-ui/src/app/components/file-workload/file-workload.component.html rename to apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.html diff --git a/apps/red-ui/src/app/components/file-workload/file-workload.component.scss b/apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.scss similarity index 96% rename from apps/red-ui/src/app/components/file-workload/file-workload.component.scss rename to apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.scss index 149a4fb93..6ea23bf4b 100644 --- a/apps/red-ui/src/app/components/file-workload/file-workload.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.scss @@ -1,5 +1,5 @@ -@import '../../../assets/styles/red-variables'; -@import '../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; .right-content { .no-annotations { diff --git a/apps/red-ui/src/app/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.ts similarity index 96% rename from apps/red-ui/src/app/components/file-workload/file-workload.component.ts rename to apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.ts index 6d261bdfa..7339cc2c8 100644 --- a/apps/red-ui/src/app/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/file-workload/file-workload.component.ts @@ -1,11 +1,11 @@ import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, Output, TemplateRef, ViewChild } from '@angular/core'; -import { FilterModel } from '../filter/model/filter.model'; -import { AnnotationWrapper } from '../../screens/file/model/annotation.wrapper'; -import { AnnotationProcessingService } from '../../screens/file/service/annotation-processing.service'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; +import { AnnotationProcessingService } from '../../services/annotation-processing.service'; import { MatDialogRef, MatDialogState } from '@angular/material/dialog'; import scrollIntoView from 'scroll-into-view-if-needed'; -import { debounce } from '../../utils/debounce'; -import { FileDataModel } from '../../screens/file/model/file-data.model'; +import { debounce } from '../../../../utils/debounce'; +import { FileDataModel } from '../../../../models/file/file-data.model'; const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape']; const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; diff --git a/apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.html b/apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.html similarity index 100% rename from apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.html rename to apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.html diff --git a/apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.scss b/apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.scss similarity index 100% rename from apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.scss rename to apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.scss diff --git a/apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.ts b/apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.ts similarity index 85% rename from apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.ts rename to apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.ts index 65b5a007f..2556f9806 100644 --- a/apps/red-ui/src/app/components/needs-work-badge/needs-work-badge.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/needs-work-badge/needs-work-badge.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; -import { PermissionsService } from '../../utils/permissions.service'; -import { FileStatusWrapper } from '../../screens/file/model/file-status.wrapper'; -import { ProjectWrapper } from '../../state/model/project.wrapper'; +import { AppStateService } from '../../../../state/app-state.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; +import { ProjectWrapper } from '../../../../state/model/project.wrapper'; @Component({ selector: 'redaction-needs-work-badge', diff --git a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.html b/apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.html similarity index 100% rename from apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.html rename to apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.html diff --git a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.scss b/apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.scss similarity index 93% rename from apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.scss rename to apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.scss index 00f405a85..3bbdd9b5f 100644 --- a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .page-wrapper { color: $grey-1; diff --git a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts b/apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.ts similarity index 96% rename from apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts rename to apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.ts index 4045a09c1..c2f0ce4a0 100644 --- a/apps/red-ui/src/app/screens/file/page-indicator/page-indicator.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/page-indicator/page-indicator.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { ViewedPages, ViewedPagesControllerService } from '@redaction/red-ui-http'; -import { AppStateService } from '../../../state/app-state.service'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { PermissionsService } from '../../../../services/permissions.service'; import { AppConfigKey, AppConfigService } from '../../../app-config/app-config.service'; import { Subscription } from 'rxjs'; diff --git a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.html b/apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.html similarity index 100% rename from apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.html rename to apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.html diff --git a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.scss b/apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.scss similarity index 100% rename from apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.scss rename to apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.scss diff --git a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.ts similarity index 96% rename from apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts rename to apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.ts index 171014c2d..70e24b7b2 100644 --- a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/pdf-viewer/pdf-viewer.component.ts @@ -16,17 +16,17 @@ import { AppConfigService } from '../../../app-config/app-config.service'; import { ManualRedactionEntry, Rectangle } from '@redaction/red-ui-http'; import WebViewer, { Annotations, Tools, WebViewerInstance } from '@pdftron/webviewer'; import { TranslateService } from '@ngx-translate/core'; -import { ManualRedactionEntryWrapper } from '../model/manual-redaction-entry.wrapper'; -import { AppStateService } from '../../../state/app-state.service'; -import { AnnotationWrapper } from '../model/annotation.wrapper'; -import { ManualAnnotationService } from '../service/manual-annotation.service'; -import { FileStatusWrapper } from '../model/file-status.wrapper'; +import { ManualRedactionEntryWrapper } from '../../../../models/file/manual-redaction-entry.wrapper'; +import { AppStateService } from '../../../../state/app-state.service'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; +import { ManualAnnotationService } from '../../services/manual-annotation.service'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; import { KeycloakService } from 'keycloak-angular'; -import { environment } from '../../../../environments/environment'; -import { AnnotationDrawService } from '../service/annotation-draw.service'; -import { AnnotationActionsService } from '../../../utils/annotation-actions.service'; -import { UserPreferenceService } from '../../../utils/user-preference.service'; -import { translateQuads } from '../../../utils/pdf-coordinates'; +import { environment } from '../../../../../environments/environment'; +import { AnnotationDrawService } from '../../services/annotation-draw.service'; +import { AnnotationActionsService } from '../../services/annotation-actions.service'; +import { UserPreferenceService } from '../../../../services/user-preference.service'; +import { translateQuads } from '../../../../utils/pdf-coordinates'; import Tool = Tools.Tool; @Component({ diff --git a/apps/red-ui/src/app/components/project-details/project-details.component.html b/apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.html similarity index 100% rename from apps/red-ui/src/app/components/project-details/project-details.component.html rename to apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.html diff --git a/apps/red-ui/src/app/components/project-details/project-details.component.scss b/apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.scss similarity index 94% rename from apps/red-ui/src/app/components/project-details/project-details.component.scss rename to apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.scss index 0ab55b1f0..ed03963c4 100644 --- a/apps/red-ui/src/app/components/project-details/project-details.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .header-wrapper { display: flex; diff --git a/apps/red-ui/src/app/components/project-details/project-details.component.ts b/apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.ts similarity index 76% rename from apps/red-ui/src/app/components/project-details/project-details.component.ts rename to apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.ts index eea25d3ed..5dc948b26 100644 --- a/apps/red-ui/src/app/components/project-details/project-details.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/project-details/project-details.component.ts @@ -1,13 +1,13 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; -import { groupBy } from '../../utils/functions'; -import { DoughnutChartConfig } from '../simple-doughnut-chart/simple-doughnut-chart.component'; -import { DialogService } from '../../dialogs/dialog.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { groupBy } from '../../../../utils/functions'; +import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; import { Router } from '@angular/router'; -import { FilterModel } from '../filter/model/filter.model'; -import { PermissionsService } from '../../utils/permissions.service'; -import { TranslateChartService } from '../../utils/translate-chart.service'; -import { StatusSorter } from '../../utils/sorters/status-sorter'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { TranslateChartService } from '../../../../services/translate-chart.service'; +import { StatusSorter } from '../../../../utils/sorters/status-sorter'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-project-details', @@ -26,7 +26,7 @@ export class ProjectDetailsComponent implements OnInit { public readonly translateChartService: TranslateChartService, public readonly permissionsService: PermissionsService, private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _router: Router ) {} diff --git a/apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.html b/apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.html similarity index 100% rename from apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.html rename to apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.html diff --git a/apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.scss b/apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.scss similarity index 100% rename from apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.scss rename to apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.scss diff --git a/apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.ts b/apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.ts similarity index 83% rename from apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.ts rename to apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.ts index 73f8a77ca..eae6dd16d 100644 --- a/apps/red-ui/src/app/components/project-listing-actions/project-listing-actions.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/project-listing-actions/project-listing-actions.component.ts @@ -1,12 +1,12 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { PermissionsService } from '../../utils/permissions.service'; -import { ProjectWrapper } from '../../state/model/project.wrapper'; -import { StatusSorter } from '../../utils/sorters/status-sorter'; -import { download } from '../../utils/file-download-utils'; -import { computerize } from '../../utils/functions'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { ProjectWrapper } from '../../../../state/model/project.wrapper'; +import { StatusSorter } from '../../../../utils/sorters/status-sorter'; +import { download } from '../../../../utils/file-download-utils'; +import { computerize } from '../../../../utils/functions'; import { FileManagementControllerService } from '@redaction/red-ui-http'; -import { AppStateService } from '../../state/app-state.service'; -import { DialogService } from '../../dialogs/dialog.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-project-listing-actions', @@ -21,7 +21,7 @@ export class ProjectListingActionsComponent implements OnInit { constructor( public readonly permissionsService: PermissionsService, public readonly appStateService: AppStateService, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _fileManagementControllerService: FileManagementControllerService ) {} diff --git a/apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.html b/apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.html similarity index 100% rename from apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.html rename to apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.html diff --git a/apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.scss b/apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.scss similarity index 92% rename from apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.scss rename to apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.scss index 91d537dd3..cce2276b1 100644 --- a/apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; :host { flex: 1; diff --git a/apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.ts b/apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.ts similarity index 80% rename from apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.ts rename to apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.ts index 586e1c6af..fd0204bf6 100644 --- a/apps/red-ui/src/app/components/project-listing-details/project-listing-details.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/project-listing-details/project-listing-details.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { DoughnutChartConfig } from '../simple-doughnut-chart/simple-doughnut-chart.component'; -import { AppStateService } from '../../state/app-state.service'; -import { FilterModel } from '../filter/model/filter.model'; +import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; +import { AppStateService } from '../../../../state/app-state.service'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; @Component({ selector: 'redaction-project-listing-details', diff --git a/apps/red-ui/src/app/components/team-members/team-members.component.html b/apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.html similarity index 100% rename from apps/red-ui/src/app/components/team-members/team-members.component.html rename to apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.html diff --git a/apps/red-ui/src/app/components/team-members/team-members.component.scss b/apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.scss similarity index 92% rename from apps/red-ui/src/app/components/team-members/team-members.component.scss rename to apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.scss index 661778a93..3b000abab 100644 --- a/apps/red-ui/src/app/components/team-members/team-members.component.scss +++ b/apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .container { flex-wrap: wrap; @@ -39,7 +39,7 @@ mat-icon { width: 6px; - height: 7px; + height: 8px; } } } diff --git a/apps/red-ui/src/app/components/team-members/team-members.component.ts b/apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.ts similarity index 94% rename from apps/red-ui/src/app/components/team-members/team-members.component.ts rename to apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.ts index 55e13d956..34c83603f 100644 --- a/apps/red-ui/src/app/components/team-members/team-members.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/team-members/team-members.component.ts @@ -1,5 +1,5 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { PermissionsService } from '../../utils/permissions.service'; +import { PermissionsService } from '../../../../services/permissions.service'; @Component({ selector: 'redaction-team-members', diff --git a/apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.html b/apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.html similarity index 100% rename from apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.html rename to apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.html diff --git a/apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.scss b/apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.scss similarity index 100% rename from apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.scss rename to apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.scss diff --git a/apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.ts b/apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.ts similarity index 91% rename from apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.ts rename to apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.ts index eb67e6244..022f29f91 100644 --- a/apps/red-ui/src/app/components/type-annotation-icon/type-annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/type-annotation-icon/type-annotation-icon.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; -import { AnnotationWrapper } from '../../screens/file/model/annotation.wrapper'; -import { AppStateService } from '../../state/app-state.service'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; +import { AppStateService } from '../../../../state/app-state.service'; @Component({ selector: 'redaction-type-annotation-icon', diff --git a/apps/red-ui/src/app/components/type-filter/type-filter.component.html b/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.html similarity index 100% rename from apps/red-ui/src/app/components/type-filter/type-filter.component.html rename to apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.html diff --git a/apps/red-ui/src/app/components/type-filter/type-filter.component.scss b/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.scss similarity index 100% rename from apps/red-ui/src/app/components/type-filter/type-filter.component.scss rename to apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.scss diff --git a/apps/red-ui/src/app/components/type-filter/type-filter.component.ts b/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts similarity index 71% rename from apps/red-ui/src/app/components/type-filter/type-filter.component.ts rename to apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts index fe3702f18..e5e4a0304 100644 --- a/apps/red-ui/src/app/components/type-filter/type-filter.component.ts +++ b/apps/red-ui/src/app/modules/projects/components/type-filter/type-filter.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; -import { FilterModel } from '../filter/model/filter.model'; -import { AppStateService } from '../../state/app-state.service'; -import { DEFAULT_RUL_SET_UUID } from '../../utils/rule-set-default'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; +import { AppStateService } from '../../../../state/app-state.service'; +import { DEFAULT_RUL_SET_UUID } from '../../../../utils/rule-set-default'; @Component({ selector: 'redaction-type-filter', diff --git a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html rename to apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.scss similarity index 79% rename from apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.scss rename to apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.scss index 67ea93a7d..656077c39 100644 --- a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.scss +++ b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .due-date { margin-top: 16px; diff --git a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts similarity index 96% rename from apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts rename to apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts index db8e19078..b00e07198 100644 --- a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts @@ -2,8 +2,8 @@ import { Component, Inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Project, RuleSetModel } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { AppStateService } from '../../state/app-state.service'; -import { ProjectWrapper } from '../../state/model/project.wrapper'; +import { AppStateService } from '../../../../state/app-state.service'; +import { ProjectWrapper } from '../../../../state/model/project.wrapper'; import * as moment from 'moment'; @Component({ diff --git a/apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.html rename to apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.scss similarity index 96% rename from apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.scss rename to apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.scss index 2d19c30e2..3c383fe6e 100644 --- a/apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.scss +++ b/apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-mixins'; .no-padding-bottom { padding-bottom: 0; diff --git a/apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.ts similarity index 93% rename from apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.ts rename to apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.ts index 835be80a9..8862dcf97 100644 --- a/apps/red-ui/src/app/dialogs/assign-owner-dialog/assign-owner-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/assign-owner-dialog/assign-owner-dialog.component.ts @@ -1,12 +1,12 @@ import { Component, Inject } from '@angular/core'; import { ProjectControllerService, StatusControllerService } from '@redaction/red-ui-http'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { AppStateService } from '../../state/app-state.service'; -import { UserService } from '../../user/user.service'; -import { NotificationService, NotificationType } from '../../notification/notification.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { UserService } from '../../../../services/user.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { FileStatusWrapper } from '../../screens/file/model/file-status.wrapper'; -import { ProjectWrapper } from '../../state/model/project.wrapper'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; +import { ProjectWrapper } from '../../../../state/model/project.wrapper'; class DialogData { type: 'file' | 'project'; diff --git a/apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.html rename to apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.scss rename to apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.ts similarity index 93% rename from apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.ts rename to apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.ts index 493d1ec47..5be9779ef 100644 --- a/apps/red-ui/src/app/dialogs/document-info-dialog/document-info-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/document-info-dialog/document-info-dialog.component.ts @@ -1,9 +1,9 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { FileAttributeConfig, FileAttributesControllerService, FileStatus } from '@redaction/red-ui-http'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { ProjectWrapper } from '../../state/model/project.wrapper'; +import { ProjectWrapper } from '../../../../state/model/project.wrapper'; @Component({ selector: 'redaction-document-info-dialog', diff --git a/apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.html rename to apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.scss rename to apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts similarity index 87% rename from apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts rename to apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts index fa4fd1e35..1d0018dd9 100644 --- a/apps/red-ui/src/app/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/force-redaction-dialog/force-redaction-dialog.component.ts @@ -1,13 +1,13 @@ import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { MatDialogRef } from '@angular/material/dialog'; import { ForceRedactionRequest, LegalBasisMappingControllerService } from '@redaction/red-ui-http'; -import { NotificationService } from '../../notification/notification.service'; +import { NotificationService } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; -import { UserService } from '../../user/user.service'; -import { ManualAnnotationService } from '../../screens/file/service/manual-annotation.service'; -import { PermissionsService } from '../../utils/permissions.service'; +import { UserService } from '../../../../services/user.service'; +import { ManualAnnotationService } from '../../services/manual-annotation.service'; +import { PermissionsService } from '../../../../services/permissions.service'; export interface LegalBasisOption { label?: string; diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html rename to apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.scss rename to apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts similarity index 89% rename from apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts rename to apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 38ce3848a..4ede91b17 100644 --- a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -1,15 +1,15 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AddRedactionRequest, LegalBasisMappingControllerService, TypeValue } from '@redaction/red-ui-http'; -import { NotificationService } from '../../notification/notification.service'; +import { NotificationService } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; -import { UserService } from '../../user/user.service'; -import { ManualRedactionEntryWrapper } from '../../screens/file/model/manual-redaction-entry.wrapper'; -import { ManualAnnotationService } from '../../screens/file/service/manual-annotation.service'; -import { ManualAnnotationResponse } from '../../screens/file/model/manual-annotation-response'; -import { PermissionsService } from '../../utils/permissions.service'; +import { UserService } from '../../../../services/user.service'; +import { ManualRedactionEntryWrapper } from '../../../../models/file/manual-redaction-entry.wrapper'; +import { ManualAnnotationService } from '../../services/manual-annotation.service'; +import { ManualAnnotationResponse } from '../../../../models/file/manual-annotation-response'; +import { PermissionsService } from '../../../../services/permissions.service'; export interface LegalBasisOption { label?: string; diff --git a/apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html rename to apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.scss b/apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.scss rename to apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.ts similarity index 82% rename from apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.ts rename to apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.ts index 8e7eb78b4..507936a7c 100644 --- a/apps/red-ui/src/app/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/remove-annotations-dialog/remove-annotations-dialog.component.ts @@ -1,8 +1,8 @@ import { Component, Inject, OnInit } from '@angular/core'; -import { AnnotationWrapper } from '../../screens/file/model/annotation.wrapper'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; import { TranslateService } from '@ngx-translate/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { ConfirmationDialogInput } from '../confirmation-dialog/confirmation-dialog.component'; +import { ConfirmationDialogInput } from '../../../shared/dialogs/confirmation-dialog/confirmation-dialog.component'; export interface RemoveAnnotationsDialogInput { annotationsToRemove: AnnotationWrapper[]; diff --git a/apps/red-ui/src/app/modules/projects/projects-routing.module.ts b/apps/red-ui/src/app/modules/projects/projects-routing.module.ts new file mode 100644 index 000000000..2bbe0381d --- /dev/null +++ b/apps/red-ui/src/app/modules/projects/projects-routing.module.ts @@ -0,0 +1,43 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import { ProjectListingScreenComponent } from './screens/project-listing-screen/project-listing-screen.component'; +import { CompositeRouteGuard } from '../../guards/composite-route.guard'; +import { AuthGuard } from '../auth/auth.guard'; +import { RedRoleGuard } from '../auth/red-role.guard'; +import { AppStateGuard } from '../../state/app-state.guard'; +import { ProjectOverviewScreenComponent } from './screens/project-overview-screen/project-overview-screen.component'; +import { FilePreviewScreenComponent } from './screens/file-preview-screen/file-preview-screen.component'; + +const routes = [ + { + path: '', + component: ProjectListingScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: ':projectId', + component: ProjectOverviewScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + }, + { + path: ':projectId/file/:fileId', + component: FilePreviewScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard] + } + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class ProjectsRoutingModule {} diff --git a/apps/red-ui/src/app/modules/projects/projects.module.ts b/apps/red-ui/src/app/modules/projects/projects.module.ts new file mode 100644 index 000000000..818b553ed --- /dev/null +++ b/apps/red-ui/src/app/modules/projects/projects.module.ts @@ -0,0 +1,89 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ProjectListingScreenComponent } from './screens/project-listing-screen/project-listing-screen.component'; +import { ProjectOverviewScreenComponent } from './screens/project-overview-screen/project-overview-screen.component'; +import { FilePreviewScreenComponent } from './screens/file-preview-screen/file-preview-screen.component'; +import { AddEditProjectDialogComponent } from './dialogs/add-edit-project-dialog/add-edit-project-dialog.component'; +import { AssignOwnerDialogComponent } from './dialogs/assign-owner-dialog/assign-owner-dialog.component'; +import { ManualAnnotationDialogComponent } from './dialogs/manual-redaction-dialog/manual-annotation-dialog.component'; +import { ForceRedactionDialogComponent } from './dialogs/force-redaction-dialog/force-redaction-dialog.component'; +import { RemoveAnnotationsDialogComponent } from './dialogs/remove-annotations-dialog/remove-annotations-dialog.component'; +import { DocumentInfoDialogComponent } from './dialogs/document-info-dialog/document-info-dialog.component'; +import { PdfViewerComponent } from './components/pdf-viewer/pdf-viewer.component'; +import { CommentsComponent } from './components/comments/comments.component'; +import { ProjectDetailsComponent } from './components/project-details/project-details.component'; +import { PageIndicatorComponent } from './components/page-indicator/page-indicator.component'; +import { NeedsWorkBadgeComponent } from './components/needs-work-badge/needs-work-badge.component'; +import { ProjectListingEmptyComponent } from './components/empty-states/project-listing-empty/project-listing-empty.component'; +import { AnnotationActionsComponent } from './components/annotation-actions/annotation-actions.component'; +import { ProjectListingDetailsComponent } from './components/project-listing-details/project-listing-details.component'; +import { FileActionsComponent } from './components/file-actions/file-actions.component'; +import { TypeAnnotationIconComponent } from './components/type-annotation-icon/type-annotation-icon.component'; +import { TypeFilterComponent } from './components/type-filter/type-filter.component'; +import { ProjectOverviewBulkActionsComponent } from './components/bulk-actions/project-overview-bulk-actions.component'; +import { TeamMembersComponent } from './components/team-members/team-members.component'; +import { ProjectListingActionsComponent } from './components/project-listing-actions/project-listing-actions.component'; +import { DocumentInfoComponent } from './components/document-info/document-info.component'; +import { FileWorkloadComponent } from './components/file-workload/file-workload.component'; +import { SharedModule } from '../shared/shared.module'; +import { ProjectsRoutingModule } from './projects-routing.module'; +import { FileUploadDownloadModule } from '../upload-download/file-upload-download.module'; +import { ProjectsDialogService } from './services/projects-dialog.service'; +import { AnnotationActionsService } from './services/annotation-actions.service'; +import { FileActionService } from './services/file-action.service'; +import { PdfViewerDataService } from './services/pdf-viewer-data.service'; +import { ManualAnnotationService } from './services/manual-annotation.service'; +import { AnnotationDrawService } from './services/annotation-draw.service'; +import { AnnotationProcessingService } from './services/annotation-processing.service'; + +const screens = [ProjectListingScreenComponent, ProjectOverviewScreenComponent, FilePreviewScreenComponent]; + +const dialogs = [ + AddEditProjectDialogComponent, + AssignOwnerDialogComponent, + ManualAnnotationDialogComponent, + ForceRedactionDialogComponent, + RemoveAnnotationsDialogComponent, + DocumentInfoDialogComponent +]; + +const components = [ + PdfViewerComponent, + CommentsComponent, + ProjectDetailsComponent, + PageIndicatorComponent, + NeedsWorkBadgeComponent, + ProjectListingEmptyComponent, + AnnotationActionsComponent, + ProjectListingEmptyComponent, + ProjectListingDetailsComponent, + FileActionsComponent, + TypeAnnotationIconComponent, + TypeFilterComponent, + ProjectOverviewBulkActionsComponent, + FileActionsComponent, + TeamMembersComponent, + ProjectListingActionsComponent, + DocumentInfoComponent, + FileWorkloadComponent, + + ...screens, + ...dialogs +]; + +const services = [ + ProjectsDialogService, + FileActionService, + AnnotationActionsService, + ManualAnnotationService, + PdfViewerDataService, + AnnotationDrawService, + AnnotationProcessingService +]; + +@NgModule({ + declarations: [...components], + providers: [...services], + imports: [CommonModule, SharedModule, FileUploadDownloadModule, ProjectsRoutingModule] +}) +export class ProjectsModule {} diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html rename to apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.html diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.scss similarity index 97% rename from apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss rename to apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.scss index 00691a2d4..a2206297a 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss +++ b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../../assets/styles/red-variables'; -@import '../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; .vertical-line { width: 1px; diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts similarity index 91% rename from apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts rename to apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts index 4eb298fc9..88bba9c3b 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/projects/screens/file-preview-screen/file-preview-screen.component.ts @@ -1,36 +1,35 @@ -import { ChangeDetectorRef, Component, ElementRef, HostListener, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ChangeDetectorRef, Component, HostListener, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { AppStateService } from '../../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { WebViewerInstance } from '@pdftron/webviewer'; -import { PdfViewerComponent } from '../pdf-viewer/pdf-viewer.component'; -import { debounce } from '../../../utils/debounce'; -import scrollIntoView from 'scroll-into-view-if-needed'; -import { DialogService } from '../../../dialogs/dialog.service'; +import { PdfViewerComponent } from '../../components/pdf-viewer/pdf-viewer.component'; +import { debounce } from '../../../../utils/debounce'; import { MatDialogRef, MatDialogState } from '@angular/material/dialog'; -import { ManualRedactionEntryWrapper } from '../model/manual-redaction-entry.wrapper'; -import { AnnotationWrapper } from '../model/annotation.wrapper'; -import { ManualAnnotationService } from '../service/manual-annotation.service'; -import { ManualAnnotationResponse } from '../model/manual-annotation-response'; -import { AnnotationData, FileDataModel } from '../model/file-data.model'; -import { FileActionService } from '../service/file-action.service'; -import { AnnotationDrawService } from '../service/annotation-draw.service'; -import { AnnotationProcessingService } from '../service/annotation-processing.service'; -import { FilterModel } from '../../../components/filter/model/filter.model'; +import { ManualRedactionEntryWrapper } from '../../../../models/file/manual-redaction-entry.wrapper'; +import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; +import { ManualAnnotationService } from '../../services/manual-annotation.service'; +import { ManualAnnotationResponse } from '../../../../models/file/manual-annotation-response'; +import { AnnotationData, FileDataModel } from '../../../../models/file/file-data.model'; +import { FileActionService } from '../../services/file-action.service'; +import { AnnotationDrawService } from '../../services/annotation-draw.service'; +import { AnnotationProcessingService } from '../../services/annotation-processing.service'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; import { tap } from 'rxjs/operators'; -import { NotificationService } from '../../../notification/notification.service'; +import { NotificationService } from '../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; -import { FileStatusWrapper } from '../model/file-status.wrapper'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; +import { PermissionsService } from '../../../../services/permissions.service'; import { Subscription, timer } from 'rxjs'; -import { handleFilterDelta, processFilters } from '../../../components/filter/utils/filter-utils'; -import { UserPreferenceService } from '../../../utils/user-preference.service'; -import { UserService } from '../../../user/user.service'; +import { handleFilterDelta, processFilters } from '../../../shared/components/filter/utils/filter-utils'; +import { UserPreferenceService } from '../../../../services/user-preference.service'; +import { UserService } from '../../../../services/user.service'; import { FormBuilder, FormGroup } from '@angular/forms'; import { FileManagementControllerService, StatusControllerService } from '@redaction/red-ui-http'; -import { PdfViewerDataService } from '../service/pdf-viewer-data.service'; -import { download } from '../../../utils/file-download-utils'; -import { ViewMode } from '../model/view-mode'; -import { FileWorkloadComponent } from '../../../components/file-workload/file-workload.component'; +import { PdfViewerDataService } from '../../services/pdf-viewer-data.service'; +import { download } from '../../../../utils/file-download-utils'; +import { ViewMode } from '../../../../models/file/view-mode'; +import { FileWorkloadComponent } from '../../components/file-workload/file-workload.component'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; const ALL_HOTKEY_ARRAY = ['Escape', 'F', 'f']; @@ -74,7 +73,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { public readonly userService: UserService, private readonly _changeDetectorRef: ChangeDetectorRef, private readonly _activatedRoute: ActivatedRoute, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _router: Router, private readonly _notificationService: NotificationService, private readonly _translateService: TranslateService, diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html b/apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html rename to apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.html diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss b/apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.scss similarity index 90% rename from apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss rename to apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.scss index 203f627bc..d9b0fe708 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss +++ b/apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../assets/styles/red-mixins'; -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; .left-container { cdk-virtual-scroll-viewport { diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts b/apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.ts similarity index 88% rename from apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts rename to apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.ts index f2ec6af0a..d44bd270d 100644 --- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/projects/screens/project-listing-screen/project-listing-screen.component.ts @@ -1,11 +1,10 @@ -import { ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FileManagementControllerService, Project, RuleSetModel } from '@redaction/red-ui-http'; -import { AppStateService } from '../../state/app-state.service'; -import { UserService } from '../../user/user.service'; -import { DoughnutChartConfig } from '../../components/simple-doughnut-chart/simple-doughnut-chart.component'; -import { groupBy, humanize } from '../../utils/functions'; -import { DialogService } from '../../dialogs/dialog.service'; -import { FilterModel } from '../../components/filter/model/filter.model'; +import { AppStateService } from '../../../../state/app-state.service'; +import { UserService } from '../../../../services/user.service'; +import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; +import { groupBy } from '../../../../utils/functions'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; import { annotationFilterChecker, getFilteredEntities, @@ -13,20 +12,21 @@ import { projectMemberChecker, projectStatusChecker, ruleSetChecker -} from '../../components/filter/utils/filter-utils'; +} from '../../../shared/components/filter/utils/filter-utils'; import { TranslateService } from '@ngx-translate/core'; -import { SortingOption, SortingService } from '../../utils/sorting.service'; -import { PermissionsService } from '../../utils/permissions.service'; -import { ProjectWrapper } from '../../state/model/project.wrapper'; +import { SortingOption, SortingService } from '../../../../services/sorting.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { ProjectWrapper } from '../../../../state/model/project.wrapper'; import { Subscription, timer } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { TranslateChartService } from '../../utils/translate-chart.service'; -import { RedactionFilterSorter } from '../../utils/sorters/redaction-filter-sorter'; -import { StatusSorter } from '../../utils/sorters/status-sorter'; +import { TranslateChartService } from '../../../../services/translate-chart.service'; +import { RedactionFilterSorter } from '../../../../utils/sorters/redaction-filter-sorter'; +import { StatusSorter } from '../../../../utils/sorters/status-sorter'; import { Router } from '@angular/router'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { debounce } from '../../utils/debounce'; -import { FilterComponent } from '../../components/filter/filter.component'; +import { debounce } from '../../../../utils/debounce'; +import { FilterComponent } from '../../../shared/components/filter/filter.component'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-project-listing-screen', @@ -64,7 +64,7 @@ export class ProjectListingScreenComponent implements OnInit, OnDestroy { public readonly userService: UserService, public readonly permissionsService: PermissionsService, private readonly _changeDetectorRef: ChangeDetectorRef, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _translateService: TranslateService, private readonly _router: Router, public readonly sortingService: SortingService, diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html b/apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.html similarity index 100% rename from apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html rename to apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.html diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.scss b/apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.scss similarity index 95% rename from apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.scss rename to apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.scss index 4f7e8b28f..aaf1aa8b1 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.scss +++ b/apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.scss @@ -1,5 +1,5 @@ -@import '../../../assets/styles/red-variables'; -@import '../../../assets/styles/red-mixins'; +@import '../../../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-mixins'; .file-upload-input { display: none; diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts b/apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.ts similarity index 89% rename from apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts rename to apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.ts index 426be5039..45356c96d 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/projects/screens/project-overview-screen/project-overview-screen.component.ts @@ -1,31 +1,31 @@ import { ChangeDetectorRef, Component, HostListener, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { NotificationService, NotificationType } from '../../notification/notification.service'; -import { AppStateService } from '../../state/app-state.service'; -import { FileDropOverlayService } from '../../upload-download/file-drop/service/file-drop-overlay.service'; -import { FileUploadModel } from '../../upload-download/model/file-upload.model'; -import { FileUploadService } from '../../upload-download/file-upload.service'; -import { StatusOverlayService } from '../../upload-download/status-overlay.service'; -import { DialogService } from '../../dialogs/dialog.service'; +import { NotificationService, NotificationType } from '../../../../services/notification.service'; +import { AppStateService } from '../../../../state/app-state.service'; +import { FileDropOverlayService } from '../../../upload-download/services/file-drop-overlay.service'; +import { FileUploadModel } from '../../../upload-download/model/file-upload.model'; +import { FileUploadService } from '../../../upload-download/services/file-upload.service'; +import { StatusOverlayService } from '../../../upload-download/services/status-overlay.service'; import { TranslateService } from '@ngx-translate/core'; -import { FileActionService } from '../file/service/file-action.service'; -import { FilterModel } from '../../components/filter/model/filter.model'; +import { FileActionService } from '../../services/file-action.service'; +import { FilterModel } from '../../../shared/components/filter/model/filter.model'; import * as moment from 'moment'; import { ProjectDetailsComponent } from '../../components/project-details/project-details.component'; -import { FileStatusWrapper } from '../file/model/file-status.wrapper'; -import { annotationFilterChecker, getFilteredEntities, keyChecker, processFilters } from '../../components/filter/utils/filter-utils'; -import { SortingOption, SortingService } from '../../utils/sorting.service'; -import { PermissionsService } from '../../utils/permissions.service'; -import { UserService } from '../../user/user.service'; +import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper'; +import { annotationFilterChecker, getFilteredEntities, keyChecker, processFilters } from '../../../shared/components/filter/utils/filter-utils'; +import { SortingOption, SortingService } from '../../../../services/sorting.service'; +import { PermissionsService } from '../../../../services/permissions.service'; +import { UserService } from '../../../../services/user.service'; import { FileManagementControllerService, FileStatus } from '@redaction/red-ui-http'; import { Subscription, timer } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { RedactionFilterSorter } from '../../utils/sorters/redaction-filter-sorter'; -import { StatusSorter } from '../../utils/sorters/status-sorter'; +import { RedactionFilterSorter } from '../../../../utils/sorters/redaction-filter-sorter'; +import { StatusSorter } from '../../../../utils/sorters/status-sorter'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { debounce } from '../../utils/debounce'; -import { convertFiles, handleFileDrop } from '../../utils/file-drop-utils'; -import { FilterComponent } from '../../components/filter/filter.component'; +import { debounce } from '../../../../utils/debounce'; +import { convertFiles, handleFileDrop } from '../../../../utils/file-drop-utils'; +import { FilterComponent } from '../../../shared/components/filter/filter.component'; +import { ProjectsDialogService } from '../../services/projects-dialog.service'; @Component({ selector: 'redaction-project-overview-screen', @@ -62,7 +62,7 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy { public readonly permissionsService: PermissionsService, private readonly _activatedRoute: ActivatedRoute, private readonly _notificationService: NotificationService, - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _fileActionService: FileActionService, private readonly _fileUploadService: FileUploadService, private readonly _statusOverlayService: StatusOverlayService, diff --git a/apps/red-ui/src/app/utils/annotation-actions.service.ts b/apps/red-ui/src/app/modules/projects/services/annotation-actions.service.ts similarity index 95% rename from apps/red-ui/src/app/utils/annotation-actions.service.ts rename to apps/red-ui/src/app/modules/projects/services/annotation-actions.service.ts index 1abfc4eda..58d95d3ec 100644 --- a/apps/red-ui/src/app/utils/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/annotation-actions.service.ts @@ -1,24 +1,22 @@ import { EventEmitter, Injectable, NgZone } from '@angular/core'; -import { PermissionsService } from './permissions.service'; -import { ManualAnnotationService } from '../screens/file/service/manual-annotation.service'; -import { DialogService } from '../dialogs/dialog.service'; -import { AnnotationWrapper } from '../screens/file/model/annotation.wrapper'; +import { PermissionsService } from '../../../services/permissions.service'; +import { ManualAnnotationService } from './manual-annotation.service'; +import { AnnotationWrapper } from '../../../models/file/annotation.wrapper'; import { Observable } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { AddRedactionRequest } from '@redaction/red-ui-http'; -import { getFirstRelevantTextPart } from './functions'; -import { AnnotationPermissions } from '../screens/file/model/annotation.permissions'; +import { getFirstRelevantTextPart } from '../../../utils/functions'; +import { AnnotationPermissions } from '../../../models/file/annotation.permissions'; +import { ProjectsDialogService } from './projects-dialog.service'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class AnnotationActionsService { constructor( private readonly _permissionsService: PermissionsService, private readonly _ngZone: NgZone, private readonly _manualAnnotationService: ManualAnnotationService, private readonly _translateService: TranslateService, - private readonly _dialogService: DialogService + private readonly _dialogService: ProjectsDialogService ) {} public acceptSuggestion($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter) { diff --git a/apps/red-ui/src/app/screens/file/service/annotation-draw.service.ts b/apps/red-ui/src/app/modules/projects/services/annotation-draw.service.ts similarity index 97% rename from apps/red-ui/src/app/screens/file/service/annotation-draw.service.ts rename to apps/red-ui/src/app/modules/projects/services/annotation-draw.service.ts index b3d23f7c4..0fb108f35 100644 --- a/apps/red-ui/src/app/screens/file/service/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/annotation-draw.service.ts @@ -3,12 +3,10 @@ import { Annotations, WebViewerInstance } from '@pdftron/webviewer'; import { Rectangle, RedactionLogControllerService, SectionGrid, SectionRectangle } from '@redaction/red-ui-http'; import { hexToRgb } from '../../../utils/functions'; import { AppStateService } from '../../../state/app-state.service'; -import { AnnotationWrapper } from '../model/annotation.wrapper'; -import { UserPreferenceService } from '../../../utils/user-preference.service'; +import { AnnotationWrapper } from '../../../models/file/annotation.wrapper'; +import { UserPreferenceService } from '../../../services/user-preference.service'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class AnnotationDrawService { constructor( private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts b/apps/red-ui/src/app/modules/projects/services/annotation-processing.service.ts similarity index 93% rename from apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts rename to apps/red-ui/src/app/modules/projects/services/annotation-processing.service.ts index 379774b64..b55219238 100644 --- a/apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/annotation-processing.service.ts @@ -1,14 +1,11 @@ import { Injectable } from '@angular/core'; import { AppStateService } from '../../../state/app-state.service'; -import { AnnotationWrapper } from '../model/annotation.wrapper'; -import { FilterModel } from '../../../components/filter/model/filter.model'; -import { handleCheckedValue } from '../../../components/filter/utils/filter-utils'; +import { AnnotationWrapper } from '../../../models/file/annotation.wrapper'; +import { FilterModel } from '../../shared/components/filter/model/filter.model'; +import { handleCheckedValue } from '../../shared/components/filter/utils/filter-utils'; import { SuperTypeSorter } from '../../../utils/sorters/super-type-sorter'; -import { getFirstRelevantTextPart } from '../../../utils/functions'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class AnnotationProcessingService { constructor(private readonly _appStateService: AppStateService) {} diff --git a/apps/red-ui/src/app/screens/file/service/file-action.service.ts b/apps/red-ui/src/app/modules/projects/services/file-action.service.ts similarity index 91% rename from apps/red-ui/src/app/screens/file/service/file-action.service.ts rename to apps/red-ui/src/app/modules/projects/services/file-action.service.ts index bd2e063f3..21007df1c 100644 --- a/apps/red-ui/src/app/screens/file/service/file-action.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/file-action.service.ts @@ -1,18 +1,16 @@ import { Injectable } from '@angular/core'; -import { DialogService } from '../../../dialogs/dialog.service'; import { AppStateService } from '../../../state/app-state.service'; -import { UserService } from '../../../user/user.service'; +import { UserService } from '../../../services/user.service'; import { FileStatus, ReanalysisControllerService, StatusControllerService } from '@redaction/red-ui-http'; -import { FileStatusWrapper } from '../model/file-status.wrapper'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { FileStatusWrapper } from '../../../models/file/file-status.wrapper'; +import { PermissionsService } from '../../../services/permissions.service'; import { isArray } from 'rxjs/internal-compatibility'; +import { ProjectsDialogService } from './projects-dialog.service'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class FileActionService { constructor( - private readonly _dialogService: DialogService, + private readonly _dialogService: ProjectsDialogService, private readonly _permissionsService: PermissionsService, private readonly _userService: UserService, private readonly _statusControllerService: StatusControllerService, diff --git a/apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts b/apps/red-ui/src/app/modules/projects/services/manual-annotation.service.ts similarity index 97% rename from apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts rename to apps/red-ui/src/app/modules/projects/services/manual-annotation.service.ts index 80c5a496e..df3d89031 100644 --- a/apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/manual-annotation.service.ts @@ -1,16 +1,14 @@ import { Injectable } from '@angular/core'; import { AppStateService } from '../../../state/app-state.service'; import { AddRedactionRequest, DictionaryControllerService, ForceRedactionRequest, ManualRedactionControllerService } from '@redaction/red-ui-http'; -import { AnnotationWrapper } from '../model/annotation.wrapper'; -import { NotificationService, NotificationType } from '../../../notification/notification.service'; +import { AnnotationWrapper } from '../../../models/file/annotation.wrapper'; +import { NotificationService, NotificationType } from '../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { tap } from 'rxjs/operators'; -import { UserService } from '../../../user/user.service'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { UserService } from '../../../services/user.service'; +import { PermissionsService } from '../../../services/permissions.service'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class ManualAnnotationService { constructor( private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/screens/file/service/pdf-viewer-data.service.ts b/apps/red-ui/src/app/modules/projects/services/pdf-viewer-data.service.ts similarity index 90% rename from apps/red-ui/src/app/screens/file/service/pdf-viewer-data.service.ts rename to apps/red-ui/src/app/modules/projects/services/pdf-viewer-data.service.ts index 9d0378de4..ad42e06a6 100644 --- a/apps/red-ui/src/app/screens/file/service/pdf-viewer-data.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/pdf-viewer-data.service.ts @@ -7,15 +7,13 @@ import { RedactionLogControllerService, ViewedPagesControllerService } from '@redaction/red-ui-http'; -import { FileType } from '../model/file-type'; -import { FileDataModel } from '../model/file-data.model'; +import { FileType } from '../../../models/file/file-type'; +import { FileDataModel } from '../../../models/file/file-data.model'; import { AppStateService } from '../../../state/app-state.service'; -import { PermissionsService } from '../../../utils/permissions.service'; -import { FileStatusWrapper } from '../model/file-status.wrapper'; +import { PermissionsService } from '../../../services/permissions.service'; +import { FileStatusWrapper } from '../../../models/file/file-status.wrapper'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class PdfViewerDataService { constructor( private readonly _appStateService: AppStateService, diff --git a/apps/red-ui/src/app/dialogs/dialog.service.ts b/apps/red-ui/src/app/modules/projects/services/projects-dialog.service.ts similarity index 61% rename from apps/red-ui/src/app/dialogs/dialog.service.ts rename to apps/red-ui/src/app/modules/projects/services/projects-dialog.service.ts index d35edbca1..fa394be54 100644 --- a/apps/red-ui/src/app/dialogs/dialog.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/projects-dialog.service.ts @@ -1,9 +1,7 @@ import { Injectable } from '@angular/core'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { - Colors, DictionaryControllerService, - FileAttributeConfig, FileManagementControllerService, FileStatus, ManualRedactionControllerService, @@ -11,26 +9,20 @@ import { RuleSetModel, TypeValue } from '@redaction/red-ui-http'; -import { ConfirmationDialogComponent, ConfirmationDialogInput } from './confirmation-dialog/confirmation-dialog.component'; -import { NotificationService, NotificationType } from '../notification/notification.service'; +import { AddEditProjectDialogComponent } from '../dialogs/add-edit-project-dialog/add-edit-project-dialog.component'; +import { RemoveAnnotationsDialogComponent } from '../dialogs/remove-annotations-dialog/remove-annotations-dialog.component'; +import { NotificationService, NotificationType } from '../../../services/notification.service'; +import { ForceRedactionDialogComponent } from '../dialogs/force-redaction-dialog/force-redaction-dialog.component'; +import { AnnotationWrapper } from '../../../models/file/annotation.wrapper'; +import { ConfirmationDialogComponent, ConfirmationDialogInput } from '../../shared/dialogs/confirmation-dialog/confirmation-dialog.component'; +import { ProjectWrapper } from '../../../state/model/project.wrapper'; +import { DocumentInfoDialogComponent } from '../dialogs/document-info-dialog/document-info-dialog.component'; +import { AppStateService } from '../../../state/app-state.service'; +import { ManualRedactionEntryWrapper } from '../../../models/file/manual-redaction-entry.wrapper'; +import { ManualAnnotationService } from './manual-annotation.service'; import { TranslateService } from '@ngx-translate/core'; -import { AppStateService } from '../state/app-state.service'; -import { AddEditProjectDialogComponent } from './add-edit-project-dialog/add-edit-project-dialog.component'; -import { AssignOwnerDialogComponent } from './assign-owner-dialog/assign-owner-dialog.component'; -import { ManualRedactionEntryWrapper } from '../screens/file/model/manual-redaction-entry.wrapper'; -import { AnnotationWrapper } from '../screens/file/model/annotation.wrapper'; -import { ManualAnnotationDialogComponent } from './manual-redaction-dialog/manual-annotation-dialog.component'; -import { ManualAnnotationService } from '../screens/file/service/manual-annotation.service'; -import { ProjectWrapper } from '../state/model/project.wrapper'; -import { AddEditDictionaryDialogComponent } from './add-edit-dictionary-dialog/add-edit-dictionary-dialog.component'; -import { AddEditRuleSetDialogComponent } from './add-edit-rule-set-dialog/add-edit-rule-set-dialog.component'; -import { OverwriteFilesDialogComponent } from './overwrite-files-dialog/overwrite-files-dialog.component'; -import { EditColorDialogComponent } from './edit-color-dialog/edit-color-dialog.component'; -import { RemoveAnnotationsDialogComponent } from './remove-annotations-dialog/remove-annotations-dialog.component'; -import { ForceRedactionDialogComponent } from './force-redaction-dialog/force-redaction-dialog.component'; -import { AddEditFileAttributeDialogComponent } from './add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; -import { ConfirmDeleteFileAttributeDialogComponent } from './confirm-delete-file-attribute-dialog/confirm-delete-file-attribute-dialog.component'; -import { DocumentInfoDialogComponent } from './document-info-dialog/document-info-dialog.component'; +import { ManualAnnotationDialogComponent } from '../dialogs/manual-redaction-dialog/manual-annotation-dialog.component'; +import { AssignOwnerDialogComponent } from '../dialogs/assign-owner-dialog/assign-owner-dialog.component'; const dialogConfig = { width: '662px', @@ -38,10 +30,8 @@ const dialogConfig = { autoFocus: false }; -@Injectable({ - providedIn: 'root' -}) -export class DialogService { +@Injectable() +export class ProjectsDialogService { constructor( private readonly _dialog: MatDialog, private readonly _translateService: TranslateService, @@ -179,30 +169,6 @@ export class DialogService { return ref; } - public openDeleteDictionaryDialog($event: MouseEvent, dictionary: TypeValue, ruleSetId: string, cb?: Function): MatDialogRef { - $event.stopPropagation(); - const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig); - ref.afterClosed().subscribe(async (result) => { - if (result) { - await this._dictionaryControllerService.deleteType(dictionary.type, ruleSetId).toPromise(); - if (cb) cb(); - } - }); - return ref; - } - - public openDeleteRuleSetDialog($event: MouseEvent, ruleSet: RuleSetModel, cb?: Function): MatDialogRef { - $event.stopPropagation(); - const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig); - ref.afterClosed().subscribe(async (result) => { - if (result) { - await this._ruleSetControllerService.getAllRuleSets(ruleSet.ruleSetId).toPromise(); - if (cb) await cb(); - } - }); - return ref; - } - public openDeleteProjectDialog($event: MouseEvent, project: ProjectWrapper, cb?: Function): MatDialogRef { $event.stopPropagation(); const ref = this._dialog.open(ConfirmationDialogComponent, { @@ -292,94 +258,6 @@ export class DialogService { return ref; } - public openAddEditDictionaryDialog(dictionary: TypeValue, ruleSetId: string, cb?: Function): MatDialogRef { - const ref = this._dialog.open(AddEditDictionaryDialogComponent, { - ...dialogConfig, - data: { dictionary, ruleSetId }, - autoFocus: true - }); - - ref.afterClosed().subscribe((result) => { - if (result && cb) { - cb(result); - } - }); - - return ref; - } - - public openEditColorsDialog(colors: Colors, colorKey: string, ruleSetId: string, cb?: Function): MatDialogRef { - const ref = this._dialog.open(EditColorDialogComponent, { - ...dialogConfig, - data: { colors, colorKey, ruleSetId }, - autoFocus: true - }); - - ref.afterClosed().subscribe((result) => { - if (result && cb) { - cb(result); - } - }); - - return ref; - } - - public openAddEditRuleSetDialog(ruleSet: RuleSetModel, cb?: Function): MatDialogRef { - const ref = this._dialog.open(AddEditRuleSetDialogComponent, { - ...dialogConfig, - data: ruleSet, - autoFocus: true - }); - - ref.afterClosed().subscribe((result) => { - if (result && cb) { - cb(result); - } - }); - - return ref; - } - - public openAddEditFileAttributeDialog( - fileAttribute: FileAttributeConfig, - ruleSetId: string, - cb?: Function - ): MatDialogRef { - const ref = this._dialog.open(AddEditFileAttributeDialogComponent, { - ...dialogConfig, - data: { fileAttribute, ruleSetId }, - autoFocus: true - }); - - ref.afterClosed().subscribe((result) => { - if (result && cb) { - cb(result); - } - }); - - return ref; - } - - public openConfirmDeleteFileAttributeDialog( - fileAttribute: FileAttributeConfig, - ruleSetId: string, - cb?: Function - ): MatDialogRef { - const ref = this._dialog.open(ConfirmDeleteFileAttributeDialogComponent, { - ...dialogConfig, - data: { fileAttribute, ruleSetId }, - autoFocus: true - }); - - ref.afterClosed().subscribe((result) => { - if (result && cb) { - cb(result); - } - }); - - return ref; - } - public openDocumentInfoDialog(file: FileStatus, cb?: Function): MatDialogRef { const ref = this._dialog.open(DocumentInfoDialogComponent, { ...dialogConfig, @@ -416,18 +294,4 @@ export class DialogService { return ref; } - - openOverwriteFileDialog(filename: string): Promise<{ option?: 'overwrite' | 'skip'; remember?: boolean; cancel?: boolean }> { - const ref = this._dialog.open(OverwriteFilesDialogComponent, { - ...dialogConfig, - data: filename - }); - - return ref - .afterClosed() - .toPromise() - .then((res) => { - return res || { cancel: true }; - }); - } } diff --git a/apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.html b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.html similarity index 100% rename from apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.html rename to apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.html diff --git a/apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.scss b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.scss similarity index 95% rename from apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.scss rename to apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.scss index 3df8ab405..4fe813206 100644 --- a/apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .icon { height: 16px; diff --git a/apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts similarity index 100% rename from apps/red-ui/src/app/components/annotation-icon/annotation-icon.component.ts rename to apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts diff --git a/apps/red-ui/src/app/components/buttons/chevron-button/chevron-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.html similarity index 100% rename from apps/red-ui/src/app/components/buttons/chevron-button/chevron-button.component.html rename to apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.html diff --git a/apps/red-ui/src/app/components/buttons/chevron-button/chevron-button.component.scss b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.scss similarity index 100% rename from apps/red-ui/src/app/components/buttons/chevron-button/chevron-button.component.scss rename to apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.scss diff --git a/apps/red-ui/src/app/components/buttons/chevron-button/chevron-button.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.ts similarity index 100% rename from apps/red-ui/src/app/components/buttons/chevron-button/chevron-button.component.ts rename to apps/red-ui/src/app/modules/shared/components/buttons/chevron-button/chevron-button.component.ts diff --git a/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html similarity index 100% rename from apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.html rename to apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html diff --git a/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss similarity index 91% rename from apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss rename to apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss index 5e1167f4b..d261cdf2b 100644 --- a/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-variables'; +@import '../../../../../../assets/styles/red-variables'; :host { height: 34px; diff --git a/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.ts similarity index 100% rename from apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.ts rename to apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.ts diff --git a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.html similarity index 100% rename from apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.html rename to apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.html diff --git a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.scss b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.scss similarity index 100% rename from apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.scss rename to apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.scss diff --git a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts similarity index 78% rename from apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts rename to apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts index 21b7edb01..4e51ddda5 100644 --- a/apps/red-ui/src/app/components/buttons/file-download-btn/file-download-btn.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/file-download-btn/file-download-btn.component.ts @@ -1,9 +1,9 @@ import { Component, Input } from '@angular/core'; -import { PermissionsService } from '../../../utils/permissions.service'; -import { ProjectWrapper } from '../../../state/model/project.wrapper'; -import { FileStatusWrapper } from '../../../screens/file/model/file-status.wrapper'; -import { FileDownloadService } from '../../../upload-download/file-download.service'; -import { NotificationService } from '../../../notification/notification.service'; +import { PermissionsService } from '../../../../../services/permissions.service'; +import { ProjectWrapper } from '../../../../../state/model/project.wrapper'; +import { FileStatusWrapper } from '../../../../../models/file/file-status.wrapper'; +import { FileDownloadService } from '../../../../upload-download/services/file-download.service'; +import { NotificationService } from '../../../../../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; export type MenuState = 'OPEN' | 'CLOSED'; diff --git a/apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.html similarity index 100% rename from apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.html rename to apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.html diff --git a/apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.scss b/apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.scss similarity index 83% rename from apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.scss rename to apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.scss index f60ecdbf2..d84f2d27b 100644 --- a/apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-variables'; +@import '../../../../../../assets/styles/red-variables'; button { padding: 0 14px; diff --git a/apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.ts similarity index 100% rename from apps/red-ui/src/app/components/buttons/icon-button/icon-button.component.ts rename to apps/red-ui/src/app/modules/shared/components/buttons/icon-button/icon-button.component.ts diff --git a/apps/red-ui/src/app/components/buttons/user-button/user-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.html similarity index 100% rename from apps/red-ui/src/app/components/buttons/user-button/user-button.component.html rename to apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.html diff --git a/apps/red-ui/src/app/components/buttons/user-button/user-button.component.scss b/apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.scss similarity index 82% rename from apps/red-ui/src/app/components/buttons/user-button/user-button.component.scss rename to apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.scss index 13064f8ca..a50092b2a 100644 --- a/apps/red-ui/src/app/components/buttons/user-button/user-button.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.scss @@ -1,4 +1,4 @@ -@import '../../../../assets/styles/red-variables'; +@import '../../../../../../assets/styles/red-variables'; :host { button { diff --git a/apps/red-ui/src/app/components/buttons/user-button/user-button.component.ts b/apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.ts similarity index 84% rename from apps/red-ui/src/app/components/buttons/user-button/user-button.component.ts rename to apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.ts index fc4f2368a..607f60830 100644 --- a/apps/red-ui/src/app/components/buttons/user-button/user-button.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/buttons/user-button/user-button.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import { UserWrapper } from '../../../user/user.service'; +import { UserWrapper } from '../../../../../services/user.service'; @Component({ selector: 'redaction-user-button', diff --git a/apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html similarity index 100% rename from apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html rename to apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.html diff --git a/apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.scss b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.scss similarity index 100% rename from apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.scss rename to apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.scss diff --git a/apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts similarity index 93% rename from apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts rename to apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts index ff202d35b..696268e5b 100644 --- a/apps/red-ui/src/app/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnChanges } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { TypeValue } from '@redaction/red-ui-http'; @Component({ diff --git a/apps/red-ui/src/app/components/filter/filter.component.html b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.html similarity index 100% rename from apps/red-ui/src/app/components/filter/filter.component.html rename to apps/red-ui/src/app/modules/shared/components/filter/filter.component.html diff --git a/apps/red-ui/src/app/components/filter/filter.component.scss b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.scss similarity index 87% rename from apps/red-ui/src/app/components/filter/filter.component.scss rename to apps/red-ui/src/app/modules/shared/components/filter/filter.component.scss index 02a600d80..0b97ef116 100644 --- a/apps/red-ui/src/app/components/filter/filter.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .filter-menu-header { display: flex; diff --git a/apps/red-ui/src/app/components/filter/filter.component.ts b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts similarity index 98% rename from apps/red-ui/src/app/components/filter/filter.component.ts rename to apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts index 27a3c87a3..64987f97e 100644 --- a/apps/red-ui/src/app/components/filter/filter.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/filter/filter.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; -import { AppStateService } from '../../state/app-state.service'; +import { AppStateService } from '../../../../state/app-state.service'; import { FilterModel } from './model/filter.model'; import { handleCheckedValue } from './utils/filter-utils'; import { MatMenuTrigger } from '@angular/material/menu'; diff --git a/apps/red-ui/src/app/components/filter/model/filter.model.ts b/apps/red-ui/src/app/modules/shared/components/filter/model/filter.model.ts similarity index 100% rename from apps/red-ui/src/app/components/filter/model/filter.model.ts rename to apps/red-ui/src/app/modules/shared/components/filter/model/filter.model.ts diff --git a/apps/red-ui/src/app/components/filter/utils/filter-utils.ts b/apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts similarity index 96% rename from apps/red-ui/src/app/components/filter/utils/filter-utils.ts rename to apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts index 4941d5baa..a865bb31d 100644 --- a/apps/red-ui/src/app/components/filter/utils/filter-utils.ts +++ b/apps/red-ui/src/app/modules/shared/components/filter/utils/filter-utils.ts @@ -1,7 +1,7 @@ import { FilterModel } from '../model/filter.model'; -import { FileStatusWrapper } from '../../../screens/file/model/file-status.wrapper'; -import { ProjectWrapper } from '../../../state/model/project.wrapper'; -import { PermissionsService } from '../../../utils/permissions.service'; +import { FileStatusWrapper } from '../../../../../models/file/file-status.wrapper'; +import { ProjectWrapper } from '../../../../../state/model/project.wrapper'; +import { PermissionsService } from '../../../../../services/permissions.service'; export function processFilters(oldFilters: FilterModel[], newFilters: FilterModel[]) { copySettings(oldFilters, newFilters); diff --git a/apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.html b/apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.html similarity index 100% rename from apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.html rename to apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.html diff --git a/apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.scss b/apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.scss similarity index 87% rename from apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.scss rename to apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.scss index 41151fbea..df45e39cf 100644 --- a/apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .full-page-load-section, .full-page-load-spinner { diff --git a/apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.ts b/apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.ts similarity index 100% rename from apps/red-ui/src/app/components/full-page-loading-indicator/full-page-loading-indicator.component.ts rename to apps/red-ui/src/app/modules/shared/components/full-page-loading-indicator/full-page-loading-indicator.component.ts diff --git a/apps/red-ui/src/app/components/hidden-action/hidden-action.component.html b/apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.html similarity index 100% rename from apps/red-ui/src/app/components/hidden-action/hidden-action.component.html rename to apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.html diff --git a/apps/red-ui/src/app/components/hidden-action/hidden-action.component.scss b/apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.scss similarity index 100% rename from apps/red-ui/src/app/components/hidden-action/hidden-action.component.scss rename to apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.scss diff --git a/apps/red-ui/src/app/components/hidden-action/hidden-action.component.ts b/apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.ts similarity index 89% rename from apps/red-ui/src/app/components/hidden-action/hidden-action.component.ts rename to apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.ts index ad1c2a56d..82aba4c8c 100644 --- a/apps/red-ui/src/app/components/hidden-action/hidden-action.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/hidden-action/hidden-action.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; @Component({ selector: 'redaction-hidden-action', diff --git a/apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.html b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.html similarity index 100% rename from apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.html rename to apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.html diff --git a/apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.scss b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.scss similarity index 76% rename from apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.scss rename to apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.scss index 61c92d816..f7cc321aa 100644 --- a/apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .wrapper { display: flex; diff --git a/apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.ts b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts similarity index 96% rename from apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.ts rename to apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts index a4999dced..eed1e9c6b 100644 --- a/apps/red-ui/src/app/components/initials-avatar/initials-avatar.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/initials-avatar/initials-avatar.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnChanges, OnInit } from '@angular/core'; -import { UserService } from '../../user/user.service'; +import { UserService } from '../../../../services/user.service'; import { User } from '@redaction/red-ui-http'; @Component({ diff --git a/apps/red-ui/src/app/components/pagination/pagination.component.html b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.html similarity index 100% rename from apps/red-ui/src/app/components/pagination/pagination.component.html rename to apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.html diff --git a/apps/red-ui/src/app/components/pagination/pagination.component.scss b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.scss similarity index 86% rename from apps/red-ui/src/app/components/pagination/pagination.component.scss rename to apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.scss index e2061e12a..1727e012b 100644 --- a/apps/red-ui/src/app/components/pagination/pagination.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; :host { display: flex; diff --git a/apps/red-ui/src/app/components/pagination/pagination.component.ts b/apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.ts similarity index 100% rename from apps/red-ui/src/app/components/pagination/pagination.component.ts rename to apps/red-ui/src/app/modules/shared/components/pagination/pagination.component.ts diff --git a/apps/red-ui/src/app/components/search-input/search-input.component.html b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.html similarity index 100% rename from apps/red-ui/src/app/components/search-input/search-input.component.html rename to apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.html diff --git a/apps/red-ui/src/app/components/search-input/search-input.component.scss b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.scss similarity index 100% rename from apps/red-ui/src/app/components/search-input/search-input.component.scss rename to apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.scss diff --git a/apps/red-ui/src/app/components/search-input/search-input.component.ts b/apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.ts similarity index 100% rename from apps/red-ui/src/app/components/search-input/search-input.component.ts rename to apps/red-ui/src/app/modules/shared/components/search-input/search-input.component.ts diff --git a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html similarity index 100% rename from apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html rename to apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.html diff --git a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.scss b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.scss similarity index 95% rename from apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.scss rename to apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.scss index 86ddd6256..c15d4f883 100644 --- a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; :host { height: fit-content; diff --git a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.ts b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts similarity index 98% rename from apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.ts rename to apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts index 9828a12f8..a070c76b5 100644 --- a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; -import { Color } from '../../utils/types'; +import { Color } from '../../../../utils/types'; import { FilterModel } from '../filter/model/filter.model'; export class DoughnutChartConfig { diff --git a/apps/red-ui/src/app/components/status-bar/status-bar.component.html b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.html similarity index 100% rename from apps/red-ui/src/app/components/status-bar/status-bar.component.html rename to apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.html diff --git a/apps/red-ui/src/app/components/status-bar/status-bar.component.scss b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.scss similarity index 93% rename from apps/red-ui/src/app/components/status-bar/status-bar.component.scss rename to apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.scss index 267368096..9f7bb6620 100644 --- a/apps/red-ui/src/app/components/status-bar/status-bar.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; .rectangle-container { flex: 1; diff --git a/apps/red-ui/src/app/components/status-bar/status-bar.component.ts b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.ts similarity index 91% rename from apps/red-ui/src/app/components/status-bar/status-bar.component.ts rename to apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.ts index 59dd95033..c2cbaa8f0 100644 --- a/apps/red-ui/src/app/components/status-bar/status-bar.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/status-bar/status-bar.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; -import { Color } from '../../utils/types'; +import { Color } from '../../../../utils/types'; @Component({ selector: 'redaction-status-bar', diff --git a/apps/red-ui/src/app/components/table-col-name/table-col-name.component.html b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.html similarity index 100% rename from apps/red-ui/src/app/components/table-col-name/table-col-name.component.html rename to apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.html diff --git a/apps/red-ui/src/app/components/table-col-name/table-col-name.component.scss b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.scss similarity index 91% rename from apps/red-ui/src/app/components/table-col-name/table-col-name.component.scss rename to apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.scss index 2db26872e..0442793be 100644 --- a/apps/red-ui/src/app/components/table-col-name/table-col-name.component.scss +++ b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.scss @@ -1,4 +1,4 @@ -@import '../../../assets/styles/red-variables'; +@import '../../../../../assets/styles/red-variables'; :host { display: flex; diff --git a/apps/red-ui/src/app/components/table-col-name/table-col-name.component.ts b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.ts similarity index 89% rename from apps/red-ui/src/app/components/table-col-name/table-col-name.component.ts rename to apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.ts index 52e8a9b52..291e92fa7 100644 --- a/apps/red-ui/src/app/components/table-col-name/table-col-name.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/table-col-name/table-col-name.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { SortingOption } from '../../utils/sorting.service'; +import { SortingOption } from '../../../../services/sorting.service'; @Component({ selector: 'redaction-table-col-name', diff --git a/apps/red-ui/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.html b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.html rename to apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.scss b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.scss rename to apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts similarity index 100% rename from apps/red-ui/src/app/dialogs/confirmation-dialog/confirmation-dialog.component.ts rename to apps/red-ui/src/app/modules/shared/dialogs/confirmation-dialog/confirmation-dialog.component.ts diff --git a/apps/red-ui/src/app/utils/has-scrollbar.directive.ts b/apps/red-ui/src/app/modules/shared/directives/has-scrollbar.directive.ts similarity index 100% rename from apps/red-ui/src/app/utils/has-scrollbar.directive.ts rename to apps/red-ui/src/app/modules/shared/directives/has-scrollbar.directive.ts diff --git a/apps/red-ui/src/app/utils/sync-width.directive.ts b/apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts similarity index 97% rename from apps/red-ui/src/app/utils/sync-width.directive.ts rename to apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts index 5605f433f..f49b0d41e 100644 --- a/apps/red-ui/src/app/utils/sync-width.directive.ts +++ b/apps/red-ui/src/app/modules/shared/directives/sync-width.directive.ts @@ -1,5 +1,5 @@ import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnDestroy } from '@angular/core'; -import { debounce } from './debounce'; +import { debounce } from '../../../utils/debounce'; @Directive({ selector: '[redactionSyncWidth]', diff --git a/apps/red-ui/src/app/utils/humanize.pipe.ts b/apps/red-ui/src/app/modules/shared/pipes/humanize.pipe.ts similarity index 82% rename from apps/red-ui/src/app/utils/humanize.pipe.ts rename to apps/red-ui/src/app/modules/shared/pipes/humanize.pipe.ts index c06c2fa03..b791a2446 100644 --- a/apps/red-ui/src/app/utils/humanize.pipe.ts +++ b/apps/red-ui/src/app/modules/shared/pipes/humanize.pipe.ts @@ -1,5 +1,5 @@ import { Pipe, PipeTransform } from '@angular/core'; -import { humanize } from './functions'; +import { humanize } from '../../../utils/functions'; @Pipe({ name: 'humanize' diff --git a/apps/red-ui/src/app/modules/shared/shared.module.ts b/apps/red-ui/src/app/modules/shared/shared.module.ts new file mode 100644 index 000000000..4443b1a9e --- /dev/null +++ b/apps/red-ui/src/app/modules/shared/shared.module.ts @@ -0,0 +1,58 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FullPageLoadingIndicatorComponent } from './components/full-page-loading-indicator/full-page-loading-indicator.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { InitialsAvatarComponent } from './components/initials-avatar/initials-avatar.component'; +import { ScrollingModule } from '@angular/cdk/scrolling'; +import { TableColNameComponent } from './components/table-col-name/table-col-name.component'; +import { PaginationComponent } from './components/pagination/pagination.component'; +import { ChevronButtonComponent } from './components/buttons/chevron-button/chevron-button.component'; +import { CircleButtonComponent } from './components/buttons/circle-button/circle-button.component'; +import { FileDownloadBtnComponent } from './components/buttons/file-download-btn/file-download-btn.component'; +import { IconButtonComponent } from './components/buttons/icon-button/icon-button.component'; +import { UserButtonComponent } from './components/buttons/user-button/user-button.component'; +import { MatConfigModule } from '../mat-config/mat-config.module'; +import { SearchInputComponent } from './components/search-input/search-input.component'; +import { NgpSortModule } from 'ngp-sort-pipe'; +import { IconsModule } from '../icons/icons.module'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { AnnotationIconComponent } from './components/annotation-icon/annotation-icon.component'; +import { SimpleDoughnutChartComponent } from './components/simple-doughnut-chart/simple-doughnut-chart.component'; +import { StatusBarComponent } from './components/status-bar/status-bar.component'; +import { HumanizePipe } from './pipes/humanize.pipe'; +import { SyncWidthDirective } from './directives/sync-width.directive'; +import { HasScrollbarDirective } from './directives/has-scrollbar.directive'; +import { DictionaryAnnotationIconComponent } from './components/dictionary-annotation-icon/dictionary-annotation-icon.component'; +import { HiddenActionComponent } from './components/hidden-action/hidden-action.component'; +import { ConfirmationDialogComponent } from './dialogs/confirmation-dialog/confirmation-dialog.component'; +import { FilterComponent } from './components/filter/filter.component'; + +const buttons = [ChevronButtonComponent, CircleButtonComponent, FileDownloadBtnComponent, IconButtonComponent, UserButtonComponent]; + +const components = [ + FullPageLoadingIndicatorComponent, + InitialsAvatarComponent, + TableColNameComponent, + PaginationComponent, + SearchInputComponent, + AnnotationIconComponent, + SimpleDoughnutChartComponent, + StatusBarComponent, + DictionaryAnnotationIconComponent, + HiddenActionComponent, + FilterComponent, + ConfirmationDialogComponent, + + ...buttons +]; + +const utils = [HumanizePipe, SyncWidthDirective, HasScrollbarDirective]; + +const modules = [MatConfigModule, TranslateModule, ScrollingModule, NgpSortModule, IconsModule, FormsModule, ReactiveFormsModule]; + +@NgModule({ + declarations: [...components, ...utils], + imports: [CommonModule, ...modules], + exports: [...modules, ...components, ...utils] +}) +export class SharedModule {} diff --git a/apps/red-ui/src/app/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.html b/apps/red-ui/src/app/modules/upload-download/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.html rename to apps/red-ui/src/app/modules/upload-download/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.html diff --git a/apps/red-ui/src/app/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.scss b/apps/red-ui/src/app/modules/upload-download/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.scss similarity index 100% rename from apps/red-ui/src/app/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.scss rename to apps/red-ui/src/app/modules/upload-download/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.scss diff --git a/apps/red-ui/src/app/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.ts b/apps/red-ui/src/app/modules/upload-download/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.ts similarity index 100% rename from apps/red-ui/src/app/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.ts rename to apps/red-ui/src/app/modules/upload-download/dialogs/overwrite-files-dialog/overwrite-files-dialog.component.ts diff --git a/apps/red-ui/src/app/upload-download/file-drop/file-drop.component.html b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.html similarity index 100% rename from apps/red-ui/src/app/upload-download/file-drop/file-drop.component.html rename to apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.html diff --git a/apps/red-ui/src/app/upload-download/file-drop/file-drop.component.scss b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.scss similarity index 100% rename from apps/red-ui/src/app/upload-download/file-drop/file-drop.component.scss rename to apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.scss diff --git a/apps/red-ui/src/app/upload-download/file-drop/file-drop.component.ts b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts similarity index 85% rename from apps/red-ui/src/app/upload-download/file-drop/file-drop.component.ts rename to apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts index af1ef5946..9768d5788 100644 --- a/apps/red-ui/src/app/upload-download/file-drop/file-drop.component.ts +++ b/apps/red-ui/src/app/modules/upload-download/file-drop/file-drop.component.ts @@ -1,10 +1,10 @@ import { ChangeDetectorRef, Component, HostListener, OnInit } from '@angular/core'; -import { FileUploadService } from '../file-upload.service'; +import { FileUploadService } from '../services/file-upload.service'; import { FileUploadModel } from '../model/file-upload.model'; import { OverlayRef } from '@angular/cdk/overlay'; -import { StatusOverlayService } from '../status-overlay.service'; -import { handleFileDrop } from '../../utils/file-drop-utils'; -import { AppStateService } from '../../state/app-state.service'; +import { StatusOverlayService } from '../services/status-overlay.service'; +import { handleFileDrop } from '../../../utils/file-drop-utils'; +import { AppStateService } from '../../../state/app-state.service'; @Component({ selector: 'redaction-file-drop', diff --git a/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts b/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts new file mode 100644 index 000000000..1804b96c5 --- /dev/null +++ b/apps/red-ui/src/app/modules/upload-download/file-upload-download.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FileDropComponent } from './file-drop/file-drop.component'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { UploadStatusOverlay } from './upload-status-overlay/upload-status-overlay.component'; +import { NgxDropzoneModule } from 'ngx-dropzone'; +import { SharedModule } from '../shared/shared.module'; +import { UploadDownloadDialogService } from './services/upload-download-dialog.service'; +import { OverwriteFilesDialogComponent } from './dialogs/overwrite-files-dialog/overwrite-files-dialog.component'; +import { FileUploadService } from './services/file-upload.service'; +import { FileDownloadService } from './services/file-download.service'; +import { StatusOverlayService } from './services/status-overlay.service'; +import { FileDropOverlayService } from './services/file-drop-overlay.service'; + +@NgModule({ + imports: [CommonModule, SharedModule, NgxDropzoneModule, OverlayModule], + declarations: [FileDropComponent, UploadStatusOverlay, OverwriteFilesDialogComponent], + entryComponents: [FileDropComponent, UploadStatusOverlay], + providers: [UploadDownloadDialogService, FileUploadService, FileDownloadService, StatusOverlayService, FileDropOverlayService], + exports: [FileDropComponent, UploadStatusOverlay] +}) +export class FileUploadDownloadModule {} diff --git a/apps/red-ui/src/app/upload-download/model/download-status.wrapper.ts b/apps/red-ui/src/app/modules/upload-download/model/download-status.wrapper.ts similarity index 100% rename from apps/red-ui/src/app/upload-download/model/download-status.wrapper.ts rename to apps/red-ui/src/app/modules/upload-download/model/download-status.wrapper.ts diff --git a/apps/red-ui/src/app/upload-download/model/file-upload.model.ts b/apps/red-ui/src/app/modules/upload-download/model/file-upload.model.ts similarity index 100% rename from apps/red-ui/src/app/upload-download/model/file-upload.model.ts rename to apps/red-ui/src/app/modules/upload-download/model/file-upload.model.ts diff --git a/apps/red-ui/src/app/upload-download/file-download.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts similarity index 82% rename from apps/red-ui/src/app/upload-download/file-download.service.ts rename to apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts index 6038577ad..518473261 100644 --- a/apps/red-ui/src/app/upload-download/file-download.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts @@ -1,20 +1,17 @@ import { ApplicationRef, Injectable } from '@angular/core'; import { DownloadControllerService, FileManagementControllerService } from '@redaction/red-ui-http'; import { interval, Observable } from 'rxjs'; -import { AppConfigKey, AppConfigService } from '../app-config/app-config.service'; +import { AppConfigKey, AppConfigService } from '../../app-config/app-config.service'; import { TranslateService } from '@ngx-translate/core'; -import { DialogService } from '../dialogs/dialog.service'; -import { ProjectWrapper } from '../state/model/project.wrapper'; -import { FileStatusWrapper } from '../screens/file/model/file-status.wrapper'; +import { ProjectWrapper } from '../../../state/model/project.wrapper'; +import { FileStatusWrapper } from '../../../models/file/file-status.wrapper'; import { mergeMap, tap } from 'rxjs/operators'; -import { DownloadStatusWrapper } from './model/download-status.wrapper'; -import { AppStateService } from '../state/app-state.service'; -import { PermissionsService } from '../utils/permissions.service'; +import { DownloadStatusWrapper } from '../model/download-status.wrapper'; +import { AppStateService } from '../../../state/app-state.service'; +import { PermissionsService } from '../../../services/permissions.service'; import { KeycloakService } from 'keycloak-angular'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class FileDownloadService { public downloads: DownloadStatusWrapper[] = []; @@ -28,8 +25,7 @@ export class FileDownloadService { private readonly _translateService: TranslateService, private readonly _appConfigService: AppConfigService, private readonly _keycloakService: KeycloakService, - private readonly _fileManagementControllerService: FileManagementControllerService, - private readonly _dialogService: DialogService + private readonly _fileManagementControllerService: FileManagementControllerService ) { interval(5000).subscribe((val) => { if (_permissionsService.isUser()) { diff --git a/apps/red-ui/src/app/upload-download/file-drop/service/file-drop-overlay.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts similarity index 96% rename from apps/red-ui/src/app/upload-download/file-drop/service/file-drop-overlay.service.ts rename to apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts index 69c2526c9..29016a076 100644 --- a/apps/red-ui/src/app/upload-download/file-drop/service/file-drop-overlay.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-drop-overlay.service.ts @@ -1,11 +1,9 @@ import { Injectable, Injector } from '@angular/core'; import { Overlay, OverlayRef } from '@angular/cdk/overlay'; -import { FileDropComponent } from '../file-drop.component'; +import { FileDropComponent } from '../file-drop/file-drop.component'; import { ComponentPortal } from '@angular/cdk/portal'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class FileDropOverlayService { private _mouseIn = false; private readonly _dropOverlayRef: OverlayRef; diff --git a/apps/red-ui/src/app/upload-download/file-upload.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts similarity index 94% rename from apps/red-ui/src/app/upload-download/file-upload.service.ts rename to apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts index 0bc4fc6ca..64d698a54 100644 --- a/apps/red-ui/src/app/upload-download/file-upload.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts @@ -1,21 +1,19 @@ import { ApplicationRef, Injectable } from '@angular/core'; -import { FileUploadModel } from './model/file-upload.model'; -import { AppStateService } from '../state/app-state.service'; +import { FileUploadModel } from '../model/file-upload.model'; +import { AppStateService } from '../../../state/app-state.service'; import { HttpEventType } from '@angular/common/http'; import { FileManagementControllerService } from '@redaction/red-ui-http'; import { interval, Subscription } from 'rxjs'; -import { AppConfigKey, AppConfigService } from '../app-config/app-config.service'; +import { AppConfigKey, AppConfigService } from '../../app-config/app-config.service'; import { TranslateService } from '@ngx-translate/core'; -import { DialogService } from '../dialogs/dialog.service'; +import { UploadDownloadDialogService } from './upload-download-dialog.service'; export interface ActiveUpload { subscription: Subscription; fileUploadModel: FileUploadModel; } -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class FileUploadService { static readonly MAX_PARALLEL_UPLOADS = 5; files: FileUploadModel[] = []; @@ -31,7 +29,7 @@ export class FileUploadService { private readonly _translateService: TranslateService, private readonly _appConfigService: AppConfigService, private readonly _fileManagementControllerService: FileManagementControllerService, - private readonly _dialogService: DialogService + private readonly _dialogService: UploadDownloadDialogService ) { interval(2500).subscribe((val) => { this._handleUploads(); diff --git a/apps/red-ui/src/app/upload-download/status-overlay.service.ts b/apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts similarity index 87% rename from apps/red-ui/src/app/upload-download/status-overlay.service.ts rename to apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts index 08ca516e9..e5b2259a9 100644 --- a/apps/red-ui/src/app/upload-download/status-overlay.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/status-overlay.service.ts @@ -1,11 +1,9 @@ import { Injectable, Injector } from '@angular/core'; import { Overlay, OverlayRef } from '@angular/cdk/overlay'; import { ComponentPortal } from '@angular/cdk/portal'; -import { UploadStatusOverlay } from './upload-status-overlay/upload-status-overlay.component'; +import { UploadStatusOverlay } from '../upload-status-overlay/upload-status-overlay.component'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class StatusOverlayService { private readonly _uploadStatusOverlayRef: OverlayRef; diff --git a/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts b/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts new file mode 100644 index 000000000..9f555f611 --- /dev/null +++ b/apps/red-ui/src/app/modules/upload-download/services/upload-download-dialog.service.ts @@ -0,0 +1,28 @@ +import { Injectable } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { OverwriteFilesDialogComponent } from '../dialogs/overwrite-files-dialog/overwrite-files-dialog.component'; + +const dialogConfig = { + width: '662px', + maxWidth: '90vw', + autoFocus: false +}; + +@Injectable() +export class UploadDownloadDialogService { + constructor(private readonly _dialog: MatDialog) {} + + openOverwriteFileDialog(filename: string): Promise<{ option?: 'overwrite' | 'skip'; remember?: boolean; cancel?: boolean }> { + const ref = this._dialog.open(OverwriteFilesDialogComponent, { + ...dialogConfig, + data: filename + }); + + return ref + .afterClosed() + .toPromise() + .then((res) => { + return res || { cancel: true }; + }); + } +} diff --git a/apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.html b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html similarity index 100% rename from apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.html rename to apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.html diff --git a/apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.scss b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.scss similarity index 96% rename from apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.scss rename to apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.scss index a0f95ff94..0e76d6a28 100644 --- a/apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.scss +++ b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.scss @@ -1,5 +1,5 @@ -@import '../../../assets/styles/red-variables'; -@import '../../../assets/styles/red-mixins'; +@import '../../../../assets/styles/red-variables'; +@import '../../../../assets/styles/red-mixins'; .red-upload-download-overlay { background: $white; diff --git a/apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.ts b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.ts similarity index 95% rename from apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.ts rename to apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.ts index 0180b4668..ae18c664e 100644 --- a/apps/red-ui/src/app/upload-download/upload-status-overlay/upload-status-overlay.component.ts +++ b/apps/red-ui/src/app/modules/upload-download/upload-status-overlay/upload-status-overlay.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { FileUploadModel } from '../model/file-upload.model'; -import { FileUploadService } from '../file-upload.service'; +import { FileUploadService } from '../services/file-upload.service'; import { OverlayRef } from '@angular/cdk/overlay'; @Component({ diff --git a/apps/red-ui/src/app/screens/file/model/manual-annotation-response.ts b/apps/red-ui/src/app/screens/file/model/manual-annotation-response.ts deleted file mode 100644 index 6902baf78..000000000 --- a/apps/red-ui/src/app/screens/file/model/manual-annotation-response.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ManualRedactionEntryWrapper } from './manual-redaction-entry.wrapper'; -import { ManualAddResponse } from '@redaction/red-ui-http'; - -export class ManualAnnotationResponse { - annotationId; - commentId; - - constructor( - public manualRedactionEntryWrapper: ManualRedactionEntryWrapper, - public manualAddResponse: ManualAddResponse - ) { - this.annotationId = manualAddResponse?.annotationId - ? manualAddResponse.annotationId - : new Date().getTime(); - this.commentId = manualAddResponse?.commentId - ? manualAddResponse.commentId - : new Date().getTime(); - } - - get dictionary() { - return this.manualRedactionEntryWrapper.manualRedactionEntry.type; - } -} diff --git a/apps/red-ui/src/app/utils/app-load-state.service.ts b/apps/red-ui/src/app/services/app-load-state.service.ts similarity index 100% rename from apps/red-ui/src/app/utils/app-load-state.service.ts rename to apps/red-ui/src/app/services/app-load-state.service.ts diff --git a/apps/red-ui/src/app/notification/notification.service.ts b/apps/red-ui/src/app/services/notification.service.ts similarity index 86% rename from apps/red-ui/src/app/notification/notification.service.ts rename to apps/red-ui/src/app/services/notification.service.ts index ef6615075..657215df9 100644 --- a/apps/red-ui/src/app/notification/notification.service.ts +++ b/apps/red-ui/src/app/services/notification.service.ts @@ -1,5 +1,4 @@ import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; import { ActiveToast, ToastrService } from 'ngx-toastr'; import { IndividualConfig } from 'ngx-toastr/toastr/toastr-config'; import { NavigationStart, Router } from '@angular/router'; @@ -20,11 +19,7 @@ export class Action { providedIn: 'root' }) export class NotificationService { - constructor( - private readonly _snackBar: MatSnackBar, - private readonly _toastr: ToastrService, - private readonly _router: Router - ) { + constructor(private readonly _toastr: ToastrService, private readonly _router: Router) { _router.events.subscribe((event) => { if (event instanceof NavigationStart) { this._toastr.clear(); diff --git a/apps/red-ui/src/app/utils/permissions.service.ts b/apps/red-ui/src/app/services/permissions.service.ts similarity index 98% rename from apps/red-ui/src/app/utils/permissions.service.ts rename to apps/red-ui/src/app/services/permissions.service.ts index 4bcc25cb9..f6f18e3df 100644 --- a/apps/red-ui/src/app/utils/permissions.service.ts +++ b/apps/red-ui/src/app/services/permissions.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { AppStateService } from '../state/app-state.service'; -import { UserService, UserWrapper } from '../user/user.service'; -import { FileStatusWrapper } from '../screens/file/model/file-status.wrapper'; +import { UserService, UserWrapper } from './user.service'; +import { FileStatusWrapper } from '../models/file/file-status.wrapper'; import { User } from '@redaction/red-ui-http'; import { ProjectWrapper } from '../state/model/project.wrapper'; diff --git a/apps/red-ui/src/app/utils/sorting.service.ts b/apps/red-ui/src/app/services/sorting.service.ts similarity index 100% rename from apps/red-ui/src/app/utils/sorting.service.ts rename to apps/red-ui/src/app/services/sorting.service.ts diff --git a/apps/red-ui/src/app/utils/translate-chart.service.ts b/apps/red-ui/src/app/services/translate-chart.service.ts similarity index 78% rename from apps/red-ui/src/app/utils/translate-chart.service.ts rename to apps/red-ui/src/app/services/translate-chart.service.ts index a576a1af5..7e2b0f502 100644 --- a/apps/red-ui/src/app/utils/translate-chart.service.ts +++ b/apps/red-ui/src/app/services/translate-chart.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { DoughnutChartConfig } from '../components/simple-doughnut-chart/simple-doughnut-chart.component'; +import { DoughnutChartConfig } from '../modules/shared/components/simple-doughnut-chart/simple-doughnut-chart.component'; import { TranslateService } from '@ngx-translate/core'; @Injectable({ diff --git a/apps/red-ui/src/app/utils/user-preference.service.ts b/apps/red-ui/src/app/services/user-preference.service.ts similarity index 100% rename from apps/red-ui/src/app/utils/user-preference.service.ts rename to apps/red-ui/src/app/services/user-preference.service.ts diff --git a/apps/red-ui/src/app/user/user.service.ts b/apps/red-ui/src/app/services/user.service.ts similarity index 100% rename from apps/red-ui/src/app/user/user.service.ts rename to apps/red-ui/src/app/services/user.service.ts diff --git a/apps/red-ui/src/app/state/app-state.guard.ts b/apps/red-ui/src/app/state/app-state.guard.ts index 59845752b..a799054fc 100644 --- a/apps/red-ui/src/app/state/app-state.guard.ts +++ b/apps/red-ui/src/app/state/app-state.guard.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; import { AppStateService } from './app-state.service'; -import { UserService } from '../user/user.service'; +import { UserService } from '../services/user.service'; @Injectable({ providedIn: 'root' diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index b90fc0ba6..55b2a8f4f 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -14,14 +14,14 @@ import { TypeValue, VersionsControllerService } from '@redaction/red-ui-http'; -import { NotificationService, NotificationType } from '../notification/notification.service'; +import { NotificationService, NotificationType } from '../services/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { Router } from '@angular/router'; -import { UserService } from '../user/user.service'; +import { UserService } from '../services/user.service'; import { forkJoin, Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; import { humanize } from '../utils/functions'; -import { FileStatusWrapper } from '../screens/file/model/file-status.wrapper'; +import { FileStatusWrapper } from '../models/file/file-status.wrapper'; import { ProjectWrapper } from './model/project.wrapper'; import { saveAs } from 'file-saver'; diff --git a/apps/red-ui/src/app/state/model/project.wrapper.ts b/apps/red-ui/src/app/state/model/project.wrapper.ts index 76e7949db..517635fbd 100644 --- a/apps/red-ui/src/app/state/model/project.wrapper.ts +++ b/apps/red-ui/src/app/state/model/project.wrapper.ts @@ -1,4 +1,4 @@ -import { FileStatusWrapper } from '../../screens/file/model/file-status.wrapper'; +import { FileStatusWrapper } from '../../models/file/file-status.wrapper'; import * as moment from 'moment'; import { Project } from '@redaction/red-ui-http'; diff --git a/apps/red-ui/src/app/upload-download/file-upload-download.module.ts b/apps/red-ui/src/app/upload-download/file-upload-download.module.ts deleted file mode 100644 index 8bd63748e..000000000 --- a/apps/red-ui/src/app/upload-download/file-upload-download.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { FileDropComponent } from './file-drop/file-drop.component'; -import { OverlayModule } from '@angular/cdk/overlay'; -import { UploadStatusOverlay } from './upload-status-overlay/upload-status-overlay.component'; -import { NgxDropzoneModule } from 'ngx-dropzone'; -import { TranslateModule } from '@ngx-translate/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; - -@NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatTooltipModule, - TranslateModule, - MatListModule, - NgxDropzoneModule, - MatProgressBarModule, - MatProgressSpinnerModule, - OverlayModule, - MatButtonModule - ], - declarations: [FileDropComponent, UploadStatusOverlay], - providers: [], - entryComponents: [FileDropComponent, UploadStatusOverlay], - exports: [FileDropComponent, UploadStatusOverlay] -}) -export class FileUploadDownloadModule {} diff --git a/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts b/apps/red-ui/src/app/utils/api-path-interceptor.ts similarity index 81% rename from apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts rename to apps/red-ui/src/app/utils/api-path-interceptor.ts index 16f2371e2..246d64a71 100644 --- a/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts +++ b/apps/red-ui/src/app/utils/api-path-interceptor.ts @@ -1,10 +1,10 @@ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { AppConfigKey, AppConfigService } from '../app-config/app-config.service'; +import { AppConfigKey, AppConfigService } from '../modules/app-config/app-config.service'; @Injectable() -export class ApiPathInterceptorService implements HttpInterceptor { +export class ApiPathInterceptor implements HttpInterceptor { constructor(private readonly _appConfigService: AppConfigService) {} intercept(req: HttpRequest, next: HttpHandler): Observable> { diff --git a/apps/red-ui/src/app/utils/file-drop-utils.ts b/apps/red-ui/src/app/utils/file-drop-utils.ts index 1ca3e28b8..93ff1f26d 100644 --- a/apps/red-ui/src/app/utils/file-drop-utils.ts +++ b/apps/red-ui/src/app/utils/file-drop-utils.ts @@ -1,4 +1,4 @@ -import { FileUploadModel } from '../upload-download/model/file-upload.model'; +import { FileUploadModel } from '../modules/upload-download/model/file-upload.model'; import { ProjectWrapper } from '../state/model/project.wrapper'; export function handleFileDrop(event: DragEvent, project: ProjectWrapper, uploadFiles: (files: FileUploadModel[]) => void) { diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index a9d309f2c..2a7cd8045 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,7 +1,7 @@ { - "OAUTH_URL": "https://timo-redaction-dev.iqser.cloud/auth/realms/redaction", + "OAUTH_URL": "https://redkc-staging.iqser.cloud/auth/realms/redaction", "OAUTH_CLIENT_ID": "redaction", - "API_URL": "https://timo-redaction-dev-2.iqser.cloud", + "API_URL": "https://redapi-staging.iqser.cloud", "BACKEND_APP_VERSION": "4.4.40", "FRONTEND_APP_VERSION": "1.0", "EULA_URL": "EULA_URL",