Compare commits
2 Commits
master
...
RulesLogge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4435752ac | ||
|
|
df64a73adc |
@ -16,7 +16,6 @@
|
||||
},
|
||||
"rules": {
|
||||
"rxjs/no-ignored-subscription": "warn",
|
||||
"@angular-eslint/prefer-standalone": "off",
|
||||
"@angular-eslint/no-conflicting-lifecycle": "error",
|
||||
"@angular-eslint/no-host-metadata-property": "error",
|
||||
"@angular-eslint/no-input-rename": "error",
|
||||
|
||||
@ -11,26 +11,6 @@ include:
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE != "schedule"
|
||||
|
||||
sonarqube:
|
||||
stage: test
|
||||
image:
|
||||
name: sonarsource/sonar-scanner-cli:11.1
|
||||
entrypoint:
|
||||
- ''
|
||||
variables:
|
||||
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
|
||||
GIT_DEPTH: '0'
|
||||
cache:
|
||||
key: "${CI_JOB_NAME}"
|
||||
paths:
|
||||
- ".sonar/cache"
|
||||
script:
|
||||
- sonar-scanner
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|
||||
- if: "$CI_COMMIT_BRANCH =~ /^release/"
|
||||
|
||||
localazy update:
|
||||
image: node:20.5
|
||||
cache:
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/@pdftron/webviewer/public/",
|
||||
"output": "/assets/wv-resources/11.1.0/"
|
||||
"output": "/assets/wv-resources/10.10.1/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
@ -73,7 +73,7 @@
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["./apps/red-ui/src/assets/styles", "./libs/common-ui/src/assets/styles"]
|
||||
},
|
||||
"scripts": ["node_modules/chart.js/auto/auto.cjs"],
|
||||
"scripts": ["node_modules/@pdftron/webviewer/webviewer.min.js", "node_modules/chart.js/auto/auto.cjs"],
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true,
|
||||
"optimization": false,
|
||||
|
||||
@ -4,27 +4,26 @@ import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
import { AppConfig } from '@red/domain';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { filter, map, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { APP_TYPE_PATHS } from '@common-ui/utils/constants';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { TenantsService } from '@common-ui/tenants';
|
||||
import { filter, map, switchMap, take } from 'rxjs/operators';
|
||||
|
||||
export function loadCustomTheme(cssFileName: string) {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const link = document.createElement('link');
|
||||
link.id = cssFileName;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = 'assets/styles/themes/' + cssFileName + '.css';
|
||||
link.media = 'all';
|
||||
head.appendChild(link);
|
||||
function loadCustomTheme() {
|
||||
const cssFileName = getConfig<AppConfig>().THEME;
|
||||
|
||||
if (cssFileName) {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const link = document.createElement('link');
|
||||
link.id = cssFileName;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = 'assets/styles/themes/' + cssFileName + '.css';
|
||||
link.media = 'all';
|
||||
head.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-root',
|
||||
templateUrl: './app.component.html',
|
||||
standalone: false,
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor(
|
||||
@ -35,12 +34,9 @@ export class AppComponent {
|
||||
userPreferenceService: UserPreferenceService,
|
||||
renderer: Renderer2,
|
||||
private readonly _router: Router,
|
||||
private readonly _iconRegistry: MatIconRegistry,
|
||||
private readonly _sanitizer: DomSanitizer,
|
||||
private readonly _tenantsService: TenantsService,
|
||||
) {
|
||||
const config = getConfig<AppConfig>();
|
||||
renderer.addClass(document.body, userPreferenceService.getTheme());
|
||||
loadCustomTheme();
|
||||
|
||||
const removeQueryParams = _router.events.pipe(
|
||||
filter((event): event is NavigationEnd => event instanceof NavigationEnd),
|
||||
@ -51,25 +47,9 @@ export class AppComponent {
|
||||
);
|
||||
removeQueryParams.subscribe();
|
||||
|
||||
this._tenantsService
|
||||
.waitForSettingTenant()
|
||||
.pipe(
|
||||
tap(() => {
|
||||
const isDocumine = this._tenantsService.activeTenant.documine;
|
||||
const logo = isDocumine ? 'documine' : 'redaction';
|
||||
_iconRegistry.addSvgIconInNamespace(
|
||||
'iqser',
|
||||
'logo',
|
||||
_sanitizer.bypassSecurityTrustResourceUrl(`/assets/icons/general/${logo}-logo.svg`),
|
||||
);
|
||||
if (isDocumine) {
|
||||
document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico');
|
||||
}
|
||||
loadCustomTheme(isDocumine ? APP_TYPE_PATHS.SCM : APP_TYPE_PATHS.REDACT);
|
||||
}),
|
||||
take(1),
|
||||
)
|
||||
.subscribe();
|
||||
if (getConfig().IS_DOCUMINE) {
|
||||
document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico');
|
||||
}
|
||||
}
|
||||
|
||||
#removeKeycloakQueryParams() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { APP_BASE_HREF, DatePipe as BaseDatePipe } from '@angular/common';
|
||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { ErrorHandler, inject, NgModule, provideEnvironmentInitializer } from '@angular/core';
|
||||
import { ENVIRONMENT_INITIALIZER, ErrorHandler, inject, NgModule } from '@angular/core';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { MatMenu, MatMenuContent, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
||||
@ -117,7 +117,7 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
resetTimeoutOnDuplicate: true,
|
||||
}),
|
||||
TenantsModule.forRoot(),
|
||||
IqserTranslateModule.forRoot({ pathPrefix: config.BASE_TRANSLATIONS_DIRECTORY }),
|
||||
IqserTranslateModule.forRoot({ pathPrefix: config.BASE_TRANSLATIONS_DIRECTORY || '/assets/i18n/redact/' }),
|
||||
IqserLoadingModule.forRoot(),
|
||||
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
||||
LoggerModule.forRoot(undefined, {
|
||||
@ -233,10 +233,14 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
provide: ErrorHandler,
|
||||
useClass: GlobalErrorHandler,
|
||||
},
|
||||
provideEnvironmentInitializer(async () => {
|
||||
const languageService = inject(LanguageService);
|
||||
return languageService.setInitialLanguage();
|
||||
}),
|
||||
{
|
||||
provide: ENVIRONMENT_INITIALIZER,
|
||||
multi: true,
|
||||
useValue: async () => {
|
||||
const languageService = inject(LanguageService);
|
||||
return languageService.setInitialLanguage();
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: MAX_RETRIES_ON_SERVER_ERROR,
|
||||
useFactory: () => config.MAX_RETRIES_ON_SERVER_ERROR,
|
||||
@ -257,7 +261,6 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
provide: MAT_TOOLTIP_DEFAULT_OPTIONS,
|
||||
useValue: {
|
||||
disableTooltipInteractivity: true,
|
||||
showDelay: 1,
|
||||
},
|
||||
},
|
||||
BaseDatePipe,
|
||||
|
||||
@ -7,7 +7,6 @@ import { AppConfig } from '@red/domain';
|
||||
selector: 'redaction-auth-error',
|
||||
templateUrl: './auth-error.component.html',
|
||||
styleUrls: ['./auth-error.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class AuthErrorComponent {
|
||||
readonly #config = getConfig<AppConfig>();
|
||||
|
||||
@ -20,7 +20,6 @@ const isSearchScreen: (url: string) => boolean = url => url.includes('/search');
|
||||
@Component({
|
||||
templateUrl: './base-screen.component.html',
|
||||
styleUrls: ['./base-screen.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class BaseScreenComponent {
|
||||
readonly roles = Roles;
|
||||
|
||||
@ -7,7 +7,6 @@ import { Breadcrumb, BreadcrumbDisplayType, BreadcrumbsService } from '@services
|
||||
selector: 'redaction-breadcrumbs',
|
||||
templateUrl: './breadcrumbs.component.html',
|
||||
styleUrls: ['./breadcrumbs.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class BreadcrumbsComponent {
|
||||
constructor(readonly breadcrumbsService: BreadcrumbsService) {}
|
||||
|
||||
@ -13,7 +13,6 @@ import { firstValueFrom } from 'rxjs';
|
||||
entitiesService: FileDownloadService,
|
||||
component: DownloadsListScreenComponent,
|
||||
}),
|
||||
standalone: false,
|
||||
})
|
||||
export class DownloadsListScreenComponent extends ListingComponent<DownloadStatus> implements OnDestroy {
|
||||
readonly #interval: number;
|
||||
|
||||
@ -25,7 +25,6 @@ function chronologically(first: string, second: string) {
|
||||
selector: 'redaction-notifications',
|
||||
templateUrl: './notifications.component.html',
|
||||
styleUrls: ['./notifications.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class NotificationsComponent {
|
||||
readonly hasUnreadNotifications$: Observable<boolean>;
|
||||
|
||||
@ -5,6 +5,5 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
templateUrl: './dashboard-skeleton.component.html',
|
||||
styleUrls: ['./dashboard-skeleton.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class DashboardSkeletonComponent {}
|
||||
|
||||
@ -5,7 +5,6 @@ import { ChangeDetectionStrategy, Component, OnInit, TemplateRef, ViewChild } fr
|
||||
templateUrl: './dossier-skeleton.component.html',
|
||||
styleUrls: ['./dossier-skeleton.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class DossierSkeletonComponent implements OnInit {
|
||||
@ViewChild('workload1', { static: true }) workload1: TemplateRef<unknown>;
|
||||
|
||||
@ -5,6 +5,5 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
templateUrl: './skeleton-stats.component.html',
|
||||
styleUrls: ['./skeleton-stats.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class SkeletonStatsComponent {}
|
||||
|
||||
@ -6,7 +6,6 @@ import { Title } from '@angular/platform-browser';
|
||||
templateUrl: './skeleton-top-bar.component.html',
|
||||
styleUrls: ['./skeleton-top-bar.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class SkeletonTopBarComponent {
|
||||
constructor(readonly titleService: Title) {}
|
||||
|
||||
@ -9,7 +9,6 @@ import { MatMenuTrigger } from '@angular/material/menu';
|
||||
templateUrl: './spotlight-search.component.html',
|
||||
styleUrls: ['./spotlight-search.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class SpotlightSearchComponent {
|
||||
@Input() actions: readonly SpotlightSearchAction[];
|
||||
|
||||
@ -9,7 +9,6 @@ interface ITenant extends IStoredTenantId {
|
||||
selector: 'app-tenants-menu',
|
||||
templateUrl: './tenants-menu.component.html',
|
||||
styleUrls: ['./tenants-menu.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class TenantsMenuComponent {
|
||||
readonly tenantsService = inject(TenantsService);
|
||||
|
||||
@ -20,7 +20,6 @@ interface MenuItem {
|
||||
selector: 'app-user-menu',
|
||||
templateUrl: './user-menu.component.html',
|
||||
styleUrls: ['./user-menu.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class UserMenuComponent {
|
||||
readonly currentUser = getCurrentUser<User>();
|
||||
|
||||
@ -11,9 +11,7 @@ import { DictionaryService } from '@services/entity-services/dictionary.service'
|
||||
import { DefaultColorsService } from '@services/entity-services/default-colors.service';
|
||||
import { WatermarkService } from '@services/entity-services/watermark.service';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import { getConfig, Toaster } from '@iqser/common-ui';
|
||||
import { RulesService } from '../modules/admin/services/rules.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
|
||||
export function templateExistsWhenEnteringAdmin(): CanActivateFn {
|
||||
return async function (route: ActivatedRouteSnapshot): Promise<boolean> {
|
||||
@ -23,14 +21,12 @@ export function templateExistsWhenEnteringAdmin(): CanActivateFn {
|
||||
const defaultColorsService = inject(DefaultColorsService);
|
||||
const watermarksService = inject(WatermarkService);
|
||||
const router = inject(Router);
|
||||
const rulesService = inject(RulesService);
|
||||
const isDocumine = getConfig().IS_DOCUMINE;
|
||||
|
||||
const dossierTemplate = inject(DossierTemplateStatsService).get(dossierTemplateId);
|
||||
await firstValueFrom(fileAttributesService.loadFileAttributesConfig(dossierTemplateId));
|
||||
await firstValueFrom(dictionaryService.loadDictionaryDataForDossierTemplate(dossierTemplateId));
|
||||
await firstValueFrom(defaultColorsService.loadForDossierTemplate(dossierTemplateId));
|
||||
await firstValueFrom(rulesService.getFor(dossierTemplateId));
|
||||
if (!isDocumine) {
|
||||
await firstValueFrom(watermarksService.loadForDossierTemplate(dossierTemplateId));
|
||||
}
|
||||
@ -54,8 +50,6 @@ export function templateExistsWhenEnteringDossierList(): CanActivateFn {
|
||||
const dictionaryService = inject(DictionaryService);
|
||||
const defaultColorsService = inject(DefaultColorsService);
|
||||
const watermarksService = inject(WatermarkService);
|
||||
const rulesService = inject(RulesService);
|
||||
const toaster = inject(Toaster);
|
||||
const isDocumine = getConfig().IS_DOCUMINE;
|
||||
|
||||
await firstValueFrom(dashboardStatsService.loadForTemplate(dossierTemplateId));
|
||||
@ -70,10 +64,6 @@ export function templateExistsWhenEnteringDossierList(): CanActivateFn {
|
||||
await firstValueFrom(fileAttributesService.loadFileAttributesConfig(dossierTemplateId));
|
||||
await firstValueFrom(dictionaryService.loadDictionaryDataForDossierTemplate(dossierTemplateId));
|
||||
await firstValueFrom(defaultColorsService.loadForDossierTemplate(dossierTemplateId));
|
||||
const rules = await firstValueFrom(rulesService.getFor(dossierTemplateId));
|
||||
if (rules.timeoutDetected) {
|
||||
toaster.error(_('dossier-listing.rules.timeoutError'));
|
||||
}
|
||||
if (!isDocumine) {
|
||||
await firstValueFrom(watermarksService.loadForDossierTemplate(dossierTemplateId));
|
||||
}
|
||||
|
||||
@ -40,7 +40,8 @@ export function ifLoggedIn(): AsyncGuard {
|
||||
|
||||
logger.info('[KEYCLOAK] Keycloak init...');
|
||||
await keycloakInitializer(tenant);
|
||||
logger.info('[KEYCLOAK] Keycloak init done for tenant: ', { tenant });
|
||||
logger.info('[KEYCLOAK] Keycloak init done!');
|
||||
console.log({ tenant });
|
||||
await tenantsService.selectTenant(tenant);
|
||||
await usersService.initialize();
|
||||
await licenseService.loadLicenses();
|
||||
|
||||
@ -16,7 +16,11 @@ export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction
|
||||
export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending;
|
||||
|
||||
export const canMarkAsFalsePositive = (annotation: AnnotationWrapper, annotationEntity: Dictionary) =>
|
||||
annotation.canBeMarkedAsFalsePositive && !annotation.hasBeenResizedLocally && annotationEntity?.hasDictionary;
|
||||
annotation.canBeMarkedAsFalsePositive &&
|
||||
!annotation.hasBeenResizedLocally &&
|
||||
!annotation.isRemovedLocally &&
|
||||
!annotation.hasBeenForcedRedaction &&
|
||||
annotationEntity?.hasDictionary;
|
||||
|
||||
export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean, autoAnalysisDisabled: boolean) =>
|
||||
canAddRedaction &&
|
||||
@ -69,5 +73,3 @@ export const canEditHint = (annotation: AnnotationWrapper) =>
|
||||
((annotation.isHint && !annotation.isRuleBased) || annotation.isIgnoredHint) && !annotation.isImage;
|
||||
|
||||
export const canEditImage = (annotation: AnnotationWrapper) => annotation.isImage;
|
||||
|
||||
export const canRevertChanges = (annotation: AnnotationWrapper) => annotation.hasRedactionChanges;
|
||||
|
||||
@ -17,7 +17,6 @@ import {
|
||||
canRemoveRedaction,
|
||||
canResizeAnnotation,
|
||||
canResizeInDictionary,
|
||||
canRevertChanges,
|
||||
canUndo,
|
||||
} from './annotation-permissions.utils';
|
||||
import { AnnotationWrapper } from './annotation.wrapper';
|
||||
@ -38,7 +37,6 @@ export class AnnotationPermissions {
|
||||
canEditAnnotations = true;
|
||||
canEditHints = true;
|
||||
canEditImages = true;
|
||||
canRevertChanges = true;
|
||||
|
||||
static forUser(
|
||||
isApprover: boolean,
|
||||
@ -77,7 +75,6 @@ export class AnnotationPermissions {
|
||||
permissions.canEditAnnotations = canEditAnnotation(annotation);
|
||||
permissions.canEditHints = canEditHint(annotation);
|
||||
permissions.canEditImages = canEditImage(annotation);
|
||||
permissions.canRevertChanges = canRevertChanges(annotation);
|
||||
summedPermissions._merge(permissions);
|
||||
}
|
||||
return summedPermissions;
|
||||
@ -100,7 +97,6 @@ export class AnnotationPermissions {
|
||||
result.canEditAnnotations = permissions.reduce((acc, next) => acc && next.canEditAnnotations, true);
|
||||
result.canEditHints = permissions.reduce((acc, next) => acc && next.canEditHints, true);
|
||||
result.canEditImages = permissions.reduce((acc, next) => acc && next.canEditImages, true);
|
||||
result.canRevertChanges = permissions.reduce((acc, next) => acc && next.canRevertChanges, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ export class AnnotationWrapper implements IListable {
|
||||
typeLabel?: string;
|
||||
color: string;
|
||||
numberOfComments = 0;
|
||||
firstBottomLeftPoint: IPoint;
|
||||
firstTopLeftPoint: IPoint;
|
||||
shortContent: string;
|
||||
content: AnnotationContent;
|
||||
value: string;
|
||||
@ -84,10 +84,7 @@ export class AnnotationWrapper implements IListable {
|
||||
}
|
||||
|
||||
get isRedactedImageHint() {
|
||||
return (
|
||||
(this.IMAGE_HINT && this.superType === SuperTypes.Redaction) ||
|
||||
(this.IMAGE_HINT && this.superType === SuperTypes.ManualRedaction)
|
||||
);
|
||||
return this.IMAGE_HINT && this.superType === SuperTypes.Redaction;
|
||||
}
|
||||
|
||||
get isSkippedImageHint() {
|
||||
@ -112,10 +109,7 @@ export class AnnotationWrapper implements IListable {
|
||||
|
||||
get canBeMarkedAsFalsePositive() {
|
||||
return (
|
||||
(this.isRecommendation ||
|
||||
this.superType === SuperTypes.Redaction ||
|
||||
(this.isSkipped && this.isDictBased) ||
|
||||
(this.isRemovedLocally && this.isDictBased)) &&
|
||||
(this.isRecommendation || this.superType === SuperTypes.Redaction || (this.isSkipped && this.isDictBased)) &&
|
||||
!this.isImage &&
|
||||
!this.imported &&
|
||||
!this.pending &&
|
||||
@ -199,11 +193,11 @@ export class AnnotationWrapper implements IListable {
|
||||
}
|
||||
|
||||
get x() {
|
||||
return this.firstBottomLeftPoint.x;
|
||||
return this.firstTopLeftPoint.x;
|
||||
}
|
||||
|
||||
get y() {
|
||||
return this.firstBottomLeftPoint.y;
|
||||
return this.firstTopLeftPoint.y;
|
||||
}
|
||||
|
||||
get legalBasis() {
|
||||
@ -228,7 +222,7 @@ export class AnnotationWrapper implements IListable {
|
||||
annotationWrapper.value = 'Imported';
|
||||
annotationWrapper.color = earmark.hexColor;
|
||||
annotationWrapper.positions = earmark.positions;
|
||||
annotationWrapper.firstBottomLeftPoint = earmark.positions[0]?.topLeft;
|
||||
annotationWrapper.firstTopLeftPoint = earmark.positions[0]?.topLeft;
|
||||
annotationWrapper.superTypeLabel = annotationTypesTranslations[annotationWrapper.superType];
|
||||
|
||||
return annotationWrapper;
|
||||
@ -249,7 +243,7 @@ export class AnnotationWrapper implements IListable {
|
||||
annotationWrapper.isChangeLogEntry = logEntry.state === EntryStates.REMOVED || !!changeLogType;
|
||||
annotationWrapper.type = logEntry.type;
|
||||
annotationWrapper.value = logEntry.value;
|
||||
annotationWrapper.firstBottomLeftPoint = { x: logEntry.positions[0].rectangle[0], y: logEntry.positions[0].rectangle[1] };
|
||||
annotationWrapper.firstTopLeftPoint = { x: logEntry.positions[0].rectangle[0], y: logEntry.positions[0].rectangle[1] };
|
||||
annotationWrapper.pageNumber = logEntry.positions[0].pageNumber;
|
||||
annotationWrapper.positions = logEntry.positions.map(p => ({
|
||||
page: p.pageNumber,
|
||||
@ -378,7 +372,7 @@ export class AnnotationWrapper implements IListable {
|
||||
|
||||
static #getShortContent(annotationWrapper: AnnotationWrapper, legalBasisList: ILegalBasis[]) {
|
||||
if (annotationWrapper.legalBasis) {
|
||||
const lb = legalBasisList.find(lbm => lbm.technicalName?.toLowerCase().includes(annotationWrapper.legalBasis.toLowerCase()));
|
||||
const lb = legalBasisList.find(lbm => lbm.reason?.toLowerCase().includes(annotationWrapper.legalBasis.toLowerCase()));
|
||||
if (lb) {
|
||||
return lb.name;
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ interface NavItem {
|
||||
templateUrl: './account-side-nav.component.html',
|
||||
styleUrls: ['./account-side-nav.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [SideNavComponent, TranslateModule, NgForOf, NgIf, RouterLinkActive, RouterLink],
|
||||
})
|
||||
export class AccountSideNavComponent {
|
||||
|
||||
@ -8,11 +8,10 @@
|
||||
<div class="content-container full-height">
|
||||
<div class="overlay-shadow"></div>
|
||||
<div [ngClass]="!isWarningsScreen && 'dialog'">
|
||||
@if (!isWarningsScreen) {
|
||||
<div class="dialog-header">
|
||||
<div class="heading-l" [translate]="translations[path]"></div>
|
||||
</div>
|
||||
}
|
||||
<div *ngIf="!isWarningsScreen" class="dialog-header">
|
||||
<div class="heading-l" [translate]="translations[path]"></div>
|
||||
</div>
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component, OnInit, ViewContainerRef } from '@angular/core';
|
||||
import { Router, RouterOutlet } from '@angular/router';
|
||||
import { accountTranslations } from '@translations/account-translations';
|
||||
import { NgClass } from '@angular/common';
|
||||
import { NgClass, NgIf } from '@angular/common';
|
||||
import { AccountSideNavComponent } from '../account-side-nav/account-side-nav.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@ -10,7 +10,8 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
templateUrl: './base-account-screen-component.html',
|
||||
styleUrls: ['./base-account-screen-component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [NgClass, RouterOutlet, AccountSideNavComponent, TranslateModule],
|
||||
standalone: true,
|
||||
imports: [NgClass, NgIf, RouterOutlet, AccountSideNavComponent, TranslateModule],
|
||||
})
|
||||
export class BaseAccountScreenComponent implements OnInit {
|
||||
readonly translations = accountTranslations;
|
||||
|
||||
@ -25,6 +25,7 @@ const RSS_EXCLUDED_SETTINGS = ['USER_PROMOTED_TO_APPROVER', 'USER_DEGRADED_TO_RE
|
||||
templateUrl: './notifications-screen.component.html',
|
||||
styleUrls: ['./notifications-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, NgForOf, MatSlideToggle, TranslateModule, NgIf, MatCheckbox, IconButtonComponent],
|
||||
})
|
||||
export class NotificationsScreenComponent extends BaseFormComponent implements OnInit {
|
||||
|
||||
@ -41,6 +41,7 @@ interface DefaultOptionsForm {
|
||||
selector: 'redaction-dialog-defaults',
|
||||
templateUrl: './dialog-defaults.component.html',
|
||||
styleUrl: './dialog-defaults.component.scss',
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, TranslateModule, MatFormField, MatSelect, MatOption, NgForOf, MatCheckbox, NgIf, IconButtonComponent],
|
||||
})
|
||||
export class DialogDefaultsComponent extends BaseFormComponent {
|
||||
|
||||
@ -44,6 +44,7 @@ const Screens = {
|
||||
templateUrl: './preferences.component.html',
|
||||
styleUrls: ['./preferences.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
DialogDefaultsComponent,
|
||||
NgClass,
|
||||
|
||||
@ -10,6 +10,7 @@ interface FormType {
|
||||
|
||||
@Component({
|
||||
templateUrl: './confirm-password-dialog.component.html',
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, IconButtonComponent, TranslateModule, CircleButtonComponent],
|
||||
})
|
||||
export class ConfirmPasswordDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -16,16 +16,14 @@
|
||||
<input formControlName="lastName" name="lastName" type="text" />
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group">
|
||||
<div *ngIf="devMode" class="iqser-input-group">
|
||||
<label [translate]="'top-bar.navigation-items.my-account.children.language.label'"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="language">
|
||||
<mat-select-trigger>{{ languageSelectLabel() | translate }}</mat-select-trigger>
|
||||
@for (language of languages; track language) {
|
||||
<mat-option [value]="language">
|
||||
{{ translations[language] | translate }}
|
||||
</mat-option>
|
||||
}
|
||||
<mat-option *ngFor="let language of languages" [value]="language">
|
||||
{{ translations[language] | translate }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@ -34,13 +32,11 @@
|
||||
<a (click)="resetPassword()" target="_blank"> {{ 'user-profile-screen.actions.change-password' | translate }}</a>
|
||||
</div>
|
||||
|
||||
@if (devMode) {
|
||||
<div class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="darkTheme">
|
||||
{{ 'user-profile-screen.form.dark-theme' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
}
|
||||
<div *ngIf="devMode" class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="darkTheme">
|
||||
{{ 'user-profile-screen.form.dark-theme' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { UserProfileDialogService } from '../services/user-profile-dialog.service';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
@ -36,11 +37,14 @@ interface UserProfileForm {
|
||||
templateUrl: './user-profile-screen.component.html',
|
||||
styleUrls: ['./user-profile-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
NgIf,
|
||||
MatFormField,
|
||||
MatSelect,
|
||||
MatOption,
|
||||
NgForOf,
|
||||
TranslateModule,
|
||||
MatSlideToggle,
|
||||
IconButtonComponent,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { inject, provideEnvironmentInitializer } from '@angular/core';
|
||||
import { ENVIRONMENT_INITIALIZER, inject } from '@angular/core';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { templateExistsWhenEnteringAdmin } from '@guards/dossier-template-exists.guard';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
@ -24,6 +24,7 @@ import { AuditService } from './services/audit.service';
|
||||
import { DigitalSignatureService } from './services/digital-signature.service';
|
||||
import { RulesService } from './services/rules.service';
|
||||
import { SmtpConfigService } from './services/smtp-config.service';
|
||||
import { RulesLoggerService } from '@services/rules-logger.service';
|
||||
|
||||
const entityRoutes: IqserRoutes = [
|
||||
{
|
||||
@ -82,9 +83,32 @@ const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
},
|
||||
providers: [
|
||||
RulesService,
|
||||
provideEnvironmentInitializer(() => {
|
||||
return inject(CopilotService).connectAsync('/api/llm/llm-websocket');
|
||||
}),
|
||||
{
|
||||
provide: ENVIRONMENT_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: () => {
|
||||
const service = inject(CopilotService);
|
||||
return () => {
|
||||
setTimeout(() => {
|
||||
service.connect('/api/llm/llm-websocket');
|
||||
console.log('Copilot ready');
|
||||
}, 2000);
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: ENVIRONMENT_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: () => {
|
||||
const service = inject(RulesLoggerService);
|
||||
return () => {
|
||||
setTimeout(() => {
|
||||
service.connect('/api/rules-logging/rulesocket');
|
||||
console.log('Rules logger ready');
|
||||
}, 2000);
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ import { RouterOutlet } from '@angular/router';
|
||||
@Component({
|
||||
templateUrl: './base-admin-screen.component.html',
|
||||
styleUrls: ['./base-admin-screen.component.scss'],
|
||||
standalone: true,
|
||||
imports: [AdminSideNavComponent, RouterOutlet],
|
||||
})
|
||||
export class BaseAdminScreenComponent {}
|
||||
|
||||
@ -9,6 +9,7 @@ import { AdminSideNavComponent } from '../shared/components/admin-side-nav/admin
|
||||
@Component({
|
||||
templateUrl: './base-dossier-template-screen.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
DossierTemplateBreadcrumbsComponent,
|
||||
DossierTemplateActionsComponent,
|
||||
|
||||
@ -18,6 +18,7 @@ import { AdminSideNavComponent } from '../shared/components/admin-side-nav/admin
|
||||
@Component({
|
||||
templateUrl: './base-entity-screen.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
DossierTemplateBreadcrumbsComponent,
|
||||
CircleButtonComponent,
|
||||
|
||||
@ -8,6 +8,7 @@ import { DonutChartComponent } from '@shared/components/donut-chart/donut-chart.
|
||||
selector: 'redaction-users-stats',
|
||||
templateUrl: './users-stats.component.html',
|
||||
styleUrls: ['./users-stats.component.scss'],
|
||||
standalone: true,
|
||||
imports: [CircleButtonComponent, TranslateModule, DonutChartComponent],
|
||||
})
|
||||
export class UsersStatsComponent {
|
||||
|
||||
@ -16,6 +16,7 @@ export interface CloneTemplateData {
|
||||
@Component({
|
||||
templateUrl: './add-clone-dossier-template-dialog.component.html',
|
||||
styleUrls: ['./add-clone-dossier-template-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [TranslateModule, ReactiveFormsModule, IconButtonComponent, CircleButtonComponent],
|
||||
})
|
||||
export class AddCloneDossierTemplateDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -8,6 +8,7 @@ import { UserDetailsComponent } from './user-details/user-details.component';
|
||||
@Component({
|
||||
selector: 'redaction-add-edit-user-dialog',
|
||||
templateUrl: './add-edit-user-dialog.component.html',
|
||||
standalone: true,
|
||||
imports: [UserDetailsComponent, ResetPasswordComponent, CircleButtonComponent],
|
||||
})
|
||||
export class AddEditUserDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -10,6 +10,7 @@ import { NamePipe } from '@common-ui/users/name.pipe';
|
||||
@Component({
|
||||
selector: 'redaction-reset-password',
|
||||
templateUrl: './reset-password.component.html',
|
||||
standalone: true,
|
||||
imports: [TranslateModule, NamePipe, ReactiveFormsModule, IconButtonComponent],
|
||||
})
|
||||
export class ResetPasswordComponent {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
[formControlName]="role"
|
||||
color="primary"
|
||||
>
|
||||
{{ translations[role] | translate: { count: 1 } }}
|
||||
{{ translations[role] | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -3,8 +3,10 @@ import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators }
|
||||
import { AdminDialogService } from '../../../services/admin-dialog.service';
|
||||
import { BaseFormComponent, IconButtonComponent, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { rolesTranslations } from '@translations/roles-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { User } from '@red/domain';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { IProfileUpdateRequest } from '@iqser/common-ui/lib/users';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@ -15,6 +17,7 @@ import { NgForOf, NgIf } from '@angular/common';
|
||||
selector: 'redaction-user-details',
|
||||
templateUrl: './user-details.component.html',
|
||||
styleUrls: ['./user-details.component.scss'],
|
||||
standalone: true,
|
||||
imports: [TranslateModule, ReactiveFormsModule, MatCheckbox, NgForOf, IconButtonComponent, NgIf],
|
||||
})
|
||||
export class UserDetailsComponent extends BaseFormComponent implements OnInit {
|
||||
|
||||
@ -19,6 +19,7 @@ interface DialogData {
|
||||
@Component({
|
||||
templateUrl: './add-entity-dialog.component.html',
|
||||
styleUrls: ['./add-entity-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [AddEditEntityComponent, TranslateModule, IconButtonComponent, NgIf, CircleButtonComponent, HelpButtonComponent],
|
||||
})
|
||||
export class AddEntityDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -16,6 +16,7 @@ type OrderFn = (a: KeyValue<string, string>, b: KeyValue<string, string>) => num
|
||||
templateUrl: './audit-info-dialog.component.html',
|
||||
styleUrls: ['./audit-info-dialog.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [TranslateModule, NgForOf, KeyValuePipe, HumanizePipe, CircleButtonComponent, JsonPipe],
|
||||
})
|
||||
export class AuditInfoDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -20,6 +20,7 @@ const KMS_SIGNATURE_DIALOG_WIDTH = '810px';
|
||||
@Component({
|
||||
templateUrl: './configure-certificate-dialog.component.html',
|
||||
styleUrls: ['./configure-certificate-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
DetailsRadioComponent,
|
||||
NgIf,
|
||||
|
||||
@ -13,6 +13,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
templateUrl: './kms-signature-configuration.component.html',
|
||||
styleUrls: ['./kms-signature-configuration.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [UploadFileComponent, ReactiveFormsModule, NgIf, TranslateModule],
|
||||
})
|
||||
export class KmsSignatureConfigurationComponent extends BaseSignatureConfigurationComponent implements OnInit {
|
||||
|
||||
@ -14,6 +14,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
templateUrl: './pkcs-signature-configuration.component.html',
|
||||
styleUrls: ['./pkcs-signature-configuration.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [UploadFileComponent, ReactiveFormsModule, NgIf, TranslateModule],
|
||||
})
|
||||
export class PkcsSignatureConfigurationComponent extends BaseSignatureConfigurationComponent implements OnInit {
|
||||
|
||||
@ -20,6 +20,7 @@ interface IEditColorData {
|
||||
@Component({
|
||||
templateUrl: './edit-color-dialog.component.html',
|
||||
styleUrls: ['./edit-color-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, TranslateModule, ColorPickerModule, MatIcon, NgIf, IconButtonComponent, CircleButtonComponent],
|
||||
})
|
||||
export class EditColorDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -9,6 +9,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
@Component({
|
||||
selector: 'redaction-smtp-auth-dialog',
|
||||
templateUrl: './smtp-auth-dialog.component.html',
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, TranslateModule, IconButtonComponent, CircleButtonComponent, MatDialogClose],
|
||||
})
|
||||
export class SmtpAuthDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -7,6 +7,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
templateUrl: './upload-dictionary-dialog.component.html',
|
||||
styleUrls: ['./upload-dictionary-dialog.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [IconButtonComponent, TranslateModule],
|
||||
})
|
||||
export class UploadDictionaryDialogComponent {
|
||||
|
||||
@ -36,6 +36,7 @@ const PAGE_SIZE = 50;
|
||||
templateUrl: './audit-screen.component.html',
|
||||
styleUrls: ['./audit-screen.component.scss'],
|
||||
providers: listingProvidersFactory(AuditScreenComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
|
||||
@ -1,18 +1,12 @@
|
||||
import { Component, OnInit, signal } from '@angular/core';
|
||||
import {
|
||||
BaseFormComponent,
|
||||
CircleButtonComponent,
|
||||
HasScrollbarDirective,
|
||||
IconButtonComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
} from '@iqser/common-ui';
|
||||
import { BaseFormComponent, CircleButtonComponent, IconButtonComponent, listingProvidersFactory, LoadingService } from '@iqser/common-ui';
|
||||
import { ComponentDefinitionsService } from '@services/entity-services/component-definitions.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { getParam } from '@common-ui/utils';
|
||||
import { DOSSIER_TEMPLATE_ID, IComponentDefinition } from '@red/domain';
|
||||
import { toObservable } from '@angular/core/rxjs-interop';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import { CommonModule, NgIf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
@ -24,8 +18,11 @@ import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
templateUrl: './component-definitions.component.html',
|
||||
styleUrls: ['./component-definitions.component.scss'],
|
||||
providers: listingProvidersFactory(ComponentDefinitionsComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IconButtonComponent,
|
||||
InputWithActionComponent,
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
CommonModule,
|
||||
MatIcon,
|
||||
@ -35,7 +32,6 @@ import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
CircleButtonComponent,
|
||||
HasScrollbarDirective,
|
||||
],
|
||||
})
|
||||
export default class ComponentDefinitionsComponent extends BaseFormComponent implements OnInit {
|
||||
@ -107,7 +103,6 @@ export default class ComponentDefinitionsComponent extends BaseFormComponent imp
|
||||
this._dialogService.openDialog('confirm', null, async () => {
|
||||
await firstValueFrom(this._componentDefinitionsService.deleteComponentDefinitions(this.#dossierTemplateId, [componentId]));
|
||||
await this.#loadData();
|
||||
this.selectedComponent = null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { NgForOf, NgIf } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatOption } from '@angular/material/autocomplete';
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
import { MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { fileAttributeEncodingTypesTranslations } from '@translations/file-attribute-encoding-types-translations';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ComponentMappingsService } from '@services/entity-services/component-mappings.service';
|
||||
@ -31,6 +31,7 @@ interface DialogResult {
|
||||
@Component({
|
||||
templateUrl: './add-edit-component-mapping-dialog.component.html',
|
||||
styleUrls: ['./add-edit-component-mapping-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
@ -40,6 +41,7 @@ interface DialogResult {
|
||||
CircleButtonComponent,
|
||||
MatDialogModule,
|
||||
MatOption,
|
||||
MatSelectTrigger,
|
||||
MatSelect,
|
||||
IconButtonComponent,
|
||||
UploadFileComponent,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import { getCurrentUser } from '@common-ui/users';
|
||||
@ -24,6 +25,9 @@ import { Roles } from '@users/roles';
|
||||
import { combineLatest, firstValueFrom } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { AdminSideNavComponent } from '../../shared/components/admin-side-nav/admin-side-nav.component';
|
||||
import { DossierTemplateActionsComponent } from '../../shared/components/dossier-template-actions/dossier-template-actions.component';
|
||||
import { DossierTemplateBreadcrumbsComponent } from '../../shared/components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component';
|
||||
import { AddEditComponentMappingDialogComponent } from './add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component';
|
||||
import { download } from '@utils/file-download-utils';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
@ -32,11 +36,16 @@ import { MatTooltip } from '@angular/material/tooltip';
|
||||
templateUrl: './component-mappings-screen.component.html',
|
||||
styleUrls: ['./component-mappings-screen.component.scss'],
|
||||
providers: listingProvidersFactory(ComponentMappingsScreenComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
DossierTemplateBreadcrumbsComponent,
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
DossierTemplateActionsComponent,
|
||||
CircleButtonComponent,
|
||||
TranslateModule,
|
||||
RouterLink,
|
||||
AdminSideNavComponent,
|
||||
IqserListingModule,
|
||||
InputWithActionComponent,
|
||||
IconButtonComponent,
|
||||
|
||||
@ -33,6 +33,7 @@ interface ListItem extends IListable {
|
||||
styleUrls: ['./default-colors-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: listingProvidersFactory(DefaultColorsScreenComponent),
|
||||
standalone: true,
|
||||
imports: [IqserListingModule, NgStyle, CircleButtonComponent, IqserAllowDirective, TranslateModule, AsyncPipe, NgIf],
|
||||
})
|
||||
export class DefaultColorsScreenComponent extends ListingComponent<ListItem> implements OnInit {
|
||||
|
||||
@ -25,6 +25,7 @@ import { DigitalSignatureService } from '../../services/digital-signature.servic
|
||||
selector: 'redaction-digital-signature-screen',
|
||||
templateUrl: './digital-signature-screen.component.html',
|
||||
styleUrls: ['./digital-signature-screen.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
EmptyStateComponent,
|
||||
|
||||
@ -20,6 +20,7 @@ export interface AddEditDossierAttributeDialogData {
|
||||
@Component({
|
||||
templateUrl: './add-edit-dossier-attribute-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dossier-attribute-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
|
||||
@ -35,6 +35,7 @@ import { TableItemComponent } from './table-item/table-item.component';
|
||||
entitiesService: DossierAttributesService,
|
||||
component: DossierAttributesListingScreenComponent,
|
||||
}),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
|
||||
@ -10,6 +10,7 @@ import { NgIf } from '@angular/common';
|
||||
selector: 'redaction-table-item [attribute] [canEditDossierAttributes]',
|
||||
templateUrl: './table-item.component.html',
|
||||
styleUrls: ['./table-item.component.scss'],
|
||||
standalone: true,
|
||||
imports: [MatTooltip, TranslateModule, CircleButtonComponent, NgIf],
|
||||
})
|
||||
export class TableItemComponent {
|
||||
|
||||
@ -18,6 +18,7 @@ export interface AddEditDossierStateDialogData {
|
||||
@Component({
|
||||
templateUrl: './add-edit-dossier-state-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dossier-state-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [TranslateModule, ReactiveFormsModule, ColorPickerModule, MatIcon, NgIf, IconButtonComponent, CircleButtonComponent],
|
||||
})
|
||||
export class AddEditDossierStateDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -11,7 +11,7 @@ import { ArchivedDossiersService } from '@services/dossiers/archived-dossiers.se
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
import { MatOption, MatSelect } from '@angular/material/select';
|
||||
import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
|
||||
export interface ConfirmDeleteDossierStateDialogData {
|
||||
@ -23,11 +23,13 @@ export interface ConfirmDeleteDossierStateDialogData {
|
||||
@Component({
|
||||
templateUrl: './confirm-delete-dossier-state-dialog.component.html',
|
||||
styleUrls: ['./confirm-delete-dossier-state-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
MatCheckbox,
|
||||
MatFormField,
|
||||
MatSelectTrigger,
|
||||
MatSelect,
|
||||
MatOption,
|
||||
NgForOf,
|
||||
|
||||
@ -33,6 +33,7 @@ import { DossierStatesTableItemComponent } from '../dossier-states-table-item/do
|
||||
templateUrl: './dossier-states-listing-screen.component.html',
|
||||
styleUrls: ['./dossier-states-listing-screen.component.scss'],
|
||||
providers: listingProvidersFactory(DossierStatesListingScreenComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
DonutChartComponent,
|
||||
|
||||
@ -20,6 +20,7 @@ import { SnakeCasePipe } from '@common-ui/pipes/snake-case.pipe';
|
||||
selector: 'redaction-dossier-states-table-item',
|
||||
templateUrl: './dossier-states-table-item.component.html',
|
||||
styleUrls: ['./dossier-states-table-item.component.scss'],
|
||||
standalone: true,
|
||||
imports: [MatTooltip, CircleButtonComponent, TranslateModule, NgIf, SnakeCasePipe],
|
||||
})
|
||||
export class DossierStatesTableItemComponent {
|
||||
|
||||
@ -33,6 +33,7 @@ import { TableItemComponent } from '../table-item/table-item.component';
|
||||
entitiesService: DossierTemplatesService,
|
||||
component: DossierTemplatesListingScreenComponent,
|
||||
}),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
|
||||
@ -17,6 +17,7 @@ import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
templateUrl: './table-item.component.html',
|
||||
styleUrls: ['./table-item.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [MatTooltip, NgIf, AsyncPipe, MatIcon, TranslateModule, DatePipe, DossierTemplateActionsComponent, InitialsAvatarComponent],
|
||||
})
|
||||
export class TableItemComponent implements OnChanges {
|
||||
|
||||
@ -87,7 +87,6 @@
|
||||
[routerLink]="dict.routerLink"
|
||||
[tooltip]="'entities-listing.action.edit' | translate"
|
||||
icon="iqser:edit"
|
||||
iqserStopPropagation
|
||||
></iqser-circle-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -11,7 +11,6 @@ import {
|
||||
ListingComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
StopPropagationDirective,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { getParam } from '@iqser/common-ui/lib/utils';
|
||||
@ -30,6 +29,7 @@ import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
templateUrl: './entities-listing-screen.component.html',
|
||||
styleUrls: ['./entities-listing-screen.component.scss'],
|
||||
providers: listingProvidersFactory(EntitiesListingScreenComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
@ -41,7 +41,6 @@ import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
AnnotationIconComponent,
|
||||
AsyncPipe,
|
||||
RouterLink,
|
||||
StopPropagationDirective,
|
||||
],
|
||||
})
|
||||
export class EntitiesListingScreenComponent extends ListingComponent<Dictionary> implements OnInit {
|
||||
|
||||
@ -16,6 +16,7 @@ import { AsyncPipe } from '@angular/common';
|
||||
templateUrl: './dictionary-screen.component.html',
|
||||
styleUrls: ['./dictionary-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [AsyncPipe, DictionaryManagerComponent],
|
||||
})
|
||||
export class DictionaryScreenComponent implements OnInit {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component, HostListener, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { getConfig, HasScrollbarDirective, IconButtonComponent, IconButtonTypes } from '@iqser/common-ui';
|
||||
import { getConfig, HasScrollbarDirective, HelpButtonComponent, IconButtonComponent, IconButtonTypes } from '@iqser/common-ui';
|
||||
import { IqserEventTarget } from '@iqser/common-ui/lib/utils';
|
||||
import { Dictionary, DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
@ -17,7 +17,17 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
templateUrl: './entity-info.component.html',
|
||||
styleUrls: ['./entity-info.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [HasScrollbarDirective, MatIcon, NgIf, TranslateModule, AsyncPipe, IconButtonComponent, AddEditEntityComponent],
|
||||
standalone: true,
|
||||
imports: [
|
||||
HasScrollbarDirective,
|
||||
MatIcon,
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
IconButtonComponent,
|
||||
AddEditEntityComponent,
|
||||
HelpButtonComponent,
|
||||
],
|
||||
})
|
||||
export class EntityInfoComponent {
|
||||
@ViewChild(AddEditEntityComponent) private readonly _addEditEntityComponent: AddEditEntityComponent;
|
||||
|
||||
@ -22,6 +22,7 @@ export interface AddEditFileAttributeDialogData {
|
||||
@Component({
|
||||
templateUrl: './add-edit-file-attribute-dialog.component.html',
|
||||
styleUrls: ['./add-edit-file-attribute-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
TranslateModule,
|
||||
|
||||
@ -13,6 +13,7 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
@Component({
|
||||
templateUrl: './file-attributes-configurations-dialog.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
MatSlideToggleModule,
|
||||
@ -57,7 +58,6 @@ export class FileAttributesConfigurationsDialogComponent extends BaseDialogCompo
|
||||
if (supportCsvMapping) {
|
||||
return {
|
||||
...this.#configuration,
|
||||
keyColumn: this.form.get('keyColumn').value,
|
||||
filenameMappingColumnHeaderName: this.form.get('keyColumn').value,
|
||||
delimiter: this.form.get('delimiter').value,
|
||||
encoding: this.form.get('encodingType').value,
|
||||
@ -67,14 +67,13 @@ export class FileAttributesConfigurationsDialogComponent extends BaseDialogCompo
|
||||
return {
|
||||
...this.#configuration,
|
||||
filenameMappingColumnHeaderName: '',
|
||||
keyColumn: this.form.get('keyColumn').value,
|
||||
};
|
||||
}
|
||||
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
supportCsvMapping: [!!this.#configuration.filenameMappingColumnHeaderName],
|
||||
keyColumn: [this.#configuration.filenameMappingColumnHeaderName || this.#configuration.keyColumn || '', [Validators.required]],
|
||||
keyColumn: [this.#configuration.filenameMappingColumnHeaderName || '', [Validators.required]],
|
||||
delimiter: [this.#configuration.delimiter || '', [Validators.required]],
|
||||
encodingType: [this.#configuration.encoding || FileAttributeEncodingTypes['UTF-8'], [Validators.required]],
|
||||
});
|
||||
|
||||
@ -2,8 +2,8 @@ import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
||||
import { MatOption, MatSelect } from '@angular/material/select';
|
||||
import { MatMenu, MatMenuTrigger } from '@angular/material/menu';
|
||||
import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { ChevronButtonComponent } from '@common-ui/buttons/chevron-button';
|
||||
@ -19,6 +19,7 @@ import { fileAttributeTypesTranslations } from '@translations/file-attribute-typ
|
||||
templateUrl: './active-fields-listing.component.html',
|
||||
styleUrls: ['./active-fields-listing.component.scss'],
|
||||
providers: listingProvidersFactory(ActiveFieldsListingComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
CircleButtonComponent,
|
||||
@ -29,6 +30,7 @@ import { fileAttributeTypesTranslations } from '@translations/file-attribute-typ
|
||||
MatMenu,
|
||||
EditableInputComponent,
|
||||
MatFormField,
|
||||
MatSelectTrigger,
|
||||
MatSelect,
|
||||
MatOption,
|
||||
FormsModule,
|
||||
@ -36,7 +38,6 @@ import { fileAttributeTypesTranslations } from '@translations/file-attribute-typ
|
||||
RoundCheckboxComponent,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
MatMenuItem,
|
||||
],
|
||||
})
|
||||
export class ActiveFieldsListingComponent extends ListingComponent<IField> implements OnChanges {
|
||||
|
||||
@ -4,7 +4,7 @@ import { AbstractControl, ReactiveFormsModule, UntypedFormBuilder, UntypedFormGr
|
||||
import { MatAutocomplete, MatAutocompleteTrigger, MatOption } from '@angular/material/autocomplete';
|
||||
import { MAT_DIALOG_DATA, MatDialogClose, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
import { MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import {
|
||||
@ -38,6 +38,7 @@ export interface IFileAttributesCSVImportData {
|
||||
styleUrls: ['./file-attributes-csv-import-dialog.component.scss'],
|
||||
providers: listingProvidersFactory(),
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
MatFormField,
|
||||
@ -45,6 +46,7 @@ export interface IFileAttributesCSVImportData {
|
||||
MatAutocomplete,
|
||||
AsyncPipe,
|
||||
MatOption,
|
||||
MatSelectTrigger,
|
||||
MatSelect,
|
||||
CircleButtonComponent,
|
||||
NgIf,
|
||||
|
||||
@ -46,6 +46,7 @@ import {
|
||||
templateUrl: './file-attributes-listing-screen.component.html',
|
||||
styleUrls: ['./file-attributes-listing-screen.component.scss'],
|
||||
providers: listingProvidersFactory(FileAttributesListingScreenComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
NgForOf,
|
||||
@ -85,7 +86,6 @@ export default class FileAttributesListingScreenComponent extends ListingCompone
|
||||
},
|
||||
];
|
||||
readonly roles = Roles;
|
||||
keyColumnValue: string = '';
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
@ -172,13 +172,13 @@ export default class FileAttributesListingScreenComponent extends ListingCompone
|
||||
FileAttributesConfigurationsDialogComponent,
|
||||
{
|
||||
...defaultDialogConfig,
|
||||
data: { ...this.#existingConfiguration, keyColumn: this.keyColumnValue },
|
||||
data: this.#existingConfiguration,
|
||||
},
|
||||
);
|
||||
|
||||
const configuration = await firstValueFrom(ref.afterClosed());
|
||||
|
||||
if (configuration) {
|
||||
this.keyColumnValue = configuration.keyColumn;
|
||||
await this.#setConfigAndLoadData(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
@Component({
|
||||
selector: 'redaction-general-config-form',
|
||||
templateUrl: './general-config-form.component.html',
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, TranslateModule, NgIf, MatSlideToggle, IconButtonComponent],
|
||||
})
|
||||
export class GeneralConfigFormComponent extends BaseFormComponent implements OnInit {
|
||||
|
||||
@ -13,6 +13,7 @@ import { ILicenseFeature } from '@red/domain';
|
||||
selector: 'redaction-general-config-screen',
|
||||
templateUrl: './general-config-screen.component.html',
|
||||
styleUrls: ['./general-config-screen.component.scss'],
|
||||
standalone: true,
|
||||
imports: [IqserListingModule, GeneralConfigFormComponent, SystemPreferencesFormComponent, SmtpFormComponent, TranslateModule],
|
||||
})
|
||||
export class GeneralConfigScreenComponent extends BaseFormComponent implements AfterViewInit {
|
||||
|
||||
@ -21,6 +21,7 @@ import { NgIf } from '@angular/common';
|
||||
@Component({
|
||||
selector: 'redaction-smtp-form',
|
||||
templateUrl: './smtp-form.component.html',
|
||||
standalone: true,
|
||||
imports: [ReactiveFormsModule, TranslateModule, MatSlideToggle, IconButtonComponent, NgIf],
|
||||
})
|
||||
export class SmtpFormComponent extends BaseFormComponent implements OnInit {
|
||||
|
||||
@ -15,6 +15,7 @@ export type ValueType = 'number' | 'string' | 'boolean';
|
||||
@Component({
|
||||
selector: 'redaction-system-preferences-form',
|
||||
templateUrl: './system-preferences-form.component.html',
|
||||
standalone: true,
|
||||
imports: [NgIf, ReactiveFormsModule, NgForOf, TranslateModule, MatSlideToggle, IconButtonComponent],
|
||||
})
|
||||
export class SystemPreferencesFormComponent extends BaseFormComponent {
|
||||
|
||||
@ -34,20 +34,6 @@
|
||||
<span [innerHTML]="'dossier-template-info-screen.created-on' | translate: { date: createdOn }"></span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="areRulesLocked()">
|
||||
<mat-icon
|
||||
(click)="resetRules()"
|
||||
[matTooltip]="
|
||||
currentUser.isAdmin
|
||||
? ('dossier-template-info-screen.rules-reset.tooltip' | translate)
|
||||
: ('dossier-template-info-screen.rules-reset.disabled-action' | translate)
|
||||
"
|
||||
[class.action-icon]="currentUser.isAdmin"
|
||||
svgIcon="iqser:alert-circle"
|
||||
></mat-icon>
|
||||
<span class="error">{{ 'dossier-template-info-screen.rules-reset.label' | translate }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<mat-icon svgIcon="red:entries"></mat-icon>
|
||||
{{ 'dossier-template-info-screen.entries' | translate: { count: ctx.stats.numberOfEntries } }}
|
||||
|
||||
@ -18,11 +18,3 @@
|
||||
padding-right: 24px;
|
||||
margin-right: 24px;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: var(--iqser-primary);
|
||||
}
|
||||
|
||||
.action-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, computed, Input, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { ContextComponent } from '@iqser/common-ui/lib/utils';
|
||||
import { type DossierTemplate, type DossierTemplateStats } from '@red/domain';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
@ -9,12 +9,6 @@ import { MatIcon } from '@angular/material/icon';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { InitialsAvatarComponent } from '@common-ui/users';
|
||||
import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
import { RulesService } from '../../../services/rules.service';
|
||||
import { Toaster } from '@iqser/common-ui';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { getCurrentUser } from '@users/user.service';
|
||||
|
||||
interface Context {
|
||||
readonly dossierTemplate: DossierTemplate;
|
||||
@ -25,21 +19,17 @@ interface Context {
|
||||
selector: 'redaction-dossier-template-details',
|
||||
templateUrl: './dossier-template-details.component.html',
|
||||
styleUrls: ['./dossier-template-details.component.scss'],
|
||||
imports: [NgIf, AsyncPipe, MatIcon, TranslateModule, DatePipe, InitialsAvatarComponent, MatTooltip],
|
||||
standalone: true,
|
||||
imports: [NgIf, AsyncPipe, MatIcon, TranslateModule, DatePipe, InitialsAvatarComponent],
|
||||
})
|
||||
export class DossierTemplateDetailsComponent extends ContextComponent<Context> implements OnInit {
|
||||
readonly translations = dossierTemplateStatusTranslations;
|
||||
|
||||
@Input({ required: true }) dossierTemplateId: string;
|
||||
readonly areRulesLocked = computed(() => {
|
||||
return this._rulesService.currentTemplateRules().timeoutDetected;
|
||||
});
|
||||
readonly currentUser = getCurrentUser();
|
||||
|
||||
constructor(
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dossierTemplateStatsService: DossierTemplateStatsService,
|
||||
private readonly _rulesService: RulesService,
|
||||
private readonly _toaster: Toaster,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@ -50,15 +40,4 @@ export class DossierTemplateDetailsComponent extends ContextComponent<Context> i
|
||||
stats: this._dossierTemplateStatsService.watch$(this.dossierTemplateId),
|
||||
});
|
||||
}
|
||||
|
||||
async resetRules() {
|
||||
if (!this.currentUser.isAdmin) return;
|
||||
try {
|
||||
await firstValueFrom(this._rulesService.reset(this.dossierTemplateId));
|
||||
this._toaster.success(_('dossier-template-info-screen.rules-reset.success'));
|
||||
await firstValueFrom(this._rulesService.getFor(this.dossierTemplateId));
|
||||
} catch (error) {
|
||||
this._toaster.rawError(error.error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
|
||||
import { DossierTemplateDetailsComponent } from '../dossier-template-details/dossier-template-details.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { NgIf } from '@angular/common';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { SelectComponent } from '@shared/components/select/select.component';
|
||||
@ -35,12 +36,14 @@ const downloadTypes = ['ORIGINAL', 'PREVIEW', 'OPTIMIZED_PREVIEW', 'DELTA_PREVIE
|
||||
@Component({
|
||||
templateUrl: './dossier-template-info-screen.component.html',
|
||||
styleUrls: ['./dossier-template-info-screen.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
HasScrollbarDirective,
|
||||
ReactiveFormsModule,
|
||||
DossierTemplateDetailsComponent,
|
||||
TranslateModule,
|
||||
MatCheckbox,
|
||||
NgIf,
|
||||
MatDatepickerModule,
|
||||
SelectComponent,
|
||||
IconButtonComponent,
|
||||
|
||||
@ -17,6 +17,7 @@ interface DialogData {
|
||||
@Component({
|
||||
templateUrl: './add-edit-justification-dialog.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [TranslateModule, ReactiveFormsModule, IconButtonComponent, CircleButtonComponent, HasScrollbarDirective],
|
||||
})
|
||||
export class AddEditJustificationDialogComponent extends BaseDialogComponent {
|
||||
|
||||
@ -33,6 +33,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
}),
|
||||
JustificationsDialogService,
|
||||
],
|
||||
standalone: true,
|
||||
imports: [IqserListingModule, CircleButtonComponent, NgIf, TableItemComponent, TranslateModule, AsyncPipe, IconButtonComponent],
|
||||
})
|
||||
export default class JustificationsScreenComponent extends ListingComponent<Justification> implements OnInit {
|
||||
|
||||
@ -12,6 +12,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
selector: 'redaction-table-item',
|
||||
templateUrl: './table-item.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [MatTooltip, CircleButtonComponent, NgIf, TranslateModule],
|
||||
})
|
||||
export class TableItemComponent {
|
||||
|
||||
@ -6,6 +6,7 @@ import { BaseChartDirective, provideCharts, withDefaultRegisterables } from 'ng2
|
||||
selector: 'redaction-chart',
|
||||
templateUrl: './chart.component.html',
|
||||
styleUrls: ['./chart.component.scss'],
|
||||
standalone: true,
|
||||
imports: [BaseChartDirective],
|
||||
providers: [provideCharts(withDefaultRegisterables())],
|
||||
})
|
||||
|
||||
@ -16,6 +16,7 @@ import { ChartComponent } from '../chart/chart.component';
|
||||
selector: 'red-license-analysis-capacity-usage',
|
||||
templateUrl: './license-analysis-capacity-usage.component.html',
|
||||
styleUrls: ['./license-analysis-capacity-usage.component.scss'],
|
||||
standalone: true,
|
||||
imports: [SizePipe, DecimalPipe, ChartComponent, AsyncPipe, NgIf, TranslateModule],
|
||||
})
|
||||
export class LicenseAnalysisCapacityUsageComponent {
|
||||
|
||||
@ -14,6 +14,7 @@ import { ChartComponent } from '../chart/chart.component';
|
||||
selector: 'red-license-page-usage',
|
||||
templateUrl: './license-page-usage.component.html',
|
||||
styleUrls: ['./license-page-usage.component.scss'],
|
||||
standalone: true,
|
||||
imports: [DecimalPipe, TranslateModule, ChartComponent, NgIf, AsyncPipe],
|
||||
})
|
||||
export class LicensePageUsageComponent {
|
||||
|
||||
@ -17,6 +17,7 @@ import { ChartComponent } from '../chart/chart.component';
|
||||
selector: 'red-license-retention-capacity',
|
||||
templateUrl: './license-retention-capacity.component.html',
|
||||
styleUrls: ['./license-retention-capacity.component.scss'],
|
||||
standalone: true,
|
||||
imports: [SizePipe, DecimalPipe, NgIf, DonutChartComponent, AsyncPipe, ChartComponent, TranslateModule],
|
||||
})
|
||||
export class LicenseRetentionCapacityComponent {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
</mat-select-trigger>
|
||||
|
||||
<mat-option *ngFor="let license of licenses" [value]="license">
|
||||
<ng-container *ngTemplateOutlet="licenseInfo; context: { license: license }"></ng-container>
|
||||
<ng-container *ngTemplateOutlet="licenseInfo; context: { license: this.license }"></ng-container>
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -19,6 +19,7 @@ const translations = {
|
||||
selector: 'redaction-license-select',
|
||||
templateUrl: './license-select.component.html',
|
||||
styleUrls: ['./license-select.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
|
||||
@ -16,6 +16,7 @@ import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
@Component({
|
||||
templateUrl: './license-screen.component.html',
|
||||
styleUrls: ['./license-screen.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
|
||||
@ -30,6 +30,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
templateUrl: './permissions-screen.component.html',
|
||||
styleUrls: ['./permissions-screen.component.scss'],
|
||||
providers: listingProvidersFactory(PermissionsScreenComponent),
|
||||
standalone: true,
|
||||
imports: [IqserListingModule, NgIf, NgForOf, MatSlideToggle, AsyncPipe, TranslateModule],
|
||||
})
|
||||
export default class PermissionsScreenComponent extends ListingComponent<PermissionsMapping> implements OnInit {
|
||||
|
||||
@ -41,6 +41,7 @@ const placeholderTypes: PlaceholderType[] = ['generalPlaceholders', 'fileAttribu
|
||||
templateUrl: './reports-screen.component.html',
|
||||
styleUrls: ['./reports-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [HasScrollbarDirective, AsyncPipe, TranslateModule, CircleButtonComponent, IqserAllowDirective, SnakeCasePipe],
|
||||
})
|
||||
export default class ReportsScreenComponent implements OnInit {
|
||||
|
||||
@ -1,88 +1,127 @@
|
||||
<div class="header-container">
|
||||
<div [translate]="translations[type()]['title']" class="heading-l"></div>
|
||||
</div>
|
||||
|
||||
<div class="flex" style="height: 100%">
|
||||
<ngx-monaco-editor (init)="onCodeEditorInit($event)" [(ngModel)]="codeEditorText" [options]="editorOptions"></ngx-monaco-editor>
|
||||
|
||||
<div [class.collapsed]="collapsed()" class="right-container flex-column">
|
||||
<div class="collapsed-wrapper">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="collapsible; context: { action: 'expand', tooltip: ('copilot.label' | translate) }"
|
||||
></ng-container>
|
||||
<div class="all-caps-label" translate="copilot.label"></div>
|
||||
<div class="rules-screen-container">
|
||||
<!-- Main content area -->
|
||||
<div class="main-content">
|
||||
<div class="header-container">
|
||||
<div [translate]="translations[type()]['title']" class="heading-l"></div>
|
||||
</div>
|
||||
|
||||
<div class="header-wrapper flex mt-8">
|
||||
<div class="heading-xl flex-1">{{ 'copilot.label' | translate | titlecase }}</div>
|
||||
<ng-container
|
||||
*ngTemplateOutlet="collapsible; context: { action: 'collapse', tooltip: ('copilot.label' | translate) }"
|
||||
></ng-container>
|
||||
</div>
|
||||
<div class="flex" style="height: 100%">
|
||||
<ngx-monaco-editor (init)="onCodeEditorInit($event)" [(ngModel)]="codeEditorText" [options]="editorOptions"></ngx-monaco-editor>
|
||||
|
||||
<div class="mt-24">
|
||||
@for (comment of conversation(); track comment) {
|
||||
<div class="comment">
|
||||
<div class="comment-details-wrapper">
|
||||
<div [matTooltipPosition]="'above'" [matTooltip]="comment.date | date: 'exactDate'" class="small-label">
|
||||
{{ comment.date | date: 'sophisticatedDate' }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pre class="text-auto">{{ comment.text }}</pre>
|
||||
<div [class.collapsed]="collapsed()" class="right-container flex-column">
|
||||
<div class="collapsed-wrapper">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="collapsible; context: { action: 'expand', tooltip: ('copilot' | translate) }"
|
||||
></ng-container>
|
||||
<div class="all-caps-label" translate="dossier-details.title"></div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<iqser-input-with-action
|
||||
(action)="add($event)"
|
||||
[placeholder]="'comments.add-comment' | translate"
|
||||
autocomplete="off"
|
||||
icon="iqser:collapse"
|
||||
width="full"
|
||||
></iqser-input-with-action>
|
||||
<div class="header-wrapper flex mt-8">
|
||||
<div class="heading-xl flex-1" id="dossierDetailsDossierName">Copilot</div>
|
||||
<ng-container
|
||||
*ngTemplateOutlet="collapsible; context: { action: 'collapse', tooltip: ('copilot' | translate) }"
|
||||
></ng-container>
|
||||
</div>
|
||||
|
||||
<div class="mt-24">
|
||||
@for (comment of responses$ | async; track comment) {
|
||||
<div class="comment">
|
||||
<div class="comment-details-wrapper">
|
||||
<div [matTooltipPosition]="'above'" [matTooltip]="comment.date | date: 'exactDate'" class="small-label">
|
||||
{{ comment.date | date: 'sophisticatedDate' }}
|
||||
</div>
|
||||
|
||||
<!-- <div class="comment-actions">-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div>{{ comment.text }}</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<iqser-input-with-action
|
||||
(action)="add($event)"
|
||||
[placeholder]="'comments.add-comment' | translate"
|
||||
autocomplete="off"
|
||||
icon="iqser:collapse"
|
||||
width="full"
|
||||
></iqser-input-with-action>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #collapsible let-action="action" let-tooltip="tooltip">
|
||||
<iqser-circle-button
|
||||
(action)="collapsed.set(!collapsed())"
|
||||
[icon]="'iqser:' + action"
|
||||
[tooltipPosition]="IqserTooltipPositions.before"
|
||||
[tooltip]="tooltip"
|
||||
></iqser-circle-button>
|
||||
</ng-template>
|
||||
|
||||
<div *ngIf="changed && permissionsService.canEditRules() && !isLeaving" class="changes-box">
|
||||
<div (click)="goToErrors()" *ngIf="numberOfErrors() || numberOfWarnings()" class="errors">
|
||||
<span>
|
||||
<mat-icon *ngIf="numberOfErrors()" [svgIcon]="'iqser:alert-circle'" class="icon"></mat-icon>
|
||||
<div class="found-errors">
|
||||
<span
|
||||
*ngIf="numberOfErrors()"
|
||||
[translateParams]="{ errors: numberOfErrors() }"
|
||||
[translate]="translations[type()]['errors-found']"
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
*ngIf="numberOfWarnings()"
|
||||
[class.only-warning]="!numberOfErrors()"
|
||||
[translateParams]="{ warnings: numberOfWarnings() }"
|
||||
[translate]="translations[type()]['warnings-found']"
|
||||
class="warning"
|
||||
></span>
|
||||
</div>
|
||||
</span>
|
||||
<mat-icon [svgIcon]="'iqser:expand'" class="icon face-up"></mat-icon>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[label]="translations[type()]['save-changes'] | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
icon="iqser:check"
|
||||
></iqser-icon-button>
|
||||
|
||||
<div (click)="revert()" [translate]="translations[type()]['revert-changes']" class="all-caps-label cancel"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rules-logger" [class.collapsed]="isLogCollapsed">
|
||||
<div class="logger-header" (click)="toggleLogCollapse()">
|
||||
<h3>Rules Log</h3>
|
||||
<button class="collapse-button">
|
||||
<!--todo: add proper icon -->
|
||||
<mat-icon>{{ isLogCollapsed ? 'x' : 'x' }}</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="logger-messages" *ngIf="!isLogCollapsed">
|
||||
<div *ngFor="let msg of messages" class="log-entry">
|
||||
<div class="log-header">
|
||||
<span class="log-level">{{ msg.logLevel }}</span>
|
||||
<span class="log-time">{{ msg.parsedTimeStamp | date: 'short' }}</span>
|
||||
</div>
|
||||
<div class="log-message">
|
||||
{{ msg.message }}
|
||||
</div>
|
||||
<div class="log-details">
|
||||
<!--todo: add translation -->
|
||||
<div><strong>Tenant ID:</strong> {{ msg.tenantId }}</div>
|
||||
<div><strong>File ID:</strong> {{ msg.fileId }}</div>
|
||||
<div><strong>Dossier ID:</strong> {{ msg.dossierId }}</div>
|
||||
<div><strong>Rule Version:</strong> {{ msg.ruleVersion }}</div>
|
||||
<div><strong>Analysis Number:</strong> {{ msg.analysisNumber }}</div>
|
||||
<div><strong>Timestamp:</strong> {{ msg.parsedTimeStamp }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #collapsible let-action="action" let-tooltip="tooltip">
|
||||
<iqser-circle-button
|
||||
(action)="toggleCollapse()"
|
||||
[icon]="'iqser:' + action"
|
||||
[tooltipPosition]="IqserTooltipPositions.before"
|
||||
[tooltip]="tooltip"
|
||||
></iqser-circle-button>
|
||||
</ng-template>
|
||||
|
||||
<div *ngIf="changed && permissionsService.canEditRules() && !isLeaving" class="changes-box">
|
||||
<div (click)="goToErrors()" *ngIf="numberOfErrors() || numberOfWarnings()" class="errors">
|
||||
<span>
|
||||
<mat-icon *ngIf="numberOfErrors()" [svgIcon]="'iqser:alert-circle'" class="icon"></mat-icon>
|
||||
<div class="found-errors">
|
||||
<span
|
||||
*ngIf="numberOfErrors()"
|
||||
[translateParams]="{ errors: numberOfErrors() }"
|
||||
[translate]="translations[type()]['errors-found']"
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
*ngIf="numberOfWarnings()"
|
||||
[class.only-warning]="!numberOfErrors()"
|
||||
[translateParams]="{ warnings: numberOfWarnings() }"
|
||||
[translate]="translations[type()]['warnings-found']"
|
||||
class="warning"
|
||||
></span>
|
||||
</div>
|
||||
</span>
|
||||
<mat-icon [svgIcon]="'iqser:expand'" class="icon face-up"></mat-icon>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[label]="translations[type()]['save-changes'] | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
icon="iqser:check"
|
||||
></iqser-icon-button>
|
||||
|
||||
<div (click)="revert()" [translate]="translations[type()]['revert-changes']" class="all-caps-label cancel"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -84,7 +84,7 @@ ngx-monaco-editor {
|
||||
|
||||
.right-container {
|
||||
display: flex;
|
||||
width: 750px;
|
||||
width: 375px;
|
||||
min-width: 375px;
|
||||
padding: 16px 24px 16px 24px;
|
||||
|
||||
@ -97,6 +97,93 @@ ngx-monaco-editor {
|
||||
}
|
||||
}
|
||||
|
||||
.text-auto {
|
||||
text-wrap: auto;
|
||||
.rules-screen-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh; /* Adjust based on your layout */
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.rules-logger {
|
||||
flex-shrink: 0;
|
||||
transition: max-height 0.3s ease;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid #ccc;
|
||||
background-color: #fafafa;
|
||||
|
||||
&.collapsed {
|
||||
max-height: 50px; /* Height of the header when collapsed */
|
||||
}
|
||||
|
||||
&:not(.collapsed) {
|
||||
max-height: 300px; /* Maximum height when expanded */
|
||||
}
|
||||
|
||||
.logger-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.collapse-button {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
|
||||
mat-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.logger-messages {
|
||||
overflow-y: auto;
|
||||
height: calc(100% - 50px); /* Subtract header height */
|
||||
padding: 10px;
|
||||
|
||||
.log-entry {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
.log-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 5px;
|
||||
|
||||
.log-level {
|
||||
font-weight: bold;
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.log-time {
|
||||
font-size: 0.9em;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.log-message {
|
||||
margin-bottom: 5px;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.log-details {
|
||||
font-size: 0.9em;
|
||||
color: #666;
|
||||
|
||||
div {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,5 @@
|
||||
import { NgIf, NgTemplateOutlet, TitleCasePipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
computed,
|
||||
DestroyRef,
|
||||
inject,
|
||||
input,
|
||||
OnInit,
|
||||
signal,
|
||||
viewChild,
|
||||
} from '@angular/core';
|
||||
import { AsyncPipe, NgForOf, NgIf, NgTemplateOutlet } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, computed, inject, input, OnInit, signal } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
@ -18,6 +7,7 @@ import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import { TenantsService } from '@common-ui/tenants';
|
||||
import { getCurrentUser } from '@common-ui/users';
|
||||
import { NamePipe } from '@common-ui/users/name.pipe';
|
||||
import { ComponentCanDeactivate } from '@guards/can-deactivate.guard';
|
||||
import { CircleButtonComponent, IconButtonComponent, IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { Debounce, IqserTooltipPositions } from '@iqser/common-ui/lib/utils';
|
||||
@ -28,13 +18,14 @@ import { CopilotService } from '@services/copilot.service';
|
||||
import { EditorThemeService } from '@services/editor-theme.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { BehaviorSubject, firstValueFrom } from 'rxjs';
|
||||
import { RulesService } from '../../../services/rules.service';
|
||||
import { rulesScreenTranslations } from '../../../translations/rules-screen-translations';
|
||||
import ICodeEditor = monaco.editor.ICodeEditor;
|
||||
import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration;
|
||||
import IStandaloneEditorConstructionOptions = monaco.editor.IStandaloneEditorConstructionOptions;
|
||||
import { RulesLoggerService } from '@services/rules-logger.service';
|
||||
import { ScrollingModule } from '@angular/cdk/scrolling';
|
||||
|
||||
interface SyntaxError {
|
||||
line: number;
|
||||
@ -49,27 +40,26 @@ interface UploadResponse {
|
||||
deprecatedWarnings: SyntaxError[];
|
||||
}
|
||||
|
||||
export const SentenceTypes = {
|
||||
question: 'question',
|
||||
answer: 'answer',
|
||||
} as const;
|
||||
|
||||
export type SentenceType = keyof typeof SentenceTypes;
|
||||
|
||||
interface Sentence {
|
||||
text: string | null;
|
||||
date: string;
|
||||
type: SentenceType;
|
||||
interface RulesLogMessage {
|
||||
tenantId: string;
|
||||
fileId: string;
|
||||
dossierId: string;
|
||||
dossierTemplateId: string;
|
||||
ruleVersion: number;
|
||||
analysisNumber: number;
|
||||
timeStamp: string;
|
||||
logLevel: string;
|
||||
message: string;
|
||||
parsedTimeStamp?: Date;
|
||||
}
|
||||
|
||||
const endingSentence: Sentence = { text: null, date: new Date().toISOString(), type: SentenceTypes.answer };
|
||||
|
||||
const RULE_VALIDATION_TIMEOUT = 2000;
|
||||
|
||||
@Component({
|
||||
templateUrl: './rules-screen.component.html',
|
||||
styleUrls: ['./rules-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
MonacoEditorModule,
|
||||
MatIcon,
|
||||
@ -77,12 +67,15 @@ const RULE_VALIDATION_TIMEOUT = 2000;
|
||||
IconButtonComponent,
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
CircleButtonComponent,
|
||||
InputWithActionComponent,
|
||||
MatTooltip,
|
||||
AsyncPipe,
|
||||
NgTemplateOutlet,
|
||||
CircleButtonComponent,
|
||||
DatePipe,
|
||||
TitleCasePipe,
|
||||
InputWithActionComponent,
|
||||
NamePipe,
|
||||
NgForOf,
|
||||
MatTooltip,
|
||||
ScrollingModule,
|
||||
],
|
||||
})
|
||||
export default class RulesScreenComponent implements OnInit, ComponentCanDeactivate {
|
||||
@ -92,14 +85,13 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
readonly #errors = signal<SyntaxError[]>([]);
|
||||
#ruleValidationTimeout: number = null;
|
||||
readonly #copilotService = inject(CopilotService);
|
||||
readonly #rulesLoggerService = inject(RulesLoggerService);
|
||||
readonly #currentUser = getCurrentUser();
|
||||
readonly #conversation = signal<Sentence[]>([endingSentence]);
|
||||
protected readonly collapsed = signal(true);
|
||||
protected readonly IqserTooltipPositions = IqserTooltipPositions;
|
||||
readonly dossierTemplateId = input.required<string>();
|
||||
readonly translations = rulesScreenTranslations;
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly inputWithAction = viewChild(InputWithActionComponent);
|
||||
readonly editorOptions: IStandaloneEditorConstructionOptions = {
|
||||
theme: 'vs',
|
||||
language: 'java',
|
||||
@ -111,10 +103,12 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
initialLines: string[] = [];
|
||||
currentLines: string[] = [];
|
||||
isLeaving = false;
|
||||
messages: RulesLogMessage[] = [];
|
||||
readonly type = input.required<IRules['ruleFileType']>();
|
||||
readonly numberOfErrors = computed(() => this.#errors().filter(e => !e.warning).length);
|
||||
readonly numberOfWarnings = computed(() => this.#errors().filter(e => e.warning).length);
|
||||
readonly conversation = computed(() => this.#conversation().filter(r => !!r.text));
|
||||
readonly responses$ = new BehaviorSubject<{ text: string; date: string }[]>([]);
|
||||
isLogCollapsed = true;
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
@ -126,28 +120,31 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
) {
|
||||
const username = this.#currentUser.id;
|
||||
const tenant = inject(TenantsService).activeTenantId;
|
||||
inject(DestroyRef).onDestroy(() => this.#copilotService.deactivate());
|
||||
this.#copilotService
|
||||
.listen<{ token?: string }>('/user/' + username + '/queue/' + tenant + '/rules-copilot')
|
||||
.pipe(
|
||||
takeUntilDestroyed(),
|
||||
map(res => res?.token),
|
||||
)
|
||||
.subscribe(token => {
|
||||
if (token === null) {
|
||||
this.#conversation.update(responses => [...responses, { ...endingSentence }]);
|
||||
return;
|
||||
}
|
||||
this.#conversation.update(responses => {
|
||||
const last = responses.pop();
|
||||
return [...responses, { ...last, text: (last.text ?? '') + token }];
|
||||
});
|
||||
.listen('/user/' + username + '/queue/' + tenant + '/rules-copilot')
|
||||
.pipe(takeUntilDestroyed())
|
||||
.subscribe(response => {
|
||||
console.log('WS response: ' + response);
|
||||
});
|
||||
|
||||
this.#copilotService.publish({
|
||||
destination: '/app/rules-copilot',
|
||||
body: JSON.stringify({ prompts: ['manageradmin'] }),
|
||||
});
|
||||
|
||||
this.#rulesLoggerService
|
||||
.listen<RulesLogMessage>('/topic/' + tenant + '/rule-log-events')
|
||||
.pipe(takeUntilDestroyed())
|
||||
.subscribe(message => {
|
||||
message.parsedTimeStamp = this.parseTimestamp(message.timeStamp);
|
||||
this.messages.push(message);
|
||||
this._changeDetectorRef.detectChanges();
|
||||
});
|
||||
}
|
||||
|
||||
set isLeavingPage(isLeaving: boolean) {
|
||||
this.isLeaving = isLeaving;
|
||||
this._changeDetectorRef.markForCheck();
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
get changed(): boolean {
|
||||
@ -165,23 +162,13 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
this.#closeProblemsView();
|
||||
}
|
||||
|
||||
toggleCollapse() {
|
||||
this.collapsed.update(collapsed => !collapsed);
|
||||
if (this.#conversation().length === 1) {
|
||||
this.#copilotService.send('Hello!');
|
||||
}
|
||||
}
|
||||
|
||||
add(question: string) {
|
||||
this.#conversation.update(responses => {
|
||||
const last = responses.pop();
|
||||
last.text = question;
|
||||
last.type = SentenceTypes.question;
|
||||
last.date = new Date().toISOString();
|
||||
return [...responses, last, { ...endingSentence }];
|
||||
console.log(question);
|
||||
this.responses$.next([...this.responses$.value, { text: question, date: new Date().toISOString() }]);
|
||||
this.#copilotService.publish({
|
||||
destination: '/app/rules-copilot',
|
||||
body: JSON.stringify({ prompts: [question] }),
|
||||
});
|
||||
this.inputWithAction().reset();
|
||||
this.#copilotService.send(question);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
@ -209,7 +196,7 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
}
|
||||
(window as any).monaco.editor.setTheme(this._editorThemeService.getTheme(true));
|
||||
await this.#configureSyntaxHighlighting();
|
||||
this._changeDetectorRef.markForCheck();
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
@Debounce()
|
||||
@ -233,7 +220,7 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
this.currentLines = this.initialLines;
|
||||
this.#decorations = this.#codeEditor?.deltaDecorations(this.#decorations, []) || [];
|
||||
this.#removeErrorMarkers();
|
||||
this._changeDetectorRef.markForCheck();
|
||||
this._changeDetectorRef.detectChanges();
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
@ -391,4 +378,23 @@ export default class RulesScreenComponent implements OnInit, ComponentCanDeactiv
|
||||
() => this._loadingService.stop(),
|
||||
);
|
||||
}
|
||||
|
||||
parseTimestamp(timestamp: string): Date {
|
||||
let adjustedTimestamp = timestamp.replace('Z', '');
|
||||
|
||||
const dotIndex = adjustedTimestamp.indexOf('.');
|
||||
if (dotIndex !== -1) {
|
||||
adjustedTimestamp = adjustedTimestamp.substring(0, dotIndex);
|
||||
}
|
||||
|
||||
return new Date(adjustedTimestamp);
|
||||
}
|
||||
|
||||
trackByMessageId(index: number, msg: RulesLogMessage): string {
|
||||
return msg.timeStamp; // Assuming timeStamp is unique
|
||||
}
|
||||
|
||||
toggleLogCollapse() {
|
||||
this.isLogCollapsed = !this.isLogCollapsed;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,6 +46,7 @@ function configToFilter({ key, label }: DonutChartConfig) {
|
||||
entitiesService: UserService,
|
||||
component: UserListingScreenComponent,
|
||||
}),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
@ -125,7 +126,7 @@ export class UserListingScreenComponent extends ListingComponent<User> implement
|
||||
|
||||
getDisplayRoles(user: User) {
|
||||
const oldRedRoles = user.roles.filter(role => role.startsWith('RED_'));
|
||||
const translatedRoles = oldRedRoles.map(role => this._translateService.instant(this.translations[role], { count: 1 }));
|
||||
const translatedRoles = oldRedRoles.map(role => this._translateService.instant(this.translations[role]));
|
||||
return translatedRoles.join(', ') || this._translateService.instant(this.translations['NO_ROLE']);
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
selector: 'redaction-paginator',
|
||||
templateUrl: './paginator.component.html',
|
||||
styleUrls: ['./paginator.component.scss'],
|
||||
standalone: true,
|
||||
imports: [MatIcon, TranslateModule],
|
||||
})
|
||||
export class PaginatorComponent {
|
||||
|
||||
@ -74,6 +74,7 @@ interface WatermarkForm {
|
||||
@Component({
|
||||
templateUrl: './watermark-screen.component.html',
|
||||
styleUrls: ['./watermark-screen.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
PaginatorComponent,
|
||||
NgIf,
|
||||
@ -82,9 +83,9 @@ interface WatermarkForm {
|
||||
AsyncPipe,
|
||||
ReactiveFormsModule,
|
||||
HasScrollbarDirective,
|
||||
MatTooltip,
|
||||
NgForOf,
|
||||
NgClass,
|
||||
MatTooltip,
|
||||
MatIcon,
|
||||
MatSlider,
|
||||
ColorPickerModule,
|
||||
@ -245,15 +246,14 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
async #loadViewer() {
|
||||
this.instance = await WebViewer.Iframe(
|
||||
this.instance = await WebViewer(
|
||||
{
|
||||
licenseKey: this._licenseService.activeLicenseKey,
|
||||
path: this.#convertPath('/assets/wv-resources/11.1.0'),
|
||||
path: this.#convertPath('/assets/wv-resources/10.10.1'),
|
||||
css: this.#convertPath('/assets/pdftron/stylesheet.css'),
|
||||
fullAPI: true,
|
||||
isReadOnly: true,
|
||||
backendType: 'ems',
|
||||
ui: 'legacy',
|
||||
},
|
||||
// use nativeElement instead of document.getElementById('viwer')
|
||||
// because WebViewer works better with this approach
|
||||
@ -269,7 +269,7 @@ export class WatermarkScreenComponent implements OnInit {
|
||||
});
|
||||
|
||||
if (environment.production) {
|
||||
this.instance.Core.setCustomFontURL(window.location.origin + this.#convertPath('/assets/pdftron/fonts'));
|
||||
this.instance.Core.setCustomFontURL('https://' + window.location.host + this.#convertPath('/assets/pdftron'));
|
||||
}
|
||||
|
||||
this.#disableElements();
|
||||
|
||||
@ -31,6 +31,7 @@ import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
templateUrl: './watermarks-listing-screen.component.html',
|
||||
styleUrls: ['./watermarks-listing-screen.component.scss'],
|
||||
providers: listingProvidersFactory(WatermarksListingScreenComponent),
|
||||
standalone: true,
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user