From fe4e49751f981ce807583f552017aac4b428c98b Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Mon, 26 Jun 2023 22:03:45 +0200 Subject: [PATCH] RED-6686 - do not merge --- .../admin/services/smtp-config.service.ts | 1 + .../services/file-download.service.ts | 6 ++--- .../services/file-upload.service.ts | 2 +- .../entity-permissions.service.ts | 4 ++-- .../app/services/files/earmarks.service.ts | 4 ++-- .../services/files/file-management.service.ts | 18 ++++++++------ .../files/redaction-import.service.ts | 2 +- .../src/app/services/files/rss.service.ts | 2 +- .../app/services/general-settings.service.ts | 1 + .../src/app/services/license.service.ts | 2 +- .../app/services/report-template.service.ts | 4 ++-- apps/red-ui/src/app/users/roles.ts | 24 +++++++++---------- apps/red-ui/src/app/users/user.service.ts | 2 +- apps/red-ui/src/assets/config/config.json | 4 ++-- docker/red-ui/docker-entrypoint.sh | 2 +- git-version.json | 10 ++++++++ libs/common-ui | 2 +- package.json | 2 +- 18 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 git-version.json diff --git a/apps/red-ui/src/app/modules/admin/services/smtp-config.service.ts b/apps/red-ui/src/app/modules/admin/services/smtp-config.service.ts index b0a702473..40b949acd 100644 --- a/apps/red-ui/src/app/modules/admin/services/smtp-config.service.ts +++ b/apps/red-ui/src/app/modules/admin/services/smtp-config.service.ts @@ -5,6 +5,7 @@ import { ISmtpConfiguration } from '@red/domain'; @Injectable() export class SmtpConfigService extends GenericService { protected readonly _defaultModelPath = 'configuration'; + protected readonly _serviceName: string = 'tenant-user-management'; updateSMTPConfiguration(body: ISmtpConfiguration) { return this._post(body, `${this._defaultModelPath}/smtp`); diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts index 8225fef33..460e55592 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-download.service.ts @@ -35,9 +35,9 @@ export class FileDownloadService extends EntitiesService impleme const headers = HeadersConfiguration.getHeaders({ contentType: false }).append('ngsw-bypass', 'true'); - return this._http.post(`/${this._defaultModelPath}/${dossierId}`, formParams, { + return this._http.post(`/${this._serviceName}/${this._defaultModelPath}/${dossierId}`, formParams, { headers, observe: 'events', reportProgress: true, diff --git a/apps/red-ui/src/app/services/entity-permissions/entity-permissions.service.ts b/apps/red-ui/src/app/services/entity-permissions/entity-permissions.service.ts index 97b96ebfd..09bd2dccf 100644 --- a/apps/red-ui/src/app/services/entity-permissions/entity-permissions.service.ts +++ b/apps/red-ui/src/app/services/entity-permissions/entity-permissions.service.ts @@ -16,14 +16,14 @@ export class EntityPermissionsService extends GenericService { - return this._http.get(`/${this._defaultModelPath}/${targetObject}/mapping`).pipe( + return this._http.get(`/${this._serviceName}/${this._defaultModelPath}/${targetObject}/mapping`).pipe( mapEach(mapping => new PermissionsMapping(mapping)), tap(mappings => this.#permissionsConfigurationMapService.set(targetObject, mappings)), ); } loadFor(targetObject: string): Observable { - return this._http.get(`/${this._defaultModelPath}/${targetObject}`).pipe( + return this._http.get(`/${this._serviceName}/${this._defaultModelPath}/${targetObject}`).pipe( mapEach(mapping => new PermissionsMapping(mapping)), tap(mappings => { this.#addMissingPermissions(mappings, targetObject); diff --git a/apps/red-ui/src/app/services/files/earmarks.service.ts b/apps/red-ui/src/app/services/files/earmarks.service.ts index b1e0d561f..bf3656d28 100644 --- a/apps/red-ui/src/app/services/files/earmarks.service.ts +++ b/apps/red-ui/src/app/services/files/earmarks.service.ts @@ -14,7 +14,7 @@ export class EarmarksService extends GenericService { readonly #toaster = inject(Toaster); getEarmarks(dossierId: string, fileId: string) { - const request = this._http.get<{ highlights: Earmark[] }>(`/${this.#getPath(dossierId, fileId)}`).pipe( + const request = this._http.get<{ highlights: Earmark[] }>(`/${this._serviceName}/${this.#getPath(dossierId, fileId)}`).pipe( map(response => response.highlights), map(highlights => highlights.map(highlight => AnnotationWrapper.fromEarmark(highlight))), map(highlights => highlights.sort((h1, h2) => h1.color.localeCompare(h2.color))), @@ -25,7 +25,7 @@ export class EarmarksService extends GenericService { } performHighlightsAction(ids: string[], dossierId: string, fileId: string, operation: EarmarkOperation) { - return this._post({ ids }, `${this.#getPath(dossierId, fileId)}/${operation}`).pipe( + return this._post({ ids }, `/${this._serviceName}/${this.#getPath(dossierId, fileId)}/${operation}`).pipe( tap(() => this.#toaster.success(_('highlight-action-dialog.success'), { params: { operation } })), ); } diff --git a/apps/red-ui/src/app/services/files/file-management.service.ts b/apps/red-ui/src/app/services/files/file-management.service.ts index 8796e168a..c742b4dea 100644 --- a/apps/red-ui/src/app/services/files/file-management.service.ts +++ b/apps/red-ui/src/app/services/files/file-management.service.ts @@ -37,12 +37,16 @@ export class FileManagementService extends GenericService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - return this._http.request('get', `/download/original/${encodeURIComponent(dossierId)}/${encodeURIComponent(fileId)}`, { - responseType: 'blob', - params: this._queryParams(queryParams), - headers: headers, - observe: observe, - reportProgress: observe === 'events', - }); + return this._http.request( + 'get', + `/${this._serviceName}/download/original/${encodeURIComponent(dossierId)}/${encodeURIComponent(fileId)}`, + { + responseType: 'blob', + params: this._queryParams(queryParams), + headers: headers, + observe: observe, + reportProgress: observe === 'events', + }, + ); } } diff --git a/apps/red-ui/src/app/services/files/redaction-import.service.ts b/apps/red-ui/src/app/services/files/redaction-import.service.ts index ab0ab214d..fc5451b62 100644 --- a/apps/red-ui/src/app/services/files/redaction-import.service.ts +++ b/apps/red-ui/src/app/services/files/redaction-import.service.ts @@ -18,7 +18,7 @@ export class RedactionImportService extends GenericService { const headers = HeadersConfiguration.getHeaders({ contentType: false }).append('ngsw-bypass', 'true'); - return this._http.post(`/${this._defaultModelPath}/${dossierId}/${fileId}`, formParams, { + return this._http.post(`/${this._serviceName}/${this._defaultModelPath}/${dossierId}/${fileId}`, formParams, { headers, observe: 'response', }); diff --git a/apps/red-ui/src/app/services/files/rss.service.ts b/apps/red-ui/src/app/services/files/rss.service.ts index db184fd29..9fa3d8e61 100644 --- a/apps/red-ui/src/app/services/files/rss.service.ts +++ b/apps/red-ui/src/app/services/files/rss.service.ts @@ -66,7 +66,7 @@ export class RssService extends GenericService { let headers = new HttpHeaders(); headers = headers.set('accept', 'application/xml'); - return this._http.get(`/${encodeURI('rss')}/${entityPath}`, { + return this._http.get(`/${this._serviceName}/${encodeURI('rss')}/${entityPath}`, { headers: headers, params: this._queryParams(queryParams), responseType: 'text', diff --git a/apps/red-ui/src/app/services/general-settings.service.ts b/apps/red-ui/src/app/services/general-settings.service.ts index 0a32a0fbd..c1d0177a7 100644 --- a/apps/red-ui/src/app/services/general-settings.service.ts +++ b/apps/red-ui/src/app/services/general-settings.service.ts @@ -8,6 +8,7 @@ import { Observable } from 'rxjs'; }) export class GeneralSettingsService extends GenericService { protected readonly _defaultModelPath = 'configuration'; + protected readonly _serviceName: string = 'tenant-user-management'; getGeneralConfigurations(): Observable { return this._getOne(['general']); diff --git a/apps/red-ui/src/app/services/license.service.ts b/apps/red-ui/src/app/services/license.service.ts index 1ee38480a..f56db7792 100644 --- a/apps/red-ui/src/app/services/license.service.ts +++ b/apps/red-ui/src/app/services/license.service.ts @@ -142,7 +142,7 @@ export class LicenseService extends GenericService { } async loadLicenses() { - const licenses$ = this._http.get('/license').pipe(catchError(() => of(defaultOnError))); + const licenses$ = this._http.get(`/${this._serviceName}/license`).pipe(catchError(() => of(defaultOnError))); const licenses = await firstValueFrom(licenses$); this.#licenseData$.next(licenses); this.setDefaultSelectedLicense(); diff --git a/apps/red-ui/src/app/services/report-template.service.ts b/apps/red-ui/src/app/services/report-template.service.ts index f55ff5c32..792dad7ef 100644 --- a/apps/red-ui/src/app/services/report-template.service.ts +++ b/apps/red-ui/src/app/services/report-template.service.ts @@ -21,7 +21,7 @@ export class ReportTemplateService extends GenericService { formParams.append('file', file); } - return this._http.post(`/${this._defaultModelPath}/${dossierTemplateId}`, formParams, { + return this._http.post(`/${this._serviceName}/${this._defaultModelPath}/${dossierTemplateId}`, formParams, { observe: 'body', }); } @@ -46,7 +46,7 @@ export class ReportTemplateService extends GenericService { downloadReportTemplate(dossierTemplateId: string, templateId: string, observe: 'response'): Observable>; downloadReportTemplate(dossierTemplateId: string, templateId: string, observe: 'body'): Observable; downloadReportTemplate(dossierTemplateId: string, templateId: string, observe: 'body' | 'response' = 'body') { - return this._http.request('get', `/${this._defaultModelPath}/${dossierTemplateId}/${templateId}`, { + return this._http.request('get', `/${this._serviceName}/${this._defaultModelPath}/${dossierTemplateId}/${templateId}`, { responseType: 'blob', observe: observe, headers: HeadersConfiguration.getHeaders({ contentType: false }), diff --git a/apps/red-ui/src/app/users/roles.ts b/apps/red-ui/src/app/users/roles.ts index 68769ca03..67ba6f5a2 100644 --- a/apps/red-ui/src/app/users/roles.ts +++ b/apps/red-ui/src/app/users/roles.ts @@ -1,11 +1,11 @@ export const Roles = { - RED_CREATE_TENANT: 'red-create-tenant', - RED_DEPLOYMENT_INFO: 'red-deployment-info', - RED_GET_TENANTS: 'red-get-tenants', + RED_CREATE_TENANT: 'fforesight-create-tenant', + RED_DEPLOYMENT_INFO: 'fforesight-deployment-info', + RED_GET_TENANTS: 'fforesight-get-tenants', RED_READ_VERSIONS: 'red-read-versions', RED_REINDEX: 'red-reindex', - managePreferences: 'red-manage-user-preferences', - updateMyProfile: 'red-update-my-profile', + managePreferences: 'fforesight-manage-user-preferences', + updateMyProfile: 'fforesight-update-my-profile', getRss: 'red-get-rss', excludeIncludeFile: 'red-exclude-include-file', excludeIncludePages: 'red-exclude-include-pages', @@ -33,8 +33,8 @@ export const Roles = { delete: 'red-delete-comment', }, smtp: { - read: 'red-read-smtp-configuration', - write: 'red-write-smtp-configuration', + read: 'fforesight-read-smtp-configuration', + write: 'fforesight-write-smtp-configuration', }, license: { edit: 'red-update-license', @@ -66,9 +66,9 @@ export const Roles = { read: 'red-read-watermark', }, users: { - write: 'red-write-users', - read: 'red-read-users', - readAll: 'red-read-all-users', + write: 'fforesight-write-users', + read: 'fforesight-read-users', + readAll: 'fforesight-read-all-users', }, dossiers: { read: 'red-read-dossier', @@ -141,8 +141,8 @@ export const Roles = { write: 'red-write-app-configuration', }, generalConfiguration: { - read: 'red-read-general-configuration', - write: 'red-write-general-configuration', + read: 'fforesight-read-general-configuration', + write: 'fforesight-write-general-configuration', }, any: 'any', } as const; diff --git a/apps/red-ui/src/app/users/user.service.ts b/apps/red-ui/src/app/users/user.service.ts index 2bdd7735d..f1a012108 100644 --- a/apps/red-ui/src/app/users/user.service.ts +++ b/apps/red-ui/src/app/users/user.service.ts @@ -38,7 +38,7 @@ export class UserService extends IqserUserService { } protected readonly _rolesFilter = (role: string) => role.startsWith('RED_'); - protected readonly _permissionsFilter = (role: string) => role.startsWith('red-'); + protected readonly _permissionsFilter = (role: string) => role.startsWith('red-') || role.startsWith('fforesight-'); } export function getCurrentUser() { diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 135b0a653..5e5347695 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,7 +1,7 @@ { "ADMIN_CONTACT_NAME": null, "ADMIN_CONTACT_URL": null, - "API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1", + "API_URL": "https://dev-01.iqser.cloud", "APP_NAME": "RedactManager", "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", @@ -11,7 +11,7 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dev-08.iqser.cloud/auth", + "OAUTH_URL": "https://dev-01.iqser.cloud/auth", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", diff --git a/docker/red-ui/docker-entrypoint.sh b/docker/red-ui/docker-entrypoint.sh index e7cc6339e..a4f900adc 100755 --- a/docker/red-ui/docker-entrypoint.sh +++ b/docker/red-ui/docker-entrypoint.sh @@ -2,7 +2,7 @@ ADMIN_CONTACT_NAME="${ADMIN_CONTACT_NAME:-}" ADMIN_CONTACT_URL="${ADMIN_CONTACT_URL:-}" -API_URL="${API_URL:-/redaction-gateway-v1}" +API_URL="${API_URL:-}" APP_NAME="${APP_NAME:-}" AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}" BACKEND_APP_VERSION="${BACKEND_APP_VERSION:-4.7.0}" diff --git a/git-version.json b/git-version.json new file mode 100644 index 000000000..c6ff5f937 --- /dev/null +++ b/git-version.json @@ -0,0 +1,10 @@ +{ + "dirty": true, + "raw": "a84073b85-dirty", + "hash": "a84073b85", + "distance": null, + "tag": null, + "semver": null, + "suffix": "a84073b85-dirty", + "semverString": null +} diff --git a/libs/common-ui b/libs/common-ui index 75356e232..f56838648 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 75356e2328051f629ac1a860e55cba0c2a16a6d5 +Subproject commit f56838648d4b54861d48de47096395e498e337ea diff --git a/package.json b/package.json index d804642ea..f9f626843 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redaction", - "version": "4.134.0", + "version": "5.0.0", "private": true, "license": "MIT", "scripts": {