From 38fafaf6218df31f10d98639944e59c1d6c1628d Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Sun, 24 Oct 2021 01:14:20 +0300 Subject: [PATCH] move dictionary to red-domain, remove generated comments --- .../src/app/models/file/file-data.model.ts | 3 +-- .../add-edit-dictionary-dialog.component.ts | 3 +-- .../dictionary-listing-screen.component.ts | 2 +- .../dictionary-overview-screen.component.ts | 2 +- .../edit-dossier-dictionary.component.ts | 3 +-- .../manual-annotation-dialog.component.ts | 2 +- .../annotation-icon/annotation-icon.component.ts | 2 +- .../dictionary-manager.component.ts | 3 +-- .../shared/services/dictionary.service.ts | 4 ++-- apps/red-ui/src/app/state/app-state.service.ts | 3 +-- libs/red-domain/src/index.ts | 1 + .../lib/dictionaries/dictionary.interface.ts} | 16 ++-------------- .../src/lib/dictionaries/dictionary.model.ts | 2 +- libs/red-domain/src/lib/dictionaries/index.ts | 2 ++ .../red-domain/src/lib/dossiers/dossier.model.ts | 2 +- .../src/lib/pages/page-exclusion.request.ts | 11 ----------- libs/red-domain/src/lib/pages/page-range.ts | 12 ------------ libs/red-domain/src/lib/pages/viewed-page.ts | 12 ------------ .../src/lib/pages/viewed-pages.request.ts | 12 ------------ .../src/lib/search/matched-document.ts | 11 ----------- .../red-domain/src/lib/search/matched-section.ts | 11 ----------- libs/red-domain/src/lib/search/search.request.ts | 11 ----------- .../red-domain/src/lib/search/search.response.ts | 11 ----------- .../src/lib/users/profile-update.request.ts | 11 ----------- libs/red-ui-http/src/lib/model/models.ts | 1 - 25 files changed, 18 insertions(+), 135 deletions(-) rename libs/{red-ui-http/src/lib/model/dictionary.ts => red-domain/src/lib/dictionaries/dictionary.interface.ts} (80%) rename apps/red-ui/src/app/models/dictionary.ts => libs/red-domain/src/lib/dictionaries/dictionary.model.ts (96%) create mode 100644 libs/red-domain/src/lib/dictionaries/index.ts diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 5e257c0e6..0658137e6 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -4,8 +4,7 @@ import { AnnotationWrapper } from './annotation.wrapper'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { ViewMode } from './view-mode'; import * as moment from 'moment'; -import { IViewedPage, User } from '@red/domain'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary, IViewedPage, User } from '@red/domain'; export class AnnotationData { visibleAnnotations: AnnotationWrapper[]; diff --git a/apps/red-ui/src/app/modules/admin/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 index 1b513895a..c51eebd57 100644 --- a/apps/red-ui/src/app/modules/admin/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 @@ -8,8 +8,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { AppStateService } from '@state/app-state.service'; import { toKebabCase } from '@utils/functions'; import { DictionaryService } from '@shared/services/dictionary.service'; -import { IDictionary } from '@redaction/red-ui-http'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary, IDictionary } from '@red/domain'; @Component({ selector: 'redaction-add-edit-dictionary-dialog', diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts index f7380fb6f..89666ca0a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts @@ -18,7 +18,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { UserService } from '@services/user.service'; import { DictionaryService } from '@shared/services/dictionary.service'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary } from '@red/domain'; const toChartConfig = (dict: Dictionary): DoughnutChartConfig => ({ value: dict.entries?.length ?? 0, diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts index 739355acc..a11c347d3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts @@ -10,7 +10,7 @@ import { DictionaryService } from '@shared/services/dictionary.service'; import { CircleButtonTypes, LoadingService } from '@iqser/common-ui'; import { UserService } from '@services/user.service'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary } from '@red/domain'; @Component({ templateUrl: './dictionary-overview-screen.component.html', diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts index 1eb2182aa..956ab598e 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/dictionary/edit-dossier-dictionary.component.ts @@ -1,12 +1,11 @@ import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { Dossier } from '@red/domain'; +import { Dossier, IDictionary } from '@red/domain'; import { EditDossierSectionInterface } from '../edit-dossier-section.interface'; import { PermissionsService } from '@services/permissions.service'; import { DictionaryManagerComponent } from '@shared/components/dictionary-manager/dictionary-manager.component'; import { DictionaryService } from '@shared/services/dictionary.service'; import { FormBuilder } from '@angular/forms'; import { CircleButtonTypes, LoadingService } from '@iqser/common-ui'; -import { IDictionary } from '@redaction/red-ui-http'; import { DossiersService } from '@services/entity-services/dossiers.service'; @Component({ diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 67ea29bb7..ec0e0d3f5 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -12,7 +12,7 @@ import { ManualAnnotationResponse } from '@models/file/manual-annotation-respons import { PermissionsService } from '@services/permissions.service'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { JustificationsService } from '@services/entity-services/justifications.service'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary } from '@red/domain'; export interface LegalBasisOption { label?: string; diff --git a/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts index 420dce889..f4bcb9c27 100644 --- a/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts @@ -1,5 +1,5 @@ import { Component, ElementRef, Input, OnChanges, ViewChild } from '@angular/core'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary } from '@red/domain'; @Component({ selector: 'redaction-annotation-icon', diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index d12c58ac7..9daa1733e 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -2,14 +2,13 @@ import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@a import { Debounce, IconButtonTypes, List } from '@iqser/common-ui'; import { Observable, of } from 'rxjs'; import { catchError, map, take, tap } from 'rxjs/operators'; -import { Dossier, DossierTemplate } from '@red/domain'; +import { Dictionary, Dossier, DossierTemplate } from '@red/domain'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DictionaryService } from '@shared/services/dictionary.service'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; import { AppStateService } from '@state/app-state.service'; import { EditorComponent } from '@shared/components/editor/editor.component'; -import { Dictionary } from '@models/dictionary'; import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration; import FindMatch = monaco.editor.FindMatch; diff --git a/apps/red-ui/src/app/modules/shared/services/dictionary.service.ts b/apps/red-ui/src/app/modules/shared/services/dictionary.service.ts index 4151cb0b2..89923d9d7 100644 --- a/apps/red-ui/src/app/modules/shared/services/dictionary.service.ts +++ b/apps/red-ui/src/app/modules/shared/services/dictionary.service.ts @@ -1,10 +1,10 @@ import { Injectable, Injector } from '@angular/core'; import { Observable, throwError } from 'rxjs'; import { EntitiesService, List, QueryParam, RequiredParam, Toaster, Validate } from '@iqser/common-ui'; -import { Colors, IDictionary, UpdateDictionary } from '@redaction/red-ui-http'; +import { Colors, UpdateDictionary } from '@redaction/red-ui-http'; import { tap } from 'rxjs/operators'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { Dictionary } from '@models/dictionary'; +import { Dictionary, IDictionary } from '@red/domain'; const MIN_WORD_LENGTH = 2; 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 808b62193..99ae7e7e9 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -6,7 +6,7 @@ import { forkJoin, Observable, of, Subject } from 'rxjs'; import { catchError, filter, first, map, tap } from 'rxjs/operators'; import { currentComponentRoute, FALLBACK_COLOR, hexToRgb } from '@utils/functions'; import { File } from '@models/file/file'; -import { Dossier, DossierTemplate, IDossier } from '@red/domain'; +import { Dictionary, Dossier, DossierTemplate, IDossier } from '@red/domain'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { UserPreferenceService } from '@services/user-preference.service'; import { FilesService } from '@services/entity-services/files.service'; @@ -14,7 +14,6 @@ import { DictionaryService } from '@shared/services/dictionary.service'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; import { FileAttributesService } from '@services/entity-services/file-attributes.service'; import { ReanalysisService } from '@services/reanalysis.service'; -import { Dictionary } from '@models/dictionary'; export interface AppState { activeFileId?: string; diff --git a/libs/red-domain/src/index.ts b/libs/red-domain/src/index.ts index a4adee960..d1c6ed49e 100644 --- a/libs/red-domain/src/index.ts +++ b/libs/red-domain/src/index.ts @@ -7,3 +7,4 @@ export * from './lib/pages'; export * from './lib/audit'; export * from './lib/notifications'; export * from './lib/dossier-templates'; +export * from './lib/dictionaries'; diff --git a/libs/red-ui-http/src/lib/model/dictionary.ts b/libs/red-domain/src/lib/dictionaries/dictionary.interface.ts similarity index 80% rename from libs/red-ui-http/src/lib/model/dictionary.ts rename to libs/red-domain/src/lib/dictionaries/dictionary.interface.ts index 2f00a869c..c32ce22aa 100644 --- a/libs/red-ui-http/src/lib/model/dictionary.ts +++ b/libs/red-domain/src/lib/dictionaries/dictionary.interface.ts @@ -1,20 +1,8 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { List } from '../red-types'; - /** * Object containing a list of dictionary entries and colors of an entry type. */ +import { List } from '@iqser/common-ui'; + export interface IDictionary { /** * If true the ui will add a action to add values to dictionary diff --git a/apps/red-ui/src/app/models/dictionary.ts b/libs/red-domain/src/lib/dictionaries/dictionary.model.ts similarity index 96% rename from apps/red-ui/src/app/models/dictionary.ts rename to libs/red-domain/src/lib/dictionaries/dictionary.model.ts index 01e7a327f..493353989 100644 --- a/apps/red-ui/src/app/models/dictionary.ts +++ b/libs/red-domain/src/lib/dictionaries/dictionary.model.ts @@ -1,5 +1,5 @@ -import { IDictionary } from '@redaction/red-ui-http'; import { IListable, List } from '@iqser/common-ui'; +import { IDictionary } from './dictionary.interface'; export class Dictionary implements IDictionary, IListable { readonly addToDictionaryAction: boolean; diff --git a/libs/red-domain/src/lib/dictionaries/index.ts b/libs/red-domain/src/lib/dictionaries/index.ts new file mode 100644 index 000000000..37eb4c2bd --- /dev/null +++ b/libs/red-domain/src/lib/dictionaries/index.ts @@ -0,0 +1,2 @@ +export * from './dictionary.interface'; +export * from './dictionary.model'; diff --git a/libs/red-domain/src/lib/dossiers/dossier.model.ts b/libs/red-domain/src/lib/dossiers/dossier.model.ts index a730affb7..3b9d90bf6 100644 --- a/libs/red-domain/src/lib/dossiers/dossier.model.ts +++ b/libs/red-domain/src/lib/dossiers/dossier.model.ts @@ -1,9 +1,9 @@ import { File } from '@models/file/file'; -import { IDictionary } from '@redaction/red-ui-http'; import { IListable, List } from '@iqser/common-ui'; import { IDossier } from './dossier.interface'; import { DossierStatus } from './types'; import { DownloadFileType } from '../shared/types'; +import { IDictionary } from '../dictionaries'; export class Dossier implements IDossier, IListable { readonly dossierId: string; diff --git a/libs/red-domain/src/lib/pages/page-exclusion.request.ts b/libs/red-domain/src/lib/pages/page-exclusion.request.ts index 9f3247f8e..b77c01987 100644 --- a/libs/red-domain/src/lib/pages/page-exclusion.request.ts +++ b/libs/red-domain/src/lib/pages/page-exclusion.request.ts @@ -1,14 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ import { IPageRange } from './page-range'; import { List } from '@iqser/common-ui'; diff --git a/libs/red-domain/src/lib/pages/page-range.ts b/libs/red-domain/src/lib/pages/page-range.ts index 034c0c861..4088a732e 100644 --- a/libs/red-domain/src/lib/pages/page-range.ts +++ b/libs/red-domain/src/lib/pages/page-range.ts @@ -1,15 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - export interface IPageRange { startPage?: number; endPage?: number; diff --git a/libs/red-domain/src/lib/pages/viewed-page.ts b/libs/red-domain/src/lib/pages/viewed-page.ts index 40a7ea86e..7dc11fc42 100644 --- a/libs/red-domain/src/lib/pages/viewed-page.ts +++ b/libs/red-domain/src/lib/pages/viewed-page.ts @@ -1,15 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - export interface IViewedPage { fileId?: string; page?: number; diff --git a/libs/red-domain/src/lib/pages/viewed-pages.request.ts b/libs/red-domain/src/lib/pages/viewed-pages.request.ts index 2f62d560d..aaa6851e8 100644 --- a/libs/red-domain/src/lib/pages/viewed-pages.request.ts +++ b/libs/red-domain/src/lib/pages/viewed-pages.request.ts @@ -1,15 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - export interface IViewedPagesRequest { page?: number; } diff --git a/libs/red-domain/src/lib/search/matched-document.ts b/libs/red-domain/src/lib/search/matched-document.ts index 20180f32c..e6b8b5f3b 100644 --- a/libs/red-domain/src/lib/search/matched-document.ts +++ b/libs/red-domain/src/lib/search/matched-document.ts @@ -1,14 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ import { IMatchedSection } from './matched-section'; import { List } from '@iqser/common-ui'; diff --git a/libs/red-domain/src/lib/search/matched-section.ts b/libs/red-domain/src/lib/search/matched-section.ts index ba969568c..2ec1893f8 100644 --- a/libs/red-domain/src/lib/search/matched-section.ts +++ b/libs/red-domain/src/lib/search/matched-section.ts @@ -1,14 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ import { List } from '@iqser/common-ui'; export interface IMatchedSection { diff --git a/libs/red-domain/src/lib/search/search.request.ts b/libs/red-domain/src/lib/search/search.request.ts index 9c8c77a0b..104e9b097 100644 --- a/libs/red-domain/src/lib/search/search.request.ts +++ b/libs/red-domain/src/lib/search/search.request.ts @@ -1,14 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ import { List } from '@iqser/common-ui'; export interface ISearchRequest { diff --git a/libs/red-domain/src/lib/search/search.response.ts b/libs/red-domain/src/lib/search/search.response.ts index 8796d1bd5..861d89ef9 100644 --- a/libs/red-domain/src/lib/search/search.response.ts +++ b/libs/red-domain/src/lib/search/search.response.ts @@ -1,14 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ import { IMatchedDocument } from './matched-document'; import { List } from '@iqser/common-ui'; diff --git a/libs/red-domain/src/lib/users/profile-update.request.ts b/libs/red-domain/src/lib/users/profile-update.request.ts index 70eac284e..778db3489 100644 --- a/libs/red-domain/src/lib/users/profile-update.request.ts +++ b/libs/red-domain/src/lib/users/profile-update.request.ts @@ -1,14 +1,3 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ import { IMyProfileUpdateRequest } from './my-profile-update.request'; import { List } from '@iqser/common-ui'; diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index 5cf927ea7..d2ce590e1 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -7,7 +7,6 @@ export * from './colors'; export * from './comment'; export * from './commentResponse'; export * from './createUserRequest'; -export * from './dictionary'; export * from './digitalSignature'; export * from './digitalSignatureViewModel'; export * from './downloadResponse';