frontend code clean up

This commit is contained in:
amentis 2024-07-11 14:51:33 +03:00
parent d7277e990c
commit 81092adc13
13 changed files with 1 additions and 50 deletions

View File

@ -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
);

View File

@ -11,8 +11,6 @@ export class QueryParamsService {
serializeLookup(lookup: Lookup): string {
return JSON.stringify(lookup, (key: string, value: any) => {
switch (key) {
// case nameof<Lookup>(x => x.page):
// case nameof<Lookup>(x => x.order):
case nameof<Lookup>(x => x.metadata):
case nameof<Lookup>(x => x.project):
return undefined;
@ -24,8 +22,6 @@ export class QueryParamsService {
deSerializeLookup(serializedLookup: string): any {
const json = JSON.parse(serializedLookup);
// delete json[nameof<Lookup>(x => x.page)];
// delete json[nameof<Lookup>(x => x.order)];
delete json[nameof<Lookup>(x => x.metadata)];
delete json[nameof<Lookup>(x => x.project)];
return json;

View File

@ -67,8 +67,6 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
valueOnBlur = new BehaviorSubject<any>(null);
onSelectAutoCompleteValue = new BehaviorSubject<any>(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();

View File

@ -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) {

View File

@ -12,10 +12,6 @@ import { Subscription } from "rxjs";
placeholder="{{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}}"
(paste)="pasteWithoutFormatting($event)"></angular-editor>
<mat-icon *ngIf="form.value && editable" (click)="parentFormGroup.get(controlName).patchValue('')" class="clear">close</mat-icon>
<!-- <mat-form-field class="full-width editor">
<mat-label>{{(placeholder? (placeholder | translate) : '')}}</mat-label>
<textarea matInput [formControl]="form" rows="5"></textarea>
</mat-form-field> -->
</div>
`,
styleUrls: ['./rich-text-editor.component.scss'],
@ -68,10 +64,8 @@ export class RichTextEditorComponent implements OnInit, OnChanges, OnDestroy {
[
'fontSize',
'backgroundColor',
// 'customClasses',
'insertImage',
'insertVideo',
// 'removeFormat',
'toggleEditorMode'
],
[

View File

@ -212,10 +212,6 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple
}
this.clearVisibilityRulesValue();
// setTimeout(() => { //TODO
// this.showPreview = true;
// });
}

View File

@ -382,8 +382,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
if (event.selectedIndex === (this.steps.length - 1)) {//preview selected
this.generatePreviewForm();
} else {
// this.formGroup = null;
}
this.formGroup.markAsUntouched();

View File

@ -7,7 +7,6 @@ export interface ToCEntry {
subEntriesType: ToCEntryType;
subEntries: ToCEntry[];
type: ToCEntryType;
// form: AbstractControl;
numbering: string;
ordinal: number;
hidden?: boolean;

View File

@ -222,7 +222,6 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O
});
}
return {
// form: form,
id: item.id,
label: item.title,
numbering: '',
@ -239,7 +238,6 @@ export class TableOfContentsComponent extends BaseComponent implements OnInit, O
if (!item) return null;
return {
// form: form,
id: item.id,
label: item.title,
numbering: 's',

View File

@ -85,11 +85,9 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
} else if (this.description.status === DescriptionStatus.Draft) {
this.isDraft = true;
this.isDeleted = false;
this.setIsUserOwner();
} else {
this.isDraft = false;
this.isDeleted = false;
this.setIsUserOwner();
}
this.canDelete = (this.authService.hasPermission(AppPermission.DeleteDescription) ||
@ -106,14 +104,6 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
return this.tenants?.find(t => 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));

View File

@ -273,10 +273,6 @@ export class PlanListingComponent extends BaseListingComponent<BasePlan, PlanLoo
this.filterChanged(this.lookup, true);
}
openShareDialog(rowId: any, rowName: any) {
//TODO: add this
}
openFiltersDialog(): void {
let dialogRef = this.dialog.open(PlanFilterDialogComponent, {
width: '456px',

View File

@ -441,8 +441,6 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit {
openShareDialog(rowId: any, rowName: any) {
const dialogRef = this.dialog.open(PlanInvitationDialogComponent, {
// height: '250px',
// width: '700px',
autoFocus: false,
restoreFocus: false,
data: {

View File

@ -780,7 +780,7 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
//
//
public isDirty(): boolean {
return this.formGroup && this.formGroup.dirty; //&& this.hasChanges;
return this.formGroup && this.formGroup.dirty;
}
getLanguageInfos(): LanguageInfo[] {