move files to red-domain

This commit is contained in:
Dan Percic 2021-10-29 13:41:12 +03:00
parent ff2f409079
commit 086c2733bb
17 changed files with 52 additions and 111 deletions

View File

@ -1,11 +1,11 @@
import { ManualRedactionEntryWrapper } from './manual-redaction-entry.wrapper';
import { ManualAddResponse } from '@redaction/red-ui-http';
import { IManualAddResponse } from '@red/domain';
export class ManualAnnotationResponse {
annotationId;
commentId;
constructor(public manualRedactionEntryWrapper: ManualRedactionEntryWrapper, public manualAddResponse: ManualAddResponse) {
constructor(public manualRedactionEntryWrapper: ManualRedactionEntryWrapper, public manualAddResponse: IManualAddResponse) {
this.annotationId = manualAddResponse?.annotationId ? manualAddResponse.annotationId : new Date().getTime();
this.commentId = manualAddResponse?.commentId ? manualAddResponse.commentId : new Date().getTime();
}

View File

@ -1,6 +1,6 @@
import { Injectable, Injector } from '@angular/core';
import { AppStateService } from '@state/app-state.service';
import { ApproveRequest, ImageRecategorizationRequest, ManualAddResponse, RemoveRedactionRequest } from '@redaction/red-ui-http';
import { ApproveRequest, ImageRecategorizationRequest } from '@redaction/red-ui-http';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
import { CONFLICT_ERROR_CODE, ErrorMessageService, GenericService, RequiredParam, Toaster, Validate } from '@iqser/common-ui';
import { TranslateService } from '@ngx-translate/core';
@ -12,10 +12,10 @@ import { annotationActionsTranslations } from '../translations/annotation-action
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { DossiersService } from '@services/entity-services/dossiers.service';
import { HttpErrorResponse } from '@angular/common/http';
import { IAddRedactionRequest, ILegalBasisChangeRequest } from '@red/domain';
import { IAddRedactionRequest, ILegalBasisChangeRequest, IManualAddResponse, IRemoveRedactionRequest } from '@red/domain';
@Injectable()
export class ManualAnnotationService extends GenericService<ManualAddResponse> {
export class ManualAnnotationService extends GenericService<IManualAddResponse> {
CONFIG: {
[key in AnnotationActionMode]: string;
};
@ -257,7 +257,7 @@ export class ManualAnnotationService extends GenericService<ManualAddResponse> {
@Validate()
requestRemoveRedaction(
@RequiredParam() body: RemoveRedactionRequest,
@RequiredParam() body: IRemoveRedactionRequest,
@RequiredParam() dossierId: string,
@RequiredParam() fileId: string,
) {
@ -289,7 +289,7 @@ export class ManualAnnotationService extends GenericService<ManualAddResponse> {
}
@Validate()
removeRedaction(@RequiredParam() body: RemoveRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) {
removeRedaction(@RequiredParam() body: IRemoveRedactionRequest, @RequiredParam() dossierId: string, @RequiredParam() fileId: string) {
const url = `${this._defaultModelPath}/redaction/remove/${dossierId}/${fileId}`;
return this._post(body, url);
}

View File

@ -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, UpdateDictionary } from '@redaction/red-ui-http';
import { Colors } from '@redaction/red-ui-http';
import { tap } from 'rxjs/operators';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { Dictionary, IDictionary } from '@red/domain';
import { Dictionary, IDictionary, IUpdateDictionary } from '@red/domain';
const MIN_WORD_LENGTH = 2;
@ -57,7 +57,7 @@ export class DictionaryService extends EntitiesService<Dictionary, IDictionary>
*/
@Validate()
updateDictionary(
@RequiredParam() body: UpdateDictionary,
@RequiredParam() body: IUpdateDictionary,
@RequiredParam() dossierTemplateId: string,
@RequiredParam() type: string,
dossierId?: string,

View File

@ -1,11 +1,10 @@
import { Inject, Injectable, Injector } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
import jwt_decode from 'jwt-decode';
import { CreateUserRequest, ResetPasswordRequest } from '@redaction/red-ui-http';
import { ICreateUserRequest, IMyProfileUpdateRequest, IProfileUpdateRequest, IResetPasswordRequest, IUser, User } from '@red/domain';
import { wipeCaches } from '@redaction/red-cache';
import { BASE_HREF } from '../tokens';
import { BehaviorSubject, Observable } from 'rxjs';
import { IMyProfileUpdateRequest, IProfileUpdateRequest, IUser, User } from '@red/domain';
import { EntitiesService, List, mapEach, QueryParam, RequiredParam, Validate } from '@iqser/common-ui';
import { tap } from 'rxjs/operators';
@ -96,12 +95,12 @@ export class UserService extends EntitiesService<User, IUser> {
}
@Validate()
resetPassword(@RequiredParam() body: ResetPasswordRequest, @RequiredParam() userId: string) {
resetPassword(@RequiredParam() body: IResetPasswordRequest, @RequiredParam() userId: string) {
return this._post<unknown>(body, `${this._defaultModelPath}/${userId}/reset-password`);
}
@Validate()
create(@RequiredParam() body: CreateUserRequest) {
create(@RequiredParam() body: ICreateUserRequest) {
return this._post(body);
}

View File

@ -1,2 +1,3 @@
export * from './dictionary';
export * from './update-dictionary';
export * from './dictionary.model';

View File

@ -1,19 +1,7 @@
/**
* 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.
*/
/**
* Object containing information of type to be updated.
*/
export interface UpdateDictionary {
export interface IUpdateDictionary {
/**
* If true the ui will add a action to add values to dictionary
*/

View File

@ -7,3 +7,5 @@ export * from './manual-redaction-entry';
export * from './redaction-log-entry';
export * from './redaction-log';
export * from './legal-basis-change.request';
export * from './remove-redaction.request';
export * from './manual-add.response';

View File

@ -0,0 +1,4 @@
export interface IManualAddResponse {
annotationId?: string;
commentId?: number;
}

View File

@ -0,0 +1,5 @@
export interface IRemoveRedactionRequest {
annotationId?: string;
comment?: string;
removeFromDictionary?: boolean;
}

View File

@ -0,0 +1,20 @@
import { List } from '@iqser/common-ui';
export interface ICreateUserRequest {
/**
* Email of user.
*/
email?: string;
/**
* First name of user.
*/
firstName?: string;
/**
* Last name of user.
*/
lastName?: string;
/**
* The list of RED_* roles.
*/
roles?: List;
}

View File

@ -4,3 +4,5 @@ export * from './my-profile-update.request';
export * from './profile-update.request';
export * from './profile';
export * from './types';
export * from './create-user.request';
export * from './reset-password.request';

View File

@ -0,0 +1,4 @@
export interface IResetPasswordRequest {
password?: string;
temporary?: boolean;
}

View File

@ -1,30 +0,0 @@
/**
* 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 CreateUserRequest {
/**
* Email of user.
*/
email?: string;
/**
* First name of user.
*/
firstName?: string;
/**
* Last name of user.
*/
lastName?: string;
/**
* The list of RED_* roles.
*/
roles?: Array<string>;
}

View File

@ -1,16 +0,0 @@
/**
* 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 ManualAddResponse {
annotationId?: string;
commentId?: number;
}

View File

@ -1,7 +1,6 @@
export * from './approveRequest';
export * from './categoryModel';
export * from './colors';
export * from './createUserRequest';
export * from './digitalSignature';
export * from './digitalSignatureViewModel';
export * from './generalConfigurationModel';
@ -9,13 +8,9 @@ export * from './idRemoval';
export * from './imageRecategorizationRequest';
export * from './licenseReport';
export * from './licenseReportRequest';
export * from './manualAddResponse';
export * from './placeholdersResponse';
export * from './removeRedactionRequest';
export * from './reportData';
export * from './reportTemplate';
export * from './resetPasswordRequest';
export * from './rules';
export * from './smtp-configuration';
export * from './updateDictionary';
export * from './watermarkModel';

View File

@ -1,17 +0,0 @@
/**
* 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 RemoveRedactionRequest {
annotationId?: string;
comment?: string;
removeFromDictionary?: boolean;
}

View File

@ -1,16 +0,0 @@
/**
* 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 ResetPasswordRequest {
password?: string;
temporary?: boolean;
}