Merge branch 'RED-3800-remove-tenant-references-in-routes' into 'master'
Resolve RED-3800 "Remove tenant references in routes" Closes RED-3800 See merge request redactmanager/red-ui!214
This commit is contained in:
commit
effe833971
@ -68,7 +68,7 @@ import { AppRoutingModule } from './app-routing.module';
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { PdfViewerModule } from './modules/pdf-viewer/pdf-viewer.module';
|
import { PdfViewerModule } from './modules/pdf-viewer/pdf-viewer.module';
|
||||||
import { ACTIVE_DOSSIERS_SERVICE, ARCHIVED_DOSSIERS_SERVICE } from './tokens';
|
import { ACTIVE_DOSSIERS_SERVICE, ARCHIVED_DOSSIERS_SERVICE } from './tokens';
|
||||||
import { UI_ROOT } from '@common-ui/utils';
|
import { GET_TENANT_FROM_PATH_FN, UI_ROOT } from '@common-ui/utils';
|
||||||
|
|
||||||
export const appModuleFactory = (config: AppConfig) => {
|
export const appModuleFactory = (config: AppConfig) => {
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@ -196,9 +196,8 @@ export const appModuleFactory = (config: AppConfig) => {
|
|||||||
provide: APP_BASE_HREF,
|
provide: APP_BASE_HREF,
|
||||||
useFactory: () => {
|
useFactory: () => {
|
||||||
const uiRoot = inject(UI_ROOT);
|
const uiRoot = inject(UI_ROOT);
|
||||||
const pathParams = location.pathname.split('/').filter(Boolean);
|
const tenant = inject(GET_TENANT_FROM_PATH_FN)();
|
||||||
const uiRootPathIndex = pathParams.indexOf(uiRoot.replace('/', ''));
|
console.log(tenant);
|
||||||
const tenant = pathParams[uiRootPathIndex + 1] ?? '';
|
|
||||||
const appBaseHref = uiRoot + '/' + tenant;
|
const appBaseHref = uiRoot + '/' + tenant;
|
||||||
|
|
||||||
inject(NGXLogger).info('Provide APP_BASE_HREF:', appBaseHref);
|
inject(NGXLogger).info('Provide APP_BASE_HREF:', appBaseHref);
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import { Roles } from '@users/roles';
|
|||||||
import { REDDocumentViewer } from '../../modules/pdf-viewer/services/document-viewer.service';
|
import { REDDocumentViewer } from '../../modules/pdf-viewer/services/document-viewer.service';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { List, shareDistinctLast } from '@iqser/common-ui/lib/utils';
|
import { List, shareDistinctLast } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
|
|
||||||
const isNavigationStart = (event: unknown): event is NavigationStart => event instanceof NavigationStart;
|
const isNavigationStart = (event: unknown): event is NavigationStart => event instanceof NavigationStart;
|
||||||
const isSearchScreen: (url: string) => boolean = url => url.includes('/search');
|
const isSearchScreen: (url: string) => boolean = url => url.includes('/search');
|
||||||
@ -24,12 +23,6 @@ const isSearchScreen: (url: string) => boolean = url => url.includes('/search');
|
|||||||
styleUrls: ['./base-screen.component.scss'],
|
styleUrls: ['./base-screen.component.scss'],
|
||||||
})
|
})
|
||||||
export class BaseScreenComponent {
|
export class BaseScreenComponent {
|
||||||
readonly #navigationStart$ = this._router.events.pipe(
|
|
||||||
filter(isNavigationStart),
|
|
||||||
map(event => event.url),
|
|
||||||
startWith(this._router.url),
|
|
||||||
shareDistinctLast(),
|
|
||||||
);
|
|
||||||
readonly roles = Roles;
|
readonly roles = Roles;
|
||||||
readonly documentViewer = inject(REDDocumentViewer);
|
readonly documentViewer = inject(REDDocumentViewer);
|
||||||
readonly currentUser = this.userService.currentUser;
|
readonly currentUser = this.userService.currentUser;
|
||||||
@ -52,15 +45,20 @@ export class BaseScreenComponent {
|
|||||||
action: (query): void => this.#search(query, []),
|
action: (query): void => this.#search(query, []),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
readonly isSearchScreen$ = this.#navigationStart$.pipe(map(isSearchScreen));
|
|
||||||
readonly config = getConfig();
|
readonly config = getConfig();
|
||||||
|
readonly #navigationStart$ = this._router.events.pipe(
|
||||||
|
filter(isNavigationStart),
|
||||||
|
map(event => event.url),
|
||||||
|
startWith(this._router.url),
|
||||||
|
shareDistinctLast(),
|
||||||
|
);
|
||||||
|
readonly isSearchScreen$ = this.#navigationStart$.pipe(map(isSearchScreen));
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _router: Router,
|
private readonly _router: Router,
|
||||||
activatedRoute: ActivatedRoute,
|
activatedRoute: ActivatedRoute,
|
||||||
private readonly _translateService: TranslateService,
|
private readonly _translateService: TranslateService,
|
||||||
private readonly _featuresService: FeaturesService,
|
private readonly _featuresService: FeaturesService,
|
||||||
protected readonly _tenantsService: TenantsService,
|
|
||||||
readonly permissionsService: IqserPermissionsService,
|
readonly permissionsService: IqserPermissionsService,
|
||||||
readonly userService: UserService,
|
readonly userService: UserService,
|
||||||
readonly userPreferenceService: UserPreferenceService,
|
readonly userPreferenceService: UserPreferenceService,
|
||||||
@ -94,7 +92,7 @@ export class BaseScreenComponent {
|
|||||||
|
|
||||||
#search(query: string, dossierIds: string[], onlyActive = false) {
|
#search(query: string, dossierIds: string[], onlyActive = false) {
|
||||||
const queryParams = { query, dossierIds: dossierIds.join(','), onlyActive };
|
const queryParams = { query, dossierIds: dossierIds.join(','), onlyActive };
|
||||||
this._router.navigate([`/${this._tenantsService.activeTenantId}/main/search`], { queryParams }).then();
|
this._router.navigate(['/main/search'], { queryParams }).then();
|
||||||
}
|
}
|
||||||
|
|
||||||
#searchThisDossier(query: string) {
|
#searchThisDossier(query: string) {
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import { User } from '@red/domain';
|
|||||||
import { UserService } from '@users/user.service';
|
import { UserService } from '@users/user.service';
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { List } from '@iqser/common-ui/lib/utils';
|
import { List } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
|
|
||||||
interface MenuItem {
|
interface MenuItem {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@ -23,10 +22,9 @@ interface MenuItem {
|
|||||||
styleUrls: ['./user-menu.component.scss'],
|
styleUrls: ['./user-menu.component.scss'],
|
||||||
})
|
})
|
||||||
export class UserMenuComponent {
|
export class UserMenuComponent {
|
||||||
readonly #permissionsService = inject(IqserPermissionsService);
|
|
||||||
readonly currentUser = getCurrentUser<User>();
|
readonly currentUser = getCurrentUser<User>();
|
||||||
readonly tenantsService = inject(TenantsService);
|
|
||||||
readonly userService = inject(UserService);
|
readonly userService = inject(UserService);
|
||||||
|
readonly #permissionsService = inject(IqserPermissionsService);
|
||||||
readonly userMenuItems: List<MenuItem> = [
|
readonly userMenuItems: List<MenuItem> = [
|
||||||
{
|
{
|
||||||
id: 'account',
|
id: 'account',
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { UserService } from '@users/user.service';
|
|||||||
import { jwtDecode } from 'jwt-decode';
|
import { jwtDecode } from 'jwt-decode';
|
||||||
import { KeycloakService } from 'keycloak-angular';
|
import { KeycloakService } from 'keycloak-angular';
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
|
import { GET_TENANT_FROM_PATH_FN } from '@common-ui/utils';
|
||||||
|
|
||||||
export interface JwtToken {
|
export interface JwtToken {
|
||||||
auth_time: number;
|
auth_time: number;
|
||||||
@ -25,8 +26,9 @@ export function ifLoggedIn(): AsyncGuard {
|
|||||||
const licenseService = inject(LicenseService);
|
const licenseService = inject(LicenseService);
|
||||||
const keycloakStatusService = inject(KeycloakStatusService);
|
const keycloakStatusService = inject(KeycloakStatusService);
|
||||||
|
|
||||||
|
const tenant = inject(GET_TENANT_FROM_PATH_FN)();
|
||||||
const keycloakInstance = keycloakService.getKeycloakInstance();
|
const keycloakInstance = keycloakService.getKeycloakInstance();
|
||||||
const tenant = getRouteTenant();
|
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
const username = queryParams.get('username');
|
const username = queryParams.get('username');
|
||||||
const router = inject(Router);
|
const router = inject(Router);
|
||||||
|
|||||||
@ -10,17 +10,16 @@ import { DictionariesMapService } from '@services/entity-services/dictionaries-m
|
|||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
import { getParam } from '@iqser/common-ui/lib/utils';
|
import { getParam } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './base-entity-screen.component.html',
|
templateUrl: './base-entity-screen.component.html',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class BaseEntityScreenComponent implements OnInit {
|
export class BaseEntityScreenComponent implements OnInit {
|
||||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
|
||||||
readonly #entityType = getParam(ENTITY_TYPE);
|
|
||||||
readonly disabledItems$: Observable<string[]>;
|
readonly disabledItems$: Observable<string[]>;
|
||||||
readonly canDeleteEntity$: Observable<boolean>;
|
readonly canDeleteEntity$: Observable<boolean>;
|
||||||
|
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||||
|
readonly #entityType = getParam(ENTITY_TYPE);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _router: Router,
|
private readonly _router: Router,
|
||||||
@ -29,7 +28,6 @@ export class BaseEntityScreenComponent implements OnInit {
|
|||||||
private readonly _dialogService: AdminDialogService,
|
private readonly _dialogService: AdminDialogService,
|
||||||
private readonly _dictionaryService: DictionaryService,
|
private readonly _dictionaryService: DictionaryService,
|
||||||
private readonly _permissionsService: PermissionsService,
|
private readonly _permissionsService: PermissionsService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
) {
|
) {
|
||||||
const entity$ = dictionaryMapService.watch$(this.#dossierTemplateId, this.#entityType);
|
const entity$ = dictionaryMapService.watch$(this.#dossierTemplateId, this.#entityType);
|
||||||
@ -50,7 +48,7 @@ export class BaseEntityScreenComponent implements OnInit {
|
|||||||
this._loadingService.start();
|
this._loadingService.start();
|
||||||
const dossierTemplate = this._dossierTemplatesService.find(this.#dossierTemplateId);
|
const dossierTemplate = this._dossierTemplatesService.find(this.#dossierTemplateId);
|
||||||
await firstValueFrom(this._dictionaryService.deleteDictionaries([this.#entityType], this.#dossierTemplateId));
|
await firstValueFrom(this._dictionaryService.deleteDictionaries([this.#entityType], this.#dossierTemplateId));
|
||||||
await this._router.navigate([`/${this._tenantsService.activeTenantId}/${dossierTemplate.routerLink}/entities`]);
|
await this._router.navigate([`/${dossierTemplate.routerLink}/entities`]);
|
||||||
this._loadingService.stop();
|
this._loadingService.stop();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import { Router } from '@angular/router';
|
|||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { environment } from '@environments/environment';
|
import { environment } from '@environments/environment';
|
||||||
import { getConfig, IconButtonTypes, IqserPermissionsService, LoadingService, Toaster } from '@iqser/common-ui';
|
import { getConfig, IconButtonTypes, IqserPermissionsService, LoadingService, Toaster } from '@iqser/common-ui';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { AsControl, Debounce, getParam, trackByFactory, UI_ROOT_PATH_FN } from '@iqser/common-ui/lib/utils';
|
import { AsControl, Debounce, getParam, trackByFactory, UI_ROOT_PATH_FN } from '@iqser/common-ui/lib/utils';
|
||||||
import WebViewer, { WebViewerInstance } from '@pdftron/webviewer';
|
import WebViewer, { WebViewerInstance } from '@pdftron/webviewer';
|
||||||
@ -62,13 +61,6 @@ interface WatermarkForm {
|
|||||||
styleUrls: ['./watermark-screen.component.scss'],
|
styleUrls: ['./watermark-screen.component.scss'],
|
||||||
})
|
})
|
||||||
export class WatermarkScreenComponent implements OnInit {
|
export class WatermarkScreenComponent implements OnInit {
|
||||||
@ViewChild('viewer', { static: true }) private readonly _viewer: ElementRef<HTMLDivElement>;
|
|
||||||
readonly #loaded$ = new BehaviorSubject(false);
|
|
||||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
|
||||||
readonly #watermarkId = Number(getParam(WATERMARK_ID));
|
|
||||||
readonly #config = getConfig<AppConfig>();
|
|
||||||
#watermark: Partial<IWatermark> = {};
|
|
||||||
readonly #convertPath = inject(UI_ROOT_PATH_FN);
|
|
||||||
readonly iconButtonTypes = IconButtonTypes;
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
readonly translations = watermarkTranslations;
|
readonly translations = watermarkTranslations;
|
||||||
readonly trackBy = trackByFactory();
|
readonly trackBy = trackByFactory();
|
||||||
@ -86,6 +78,13 @@ export class WatermarkScreenComponent implements OnInit {
|
|||||||
readonly watermarkHorizontalAlignments = Object.values(WATERMARK_HORIZONTAL_ALIGNMENTS);
|
readonly watermarkHorizontalAlignments = Object.values(WATERMARK_HORIZONTAL_ALIGNMENTS);
|
||||||
readonly watermarkVerticalAlignments = Object.values(WATERMARK_VERTICAL_ALIGNMENTS);
|
readonly watermarkVerticalAlignments = Object.values(WATERMARK_VERTICAL_ALIGNMENTS);
|
||||||
currentAlignment: WatermarkAlignment;
|
currentAlignment: WatermarkAlignment;
|
||||||
|
@ViewChild('viewer', { static: true }) private readonly _viewer: ElementRef<HTMLDivElement>;
|
||||||
|
readonly #loaded$ = new BehaviorSubject(false);
|
||||||
|
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||||
|
readonly #watermarkId = Number(getParam(WATERMARK_ID));
|
||||||
|
readonly #config = getConfig<AppConfig>();
|
||||||
|
#watermark: Partial<IWatermark> = {};
|
||||||
|
readonly #convertPath = inject(UI_ROOT_PATH_FN);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _http: HttpClient,
|
private readonly _http: HttpClient,
|
||||||
@ -93,7 +92,6 @@ export class WatermarkScreenComponent implements OnInit {
|
|||||||
private readonly _formBuilder: FormBuilder,
|
private readonly _formBuilder: FormBuilder,
|
||||||
readonly permissionsService: IqserPermissionsService,
|
readonly permissionsService: IqserPermissionsService,
|
||||||
private readonly _loadingService: LoadingService,
|
private readonly _loadingService: LoadingService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _licenseService: LicenseService,
|
private readonly _licenseService: LicenseService,
|
||||||
private readonly _watermarkService: WatermarkService,
|
private readonly _watermarkService: WatermarkService,
|
||||||
private readonly _userPreferenceService: UserPreferenceService,
|
private readonly _userPreferenceService: UserPreferenceService,
|
||||||
@ -169,11 +167,7 @@ export class WatermarkScreenComponent implements OnInit {
|
|||||||
watermark.id ? _('watermark-screen.action.change-success') : _('watermark-screen.action.created-success'),
|
watermark.id ? _('watermark-screen.action.change-success') : _('watermark-screen.action.created-success'),
|
||||||
);
|
);
|
||||||
if (!watermark.id) {
|
if (!watermark.id) {
|
||||||
await this._router.navigate([
|
await this._router.navigate([`/main/admin/dossier-templates/${this.#dossierTemplateId}/watermarks/${updatedWatermark.id}`]);
|
||||||
`/${this._tenantsService.activeTenantId}/main/admin/dossier-templates/${this.#dossierTemplateId}/watermarks/${
|
|
||||||
updatedWatermark.id
|
|
||||||
}`,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this._toaster.error(_('watermark-screen.action.error'));
|
this._toaster.error(_('watermark-screen.action.error'));
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import { NgIf } from '@angular/common';
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { CircleButtonComponent, IqserHelpModeModule, LoadingService } from '@iqser/common-ui';
|
import { CircleButtonComponent, IqserHelpModeModule, LoadingService } from '@iqser/common-ui';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { DOSSIER_TEMPLATE_ID, type User } from '@red/domain';
|
import { DOSSIER_TEMPLATE_ID, type User } from '@red/domain';
|
||||||
@ -27,7 +26,6 @@ export class DossierTemplateActionsComponent implements OnInit {
|
|||||||
private readonly _route: ActivatedRoute,
|
private readonly _route: ActivatedRoute,
|
||||||
private readonly _loadingService: LoadingService,
|
private readonly _loadingService: LoadingService,
|
||||||
private readonly _dialogService: AdminDialogService,
|
private readonly _dialogService: AdminDialogService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@ -45,7 +43,7 @@ export class DossierTemplateActionsComponent implements OnInit {
|
|||||||
|
|
||||||
const success = await firstValueFrom(this._dossierTemplatesService.delete([this.dossierTemplateId]));
|
const success = await firstValueFrom(this._dossierTemplatesService.delete([this.dossierTemplateId]));
|
||||||
if (success) {
|
if (success) {
|
||||||
await this._router.navigate([this._tenantsService.activeTenantId, 'main', 'admin']);
|
await this._router.navigate(['main', 'admin']);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._loadingService.stop();
|
this._loadingService.stop();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<iqser-page-header
|
<iqser-page-header
|
||||||
(closeAction)="router.navigate([tenantsService.activeTenantId + '/' + dossier.dossiersListRouterLink])"
|
(closeAction)="router.navigate([dossier.dossiersListRouterLink])"
|
||||||
[actionConfigs]="actionConfigs"
|
[actionConfigs]="actionConfigs"
|
||||||
[helpModeKey]="'document'"
|
[helpModeKey]="'document'"
|
||||||
[showCloseButton]="true"
|
[showCloseButton]="true"
|
||||||
@ -9,14 +9,14 @@
|
|||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
*allow="roles.getRss"
|
*allow="roles.getRss"
|
||||||
[attr.help-mode-key]="'component_download'"
|
[attr.help-mode-key]="'component_download'"
|
||||||
|
[disabled]="downloadComponentLogsDisabled$ | async"
|
||||||
|
[dropdownButton]="true"
|
||||||
[icon]="'red:extract'"
|
[icon]="'red:extract'"
|
||||||
|
[matMenuTriggerFor]="(downloadComponentLogsDisabled$ | async) ? null : bulkComponentDownloadMenu"
|
||||||
[tooltip]="
|
[tooltip]="
|
||||||
((downloadComponentLogsDisabled$ | async) ? 'component-download.disabled-tooltip' : 'component-download.tooltip')
|
((downloadComponentLogsDisabled$ | async) ? 'component-download.disabled-tooltip' : 'component-download.tooltip')
|
||||||
| translate
|
| translate
|
||||||
"
|
"
|
||||||
[matMenuTriggerFor]="(downloadComponentLogsDisabled$ | async) ? null : bulkComponentDownloadMenu"
|
|
||||||
[disabled]="downloadComponentLogsDisabled$ | async"
|
|
||||||
[dropdownButton]="true"
|
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<redaction-file-download-btn
|
<redaction-file-download-btn
|
||||||
@ -64,6 +64,6 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<mat-menu #bulkComponentDownloadMenu="matMenu">
|
<mat-menu #bulkComponentDownloadMenu="matMenu">
|
||||||
<button [innerHTML]="'component-download.json' | translate" (click)="downloadComponentAsJSON()" mat-menu-item></button>
|
<button (click)="downloadComponentAsJSON()" [innerHTML]="'component-download.json' | translate" mat-menu-item></button>
|
||||||
<button [innerHTML]="'component-download.xml' | translate" (click)="downloadComponentAsXML()" mat-menu-item></button>
|
<button (click)="downloadComponentAsXML()" [innerHTML]="'component-download.xml' | translate" mat-menu-item></button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import { Router } from '@angular/router';
|
|||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { SortingService } from '@iqser/common-ui/lib/sorting';
|
import { SortingService } from '@iqser/common-ui/lib/sorting';
|
||||||
import { List, some } from '@iqser/common-ui/lib/utils';
|
import { List, some } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { ComponentLogService } from '@services/files/component-log.service';
|
import { ComponentLogService } from '@services/files/component-log.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -39,7 +38,6 @@ export class DossierOverviewScreenHeaderComponent implements OnInit {
|
|||||||
readonly sortingService: SortingService<File>,
|
readonly sortingService: SortingService<File>,
|
||||||
readonly permissionsService: PermissionsService,
|
readonly permissionsService: PermissionsService,
|
||||||
readonly entitiesService: EntitiesService<IFile, File>,
|
readonly entitiesService: EntitiesService<IFile, File>,
|
||||||
readonly tenantsService: TenantsService,
|
|
||||||
private readonly _reanalysisService: ReanalysisService,
|
private readonly _reanalysisService: ReanalysisService,
|
||||||
private readonly _loadingService: LoadingService,
|
private readonly _loadingService: LoadingService,
|
||||||
private readonly _primaryFileAttributeService: PrimaryFileAttributeService,
|
private readonly _primaryFileAttributeService: PrimaryFileAttributeService,
|
||||||
|
|||||||
@ -32,7 +32,6 @@ import {
|
|||||||
Toaster,
|
Toaster,
|
||||||
} from '@iqser/common-ui';
|
} from '@iqser/common-ui';
|
||||||
import { copyLocalStorageFiltersValues, FilterService, NestedFilter, processFilters } from '@iqser/common-ui/lib/filtering';
|
import { copyLocalStorageFiltersValues, FilterService, NestedFilter, processFilters } from '@iqser/common-ui/lib/filtering';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { AutoUnsubscribe, Bind, bool, Debounce, List, OnAttach, OnDetach } from '@iqser/common-ui/lib/utils';
|
import { AutoUnsubscribe, Bind, bool, Debounce, List, OnAttach, OnDetach } from '@iqser/common-ui/lib/utils';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
import { ManualRedactionEntryTypes, ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
import { ManualRedactionEntryTypes, ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
||||||
@ -108,34 +107,6 @@ export class FilePreviewScreenComponent
|
|||||||
@ViewChild('actionsWrapper', { static: false }) private readonly _actionsWrapper: ElementRef;
|
@ViewChild('actionsWrapper', { static: false }) private readonly _actionsWrapper: ElementRef;
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
|
|
||||||
get changed() {
|
|
||||||
return this._pageRotationService.hasRotations();
|
|
||||||
}
|
|
||||||
|
|
||||||
get #earmarks$() {
|
|
||||||
const isEarmarksViewMode$ = this._viewModeService.viewMode$.pipe(filter(() => this._viewModeService.isEarmarks()));
|
|
||||||
|
|
||||||
const earmarks$ = isEarmarksViewMode$.pipe(
|
|
||||||
tap(() => this._loadingService.start()),
|
|
||||||
switchMap(() => this._fileDataService.loadEarmarks()),
|
|
||||||
tap(() => this.updateViewMode().then(() => this._loadingService.stop())),
|
|
||||||
);
|
|
||||||
|
|
||||||
const currentPageIfEarmarksView$ = combineLatest([this.pdf.currentPage$, this._viewModeService.viewMode$]).pipe(
|
|
||||||
filter(() => this._viewModeService.isEarmarks()),
|
|
||||||
map(([page]) => page),
|
|
||||||
);
|
|
||||||
|
|
||||||
const currentPageEarmarks$ = combineLatest([currentPageIfEarmarksView$, earmarks$]).pipe(
|
|
||||||
map(([page, earmarks]) => earmarks.get(page)),
|
|
||||||
);
|
|
||||||
|
|
||||||
return currentPageEarmarks$.pipe(
|
|
||||||
map(earmarks => [earmarks, this._skippedService.hideSkipped(), this.state.dossierTemplateId] as const),
|
|
||||||
tap(args => this._annotationDrawService.draw(...args)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly pdf: PdfViewer,
|
readonly pdf: PdfViewer,
|
||||||
readonly state: FilePreviewStateService,
|
readonly state: FilePreviewStateService,
|
||||||
@ -159,7 +130,6 @@ export class FilePreviewScreenComponent
|
|||||||
private readonly _viewModeService: ViewModeService,
|
private readonly _viewModeService: ViewModeService,
|
||||||
private readonly _documentViewer: REDDocumentViewer,
|
private readonly _documentViewer: REDDocumentViewer,
|
||||||
private readonly _changeRef: ChangeDetectorRef,
|
private readonly _changeRef: ChangeDetectorRef,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _dialogService: FilePreviewDialogService,
|
private readonly _dialogService: FilePreviewDialogService,
|
||||||
private readonly _iqserDialog: IqserDialog,
|
private readonly _iqserDialog: IqserDialog,
|
||||||
private readonly _pageRotationService: PageRotationService,
|
private readonly _pageRotationService: PageRotationService,
|
||||||
@ -212,6 +182,34 @@ export class FilePreviewScreenComponent
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get changed() {
|
||||||
|
return this._pageRotationService.hasRotations();
|
||||||
|
}
|
||||||
|
|
||||||
|
get #earmarks$() {
|
||||||
|
const isEarmarksViewMode$ = this._viewModeService.viewMode$.pipe(filter(() => this._viewModeService.isEarmarks()));
|
||||||
|
|
||||||
|
const earmarks$ = isEarmarksViewMode$.pipe(
|
||||||
|
tap(() => this._loadingService.start()),
|
||||||
|
switchMap(() => this._fileDataService.loadEarmarks()),
|
||||||
|
tap(() => this.updateViewMode().then(() => this._loadingService.stop())),
|
||||||
|
);
|
||||||
|
|
||||||
|
const currentPageIfEarmarksView$ = combineLatest([this.pdf.currentPage$, this._viewModeService.viewMode$]).pipe(
|
||||||
|
filter(() => this._viewModeService.isEarmarks()),
|
||||||
|
map(([page]) => page),
|
||||||
|
);
|
||||||
|
|
||||||
|
const currentPageEarmarks$ = combineLatest([currentPageIfEarmarksView$, earmarks$]).pipe(
|
||||||
|
map(([page, earmarks]) => earmarks.get(page)),
|
||||||
|
);
|
||||||
|
|
||||||
|
return currentPageEarmarks$.pipe(
|
||||||
|
map(earmarks => [earmarks, this._skippedService.hideSkipped(), this.state.dossierTemplateId] as const),
|
||||||
|
tap(args => this._annotationDrawService.draw(...args)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getLastAssignee() {
|
getLastAssignee() {
|
||||||
const { isApproved, lastReviewer, lastApprover } = this.state.file();
|
const { isApproved, lastReviewer, lastApprover } = this.state.file();
|
||||||
const isRss = this._iqserPermissionsService.has(this.roles.getRss);
|
const isRss = this._iqserPermissionsService.has(this.roles.getRss);
|
||||||
@ -853,7 +851,7 @@ export class FilePreviewScreenComponent
|
|||||||
|
|
||||||
#navigateToDossier() {
|
#navigateToDossier() {
|
||||||
this._logger.info('Navigating to ', this.state.dossier().dossierName);
|
this._logger.info('Navigating to ', this.state.dossier().dossierName);
|
||||||
return this._router.navigate([`/${this._tenantsService.activeTenantId}${this.state.dossier().routerLink}`]);
|
return this._router.navigate([this.state.dossier().routerLink]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#highlightSelectedAnnotations(newAnnotations: AnnotationWrapper[]) {
|
#highlightSelectedAnnotations(newAnnotations: AnnotationWrapper[]) {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import { PermissionsService } from '@services/permissions.service';
|
|||||||
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
||||||
import { AnnotationActionsService } from './annotation-actions.service';
|
import { AnnotationActionsService } from './annotation-actions.service';
|
||||||
import { FilePreviewStateService } from './file-preview-state.service';
|
import { FilePreviewStateService } from './file-preview-state.service';
|
||||||
|
import { UI_ROOT_PATH_FN } from '@common-ui/utils';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PdfAnnotationActionsService {
|
export class PdfAnnotationActionsService {
|
||||||
@ -20,6 +21,7 @@ export class PdfAnnotationActionsService {
|
|||||||
readonly #iqserPermissionsService = inject(IqserPermissionsService);
|
readonly #iqserPermissionsService = inject(IqserPermissionsService);
|
||||||
readonly #annotationManager = inject(REDAnnotationManager);
|
readonly #annotationManager = inject(REDAnnotationManager);
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
|
readonly #convertPath = inject(UI_ROOT_PATH_FN);
|
||||||
|
|
||||||
get(annotations: AnnotationWrapper[], annotationChangesAllowed: boolean): IHeaderElement[] {
|
get(annotations: AnnotationWrapper[], annotationChangesAllowed: boolean): IHeaderElement[] {
|
||||||
const availableActions: IHeaderElement[] = [];
|
const availableActions: IHeaderElement[] = [];
|
||||||
@ -105,7 +107,7 @@ export class PdfAnnotationActionsService {
|
|||||||
#getButton(icon: string, title: string, action: () => void | Promise<void>): IHeaderElement {
|
#getButton(icon: string, title: string, action: () => void | Promise<void>): IHeaderElement {
|
||||||
return {
|
return {
|
||||||
type: 'actionButton',
|
type: 'actionButton',
|
||||||
img: `ui/assets/icons/general/${icon}.svg`,
|
img: this.#convertPath(`/assets/icons/general/${icon}.svg`),
|
||||||
title: this.#translateService.instant(title),
|
title: this.#translateService.instant(title),
|
||||||
onClick: () => this.#ngZone.run(async () => action()),
|
onClick: () => this.#ngZone.run(async () => action()),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import {
|
|||||||
LoadingService,
|
LoadingService,
|
||||||
Toaster,
|
Toaster,
|
||||||
} from '@iqser/common-ui';
|
} from '@iqser/common-ui';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { IqserTooltipPositions } from '@iqser/common-ui/lib/utils';
|
import { IqserTooltipPositions } from '@iqser/common-ui/lib/utils';
|
||||||
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses, User } from '@red/domain';
|
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses, User } from '@red/domain';
|
||||||
@ -42,9 +41,6 @@ import { FileAssignService } from '../../services/file-assign.service';
|
|||||||
styleUrls: ['./file-actions.component.scss'],
|
styleUrls: ['./file-actions.component.scss'],
|
||||||
})
|
})
|
||||||
export class FileActionsComponent implements OnChanges {
|
export class FileActionsComponent implements OnChanges {
|
||||||
@ViewChild(ExpandableFileActionsComponent)
|
|
||||||
private readonly _expandableActionsComponent: ExpandableFileActionsComponent;
|
|
||||||
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
|
||||||
@Input({ required: true }) file: File;
|
@Input({ required: true }) file: File;
|
||||||
@Input({ required: true }) dossier: Dossier;
|
@Input({ required: true }) dossier: Dossier;
|
||||||
@Input({ required: true }) type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
|
@Input({ required: true }) type: 'file-preview' | 'dossier-overview-list' | 'dossier-overview-workflow';
|
||||||
@ -79,6 +75,9 @@ export class FileActionsComponent implements OnChanges {
|
|||||||
isFilePreview = false;
|
isFilePreview = false;
|
||||||
tooltipPosition = IqserTooltipPositions.above;
|
tooltipPosition = IqserTooltipPositions.above;
|
||||||
buttons: Action[];
|
buttons: Action[];
|
||||||
|
@ViewChild(ExpandableFileActionsComponent)
|
||||||
|
private readonly _expandableActionsComponent: ExpandableFileActionsComponent;
|
||||||
|
readonly #isDocumine = getConfig().IS_DOCUMINE;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _injector: Injector,
|
private readonly _injector: Injector,
|
||||||
@ -87,7 +86,6 @@ export class FileActionsComponent implements OnChanges {
|
|||||||
private readonly _loadingService: LoadingService,
|
private readonly _loadingService: LoadingService,
|
||||||
private readonly _dialogService: DossiersDialogService,
|
private readonly _dialogService: DossiersDialogService,
|
||||||
private readonly _iqserDialog: IqserDialog,
|
private readonly _iqserDialog: IqserDialog,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _fileAssignService: FileAssignService,
|
private readonly _fileAssignService: FileAssignService,
|
||||||
private readonly _reanalysisService: ReanalysisService,
|
private readonly _reanalysisService: ReanalysisService,
|
||||||
private readonly _permissionsService: PermissionsService,
|
private readonly _permissionsService: PermissionsService,
|
||||||
@ -346,7 +344,7 @@ export class FileActionsComponent implements OnChanges {
|
|||||||
try {
|
try {
|
||||||
const dossier = this._activeDossiersService.find(this.file.dossierId);
|
const dossier = this._activeDossiersService.find(this.file.dossierId);
|
||||||
await firstValueFrom(this._fileManagementService.delete([this.file], this.file.dossierId));
|
await firstValueFrom(this._fileManagementService.delete([this.file], this.file.dossierId));
|
||||||
await this._injector.get(Router).navigate([`/${this._tenantsService.activeTenantId}${dossier.routerLink}`]);
|
await this._injector.get(Router).navigate([dossier.routerLink]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this._injector.get(Toaster).error(_('error.http.generic'), { params: error });
|
this._injector.get(Toaster).error(_('error.http.generic'), { params: error });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,6 @@ import { ArchivedDossiersService } from '@services/dossiers/archived-dossiers.se
|
|||||||
import { DossierStatesMapService } from '@services/entity-services/dossier-states-map.service';
|
import { DossierStatesMapService } from '@services/entity-services/dossier-states-map.service';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { dateWithoutTime } from '@utils/functions';
|
import { dateWithoutTime } from '@utils/functions';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-edit-dossier-general-info',
|
selector: 'redaction-edit-dossier-general-info',
|
||||||
@ -38,6 +37,23 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
|||||||
dossierTemplates: IDossierTemplate[];
|
dossierTemplates: IDossierTemplate[];
|
||||||
states: string[];
|
states: string[];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
readonly permissionsService: PermissionsService,
|
||||||
|
private readonly _dossierStatesMapService: DossierStatesMapService,
|
||||||
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
|
private readonly _dossiersService: DossiersService,
|
||||||
|
private readonly _trashService: TrashService,
|
||||||
|
private readonly _dossierStatsService: DossierStatsService,
|
||||||
|
private readonly _formBuilder: UntypedFormBuilder,
|
||||||
|
private readonly _dialogService: DossiersDialogService,
|
||||||
|
private readonly _router: Router,
|
||||||
|
private readonly _editDossierDialogRef: MatDialogRef<EditDossierDialogComponent>,
|
||||||
|
private readonly _toaster: Toaster,
|
||||||
|
private readonly _loadingService: LoadingService,
|
||||||
|
private readonly _translateService: TranslateService,
|
||||||
|
private readonly _archivedDossiersService: ArchivedDossiersService,
|
||||||
|
) {}
|
||||||
|
|
||||||
get changed(): boolean {
|
get changed(): boolean {
|
||||||
for (const key of Object.keys(this.form.getRawValue())) {
|
for (const key of Object.keys(this.form.getRawValue())) {
|
||||||
if (key === 'dueDate') {
|
if (key === 'dueDate') {
|
||||||
@ -71,24 +87,6 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
|||||||
) as string;
|
) as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
|
||||||
readonly permissionsService: PermissionsService,
|
|
||||||
private readonly _dossierStatesMapService: DossierStatesMapService,
|
|
||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
|
||||||
private readonly _dossiersService: DossiersService,
|
|
||||||
private readonly _trashService: TrashService,
|
|
||||||
private readonly _dossierStatsService: DossierStatsService,
|
|
||||||
private readonly _formBuilder: UntypedFormBuilder,
|
|
||||||
private readonly _dialogService: DossiersDialogService,
|
|
||||||
private readonly _router: Router,
|
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _editDossierDialogRef: MatDialogRef<EditDossierDialogComponent>,
|
|
||||||
private readonly _toaster: Toaster,
|
|
||||||
private readonly _loadingService: LoadingService,
|
|
||||||
private readonly _translateService: TranslateService,
|
|
||||||
private readonly _archivedDossiersService: ArchivedDossiersService,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.states = [null, ...this._dossierStatesMapService.get(this.dossier.dossierTemplateId).map(s => s.id)];
|
this.states = [null, ...this._dossierStatesMapService.get(this.dossier.dossierTemplateId).map(s => s.id)];
|
||||||
this.statusPlaceholder = this.#statusPlaceholder;
|
this.statusPlaceholder = this.#statusPlaceholder;
|
||||||
@ -126,7 +124,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
|||||||
|
|
||||||
const updatedDossier = await firstValueFrom(this._dossiersService.createOrUpdate(dossier));
|
const updatedDossier = await firstValueFrom(this._dossiersService.createOrUpdate(dossier));
|
||||||
if (updatedDossier && updatedDossier.dossierTemplateId !== this.dossier.dossierTemplateId) {
|
if (updatedDossier && updatedDossier.dossierTemplateId !== this.dossier.dossierTemplateId) {
|
||||||
await this._router.navigate([`/${this._tenantsService.activeTenantId}${updatedDossier.routerLink}`]);
|
await this._router.navigate([updatedDossier.routerLink]);
|
||||||
}
|
}
|
||||||
return { success: !!updatedDossier };
|
return { success: !!updatedDossier };
|
||||||
}
|
}
|
||||||
@ -194,7 +192,7 @@ export class EditDossierGeneralInfoComponent implements OnInit, EditDossierSecti
|
|||||||
|
|
||||||
async #closeDialogAndRedirectToDossier() {
|
async #closeDialogAndRedirectToDossier() {
|
||||||
this._editDossierDialogRef.close();
|
this._editDossierDialogRef.close();
|
||||||
await this._router.navigate([`/${this._tenantsService.activeTenantId}${this.dossier.dossiersListRouterLink}`]);
|
await this._router.navigate([this.dossier.dossiersListRouterLink]);
|
||||||
this._toaster.success(_('edit-dossier-dialog.delete-successful'), {
|
this._toaster.success(_('edit-dossier-dialog.delete-successful'), {
|
||||||
params: {
|
params: {
|
||||||
dossierName: this.dossier.dossierName,
|
dossierName: this.dossier.dossierName,
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { Component, Input, OnChanges } from '@angular/core';
|
import { Component, inject, Input, OnChanges } from '@angular/core';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { CircleButtonType, CircleButtonTypes, IqserDialog, Toaster } from '@iqser/common-ui';
|
import { CircleButtonType, CircleButtonTypes, IqserDialog, Toaster } from '@iqser/common-ui';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { Dossier, File, ProcessingFileStatuses } from '@red/domain';
|
import { Dossier, File, ProcessingFileStatuses } from '@red/domain';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
import { DownloadDialogComponent } from '@shared/dialogs/download-dialog/download-dialog.component';
|
import { DownloadDialogComponent } from '@shared/dialogs/download-dialog/download-dialog.component';
|
||||||
import { FileDownloadService } from '@upload-download/services/file-download.service';
|
import { FileDownloadService } from '@upload-download/services/file-download.service';
|
||||||
|
import { APP_BASE_HREF } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-file-download-btn',
|
selector: 'redaction-file-download-btn',
|
||||||
@ -19,14 +19,13 @@ export class FileDownloadBtnComponent implements OnChanges {
|
|||||||
@Input() type: CircleButtonType = CircleButtonTypes.default;
|
@Input() type: CircleButtonType = CircleButtonTypes.default;
|
||||||
@Input() tooltipClass: string;
|
@Input() tooltipClass: string;
|
||||||
@Input() disabled = false;
|
@Input() disabled = false;
|
||||||
|
|
||||||
tooltip: string;
|
tooltip: string;
|
||||||
canDownloadFiles: boolean;
|
canDownloadFiles: boolean;
|
||||||
invalidDownload = false;
|
invalidDownload = false;
|
||||||
|
readonly #appBaseHref = inject(APP_BASE_HREF);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _permissionsService: PermissionsService,
|
private readonly _permissionsService: PermissionsService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _fileDownloadService: FileDownloadService,
|
private readonly _fileDownloadService: FileDownloadService,
|
||||||
private readonly _dialog: IqserDialog,
|
private readonly _dialog: IqserDialog,
|
||||||
private readonly _toaster: Toaster,
|
private readonly _toaster: Toaster,
|
||||||
@ -56,7 +55,7 @@ export class FileDownloadBtnComponent implements OnChanges {
|
|||||||
await downloadRequest
|
await downloadRequest
|
||||||
.then(() =>
|
.then(() =>
|
||||||
this._toaster.info(_('download-status.queued'), {
|
this._toaster.info(_('download-status.queued'), {
|
||||||
params: { downloadHref: `/ui/${this._tenantsService.activeTenantId}/main/downloads` },
|
params: { downloadHref: `${this.#appBaseHref}/main/downloads` },
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.catch(() => this._toaster.error(_('download-status.error')));
|
.catch(() => this._toaster.error(_('download-status.error')));
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Component, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
|
import { Component, inject, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
|
||||||
import { Action, ActionTypes, Dossier, File } from '@red/domain';
|
import { Action, ActionTypes, Dossier, File } from '@red/domain';
|
||||||
import { CircleButtonType, IqserDialog, Toaster } from '@iqser/common-ui';
|
import { CircleButtonType, IqserDialog, Toaster } from '@iqser/common-ui';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
@ -7,7 +7,7 @@ import { PermissionsService } from '@services/permissions.service';
|
|||||||
import { MatMenuTrigger } from '@angular/material/menu';
|
import { MatMenuTrigger } from '@angular/material/menu';
|
||||||
import { DownloadDialogComponent } from '@shared/dialogs/download-dialog/download-dialog.component';
|
import { DownloadDialogComponent } from '@shared/dialogs/download-dialog/download-dialog.component';
|
||||||
import { IqserTooltipPosition, trackByFactory } from '@iqser/common-ui/lib/utils';
|
import { IqserTooltipPosition, trackByFactory } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
import { APP_BASE_HREF } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-expandable-file-actions',
|
selector: 'redaction-expandable-file-actions',
|
||||||
@ -22,17 +22,15 @@ export class ExpandableFileActionsComponent implements OnChanges {
|
|||||||
@Input() tooltipPosition: IqserTooltipPosition;
|
@Input() tooltipPosition: IqserTooltipPosition;
|
||||||
@Input() helpModeKeyPrefix: 'dossier' | 'editor';
|
@Input() helpModeKeyPrefix: 'dossier' | 'editor';
|
||||||
@Input() isDossierOverviewWorkflow = false;
|
@Input() isDossierOverviewWorkflow = false;
|
||||||
|
|
||||||
displayedButtons: Action[];
|
displayedButtons: Action[];
|
||||||
hiddenButtons: Action[];
|
hiddenButtons: Action[];
|
||||||
expanded = false;
|
expanded = false;
|
||||||
|
|
||||||
@ViewChild(MatMenuTrigger) readonly matMenu: MatMenuTrigger;
|
@ViewChild(MatMenuTrigger) readonly matMenu: MatMenuTrigger;
|
||||||
readonly trackBy = trackByFactory();
|
readonly trackBy = trackByFactory();
|
||||||
|
readonly #appBaseHref = inject(APP_BASE_HREF);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _fileDownloadService: FileDownloadService,
|
private readonly _fileDownloadService: FileDownloadService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _toaster: Toaster,
|
private readonly _toaster: Toaster,
|
||||||
private readonly _permissionsService: PermissionsService,
|
private readonly _permissionsService: PermissionsService,
|
||||||
private readonly _dialog: IqserDialog,
|
private readonly _dialog: IqserDialog,
|
||||||
@ -101,7 +99,7 @@ export class ExpandableFileActionsComponent implements OnChanges {
|
|||||||
...result,
|
...result,
|
||||||
});
|
});
|
||||||
this._toaster.info(_('download-status.queued'), {
|
this._toaster.info(_('download-status.queued'), {
|
||||||
params: { downloadHref: `/ui/${this._tenantsService.activeTenantId}/main/downloads` },
|
params: { downloadHref: `${this.#appBaseHref}/main/downloads` },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { Validators } from '@angular/forms';
|
|||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BaseDialogComponent, getConfig, IconButtonTypes, IqserPermissionsService, SaveOptions } from '@iqser/common-ui';
|
import { BaseDialogComponent, getConfig, IconButtonTypes, IqserPermissionsService, SaveOptions } from '@iqser/common-ui';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { DOSSIER_TEMPLATE_ID, DownloadFileType, IDossierRequest, IDossierTemplate, IReportTemplate } from '@red/domain';
|
import { DOSSIER_TEMPLATE_ID, DownloadFileType, IDossierRequest, IDossierTemplate, IReportTemplate } from '@red/domain';
|
||||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||||
@ -39,7 +38,6 @@ export class AddDossierDialogComponent extends BaseDialogComponent implements On
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly permissionsService: IqserPermissionsService,
|
readonly permissionsService: IqserPermissionsService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _activeDossiersService: ActiveDossiersService,
|
private readonly _activeDossiersService: ActiveDossiersService,
|
||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
private readonly _reportTemplateService: ReportTemplateService,
|
private readonly _reportTemplateService: ReportTemplateService,
|
||||||
@ -80,7 +78,7 @@ export class AddDossierDialogComponent extends BaseDialogComponent implements On
|
|||||||
this._loadingService.start();
|
this._loadingService.start();
|
||||||
const savedDossier = await firstValueFrom(this._activeDossiersService.createOrUpdate(this.#formToObject()));
|
const savedDossier = await firstValueFrom(this._activeDossiersService.createOrUpdate(this.#formToObject()));
|
||||||
if (savedDossier) {
|
if (savedDossier) {
|
||||||
await this._router.navigate([`/${this._tenantsService.activeTenantId}${savedDossier.routerLink}`]);
|
await this._router.navigate([savedDossier.routerLink]);
|
||||||
if (options?.addMembers) {
|
if (options?.addMembers) {
|
||||||
this._dialogService.openDialog('editDossier', {
|
this._dialogService.openDialog('editDossier', {
|
||||||
dossierId: savedDossier.id,
|
dossierId: savedDossier.id,
|
||||||
|
|||||||
@ -8,17 +8,15 @@ import { DossiersService } from './dossiers.service';
|
|||||||
import { FilesMapService } from '../files/files-map.service';
|
import { FilesMapService } from '../files/files-map.service';
|
||||||
import { FeaturesService } from '../features.service';
|
import { FeaturesService } from '../features.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ArchivedDossiersService extends DossiersService {
|
export class ArchivedDossiersService extends DossiersService {
|
||||||
|
readonly routerPath = ARCHIVE_ROUTE;
|
||||||
|
protected readonly _defaultModelPath = 'archived-dossiers';
|
||||||
readonly #activeDossiersService = inject(ActiveDossiersService);
|
readonly #activeDossiersService = inject(ActiveDossiersService);
|
||||||
readonly #filesMapService = inject(FilesMapService);
|
readonly #filesMapService = inject(FilesMapService);
|
||||||
readonly #featuresService = inject(FeaturesService);
|
readonly #featuresService = inject(FeaturesService);
|
||||||
readonly #tenantsService = inject(TenantsService);
|
|
||||||
readonly #router = inject(Router);
|
readonly #router = inject(Router);
|
||||||
protected readonly _defaultModelPath = 'archived-dossiers';
|
|
||||||
readonly routerPath = ARCHIVE_ROUTE;
|
|
||||||
|
|
||||||
archive(dossiers: Dossier[]): Observable<unknown> {
|
archive(dossiers: Dossier[]): Observable<unknown> {
|
||||||
const showArchiveFailedToast = () => {
|
const showArchiveFailedToast = () => {
|
||||||
@ -41,7 +39,7 @@ export class ArchivedDossiersService extends DossiersService {
|
|||||||
if (!this.#activeDossiersService.all.find(d => d.dossierTemplateId === dossierTemplateId)) {
|
if (!this.#activeDossiersService.all.find(d => d.dossierTemplateId === dossierTemplateId)) {
|
||||||
route = route.replace(DOSSIERS_ROUTE, ARCHIVE_ROUTE);
|
route = route.replace(DOSSIERS_ROUTE, ARCHIVE_ROUTE);
|
||||||
}
|
}
|
||||||
await this.#router.navigate([`/${this.#tenantsService.activeTenantId}${route}`]);
|
await this.#router.navigate([route]);
|
||||||
}),
|
}),
|
||||||
catchError(showArchiveFailedToast),
|
catchError(showArchiveFailedToast),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Inject, Injectable, OnDestroy } from '@angular/core';
|
import { inject, Injectable, OnDestroy } from '@angular/core';
|
||||||
import { EntitiesService, getConfig, QueryParam } from '@iqser/common-ui';
|
import { EntitiesService, getConfig, QueryParam } from '@iqser/common-ui';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { EMPTY, firstValueFrom, iif, merge, Observable, of, Subscription, timer } from 'rxjs';
|
import { EMPTY, firstValueFrom, iif, merge, Observable, of, Subscription, timer } from 'rxjs';
|
||||||
@ -11,7 +11,6 @@ import { CHANGED_CHECK_INTERVAL } from '@utils/constants';
|
|||||||
import { DossiersCacheService } from './dossiers/dossiers-cache.service';
|
import { DossiersCacheService } from './dossiers/dossiers-cache.service';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { List, mapEach } from '@iqser/common-ui/lib/utils';
|
import { List, mapEach } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
|
||||||
import { APP_BASE_HREF } from '@angular/common';
|
import { APP_BASE_HREF } from '@angular/common';
|
||||||
|
|
||||||
const INCLUDE_SEEN = false;
|
const INCLUDE_SEEN = false;
|
||||||
@ -28,11 +27,10 @@ export class NotificationsService extends EntitiesService<INotification, Notific
|
|||||||
protected readonly _entityClass = Notification;
|
protected readonly _entityClass = Notification;
|
||||||
readonly #config = getConfig<AppConfig>();
|
readonly #config = getConfig<AppConfig>();
|
||||||
readonly #subscription = new Subscription();
|
readonly #subscription = new Subscription();
|
||||||
|
readonly #appBaseHref = inject(APP_BASE_HREF);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(APP_BASE_HREF) private readonly _baseHref: string,
|
|
||||||
private readonly _translateService: TranslateService,
|
private readonly _translateService: TranslateService,
|
||||||
private readonly _tenantsService: TenantsService,
|
|
||||||
private readonly _userService: UserService,
|
private readonly _userService: UserService,
|
||||||
private readonly _dossiersCacheService: DossiersCacheService,
|
private readonly _dossiersCacheService: DossiersCacheService,
|
||||||
) {
|
) {
|
||||||
@ -80,7 +78,7 @@ export class NotificationsService extends EntitiesService<INotification, Notific
|
|||||||
const dossier = this._dossiersCacheService.get(dossierId);
|
const dossier = this._dossiersCacheService.get(dossierId);
|
||||||
const fileName = notification.target.fileName;
|
const fileName = notification.target.fileName;
|
||||||
const dossierName = notification.target?.dossierName ?? dossier?.dossierName;
|
const dossierName = notification.target?.dossierName ?? dossier?.dossierName;
|
||||||
const downloadHref = `/ui/${this._tenantsService.activeTenantId}/main/downloads`;
|
const downloadHref = `${this.#appBaseHref}/main/downloads`;
|
||||||
|
|
||||||
return this._translateService.instant(translation, {
|
return this._translateService.instant(translation, {
|
||||||
fileHref: this._getFileHref(dossier, fileId),
|
fileHref: this._getFileHref(dossier, fileId),
|
||||||
@ -97,7 +95,7 @@ export class NotificationsService extends EntitiesService<INotification, Notific
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _getDossierHref(dossier: Dossier): string {
|
private _getDossierHref(dossier: Dossier): string {
|
||||||
return dossier ? `${this._baseHref}/${dossier.routerLink}` : null;
|
return dossier ? `${dossier.routerLink}` : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getUsername(userId: string | undefined) {
|
private _getUsername(userId: string | undefined) {
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export class RouterHistoryService {
|
|||||||
navigateToLastDossiersScreen() {
|
navigateToLastDossiersScreen() {
|
||||||
const lastDossiersScreen = localStorage.getItem(LAST_DOSSIERS_SCREEN);
|
const lastDossiersScreen = localStorage.getItem(LAST_DOSSIERS_SCREEN);
|
||||||
if (this._router.url === decodeURI(lastDossiersScreen) || lastDossiersScreen === null) {
|
if (this._router.url === decodeURI(lastDossiersScreen) || lastDossiersScreen === null) {
|
||||||
return this._router.navigate(['/' + this._tenantsService.activeTenantId]);
|
return this._router.navigate(['/']);
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = decodeURI(lastDossiersScreen).split('?')[0];
|
const url = decodeURI(lastDossiersScreen).split('?')[0];
|
||||||
|
|||||||
@ -14,16 +14,10 @@ import { firstValueFrom } from 'rxjs';
|
|||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
import { APP_BASE_HREF } from '@angular/common';
|
import { APP_BASE_HREF } from '@angular/common';
|
||||||
|
|
||||||
async function redirectToLastDossierTemplate(
|
async function redirectToLastDossierTemplate(router: Router, state: RouterStateSnapshot, baseHref: string, lastDossierTemplate: string) {
|
||||||
router: Router,
|
|
||||||
state: RouterStateSnapshot,
|
|
||||||
baseHref: string,
|
|
||||||
tenant: string,
|
|
||||||
lastDossierTemplate: string,
|
|
||||||
) {
|
|
||||||
const lastUrlSegment = window.location.pathname.split('/').filter(Boolean).pop();
|
const lastUrlSegment = window.location.pathname.split('/').filter(Boolean).pop();
|
||||||
if (['main', tenant, baseHref].includes(lastUrlSegment) && !state.url.includes(lastDossierTemplate)) {
|
if (['main', baseHref].includes(lastUrlSegment) && !state.url.includes(lastDossierTemplate)) {
|
||||||
await router.navigate([tenant, 'main', lastDossierTemplate]);
|
await router.navigate(['main', lastDossierTemplate]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +53,7 @@ export function mainGuard(): AsyncGuard {
|
|||||||
const lastDossierTemplate = userPreferenceService.getLastDossierTemplate();
|
const lastDossierTemplate = userPreferenceService.getLastDossierTemplate();
|
||||||
|
|
||||||
if (lastDossierTemplate) {
|
if (lastDossierTemplate) {
|
||||||
await redirectToLastDossierTemplate(router, state, baseHref, tenantsService.activeTenantId, lastDossierTemplate);
|
await redirectToLastDossierTemplate(router, state, baseHref, lastDossierTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadingService.stop();
|
loadingService.stop();
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit fa574115aa9074c0bf0856780d4ec79c525a0989
|
Subproject commit 68dbdfb8e7ade5348f490b660faaab7df9856237
|
||||||
Loading…
x
Reference in New Issue
Block a user