From 5e551cd4ef0f2a86b1d009d5b6f632cd0b905b03 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 12:57:25 +0300 Subject: [PATCH 1/9] frontend code clean up --- .../file-transformer/file-transformer.http.service.ts | 2 -- ...cription-template-editor-section-fieldset.component.ts | 3 +-- .../admin/language/listing/language-listing.component.ts | 1 - .../listing/prefilling-source-listing.component.ts | 1 - .../listing/reference-type-listing.component.ts | 2 -- .../ui/admin/tenant/listing/tenant-listing.component.ts | 1 - .../annotation-dialog.component.ts | 7 ------- frontend/src/app/ui/auth/login/login.routing.ts | 5 ----- frontend/src/app/ui/auth/logout/logout.component.ts | 1 - .../description-copy-dialog.component.ts | 2 +- .../ui/description/editor/description-editor.component.ts | 4 +--- .../components/form-field/form-field.component.ts | 8 ++++---- .../components/form-section/form-section.component.ts | 4 ---- .../ui/description/listing/description-listing.routing.ts | 1 - .../listing-item/description-listing-item.component.ts | 2 -- frontend/src/app/ui/plan/listing/plan-listing.routing.ts | 1 - 16 files changed, 7 insertions(+), 38 deletions(-) diff --git a/frontend/src/app/core/services/file-transformer/file-transformer.http.service.ts b/frontend/src/app/core/services/file-transformer/file-transformer.http.service.ts index 0c6f1a3c6..bcbd719d7 100644 --- a/frontend/src/app/core/services/file-transformer/file-transformer.http.service.ts +++ b/frontend/src/app/core/services/file-transformer/file-transformer.http.service.ts @@ -26,13 +26,11 @@ export class FileTransformerHttpService extends BaseService { } exportPlan(planId: Guid, repositoryId: string, format: string): Observable { - //TODO: implement const url = `${this.apiBase}/export-plan`; return this.http.post(url, {id: planId, repositoryId: repositoryId, format: format}, {responseType: 'blob', observe: 'response'}).pipe(catchError((error: any) => throwError(error))); } exportDescription(id: Guid, repositoryId: string, format: string): Observable { - //TODO: implement const url = `${this.apiBase}/export-description`; return this.http.post(url, {id: id, repositoryId: repositoryId, format: format}, {responseType: 'blob', observe: 'response'}).pipe(catchError((error: any) => throwError(error))); } diff --git a/frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts b/frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts index 9e204735f..a860836f1 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts +++ b/frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts @@ -138,8 +138,7 @@ export class DescriptionTemplateEditorSectionFieldSetComponent implements OnInit this._selectedFieldSetId = this.tocentry.id; this.scroller.next(this.tocentry.id); - } else {//scroll on top - // this._scrollOnTop(); + } else { this.scroller.next(null); } } diff --git a/frontend/src/app/ui/admin/language/listing/language-listing.component.ts b/frontend/src/app/ui/admin/language/listing/language-listing.component.ts index 250beb84d..2b819039c 100644 --- a/frontend/src/app/ui/admin/language/listing/language-listing.component.ts +++ b/frontend/src/app/ui/admin/language/listing/language-listing.component.ts @@ -33,7 +33,6 @@ export class LanguageListingComponent extends BaseListingComponent; @ViewChild('actions', { static: true }) actions?: TemplateRef; @ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent; diff --git a/frontend/src/app/ui/admin/prefilling-source/listing/prefilling-source-listing.component.ts b/frontend/src/app/ui/admin/prefilling-source/listing/prefilling-source-listing.component.ts index 282a37c0d..3195c4a97 100644 --- a/frontend/src/app/ui/admin/prefilling-source/listing/prefilling-source-listing.component.ts +++ b/frontend/src/app/ui/admin/prefilling-source/listing/prefilling-source-listing.component.ts @@ -33,7 +33,6 @@ export class PrefillingSourceListingComponent extends BaseListingComponent; @ViewChild('actions', { static: true }) actions?: TemplateRef; @ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent; diff --git a/frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.ts b/frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.ts index b76619c73..da50ea322 100644 --- a/frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.ts +++ b/frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.ts @@ -32,9 +32,7 @@ export class ReferenceTypeListingComponent extends BaseListingComponent; @ViewChild('actions', { static: true }) actions?: TemplateRef; @ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent; diff --git a/frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.ts b/frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.ts index 1a1e48f77..e0e03b55b 100644 --- a/frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.ts +++ b/frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.ts @@ -33,7 +33,6 @@ export class TenantListingComponent extends BaseListingComponent; @ViewChild('actions', { static: true }) actions?: TemplateRef; @ViewChild(HybridListingComponent, { static: true }) hybridListingComponent: HybridListingComponent; diff --git a/frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts b/frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts index 027d0b183..52ae223c2 100644 --- a/frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts +++ b/frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts @@ -113,7 +113,6 @@ export class AnnotationDialogComponent extends BaseComponent { } replyThread(threadId: Guid) { - // if (!this.threadReplyTexts[threadId.toString()] || this.threadReplyTexts[threadId.toString()].length === 0) { return; } this.formService.removeAllBackEndErrors(this.threadReplyTextsFG[threadId.toString()]); this.formService.touchAllFormFields(this.threadReplyTextsFG[threadId.toString()]); if (!this.isFormValid(this.threadReplyTextsFG[threadId.toString()])) { @@ -178,7 +177,6 @@ export class AnnotationDialogComponent extends BaseComponent { this.resetFormGroup(); this.comments = data.items.sort((a1, a2) => new Date(a2.timeStamp).getTime() - new Date(a1.timeStamp).getTime()); this.comments.forEach(element => { - // this.threadReplyTextsFG.addControl(element.id.toString(), new FormControl(null)); this.threadReplyTextsFG[element.threadId.toString()] = this.formBuilder.group({ replyText: new FormControl(null, [Validators.required]) }); this.annotationsPerThread[element.threadId.toString()] = data.items.filter(x => x.threadId === element.threadId && x.id !== element.id).sort((a1, a2) => new Date(a1.timeStamp).getTime() - new Date(a2.timeStamp).getTime()); this.parentAnnotationsPerThread[element.threadId.toString()] = data.items.filter(x => x.threadId === element.threadId && x.id === element.id)[0]; @@ -257,11 +255,6 @@ export class AnnotationDialogComponent extends BaseComponent { this.dialogRef.close(this.changesMade); } - startWizard() { // not used - this.router.navigate([this.routerUtils.generateUrl('/plans/new')]); - this.close(); - } - showReplies(threadId: string): void { this.showRepliesPerThread[threadId] = true; } diff --git a/frontend/src/app/ui/auth/login/login.routing.ts b/frontend/src/app/ui/auth/login/login.routing.ts index ef810dd29..05ca35964 100644 --- a/frontend/src/app/ui/auth/login/login.routing.ts +++ b/frontend/src/app/ui/auth/login/login.routing.ts @@ -5,7 +5,6 @@ import { MergeEmailConfirmation } from './merge-email-confirmation/merge-email-c import { UnlinkEmailConfirmation } from './unlink-email-confirmation/unlink-email-confirmation.component'; import { AuthGuard } from '@app/core/auth-guard.service'; import { UserInviteConfirmation } from './user-invite-confirmation/user-invite-confirmation.component'; -// import { PostLoginComponent } from './post-login/post-login.component'; const routes: Routes = [ { path: '', component: LoginComponent }, @@ -14,10 +13,6 @@ const routes: Routes = [ component: MergeEmailConfirmation, canActivate: [AuthGuard] }, - // { - // path: 'post', - // component: PostLoginComponent - // }, { path: 'unlink/confirmation/:token', component: UnlinkEmailConfirmation }, { path: 'invitation/confirmation/:token', component: UserInviteConfirmation }, diff --git a/frontend/src/app/ui/auth/logout/logout.component.ts b/frontend/src/app/ui/auth/logout/logout.component.ts index 483613234..02cc0fb4d 100644 --- a/frontend/src/app/ui/auth/logout/logout.component.ts +++ b/frontend/src/app/ui/auth/logout/logout.component.ts @@ -16,7 +16,6 @@ export class LogoutComponent implements OnInit { this.authService.clear(); this.keycloak.logout(location.origin).then(() => { localStorage.clear(); - // this.router.navigate(['./'], { replaceUrl: true }); }); } } diff --git a/frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts b/frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts index 0e81ada00..dd9b5d597 100644 --- a/frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts +++ b/frontend/src/app/ui/description/description-copy-dialog/description-copy-dialog.component.ts @@ -31,7 +31,7 @@ export class DescriptionCopyDialogComponent { sections: PlanBlueprintDefinitionSection[] = []; descriptionDescriptionTemplateLabel: String; - planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { //TODO: add filter to only get plans that have connection with the same Description Template group. + planAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { initialItems: (data?: any) => this.planService.query(this.buildPlanLookup(null,null,null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.planService.query(this.buildPlanLookup(searchQuery, null, null, this.planDescriptionTemplateLookup)).pipe(map(x => x.items)), getSelectedItem: (selectedItem: any) => this.planService.query(this.buildPlanLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), diff --git a/frontend/src/app/ui/description/editor/description-editor.component.ts b/frontend/src/app/ui/description/editor/description-editor.component.ts index 319eaf744..3700ef61a 100644 --- a/frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/frontend/src/app/ui/description/editor/description-editor.component.ts @@ -501,7 +501,6 @@ export class DescriptionEditorComponent extends BaseEditor { if (key === 'required') { - // errors.push(this.language.instant(name + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); if (name == 'label') errors.push(this.language.instant(this.language.instant('DESCRIPTION-EDITOR.BASE-INFO.FIELDS.TITLE') + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); else if (name == 'descriptionTemplateId') errors.push(this.language.instant(this.language.instant('DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION-TEMPLATE') + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } @@ -539,7 +538,7 @@ export class DescriptionEditorComponent extends BaseEditor this.getNestedSectionIdsByField(subsection, fieldSetId)) if (subNestedSectionIds.length > 0) return [section.id, ...subNestedSectionIds]; - // return [section.id, ...section.sections.flatMap((subsection: DescriptionTemplateSection) => this.getNestedSectionIdsByField(subsection, fieldSetId))]; } else if (section.fieldSets.find(fieldSet => fieldSet.id == fieldSetId)) return [section.id]; diff --git a/frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts b/frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts index 29f0dcd41..bee984270 100644 --- a/frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts +++ b/frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts @@ -241,7 +241,7 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn let messages: string[] = []; if (this.filesToUpload.length == 0) { - messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.NO-FILES-SELECTED')); // fix + messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.NO-FILES-SELECTED')); return; } else { let fileToUpload = this.filesToUpload[0]; @@ -253,9 +253,9 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn this.upload(); } else { this.filesToUpload = null; - messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.LARGE-FILE-OR-UNACCEPTED-TYPE')); // fix - messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-UPLOAD-MAX-FILE-SIZE', { 'maxfilesize': data.maxFileSizeInMB })); // fix FIELD-UPLOAD-MAX-FILE-SIZE - messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.ACCEPTED-FILE-TRANSFOMER') + data.types.map(type => type.value).join(", ")); // fix + messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.LARGE-FILE-OR-UNACCEPTED-TYPE')); + messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-UPLOAD-MAX-FILE-SIZE', { 'maxfilesize': data.maxFileSizeInMB })); + messages.push(this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.ACCEPTED-FILE-TRANSFOMER') + data.types.map(type => type.value).join(", ")); } if (messages && messages.length > 0) { diff --git a/frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts b/frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts index bbbe82951..e2b43f9e3 100644 --- a/frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts +++ b/frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.ts @@ -27,10 +27,6 @@ export class DescriptionFormSectionComponent extends BaseComponent implements On @Input() path: string; @Input() descriptionId: Guid; @Input() planUsers: PlanUser[] = []; - - - // @Input() descriptionTemplateId: String; - // @Input() form: UntypedFormGroup; @Input() tocentry: ToCEntry; @Input() pathName: string; @Input() linkToScroll: LinkToScroll; diff --git a/frontend/src/app/ui/description/listing/description-listing.routing.ts b/frontend/src/app/ui/description/listing/description-listing.routing.ts index 5df456f55..d998841fd 100644 --- a/frontend/src/app/ui/description/listing/description-listing.routing.ts +++ b/frontend/src/app/ui/description/listing/description-listing.routing.ts @@ -7,7 +7,6 @@ const routes: Routes = [ { path: '', component: DescriptionListingComponent, - // canActivate: [AuthGuard], data: { breadcrumb: true }, diff --git a/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts b/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts index f64415366..23d72ef42 100644 --- a/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts +++ b/frontend/src/app/ui/description/listing/listing-item/description-listing-item.component.ts @@ -134,8 +134,6 @@ export class DescriptionListingItemComponent extends BaseComponent implements On openShareDialog() { // TODO: This is a shared component. Put it in a seperate module. const dialogRef = this.dialog.open(PlanInvitationDialogComponent, { - // height: '250px', - // width: '700px', autoFocus: false, restoreFocus: false, data: { diff --git a/frontend/src/app/ui/plan/listing/plan-listing.routing.ts b/frontend/src/app/ui/plan/listing/plan-listing.routing.ts index 937f41a25..41c38e15d 100644 --- a/frontend/src/app/ui/plan/listing/plan-listing.routing.ts +++ b/frontend/src/app/ui/plan/listing/plan-listing.routing.ts @@ -6,7 +6,6 @@ const routes: Routes = [ { path: '', component: PlanListingComponent, - // canActivate: [AuthGuard], data: { breadcrumb: true }, From d7277e990cc2ae518ab551b425bb3d490b40bb01 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 13:46:01 +0300 Subject: [PATCH 2/9] frontend code clean up --- frontend/src/app/core/model/plan/plan.ts | 4 ++-- .../description-template-editor-default-value.component.html | 1 - ...emplate-editor-label-and-multiplicity-field.component.html | 1 - .../field/description-template-editor-field.component.html | 1 - .../editor/description-template-editor.component.html | 3 --- frontend/src/index.html | 2 -- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/core/model/plan/plan.ts b/frontend/src/app/core/model/plan/plan.ts index 49e126cc0..efc5c811b 100644 --- a/frontend/src/app/core/model/plan/plan.ts +++ b/frontend/src/app/core/model/plan/plan.ts @@ -66,8 +66,8 @@ export interface PlanUser extends BaseEntity { export interface PlanDescriptionTemplate extends BaseEntity { plan?: Plan; - currentDescriptionTemplate?: DescriptionTemplate; //TODO: what is this? - descriptionTemplates?: DescriptionTemplate[]; //TODO: why it is array? + currentDescriptionTemplate?: DescriptionTemplate; + descriptionTemplates?: DescriptionTemplate[]; descriptionTemplateGroupId?: Guid; sectionId?: Guid; } diff --git a/frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html b/frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html index 11c9ff54b..9ba23a1f5 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/components/default-value/description-template-editor-default-value.component.html @@ -75,7 +75,6 @@ - {{placeHolder}} diff --git a/frontend/src/app/ui/admin/description-template/editor/components/field-type/label-and-multiplicity-field/description-template-editor-label-and-multiplicity-field.component.html b/frontend/src/app/ui/admin/description-template/editor/components/field-type/label-and-multiplicity-field/description-template-editor-label-and-multiplicity-field.component.html index 505f3850b..3693c6132 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/field-type/label-and-multiplicity-field/description-template-editor-label-and-multiplicity-field.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/components/field-type/label-and-multiplicity-field/description-template-editor-label-and-multiplicity-field.component.html @@ -1,5 +1,4 @@
- {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-MULTIPLE-AUTOCOMPLETE' | translate}} diff --git a/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html b/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html index 8e3f2e5f3..fe5909e3d 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html @@ -46,7 +46,6 @@ - upload {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.UPLOAD)}} diff --git a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html index 096e3e881..bc0abcb5d 100644 --- a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html @@ -32,9 +32,6 @@ - -
diff --git a/frontend/src/index.html b/frontend/src/index.html index 50b68e228..01bec80b2 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -7,10 +7,8 @@ - - From 81092adc1376950c2fad183c098e03231c60da1f Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 14:51:33 +0300 Subject: [PATCH 3/9] frontend code clean up --- frontend/src/app/core/services/auth/auth.service.ts | 3 --- .../core/services/utilities/query-params.service.ts | 4 ---- .../multiple/multiple-auto-complete.component.ts | 9 --------- .../app/library/guided-tour/guided-tour.component.ts | 2 -- .../rich-text-editor/rich-text-editor.component.ts | 6 ------ .../description-template-editor-field.component.ts | 4 ---- .../editor/description-template-editor.component.ts | 2 -- .../editor/table-of-contents/models/toc-entry.ts | 1 - .../table-of-contents/table-of-contents.component.ts | 2 -- .../listing-item/description-listing-item.component.ts | 10 ---------- .../src/app/ui/plan/listing/plan-listing.component.ts | 4 ---- .../app/ui/plan/overview/plan-overview.component.ts | 2 -- .../plan-editor-blueprint/plan-editor.component.ts | 2 +- 13 files changed, 1 insertion(+), 50 deletions(-) diff --git a/frontend/src/app/core/services/auth/auth.service.ts b/frontend/src/app/core/services/auth/auth.service.ts index e6458d6dd..b212e57c7 100644 --- a/frontend/src/app/core/services/auth/auth.service.ts +++ b/frontend/src/app/core/services/auth/auth.service.ts @@ -350,10 +350,7 @@ export class AuthService extends BaseService { onAuthenticateError(errorResponse: HttpErrorResponse) { this.zone.run(() => { - // const error: HttpError = - // this.httpErrorHandlingService.getError(errorResponse); this.uiNotificationService.snackBarNotification( - // error.getMessagesString(), errorResponse.message, SnackBarNotificationLevel.Warning ); diff --git a/frontend/src/app/core/services/utilities/query-params.service.ts b/frontend/src/app/core/services/utilities/query-params.service.ts index 20260db4a..5ce4159ae 100644 --- a/frontend/src/app/core/services/utilities/query-params.service.ts +++ b/frontend/src/app/core/services/utilities/query-params.service.ts @@ -11,8 +11,6 @@ export class QueryParamsService { serializeLookup(lookup: Lookup): string { return JSON.stringify(lookup, (key: string, value: any) => { switch (key) { - // case nameof(x => x.page): - // case nameof(x => x.order): case nameof(x => x.metadata): case nameof(x => x.project): return undefined; @@ -24,8 +22,6 @@ export class QueryParamsService { deSerializeLookup(serializedLookup: string): any { const json = JSON.parse(serializedLookup); - // delete json[nameof(x => x.page)]; - // delete json[nameof(x => x.order)]; delete json[nameof(x => x.metadata)]; delete json[nameof(x => x.project)]; return json; diff --git a/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts b/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts index 0ce1b82a4..ae91dc69b 100644 --- a/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts +++ b/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts @@ -67,8 +67,6 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp valueOnBlur = new BehaviorSubject(null); onSelectAutoCompleteValue = new BehaviorSubject(null); - // valueAssignSubscription: Subscription; - queryValue: string = ""; focused = false; @@ -406,16 +404,9 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp //Chip Functions _addItem(event: MatChipInputEvent): void { const input = event.input; - const value = event.value; - // Add our fruit - // if ((value || '').trim()) { - // this.selectedItems.push(value.trim()); - // } - // Reset the input value if (input) { this.inputValue = ''; } - //this.inputFormControl.setValue(null); } public reset(): void { this._inputSubject.unsubscribe(); diff --git a/frontend/src/app/library/guided-tour/guided-tour.component.ts b/frontend/src/app/library/guided-tour/guided-tour.component.ts index 651975b98..eb094e184 100644 --- a/frontend/src/app/library/guided-tour/guided-tour.component.ts +++ b/frontend/src/app/library/guided-tour/guided-tour.component.ts @@ -337,8 +337,6 @@ export class GuidedTourComponent implements AfterViewInit, OnDestroy { public get overlayTop(): number { if (this.selectedElementRect) { - // return this.selectedElementRect.top - this.getHighlightPadding(); - /*custom add*/ let customTopOffset = 0; if (this.currentTourStep.customTopOffset) { diff --git a/frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts b/frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts index b9c73c95f..ea37ca853 100644 --- a/frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts +++ b/frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts @@ -12,10 +12,6 @@ import { Subscription } from "rxjs"; placeholder="{{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}}" (paste)="pasteWithoutFormatting($event)"> close -
`, styleUrls: ['./rich-text-editor.component.scss'], @@ -68,10 +64,8 @@ export class RichTextEditorComponent implements OnInit, OnChanges, OnDestroy { [ 'fontSize', 'backgroundColor', - // 'customClasses', 'insertImage', 'insertVideo', - // 'removeFormat', 'toggleEditorMode' ], [ diff --git a/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts b/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts index b27793b86..3530d7c6a 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts +++ b/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.ts @@ -212,10 +212,6 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple } this.clearVisibilityRulesValue(); - - // setTimeout(() => { //TODO - // this.showPreview = true; - // }); } diff --git a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts index b6181aa88..436312088 100644 --- a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts +++ b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts @@ -382,8 +382,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor t?.id == id)?.name; } - setIsUserOwner() { - if (this.description) { - const principalId: string = this.authService.userId()?.toString(); - //TODO: add user to description objects - //if (principalId) this.isUserOwner = !!this.description.users.find(x => (x.role === Role.Owner) && (principalId === x.id)); - } - } - isUserPlanRelated() { const principalId: Guid = this.authService.userId(); return this.description.plan.planUsers?.some(x => (x.user.id === principalId)); diff --git a/frontend/src/app/ui/plan/listing/plan-listing.component.ts b/frontend/src/app/ui/plan/listing/plan-listing.component.ts index f4e63082a..124f75ec3 100644 --- a/frontend/src/app/ui/plan/listing/plan-listing.component.ts +++ b/frontend/src/app/ui/plan/listing/plan-listing.component.ts @@ -273,10 +273,6 @@ export class PlanListingComponent extends BaseListingComponent imple // // public isDirty(): boolean { - return this.formGroup && this.formGroup.dirty; //&& this.hasChanges; + return this.formGroup && this.formGroup.dirty; } getLanguageInfos(): LanguageInfo[] { From cccce8de88ca93579e29c35d2cbb3b2be2f8c5c2 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 14:53:25 +0300 Subject: [PATCH 4/9] frontend code clean up --- frontend/src/app/app.component.ts | 12 ------------ frontend/src/app/core/model/plan/plan-import.ts | 2 +- .../core/services/culture/language-info-service.ts | 1 - .../src/app/core/services/matomo/matomo-service.ts | 3 --- .../services/user-settings/user-settings.service.ts | 5 ----- .../multiple/multiple-auto-complete.component.html | 2 -- .../single/single-auto-complete.component.html | 2 -- .../single/single-auto-complete.component.ts | 3 --- .../app/library/deactivate/can-deactivate.guard.ts | 1 - frontend/src/app/services/pagination.service.ts | 1 - ...tion-template-editor-visibility-rule.component.ts | 6 ------ .../editor/description-template-editor.resolver.ts | 2 +- .../filters/lock-listing-filters.component.ts | 4 ---- .../editor/plan-blueprint-editor.component.ts | 1 - .../language/language-content/language.component.ts | 11 ----------- .../http/interceptors/status-code.interceptor.ts | 8 -------- .../expandable-search-field.component.ts | 1 - .../editor/inapp-notification-editor.component.ts | 2 -- .../user-profile-notifier-list-editor.component.ts | 6 ++---- 19 files changed, 4 insertions(+), 69 deletions(-) diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index b8808fd64..4edf2e9aa 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -7,7 +7,6 @@ import { TranslateService } from '@ngx-translate/core'; import { filter, map, switchMap } from 'rxjs/operators'; import { AuthService, LoginStatus } from './core/services/auth/auth.service'; import { CultureService } from './core/services/culture/culture-service'; -// import { BreadCrumbResolverService } from './ui/misc/breadcrumb/service/breadcrumb.service'; import { DomSanitizer, Title } from '@angular/platform-browser'; import { CookieService } from "ngx-cookie-service"; import { NgcCookieConsentService, NgcStatusChangeEvent } from "ngx-cookieconsent"; @@ -34,7 +33,6 @@ declare var $: any; export class AppComponent implements OnInit, AfterViewInit { hasBreadCrumb = observableOf(false); - // sideNavOpen = false; private sideNavSubscription: Subscription; helpContentEnabled: boolean; private statusChangeSubscription: Subscription; @@ -48,7 +46,6 @@ export class AppComponent implements OnInit, AfterViewInit { private route: ActivatedRoute, private authentication: AuthService, private translate: TranslateService, - // private breadCrumbResolverService: BreadCrumbResolverService, private titleService: Title, private cultureService: CultureService, private timezoneService: TimezoneService, @@ -106,16 +103,13 @@ export class AppComponent implements OnInit, AfterViewInit { } onActivate(event: any) { - // this.breadCrumbResolverService.push(event); } onDeactivate(event: any) { - //this.breadCrumbResolverService.clear() } ngOnInit() { if (!this.cookieService.check("cookiesConsent")) { - // this.cookieService.set("cookiesConsent", "false", 356); this.cookieService.set("cookiesConsent", "false", 356, null, null, false, 'Lax'); } @@ -179,16 +173,10 @@ export class AppComponent implements OnInit, AfterViewInit { if (this.authentication.getSelectedTenantName() && this.authentication.getSelectedTenantName() !== '') this.breadcrumbService.addIdResolvedValue(this.authentication.selectedTenant(), this.authentication.getSelectedTenantName()); - - // const enrichedUrl = this.tenantHandlingService.getUrlEnrichedWithTenantCode(event.url, this.authentication.selectedTenant() ?? 'default'); - // if (event.url != enrichedUrl) { - // this.router.navigateByUrl(enrichedUrl); - // } }); this.statusChangeSubscription = this.ccService.statusChange$.subscribe((event: NgcStatusChangeEvent) => { if (event.status == "dismiss") { - // this.cookieService.set("cookiesConsent", "true", 365); this.cookieService.set("cookiesConsent", "true", 356, null, null, false, 'Lax'); } }); diff --git a/frontend/src/app/core/model/plan/plan-import.ts b/frontend/src/app/core/model/plan/plan-import.ts index 25feda261..8b711e24f 100644 --- a/frontend/src/app/core/model/plan/plan-import.ts +++ b/frontend/src/app/core/model/plan/plan-import.ts @@ -8,7 +8,7 @@ export interface PreprocessingPlanModel { preprocessingDescriptionModels: PreprocessingDescriptionModel[]; } -// rda config +// common config export interface PlanCommonModelConfig { fileId: Guid; label: string; diff --git a/frontend/src/app/core/services/culture/language-info-service.ts b/frontend/src/app/core/services/culture/language-info-service.ts index c6ef06823..7dfe8d609 100644 --- a/frontend/src/app/core/services/culture/language-info-service.ts +++ b/frontend/src/app/core/services/culture/language-info-service.ts @@ -65,7 +65,6 @@ export class LanguageInfoService { if (selectedLocale) { registerLocaleData(selectedLocale.default); } else { - // locale = newCulture.code.split('-')[0]; import(`/node_modules/@angular/common/locales/${locale}.mjs`).catch(reason => { this.logger.error('Could not load locale: ' + locale); }).then(selectedDefaultLocale => { diff --git a/frontend/src/app/core/services/matomo/matomo-service.ts b/frontend/src/app/core/services/matomo/matomo-service.ts index 5921401e7..55178ffed 100644 --- a/frontend/src/app/core/services/matomo/matomo-service.ts +++ b/frontend/src/app/core/services/matomo/matomo-service.ts @@ -43,9 +43,6 @@ export class MatomoService { var principalid = this.authService.userId(); if (principalid != null) { this.matomoTracker.setUserId(principalid.toString()); } this.matomoTracker.trackLink(this.configurationService.server + category + "/" + type + "/" + id, "download"); - - // this.matomoTracker.trackLink(url, "download"); - // this.matomoTracker.trackEvent(category, "Downloaded", type); } } } diff --git a/frontend/src/app/core/services/user-settings/user-settings.service.ts b/frontend/src/app/core/services/user-settings/user-settings.service.ts index 1cf18e6d6..13280502f 100644 --- a/frontend/src/app/core/services/user-settings/user-settings.service.ts +++ b/frontend/src/app/core/services/user-settings/user-settings.service.ts @@ -149,11 +149,6 @@ export class UserSettingsService extends BaseService { } return this.userSettingsHttpService.getSingle(userSettingsInformation.key).pipe( - // catchError(() => { - // const result: UserSettings = this.defaultValue(userSettingsInformation); - // this.persistUserSettings(userSettingsInformation.key, result, userSettingsInformation, false); - // return observableOf(result); - // }), map(x => { const result: UserSettings = (x ? this.toTypedUserSettings(x as UserSettingsObject) : null); this.persistUserSettings(userSettingsInformation.key, result, userSettingsInformation, false); diff --git a/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html b/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html index b817622f1..4d025718b 100644 --- a/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html +++ b/frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html @@ -26,7 +26,6 @@ - @@ -59,7 +58,6 @@
- diff --git a/frontend/src/app/library/auto-complete/single/single-auto-complete.component.html b/frontend/src/app/library/auto-complete/single/single-auto-complete.component.html index bb9cfcb5b..631b2bf9a 100644 --- a/frontend/src/app/library/auto-complete/single/single-auto-complete.component.html +++ b/frontend/src/app/library/auto-complete/single/single-auto-complete.component.html @@ -8,7 +8,6 @@ - @@ -29,7 +28,6 @@
- diff --git a/frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts b/frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts index 7e2295771..212f31722 100644 --- a/frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts +++ b/frontend/src/app/library/auto-complete/single/single-auto-complete.component.ts @@ -375,7 +375,4 @@ export class SingleAutoCompleteComponent extends _CustomComponentMixinBase imple this.configuration.valueAssign != null ? this.configuration.valueAssign(item) : item ) } - // get forceFocus(): boolean { - // return this.configuration.forceFocus != null ? this.configuration.forceFocus : false; - // } } diff --git a/frontend/src/app/library/deactivate/can-deactivate.guard.ts b/frontend/src/app/library/deactivate/can-deactivate.guard.ts index 8e6df7ff9..d35a8308a 100644 --- a/frontend/src/app/library/deactivate/can-deactivate.guard.ts +++ b/frontend/src/app/library/deactivate/can-deactivate.guard.ts @@ -30,7 +30,6 @@ export class CanDeactivateGuard extends BaseComponent implements CanDeactivate x ? true : false)); diff --git a/frontend/src/app/services/pagination.service.ts b/frontend/src/app/services/pagination.service.ts index 72f238384..edee64c3e 100644 --- a/frontend/src/app/services/pagination.service.ts +++ b/frontend/src/app/services/pagination.service.ts @@ -1,7 +1,6 @@ export class PaginationService { getPagination(groups, totalGroups: number, currentPage: number = 1, pageSize: number = 3) { // calculate total pages - //let totalPages = Math.ceil(totalGroups / pageSize); let totalPages = 0 ; //totalpages based on pages from xml, each group and section has each one page groups.forEach(group => { diff --git a/frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts b/frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts index d03771546..62370cec1 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts +++ b/frontend/src/app/ui/admin/description-template/editor/components/visibility-rule/description-template-editor-visibility-rule.component.ts @@ -70,10 +70,6 @@ export class DescriptionTemplateEditorRuleComponent implements OnInit { return type == DescriptionTemplateFieldType.VALIDATION || type == DescriptionTemplateFieldType.DATASET_IDENTIFIER;; } - targetValidation() { - //TODO - } - deleteRule(index) { this.form.removeAt(index); this.form.controls?.forEach( @@ -187,12 +183,10 @@ export class DescriptionTemplateEditorRuleComponent implements OnInit { const result: OptionItem[] = []; - // parentIds.push(form.get('id').value); const currentOptionItem: OptionItem = { id: form.get('id').value, type: type, label: type === ToCEntryType.Field ? form.get('data').get('label').value : form.get('title').value, - // parentsIds: [form.get('id').value] parentsIds: [...parentIds, form.get('id').value], form: form, hiddenBy: [] diff --git a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts index 0d5487c09..d06bf4c5b 100644 --- a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts +++ b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts @@ -49,7 +49,7 @@ export class DescriptionTemplateEditorResolver extends BaseEditorResolver { [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.title)].join('.'), [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.description)].join('.'), [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.ordinal)].join('.'), - [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.sections)].join('.'), // TODO: it is recursive here + [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.sections)].join('.'), [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.id)].join('.'), [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.ordinal)].join('.'), diff --git a/frontend/src/app/ui/admin/entity-locks/filters/lock-listing-filters.component.ts b/frontend/src/app/ui/admin/entity-locks/filters/lock-listing-filters.component.ts index d2b9a971e..15e1f30bf 100644 --- a/frontend/src/app/ui/admin/entity-locks/filters/lock-listing-filters.component.ts +++ b/frontend/src/app/ui/admin/entity-locks/filters/lock-listing-filters.component.ts @@ -1,6 +1,5 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; -import { IsActive } from '@app/core/common/enum/is-active.enum'; import { LockTargetType } from '@app/core/common/enum/lock-target-type'; import { LockFilter } from '@app/core/query/lock.lookup'; import { UserService } from '@app/core/services/user/user.service'; @@ -90,9 +89,6 @@ export class LockListingFiltersComponent extends BaseComponent implements OnInit private _computeAppliedFilters(filters: LockListingFilters): number { let count = 0; - // if (filters?.isActive) { - // count++ - // } return count; } diff --git a/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts b/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts index b7b5f8ca7..aa4dd4a01 100644 --- a/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts +++ b/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts @@ -536,7 +536,6 @@ export class PlanBlueprintEditorComponent extends BaseEditor(); langMap.set('language', selectedLanguage.value); - //TODO: refactor - save language selection to user profile - // this.userService.updateUserSettings({ language: this.languages.find(lang => lang === selectedLanguage.value) }) - // .pipe(takeUntil(this._destroyed)) - // .subscribe((response) => { - // this.languageService.changeLanguage(selectedLanguage.value); - // this.authentication.refresh() - // .pipe(takeUntil(this._destroyed)) - // .subscribe(innerResponse => { this.router.navigateByUrl(this.router.url); }); - // }, - // error => { - // }); this.languageService.changeLanguage(selectedLanguage.value); this.router.navigateByUrl(this.router.url); } else { diff --git a/frontend/src/common/http/interceptors/status-code.interceptor.ts b/frontend/src/common/http/interceptors/status-code.interceptor.ts index 9e737cae8..d09e2b943 100644 --- a/frontend/src/common/http/interceptors/status-code.interceptor.ts +++ b/frontend/src/common/http/interceptors/status-code.interceptor.ts @@ -16,14 +16,6 @@ export class StatusCodeInterceptor extends BaseInterceptor { type: InterceptorType; interceptRequest(req: HttpRequest, next: HttpHandler): Observable> { return next.handle(req).pipe(tap(event => { }, err => { - // if (err.status === 480) { - // this.router.navigate(['confirmation']); - // } - // const error: HttpError = this.httpErrorHandlingService.getError(err); - // if (error.statusCode === 403 && error.errorCode === 103) { - // this.authService.selectedTenant('default'); - // this.router.navigate(['/']); - // } })); } diff --git a/frontend/src/common/modules/text-filter/expandable-search-field/expandable-search-field.component.ts b/frontend/src/common/modules/text-filter/expandable-search-field/expandable-search-field.component.ts index 0e582af76..9bf4a1496 100644 --- a/frontend/src/common/modules/text-filter/expandable-search-field/expandable-search-field.component.ts +++ b/frontend/src/common/modules/text-filter/expandable-search-field/expandable-search-field.component.ts @@ -55,7 +55,6 @@ export class ExpandableSearchFieldComponent extends BaseComponent implements OnI protected a$ = this.subject$.asObservable().pipe( debounceTime(200), - // delayWhen(x => interval( x ? 0: 3000).pipe(take(1))), takeUntil(this._destroyed), shareReplay(), startWith(false) diff --git a/frontend/src/notification-service/ui/inapp-notification/editor/inapp-notification-editor.component.ts b/frontend/src/notification-service/ui/inapp-notification/editor/inapp-notification-editor.component.ts index 907a5642c..359f79dd1 100644 --- a/frontend/src/notification-service/ui/inapp-notification/editor/inapp-notification-editor.component.ts +++ b/frontend/src/notification-service/ui/inapp-notification/editor/inapp-notification-editor.component.ts @@ -121,7 +121,5 @@ export class InAppNotificationEditorComponent extends BaseComponent implements O } onCallbackSuccess(data?: any): void { - // this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - // this.router.navigate(['/mine-notifications']); } } diff --git a/frontend/src/notification-service/ui/user-profile/notifier-list/user-profile-notifier-list-editor.component.ts b/frontend/src/notification-service/ui/user-profile/notifier-list/user-profile-notifier-list-editor.component.ts index ac6659be2..02ef39579 100644 --- a/frontend/src/notification-service/ui/user-profile/notifier-list/user-profile-notifier-list-editor.component.ts +++ b/frontend/src/notification-service/ui/user-profile/notifier-list/user-profile-notifier-list-editor.component.ts @@ -1,13 +1,12 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import { HttpErrorResponse } from '@angular/common/http'; -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { Component, OnInit } from '@angular/core'; import { AuthService } from '@app/core/services/auth/auth.service'; import { LoggingService } from '@app/core/services/logging/logging-service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { BaseComponent } from '@common/base/base.component'; import { FormService } from '@common/forms/form-service'; -import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service'; +import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service'; import { TranslateService } from '@ngx-translate/core'; import { NotificationContactType } from '@notification-service/core/enum/notification-contact-type'; import { NotificationTrackingProcess } from '@notification-service/core/enum/notification-tracking-process.enum'; @@ -40,7 +39,6 @@ export class UserProfileNotifierListEditorComponent extends BaseComponent implem private formService: FormService, private logger: LoggingService, public notificationServiceEnumUtils: NotificationServiceEnumUtils, - // private totpService: TotpService ) { super(); } From 0d127807f76740227535e580af261864535b4528 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 15:15:29 +0300 Subject: [PATCH 5/9] add translations --- .../editor/plan-blueprint-editor.component.ts | 10 +++++----- frontend/src/assets/i18n/baq.json | 7 +++++++ frontend/src/assets/i18n/de.json | 7 +++++++ frontend/src/assets/i18n/en.json | 7 +++++++ frontend/src/assets/i18n/es.json | 7 +++++++ frontend/src/assets/i18n/gr.json | 7 +++++++ frontend/src/assets/i18n/hr.json | 7 +++++++ frontend/src/assets/i18n/pl.json | 7 +++++++ frontend/src/assets/i18n/pt.json | 7 +++++++ frontend/src/assets/i18n/sk.json | 7 +++++++ frontend/src/assets/i18n/sr.json | 7 +++++++ frontend/src/assets/i18n/tr.json | 7 +++++++ 12 files changed, 82 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts b/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts index aa4dd4a01..c627108ce 100644 --- a/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts +++ b/frontend/src/app/ui/admin/plan-blueprint/editor/plan-blueprint-editor.component.ts @@ -538,19 +538,19 @@ export class PlanBlueprintEditorComponent extends BaseEditor 0) { this.showValidationErrorsDialog(undefined, errorMessages); diff --git a/frontend/src/assets/i18n/baq.json b/frontend/src/assets/i18n/baq.json index 0d6659937..66dd0ed61 100644 --- a/frontend/src/assets/i18n/baq.json +++ b/frontend/src/assets/i18n/baq.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json index 5918c7e63..5ba5d73b2 100644 --- a/frontend/src/assets/i18n/de.json +++ b/frontend/src/assets/i18n/de.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json index 9bf469d57..5f46a09a8 100644 --- a/frontend/src/assets/i18n/en.json +++ b/frontend/src/assets/i18n/en.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/es.json b/frontend/src/assets/i18n/es.json index 63819f817..d10ff07d9 100644 --- a/frontend/src/assets/i18n/es.json +++ b/frontend/src/assets/i18n/es.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/gr.json b/frontend/src/assets/i18n/gr.json index f3050fea9..716c5b1c1 100644 --- a/frontend/src/assets/i18n/gr.json +++ b/frontend/src/assets/i18n/gr.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/hr.json b/frontend/src/assets/i18n/hr.json index d55d38431..dfaa44985 100644 --- a/frontend/src/assets/i18n/hr.json +++ b/frontend/src/assets/i18n/hr.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/pl.json b/frontend/src/assets/i18n/pl.json index ebd02e7de..5f5528234 100644 --- a/frontend/src/assets/i18n/pl.json +++ b/frontend/src/assets/i18n/pl.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/pt.json b/frontend/src/assets/i18n/pt.json index 79f675c80..b32822085 100644 --- a/frontend/src/assets/i18n/pt.json +++ b/frontend/src/assets/i18n/pt.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/sk.json b/frontend/src/assets/i18n/sk.json index 7bf9412ae..0e3daffb1 100644 --- a/frontend/src/assets/i18n/sk.json +++ b/frontend/src/assets/i18n/sk.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/sr.json b/frontend/src/assets/i18n/sr.json index 9279b26d9..6e5201646 100644 --- a/frontend/src/assets/i18n/sr.json +++ b/frontend/src/assets/i18n/sr.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { diff --git a/frontend/src/assets/i18n/tr.json b/frontend/src/assets/i18n/tr.json index 59db56524..3b15efaf7 100644 --- a/frontend/src/assets/i18n/tr.json +++ b/frontend/src/assets/i18n/tr.json @@ -1627,6 +1627,13 @@ "LOCKED-DIALOG": { "TITLE": "Plan Blueprint is locked", "MESSAGE": "Somebody else is modifying the Plan Blueprint at this moment. You may view the Plan Blueprint but you cannot make any changes. If you would like to modify it please come back later." + }, + "FORM-VALIDATION-DISPLAY-DIALOG": { + "TITLE-REQUIRED": "Title should be set.", + "DESCRIPTION-REQUIRED": "Description should be set.", + "LANGUAGE-REQUIRED": "Language should be set.", + "ACCESS-REQUIRED": "Access should be set.", + "DESCRIPTION-TEMPLATES-REQUIRED": "At least one section should have description templates." } }, "PLAN-EDITOR": { From adacea478830a80cd7b5dd159f21513868965b04 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 16:38:10 +0300 Subject: [PATCH 6/9] ui fixes --- .../listing/description-listing.component.html | 2 +- .../description/listing/description-listing.component.ts | 8 +++++--- .../src/app/ui/plan/listing/plan-listing.component.html | 2 +- .../src/app/ui/plan/listing/plan-listing.component.ts | 8 +++++--- .../src/app/ui/plan/overview/plan-overview.component.html | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/ui/description/listing/description-listing.component.html b/frontend/src/app/ui/description/listing/description-listing.component.html index 176374f61..426d36565 100644 --- a/frontend/src/app/ui/description/listing/description-listing.component.html +++ b/frontend/src/app/ui/description/listing/description-listing.component.html @@ -27,7 +27,7 @@
-
diff --git a/frontend/src/app/ui/plan/listing/plan-listing.component.ts b/frontend/src/app/ui/plan/listing/plan-listing.component.ts index 124f75ec3..d80c85c6e 100644 --- a/frontend/src/app/ui/plan/listing/plan-listing.component.ts +++ b/frontend/src/app/ui/plan/listing/plan-listing.component.ts @@ -152,9 +152,11 @@ export class PlanListingComponent extends BaseListingComponent { - this.tenants = tenants; - }); + if (!this.isPublic){ + this._loadUserTenants().pipe(takeUntil(this._destroyed)).subscribe( tenants => { + this.tenants = tenants; + }); + } this.formGroup.get('like').valueChanges .pipe(takeUntil(this._destroyed), debounceTime(500)) diff --git a/frontend/src/app/ui/plan/overview/plan-overview.component.html b/frontend/src/app/ui/plan/overview/plan-overview.component.html index 82dffe521..2bfc01a08 100644 --- a/frontend/src/app/ui/plan/overview/plan-overview.component.html +++ b/frontend/src/app/ui/plan/overview/plan-overview.component.html @@ -116,7 +116,7 @@
- +