Compare commits

..

7 Commits

3 changed files with 45 additions and 19 deletions

View File

@ -628,7 +628,6 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
refreshData(): void { refreshData(): void {
this.getItem(this.editorModel.id, (data: Description) => this.prepareForm(data)); this.getItem(this.editorModel.id, (data: Description) => this.prepareForm(data));
this.tocValidationService.validateForm();
} }
refreshOnNavigateToData(id?: Guid): void { refreshOnNavigateToData(id?: Guid): void {
@ -649,7 +648,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.descriptionService.persist(formData) this.descriptionService.persist(formData)
.pipe(takeUntil(this._destroyed)).subscribe( .pipe(takeUntil(this._destroyed)).subscribe(
complete => { complete => {
onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete); onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete, this.isNew);
this.tocValidationService.validateForm();
this.descriptionIsOnceSaved = true; this.descriptionIsOnceSaved = true;
if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true; if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true;
}, },
@ -1099,10 +1099,11 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
page.sections?.forEach((section: DescriptionTemplateSection) => { page.sections?.forEach((section: DescriptionTemplateSection) => {
let fieldsets = this.getNestedSectionFieldsets(section); let fieldsets = this.getNestedSectionFieldsets(section);
let sectionIds = this.getNestedSectionIds(section);
let fieldsBySection: DescriptionFieldIndicator[] = fieldsets?.flatMap((fieldset: DescriptionTemplateFieldSet) => let fieldsBySection: DescriptionFieldIndicator[] = fieldsets?.flatMap((fieldset: DescriptionTemplateFieldSet) =>
fieldset.fields?.flatMap((field: DescriptionTemplateField) => fieldset.fields?.flatMap((field: DescriptionTemplateField) => {
new DescriptionFieldIndicator(page.id, sectionIds, fieldset.id, field.id, field.data.fieldType, field.data.multipleSelect) let sectionIds = this.getNestedSectionIdsByField(section, fieldset.id);
return new DescriptionFieldIndicator(page.id, sectionIds, fieldset.id, field.id, field.data.fieldType, field.data.multipleSelect)
}
)); ));
fieldsByPage.push(...fieldsBySection); fieldsByPage.push(...fieldsBySection);
@ -1119,12 +1120,14 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
else return section.fieldSets; else return section.fieldSets;
} }
getNestedSectionIds(section: DescriptionTemplateSection): string[] { getNestedSectionIdsByField(section: DescriptionTemplateSection, fieldSetId: string): string[] {
if (section.sections) { if (section.sections) {
return [section.id, ...section.sections.flatMap((subsection: DescriptionTemplateSection) => this.getNestedSectionIds(subsection))]; return [section.id, ...section.sections.flatMap((subsection: DescriptionTemplateSection) => this.getNestedSectionIdsByField(subsection, fieldSetId))];
} }
else return [section.id]; else if (section.fieldSets.find(fieldSet => fieldSet.id == fieldSetId)) return [section.id];
else return [];
} }
// // this._listenersSubscription.add(dmpSubscription); // // this._listenersSubscription.add(dmpSubscription);

View File

@ -1,16 +1,39 @@
.percentage { // .percentage {
color: #212121; // color: #212121;
opacity: 0.7; // opacity: 0.7;
font-weight: 400; // font-weight: 400;
font-size: 0.875rem; // font-size: 0.875rem;
} // }
// .progress-bar {
// border-radius: 20px;
// height: 11px;
// }
// ::ng-deep .mat-progress-bar .mat-progress-bar-fill::after {
// border-radius: 20px !important;
// }
// Bar container
.progress-bar { .progress-bar {
--mdc-linear-progress-active-indicator-height: 11px !important;
border-radius: 20px; border-radius: 20px;
height: 11px;
} }
::ng-deep .mat-progress-bar .mat-progress-bar-fill::after { //Progress bar
::ng-deep .mdc-linear-progress__bar-inner {
--mdc-linear-progress-active-indicator-color: var(--primary-color) !important;
border-radius: 20px !important; border-radius: 20px !important;
} }
// Buffer bar
::ng-deep .mdc-linear-progress__buffer {
--mdc-linear-progress-track-height: 11px !important;
--mdc-linear-progress-active-indicator-color: var(--secondary-color) !important;
}
::ng-deep .mdc-linear-progress__buffer-bar {
--mdc-linear-progress-track-color: var(--secondary-color) !important;
}

View File

@ -109,12 +109,12 @@ export abstract class BaseEditor<EditorModelType extends BaseEditorModel, Entity
onCallbackSuccess(data?: any): void { onCallbackSuccess(data?: any, refresh: boolean = true): void {
console.log("Success:", data); console.log("Success:", data);
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
this.refreshOnNavigateToData(data ? data.id : null); if (refresh) this.refreshOnNavigateToData(data ? data.id : null);
} }
onCallbackDeleteSuccess(data?: any): void { onCallbackDeleteSuccess(data?: any): void {