From 81092adc1376950c2fad183c098e03231c60da1f Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 11 Jul 2024 14:51:33 +0300 Subject: [PATCH] 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[] {