various UI updates

This commit is contained in:
Diamantis Tziotzios 2024-01-25 20:55:42 +02:00
parent ae543324a4
commit 4644d24874
36 changed files with 494 additions and 393 deletions

View File

@ -3,6 +3,7 @@ package eu.eudat.controllers.v2;
import com.fasterxml.jackson.core.JsonProcessingException;
import eu.eudat.audit.AuditableAction;
import eu.eudat.authorization.AuthorizationFlags;
import gr.cite.tools.fieldset.BaseFieldSet;
import gr.cite.tools.validation.ValidationFilterAnnotation;
import eu.eudat.data.DescriptionTemplateEntity;
import eu.eudat.model.DescriptionTemplate;
@ -119,6 +120,7 @@ public class DescriptionTemplateController {
@ValidationFilterAnnotation(validator = DescriptionTemplatePersist.DescriptionTemplatePersistValidator.ValidatorName, argumentName = "model")
public DescriptionTemplate persist(@RequestBody DescriptionTemplatePersist model, FieldSet fieldSet) throws MyApplicationException, MyForbiddenException, MyNotFoundException, InvalidApplicationException, JAXBException, ParserConfigurationException, JsonProcessingException, TransformerException {
logger.debug(new MapLogEntry("persisting" + DescriptionTemplate.class.getSimpleName()).And("model", model).And("fieldSet", fieldSet));
new BaseFieldSet(fieldSet.getFields()).ensure(DescriptionTemplate._id);
DescriptionTemplate persisted = this.descriptionTemplateTypeService.persist(model, fieldSet);
this.auditService.track(AuditableAction.DescriptionTemplate_Persist, Map.ofEntries(

View File

@ -99,6 +99,7 @@ export class DescriptionTemplateService {
getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: DescriptionTemplate) => item.label,
titleFn: (item: DescriptionTemplate) => item.label,
subtitleFn: (item: DescriptionTemplate) => item.description,
valueAssign: (item: DescriptionTemplate) => item.id,
};
@ -109,7 +110,9 @@ export class DescriptionTemplateService {
getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)),
displayFn: (item: DescriptionTemplate) => item.label,
titleFn: (item: DescriptionTemplate) => item.label,
subtitleFn: (item: DescriptionTemplate) => item.description,
valueAssign: (item: DescriptionTemplate) => item.id,
popupItemActionIcon: 'visibility'
};
public buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[]): DescriptionTemplateLookup {
@ -121,7 +124,8 @@ export class DescriptionTemplateService {
lookup.project = {
fields: [
nameof<DescriptionTemplate>(x => x.id),
nameof<DescriptionTemplate>(x => x.label)
nameof<DescriptionTemplate>(x => x.label),
nameof<DescriptionTemplate>(x => x.description),
]
};
lookup.order = { items: [nameof<DescriptionTemplate>(x => x.label)] };
@ -139,6 +143,7 @@ export class DescriptionTemplateService {
getSelectedItem: (selectedItem: any) => this.query(this.buildDescriptionTempalteGroupAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])),
displayFn: (item: DescriptionTemplate) => item.label,
titleFn: (item: DescriptionTemplate) => item.label,
subtitleFn: (item: DescriptionTemplate) => item.description,
valueAssign: (item: DescriptionTemplate) => item.groupId,
};
@ -149,7 +154,9 @@ export class DescriptionTemplateService {
getSelectedItems: (selectedItems: any[]) => this.query(this.buildDescriptionTempalteGroupAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)),
displayFn: (item: DescriptionTemplate) => item.label,
titleFn: (item: DescriptionTemplate) => item.label,
subtitleFn: (item: DescriptionTemplate) => item.description,
valueAssign: (item: DescriptionTemplate) => item.groupId,
popupItemActionIcon: 'visibility'
};
public buildDescriptionTempalteGroupAutocompleteLookup(like?: string, excludedIds?: Guid[], groupIds?: Guid[]): DescriptionTemplateLookup {
@ -165,6 +172,7 @@ export class DescriptionTemplateService {
nameof<DescriptionTemplate>(x => x.id),
nameof<DescriptionTemplate>(x => x.label),
nameof<DescriptionTemplate>(x => x.groupId),
nameof<DescriptionTemplate>(x => x.description),
]
};
lookup.order = { items: [nameof<DescriptionTemplate>(x => x.label)] };

View File

@ -16,6 +16,7 @@ import { catchError, map } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof';
import { ConfigurationService } from '../configuration/configuration.service';
import { BaseHttpV2Service } from '../http/base-http-v2.service';
import { TranslateService } from '@ngx-translate/core';
@Injectable()
export class ReferenceService {
@ -23,7 +24,8 @@ export class ReferenceService {
constructor(
private http: BaseHttpV2Service,
private configurationService: ConfigurationService,
private filterService: FilterService
private filterService: FilterService,
private language: TranslateService,
) {
}
@ -134,6 +136,7 @@ export class ReferenceService {
getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteSearchSelectedItemsLookup([type], null, null, null, selectedItems?.map(x => x.id))).pipe(map(x => x.items)),
displayFn: (item: Reference) => item.label,
titleFn: (item: Reference) => item.label,
subtitleFn: (item: Reference) => item?.sourceType === ReferenceSourceType.External ? this.language.instant('REFERENCE-FIELD-COMPONENT.EXTERNAL-SOURCE') + ': ' + item.source : this.language.instant('REFERENCE-FIELD-COMPONENT.INTERNAL-SOURCE'),
valueAssign: (item: Reference) => item,
};
}

View File

@ -1,6 +1,7 @@
import { TemplateRef } from '@angular/core';
import { TemplateRef, Type } from '@angular/core';
import { Observable } from 'rxjs';
import { AutoCompleteGroup } from '../auto-complete-group';
import { OptionComponent } from './option-component.model';
export interface MultipleAutoCompleteConfiguration {
// Delay for performing the request. Default: 200ms.
@ -29,6 +30,8 @@ export interface MultipleAutoCompleteConfiguration {
valueAssign?: (selectedItem: any) => any;
// Property formating template
optionTemplate?: TemplateRef<any>;
// Property formatting component
optionComponent?: Type<OptionComponent>;
// Selected value formating template
selectedValueTemplate?: TemplateRef<any>;
// Display icon that opens popup

View File

@ -1,29 +1,42 @@
<div class="row multiple-auto-complete" ngForm>
<mat-chip-grid #chipList ngDefaultControl style="width: 100% !important;">
<!-- <mat-chip-grid #chipList ngDefaultControl style="width: 100% !important;">
<ng-container *ngIf="value as values">
<mat-chip *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable" [ngClass]="computeClass(value)">
<ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem">
<ng-template #cellTemplate *ngIf="_selectedValueTemplate(selectedItem)" [ngTemplateOutlet]="_selectedValueTemplate(selectedItem)" [ngTemplateOutletContext]="{ item: selectedItem }"></ng-template>
<div *ngIf="!_selectedValueTemplate(selectedItem)">{{_displayFn(selectedItem)}}</div>
<mat-icon matChipRemove *ngIf="!disabled && removable" (click)="_removeSelectedItem(_selectedItems.get(stringify(value)), $event)">cancel</mat-icon>
<div class="row">
<div *ngIf="!_selectedValueTemplate(selectedItem)">{{_displayFn(selectedItem)}}</div>
<mat-icon matChipRemove *ngIf="!disabled && removable" (click)="_removeSelectedItem(_selectedItems.get(stringify(value)), $event)">cancel</mat-icon>
</div>
</ng-container>
</mat-chip>
</ng-container>
<!-- <input matInput #autocompleteInput class="col" [class.hide-placeholder]="hidePlaceholder" [name]="id" autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)">-->
<input matInput #autocompleteInput class="col"
style="width: calc(100% - 8px) !important;"
[class.hide-placeholder]="hidePlaceholder" [name]="id"
autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger"
[placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue"
(keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()"
(blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="_addItem($event)"
[matAutocompleteConnectedTo]="origin">
<!-- The attribute autocomplete="nope", set by downshift, is ignored in Chrome 67 and Opera 54 (latest at the time of writing)
<input matInput #autocompleteInput class="col" [name]="id" autocomplete="nope" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)"> -->
<input matInput #autocompleteInput class="col" style="width: calc(100% - 8px) !important;" [class.hide-placeholder]="hidePlaceholder" [name]="id" autocomplete="off" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" (matChipInputTokenEnd)="_addItem($event)" [matAutocompleteConnectedTo]="origin">
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>arrow_drop_down</mat-icon>
<div style="height: 0 !important; width: 100% !important; visibility: hidden !important;" matAutocompleteOrigin #origin="matAutocompleteOrigin"></div>
</mat-chip-grid> -->
<mat-chip-grid #chipList ngDefaultControl class="chip-list">
<ng-container *ngIf="value as values;">
<mat-chip-row *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable" [ngClass]="computeClass(value)">
<ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem;">
<ng-template #cellTemplate *ngIf="_selectedValueTemplate(selectedItem)" [ngTemplateOutlet]="_selectedValueTemplate(selectedItem)" [ngTemplateOutletContext]="{
item: selectedItem
}" />
<span *ngIf="!_selectedValueTemplate(selectedItem)" class="chip-text" [title]="_displayFn(selectedItem)">{{_displayFn(selectedItem)}}</span>
</ng-container>
<button matChipRemove *ngIf="!disabled && removable" (click)="_removeSelectedItem(_selectedItems.get(stringify(value)), $event)">
<mat-icon>cancel</mat-icon>
</button>
</mat-chip-row>
</ng-container>
</mat-chip-grid>
<input matInput #autocompleteInput class="col" [name]="id" autocomplete="nope" #autocompleteTrigger="matAutocompleteTrigger" autocomplete="off" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)" [matAutocompleteConnectedTo]="origin">
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>arrow_drop_down</mat-icon>
<div style="height: 0 !important; width: 100% !important; visibility: hidden !important;" matAutocompleteOrigin #origin="matAutocompleteOrigin"></div>
<mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
<span *ngIf="_groupedItems">
@ -52,10 +65,36 @@
</mat-optgroup>
</span>
<span *ngIf="!_groupedItems">
<ng-container *ngIf="_items | async as autocompleteItems; else loading">
<div *ngIf="_items | async as autocompleteItems; else loading">
<ng-container *ngIf="autocompleteItems.length; else noItems">
<mat-option *ngFor="let item of autocompleteItems" class="option" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item) && !_optionComponent(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<ng-container *ngIf="_optionComponent(item)">
<ng-container *ngComponentOutlet="_optionComponent(item); inputs: { item };" />
</ng-container>
<ng-template #cellTemplate *ngIf="_optionTemplate(item) && !_optionComponent(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
item: item
}"></ng-template>
<div *ngIf="!_optionTemplate(item) && !_optionComponent(item)">
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
<span *ngIf="popupItemActionIcon" class="option-icon" (click)="_optionActionClick(item, $event)"><mat-icon>{{popupItemActionIcon}}</mat-icon></span>
</div>
</mat-option>
</ng-container>
<ng-template #noItems>
<mat-option disabled="true">No results found!</mat-option>
</ng-template>
</div>
<ng-template #loading>
<mat-option disabled="true">loading...</mat-option>
</ng-template>
<!-- <ng-container *ngIf="_items | async as autocompleteItems; else loading">
<ng-container *ngIf="autocompleteItems.length">
<mat-option *ngFor="let item of autocompleteItems" [value]="item" (mousedown)="selected = true;" (mouseup)="selected = false;" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
item: item
}"></ng-template>
@ -82,7 +121,7 @@
</ng-container>
<ng-template #loading>
<mat-option disabled="true">loading...</mat-option>
</ng-template>
</ng-template> -->
</span>
</mat-autocomplete>
</div>
</div>

View File

@ -19,6 +19,19 @@
}
.chip-text {
// text-overflow: ellipsis;
// white-space: nowrap;
// overflow: hidden;
white-space: normal;
word-break: break-word;
}
.chip-list {
max-width: calc(100% - 30px);
}
.title-subtitle-fn {
height: auto;
width: calc(100% - 46px);
@ -60,6 +73,11 @@
line-clamp: 1;
}
.option {
line-height: 1rem;
// height: 3em;
}
.option-icon {
mat-icon {
margin: 0px 5px 0px 10px;

View File

@ -14,6 +14,7 @@ import {
Self,
SimpleChanges,
TemplateRef,
Type,
ViewChild
} from '@angular/core';
import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
@ -409,10 +410,13 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
return item;
}
_optionComponent(item: any): Type<any> {
if (this.configuration.optionComponent && item) { return this.configuration.optionComponent; }
return null;
}
_optionTemplate(item: any): TemplateRef<any> {
if (this.configuration.optionTemplate && item) {
return this.configuration.optionTemplate;
}
if (this.configuration.optionTemplate && item) { return this.configuration.optionTemplate; }
return null;
}

View File

@ -0,0 +1,3 @@
export interface OptionComponent{
item: any;
}

View File

@ -1,18 +1,17 @@
<div class="template-container">
<div class="template-container" *ngIf="descriptionTemplate && formGroup">
<div mat-dialog-title class="row d-flex m-0 header">
<span class="template-title align-self-center" matTooltip="{{data.template.label}}">{{'DMP-LISTING.COLUMNS.PROFILE' | translate}} - {{data.template.label}}</span>
<span class="template-title align-self-center" matTooltip="{{descriptionTemplate.label}}">{{'DMP-LISTING.COLUMNS.PROFILE' | translate}} - {{descriptionTemplate.label}}</span>
<span class="ml-auto align-self-center" (click)="closeDialog()"><mat-icon class="close-icon">close</mat-icon></span>
</div>
<div *ngIf="progressIndication" class="progress-bar">
<mat-progress-bar color="primary" mode="indeterminate"></mat-progress-bar>
</div>
<div mat-dialog-content class="definition-content">
<app-dataset-description *ngIf="datasetProfileDefinitionFormGroup && datasetProfileDefinitionModel" [form]="datasetProfileDefinitionFormGroup" [visibilityRules]="datasetProfileDefinitionModel.rules"
[datasetProfileId]="data.template.id" [datasetDescription]="data?.template?.description"></app-dataset-description>
<app-description-form *ngIf="formGroup && formGroup.get('properties')" [propertiesFormGroup]="formGroup.get('properties')" [descriptionTemplate]="descriptionTemplate" [visibilityRulesService]="visibilityRulesService"></app-description-form>
</div>
<div mat-mat-dialog-actions *ngIf="datasetProfileDefinitionFormGroup">
<div mat-mat-dialog-actions *ngIf="formGroup">
<div class="col-auto d-flex pb-4 pt-2">
<button mat-raised-button type="button" class="start-btn ml-auto" (click)="select()">{{'TYPES.EXTERNAL-DATASET-TYPE.SELECT' | translate}}</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,81 @@
import { Component, Inject, OnInit } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
import { LoggingService } from '@app/core/services/logging/logging-service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service';
import { DescriptionEditorModel } from '@app/ui/description/editor/description-editor.model';
import { DescriptionEditorResolver } from '@app/ui/description/editor/description-editor.resolver';
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-description-template-preview-dialog-component',
templateUrl: 'description-template-preview-dialog.component.html',
styleUrls: ['./description-template-preview-dialog.component.scss'],
})
export class DescriptionTemplatePreviewDialogComponent extends BaseComponent implements OnInit {
datasetProfileDefinitionFormGroup: UntypedFormGroup;
progressIndication = false;
editorModel: DescriptionEditorModel;
formGroup: UntypedFormGroup;
descriptionTemplate: DescriptionTemplate;
constructor(
public dialogRef: MatDialogRef<DescriptionTemplatePreviewDialogComponent>,
private progressIndicationService: ProgressIndicationService,
private descriptionTemplateService: DescriptionTemplateService,
private uiNotificationService: UiNotificationService,
private logger: LoggingService,
private language: TranslateService,
public visibilityRulesService: VisibilityRulesService,
@Inject(MAT_DIALOG_DATA) public data: any
) {
super();
}
ngOnInit(): void {
this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => {
setTimeout(() => { this.progressIndication = x; });
});
if (this.data && this.data.descriptionTemplateId) {
this.descriptionTemplateService.getSingle(this.data.descriptionTemplateId, DescriptionEditorResolver.descriptionTemplateLookupFields())
.pipe(takeUntil(this._destroyed))
.subscribe(item => {
this.descriptionTemplate = item;
this.prepareForm(this.descriptionTemplate);
});
}
}
prepareForm(data: DescriptionTemplate) {
try {
this.editorModel = new DescriptionEditorModel();
this.buildForm();
} catch (error) {
this.logger.error('Could not parse Description item: ' + data + error);
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
}
}
buildForm() {
this.formGroup = this.editorModel.buildForm(null, true);
this.visibilityRulesService.buildVisibilityRules(this.visibilityRulesService.getVisibilityRulesFromDescriptionTempalte(this.descriptionTemplate), this.formGroup);
}
select(): void {
this.dialogRef.close(true);
}
closeDialog(): void {
this.dialogRef.close();
}
}

View File

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { FormattingModule } from '@app/core/formatting.module';
import { DescriptionFormModule } from '@app/ui/description/editor/description-form/description-form.module';
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { DescriptionTemplatePreviewDialogComponent } from './description-template-preview-dialog.component';
@NgModule({
imports: [
CommonUiModule,
CommonFormsModule,
FormattingModule,
DescriptionFormModule
],
declarations: [
DescriptionTemplatePreviewDialogComponent,
],
exports: [
DescriptionTemplatePreviewDialogComponent,
],
providers: [
VisibilityRulesService
]
})
export class DescriptionTemplatePreviewDialogModule { }

View File

@ -175,7 +175,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel
});
if (this.editorModel.status == DescriptionTemplateStatus.Finalized) {
if (this.editorModel.status == DescriptionTemplateStatus.Finalized || this.isDeleted) {
this.formGroup.disable();
}
}

View File

@ -191,7 +191,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
export(id: Guid): void {
@ -222,7 +222,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
.pipe(takeUntil(this._destroyed))
.subscribe(_ => {
this.uiNotificationService.snackBarNotification(this.language.instant('DESCRIPTION-TEMPLATE-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
},
error => {
this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error);

View File

@ -174,6 +174,6 @@ export class DescriptionTemplateTypeListingComponent extends BaseListingComponen
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -14,6 +14,7 @@ import { DmpBlueprintEditorComponent } from './editor/dmp-blueprint-editor.compo
import { DmpBlueprintListingComponent } from './listing/dmp-blueprint-listing.component';
import { DmpBlueprintListingFiltersComponent } from "./listing/filters/dmp-blueprint-listing-filters.component";
import { ImportDmpBlueprintDialogComponent } from './listing/import-dmp-blueprint/import-dmp-blueprint.dialog.component';
import { DescriptionTemplatePreviewDialogModule } from '../description-template/description-template-preview/description-template-preview-dialog.module';
@NgModule({
imports: [
@ -27,7 +28,8 @@ import { ImportDmpBlueprintDialogComponent } from './listing/import-dmp-blueprin
HybridListingModule,
TextFilterModule,
UserSettingsModule,
CommonFormattingModule
CommonFormattingModule,
DescriptionTemplatePreviewDialogModule
],
declarations: [
DmpBlueprintEditorComponent,

View File

@ -182,7 +182,7 @@
<div class="col-12">
<mat-form-field class="w-100">
<mat-label>{{'DMP-BLUEPRINT-EDITOR.FIELDS.DESCRIPTION-TEMPLATES' | translate}}</mat-label>
<app-multiple-auto-complete [disabled]="formGroup.disabled" [hidePlaceholder]="true" required='false' [configuration]="templatesAutoCompleteConfiguration" (optionRemoved)="onRemoveDescritionTemplate($event, sectionIndex)" (optionSelected)="onSelectDescritionTemplate($event, sectionIndex)"></app-multiple-auto-complete> </mat-form-field>
<app-multiple-auto-complete [disabled]="formGroup.disabled" [hidePlaceholder]="true" required='false' [configuration]="descriptionTemplateService.descriptionTempalteGroupMultipleAutocompleteConfiguration" (optionRemoved)="onRemoveDescritionTemplate($event, sectionIndex)" (optionSelected)="onSelectDescritionTemplate($event, sectionIndex)" (optionActionClicked)="onPreviewDescriptionTemplate($event, i)"></app-multiple-auto-complete> </mat-form-field>
</div>
</div>
</div>

View File

@ -43,6 +43,7 @@ import { nameof } from 'ts-simple-nameof';
import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status';
import { DescriptionTemplateVersionStatus } from '@app/core/common/enum/description-template-version-status';
import { MatSelectChange } from '@angular/material/select';
import { DescriptionTemplatePreviewDialogComponent } from '../../description-template/description-template-preview/description-template-preview-dialog.component';
@Component({
@ -63,14 +64,6 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
public dmpBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues<DmpBlueprintSystemFieldType>(DmpBlueprintSystemFieldType);
dmpBlueprintExtraFieldDataType = DmpBlueprintExtraFieldDataType;
public dmpBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues<DmpBlueprintExtraFieldDataType>(DmpBlueprintExtraFieldDataType);
templatesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
initialItems: (excludedItems: any[], data?: any) => this.descriptionTemplateService.query(this.buildAutocompleteLookup(null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)),
filterFn: (searchQuery: string, excludedItems: any[]) => this.descriptionTemplateService.query(this.buildAutocompleteLookup(searchQuery, excludedItems)).pipe(map(x => x.items)),
getSelectedItems: (selectedItems: any[]) => this.descriptionTemplateService.query(this.buildAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)),
displayFn: (item: DescriptionTemplate) => item.label,
titleFn: (item: DescriptionTemplate) => item.label,
valueAssign: (item: DescriptionTemplate) => item.id,
};
protected get canDelete(): boolean {
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDmpBlueprint);
@ -109,7 +102,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
private dmpBlueprintEditorService: DmpBlueprintEditorService,
private fileUtils: FileUtils,
private matomoService: MatomoService,
private descriptionTemplateService: DescriptionTemplateService
public descriptionTemplateService: DescriptionTemplateService
) {
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService);
}
@ -143,28 +136,24 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditDmpBlueprint));
this.selectedSystemFields = this.selectedSystemFieldDisabled();
this.dmpBlueprintEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
if (this.editorModel.status == DmpBlueprintStatus.Finalized) {
if (this.editorModel.status == DmpBlueprintStatus.Finalized || this.isDeleted) {
this.formGroup.disable();
}
}
refreshData(): void {
this.getItem(this.editorModel.id, (data: DmpBlueprint) => this.prepareForm(data));
refreshData(id?: Guid): void {
this.getItem(id ?? this.editorModel.id, (data: DmpBlueprint) => this.prepareForm(data));
}
refreshOnNavigateToData(id?: Guid): void {
this.formGroup.markAsPristine();
let route = [];
if (id === null) {
route.push('../..');
} else if (this.isNew) {
route.push('../' + id);
if (this.isNew) {
let route = [];
route.push('/dmp-blueprints/' + id);
this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route });
} else {
route.push('..');
this.refreshData(id);
}
this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route });
}
persistEntity(onSuccess?: (response) => void): void {
@ -201,7 +190,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
if (result) {
this.dmpBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe(
complete => this.onCallbackSuccess(),
complete => this.cancel(),
error => this.onCallbackError(error)
);
}
@ -220,7 +209,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
//
//
addSection(): void {
(this.formGroup.get('definition').get('sections') as FormArray).push(this.editorModel.createChildSection( (this.formGroup.get('definition').get('sections') as FormArray).controls.length));
(this.formGroup.get('definition').get('sections') as FormArray).push(this.editorModel.createChildSection((this.formGroup.get('definition').get('sections') as FormArray).controls.length));
}
removeSection(sectionIndex: number): void {
@ -284,13 +273,13 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
addSystemField(sectionIndex: number, matSelect: MatSelectChange): void {
const systemFieldTypes = matSelect.value as number[];
for (let systemFieldType of systemFieldTypes){
const fieldSize = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).length;
if (fieldSize == 0){
for (let systemFieldType of systemFieldTypes) {
const fieldSize = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).length;
if (fieldSize == 0) {
((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).push(this.editorModel.createChildSystemField(sectionIndex, fieldSize, systemFieldType));
return;
}else{
if (!((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).controls.some(y => (y as UntypedFormGroup).get('systemFieldType')?.value === systemFieldType)){
} else {
if (!((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).controls.some(y => (y as UntypedFormGroup).get('systemFieldType')?.value === systemFieldType)) {
((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).push(this.editorModel.createChildSystemField(sectionIndex, fieldSize, systemFieldType));
return;
}
@ -611,36 +600,36 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
// // onPreviewTemplate(event, sectionIndex: number) {
// // const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, {
// // width: '590px',
// // minHeight: '200px',
// // restoreFocus: false,
// // data: {
// // template: event
// // },
// // panelClass: 'custom-modalbox'
// // });
// // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
// // if (result) {
// // let blueprints = this.sectionsArray().at(sectionIndex).get('descriptionTemplates').value;//this.formGroup.get('blueprints').value;
// // const blueprint: DescriptionTemplatesInSectionEditor = new DescriptionTemplatesInSectionEditor();
// // blueprint.id = Guid.create().toString();
// // blueprint.descriptionTemplateId = event.id;
// // blueprint.label = event.label;
// // blueprints.push(blueprint.buildForm());
// // this.sectionsArray().at(sectionIndex).get('descriptionTemplates').setValue(blueprints);//this.formGroup.get('blueprints').setValue(blueprints);
// // this.blueprintsAutoCompleteConfiguration = {
// // filterFn: this.filterProfiles.bind(this),
// // initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
// // displayFn: (item) => item['label'],
// // titleFn: (item) => item['label'],
// // subtitleFn: (item) => item['description'],
// // popupItemActionIcon: 'visibility'
// // };
// // }
// // });
// // }
onPreviewDescriptionTemplate(event: DescriptionTemplate, sectionId: Guid) {
const dialogRef = this.dialog.open(DescriptionTemplatePreviewDialogComponent, {
width: '590px',
minHeight: '200px',
restoreFocus: false,
data: {
descriptionTemplateId: event.id
},
panelClass: 'custom-modalbox'
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
// if (result) {
// let blueprints = this.sectionsArray().at(sectionIndex).get('descriptionTemplates').value;//this.formGroup.get('blueprints').value;
// const blueprint: DescriptionTemplatesInSectionEditor = new DescriptionTemplatesInSectionEditor();
// blueprint.id = Guid.create().toString();
// blueprint.descriptionTemplateId = event.id;
// blueprint.label = event.label;
// blueprints.push(blueprint.buildForm());
// this.sectionsArray().at(sectionIndex).get('descriptionTemplates').setValue(blueprints);//this.formGroup.get('blueprints').setValue(blueprints);
// this.blueprintsAutoCompleteConfiguration = {
// filterFn: this.filterProfiles.bind(this),
// initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
// displayFn: (item) => item['label'],
// titleFn: (item) => item['label'],
// subtitleFn: (item) => item['description'],
// popupItemActionIcon: 'visibility'
// };
// }
});
}

View File

@ -41,7 +41,8 @@ export class DmpBlueprintEditorModel extends BaseEditorModel implements DmpBluep
label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
definition: this.definition.buildForm({
rootPath: `definition.`
rootPath: `definition.`,
disabled: disabled
}),
hash: [{ value: this.hash, disabled: disabled }, context.getValidation('hash').validators]
});
@ -142,7 +143,8 @@ export class DmpBlueprintDefinitionEditorModel implements DmpBlueprintDefinition
(item, index) => new DmpBlueprintDefinitionSectionEditorModel(
this.validationErrorModel
).fromModel(item).buildForm({
rootPath: `${rootPath}sections[${index}].`
rootPath: `${rootPath}sections[${index}].`,
disabled: disabled
})
), context.getValidation('sections').validators
),
@ -232,7 +234,8 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
(item, index) => new FieldInSectionEditorModel(
this.validationErrorModel
).fromModel(item).buildForm({
rootPath: `${rootPath}fields[${index}].`
rootPath: `${rootPath}fields[${index}].`,
disabled: disabled
})
), context.getValidation('fields')
),
@ -241,7 +244,8 @@ export class DmpBlueprintDefinitionSectionEditorModel implements DmpBlueprintDef
(item, index) => new DescriptionTemplatesInSectionEditorModel(
this.validationErrorModel
).fromModel(item).buildForm({
rootPath: `${rootPath}descriptionTemplates[${index}].`
rootPath: `${rootPath}descriptionTemplates[${index}].`,
disabled: disabled
})
), context.getValidation('descriptionTemplates')
)

View File

@ -185,7 +185,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
export(id: Guid): void {
@ -216,7 +216,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
.pipe(takeUntil(this._destroyed))
.subscribe(_ => {
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-BLUEPRINT-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
},
error => {
this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error);
@ -227,177 +227,177 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
}
// ngOnInit() {
// ngOnInit() {
// refresh() {
// this.dataSource = new DatasetDataSource(this.dmpBlueprintService, this._paginator, this.sort, this.criteria);
// }
// refresh() {
// this.dataSource = new DatasetDataSource(this.dmpBlueprintService, this._paginator, this.sort, this.criteria);
// }
// clone(id: string) {
// this.router.navigate(['dmp-blueprints/clone/' + id]);
// }
// clone(id: string) {
// this.router.navigate(['dmp-blueprints/clone/' + id]);
// }
// rowClick(rowId: String) {
// this.router.navigate(['dmp-blueprints/' + rowId]);
// }
// rowClick(rowId: String) {
// this.router.navigate(['dmp-blueprints/' + rowId]);
// }
// downloadXML(dmpBlueprintId: string): void {
// this.dmpBlueprintService.downloadXML(dmpBlueprintId)
// .pipe(takeUntil(this._destroyed))
// .subscribe(response => {
// const blob = new Blob([response.body], { type: 'application/xml' });
// const filename = this.fileUtils.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
// FileSaver.saveAs(blob, filename);
// });
// }
// downloadXML(dmpBlueprintId: string): void {
// this.dmpBlueprintService.downloadXML(dmpBlueprintId)
// .pipe(takeUntil(this._destroyed))
// .subscribe(response => {
// const blob = new Blob([response.body], { type: 'application/xml' });
// const filename = this.fileUtils.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
// FileSaver.saveAs(blob, filename);
// });
// }
// deleteTemplate(id: string) {
// if (id) {
// this.dialog.open(ConfirmationDialogComponent, {
// data: {
// isDeleteConfirmation: true,
// confirmButton: this.languageService.instant('DMP-BLUEPRINT-EDITOR.CONFIRM-DELETE-DIALOG.CONFIRM-BUTTON'),
// cancelButton: this.languageService.instant("DMP-BLUEPRINT-EDITOR.CONFIRM-DELETE-DIALOG.CANCEL-BUTTON"),
// message: this.languageService.instant("DMP-BLUEPRINT-EDITOR.CONFIRM-DELETE-DIALOG.MESSAGE")
// }
// })
// .afterClosed()
// .subscribe(
// confirmed => {
// if (confirmed) {
// this.dmpBlueprintService.delete(id)
// .pipe(takeUntil(this._destroyed))
// .subscribe(
// complete => {
// this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Success);
// this.refresh();
// },
// error => {
// this.onCallbackError(error);
// if (error.error.statusCode == 674) {
// this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Error);
// } else {
// this.uiNotificationService.snackBarNotification(this.languageService.instant(error.message), SnackBarNotificationLevel.Error);
// }
// }
// );
// }
// }
// )
// }
// }
// deleteTemplate(id: string) {
// if (id) {
// this.dialog.open(ConfirmationDialogComponent, {
// data: {
// isDeleteConfirmation: true,
// confirmButton: this.languageService.instant('DMP-BLUEPRINT-EDITOR.CONFIRM-DELETE-DIALOG.CONFIRM-BUTTON'),
// cancelButton: this.languageService.instant("DMP-BLUEPRINT-EDITOR.CONFIRM-DELETE-DIALOG.CANCEL-BUTTON"),
// message: this.languageService.instant("DMP-BLUEPRINT-EDITOR.CONFIRM-DELETE-DIALOG.MESSAGE")
// }
// })
// .afterClosed()
// .subscribe(
// confirmed => {
// if (confirmed) {
// this.dmpBlueprintService.delete(id)
// .pipe(takeUntil(this._destroyed))
// .subscribe(
// complete => {
// this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Success);
// this.refresh();
// },
// error => {
// this.onCallbackError(error);
// if (error.error.statusCode == 674) {
// this.uiNotificationService.snackBarNotification(this.languageService.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DMP-BLUEPRINT-DELETE'), SnackBarNotificationLevel.Error);
// } else {
// this.uiNotificationService.snackBarNotification(this.languageService.instant(error.message), SnackBarNotificationLevel.Error);
// }
// }
// );
// }
// }
// )
// }
// }
// onCallbackError(errorResponse: HttpErrorResponse) {
// this.uiNotificationService.snackBarNotification(errorResponse.message, SnackBarNotificationLevel.Warning);
// }
// onCallbackError(errorResponse: HttpErrorResponse) {
// this.uiNotificationService.snackBarNotification(errorResponse.message, SnackBarNotificationLevel.Warning);
// }
// getDefaultCriteria(): DmpBlueprintCriteria {
// const defaultCriteria = new DmpBlueprintCriteria();
// return defaultCriteria;
// }
// getDefaultCriteria(): DmpBlueprintCriteria {
// const defaultCriteria = new DmpBlueprintCriteria();
// return defaultCriteria;
// }
// // makeItPublic(id: String) {
// // debugger;
// // this.datasetService.makeDatasetPublic(id).pipe(takeUntil(this._destroyed)).subscribe();
// // }
// // makeItPublic(id: String) {
// // debugger;
// // this.datasetService.makeDatasetPublic(id).pipe(takeUntil(this._destroyed)).subscribe();
// // }
// parseStatus(value: number): string {
// const stringVal = value.toString()
// try {
// return this.statuses.find(status => status.value === stringVal).viewValue;
// } catch {
// return stringVal;
// }
// }
// parseStatus(value: number): string {
// const stringVal = value.toString()
// try {
// return this.statuses.find(status => status.value === stringVal).viewValue;
// } catch {
// return stringVal;
// }
// }
// openDialog(): void {
// const dialogRef = this.dialog.open(DialodConfirmationUploadDmpBlueprints, {
// restoreFocus: false,
// data: {
// message: this.languageService.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-TITLE'),
// confirmButton: this.languageService.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML'),
// cancelButton: this.languageService.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-CANCEL'),
// name: '',
// file: FileList,
// sucsess: false
// }
// });
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {
// if (data && data.sucsess && data.name != null && data.file != null) {
// this.dmpBlueprintService.uploadFile(data.file, data.name)
// .pipe(takeUntil(this._destroyed))
// .subscribe(_ => {
// this.uiNotificationService.snackBarNotification(this.languageService.instant('DMP-BLUEPRINT-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
// this.refresh();
// },
// error => {
// this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error);
// });
// }
// });
// }
// getStatusClass(status: number): string {
// openDialog(): void {
// const dialogRef = this.dialog.open(DialodConfirmationUploadDmpBlueprints, {
// restoreFocus: false,
// data: {
// message: this.languageService.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-TITLE'),
// confirmButton: this.languageService.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML'),
// cancelButton: this.languageService.instant('DMP-BLUEPRINT-LISTING.IMPORT.UPLOAD-XML-FILE-CANCEL'),
// name: '',
// file: FileList,
// sucsess: false
// }
// });
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {
// if (data && data.sucsess && data.name != null && data.file != null) {
// this.dmpBlueprintService.uploadFile(data.file, data.name)
// .pipe(takeUntil(this._destroyed))
// .subscribe(_ => {
// this.uiNotificationService.snackBarNotification(this.languageService.instant('DMP-BLUEPRINT-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success);
// this.refresh();
// },
// error => {
// this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error);
// });
// }
// });
// }
// getStatusClass(status: number): string {
// if (status === 1) {//finalized
// return 'status-chip-finalized'
// }
// if (status === 0) {
// return 'status-chip-draft';
// }
// return '';
// }
// }
// if (status === 1) {//finalized
// return 'status-chip-finalized'
// }
// if (status === 0) {
// return 'status-chip-draft';
// }
// return '';
// }
// }
// export class DatasetDataSource extends DataSource<DmpBlueprintListing> {
// export class DatasetDataSource extends DataSource<DmpBlueprintListing> {
// totalCount = 0;
// totalCount = 0;
// constructor(
// private _service: dmpBlueprintService,
// private _paginator: MatPaginator,
// private _sort: MatSort,
// private _criteria: DmpBlueprintCriteriaComponent
// ) {
// super();
// constructor(
// private _service: dmpBlueprintService,
// private _paginator: MatPaginator,
// private _sort: MatSort,
// private _criteria: DmpBlueprintCriteriaComponent
// ) {
// super();
// }
// }
// connect(): Observable<DmpBlueprintListing[]> {
// const displayDataChanges = [
// this._paginator.page
// //this._sort.matSortChange
// ];
// connect(): Observable<DmpBlueprintListing[]> {
// const displayDataChanges = [
// this._paginator.page
// //this._sort.matSortChange
// ];
// return observableMerge(...displayDataChanges).pipe(
// startWith(null),
// switchMap(() => {
// const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
// let fields: Array<string> = new Array();
// if (this._sort.active) { fields = this._sort.direction === 'asc' ? ['+' + this._sort.active] : ['-' + this._sort.active]; }
// const request = new DataTableRequest<DmpBlueprintCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
// request.criteria = this._criteria.criteria;
// return this._service.getPagedBlueprint(request);
// }),
// /*.catch((error: any) => {
// this._snackBar.openFromComponent(SnackBarNotificationComponent, {
// data: { message: 'GENERAL.SNACK-BAR.FORMS-BAD-REQUEST', language: this._languageService },
// duration: 3000,
// extraClasses: ['snackbar-warning']
// });
// //this._criteria.criteria.onCallbackError(error);
// return Observable.of(null);
// })*/
// map(result => {
// return result;
// }),
// map(result => {
// if (!result) { return []; }
// if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
// return result.data;
// }));
// }
// return observableMerge(...displayDataChanges).pipe(
// startWith(null),
// switchMap(() => {
// const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
// let fields: Array<string> = new Array();
// if (this._sort.active) { fields = this._sort.direction === 'asc' ? ['+' + this._sort.active] : ['-' + this._sort.active]; }
// const request = new DataTableRequest<DmpBlueprintCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
// request.criteria = this._criteria.criteria;
// return this._service.getPagedBlueprint(request);
// }),
// /*.catch((error: any) => {
// this._snackBar.openFromComponent(SnackBarNotificationComponent, {
// data: { message: 'GENERAL.SNACK-BAR.FORMS-BAD-REQUEST', language: this._languageService },
// duration: 3000,
// extraClasses: ['snackbar-warning']
// });
// //this._criteria.criteria.onCallbackError(error);
// return Observable.of(null);
// })*/
// map(result => {
// return result;
// }),
// map(result => {
// if (!result) { return []; }
// if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
// return result.data;
// }));
// }
// disconnect() {
// // No-op
// }
// disconnect() {
// // No-op
// }

View File

@ -166,6 +166,6 @@ export class LanguageListingComponent extends BaseListingComponent<Language, Lan
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -184,6 +184,6 @@ export class NotificationTemplateListingComponent extends BaseListingComponent<N
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -226,6 +226,6 @@ export class NotificationListingComponent extends BaseListingComponent<Notificat
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -172,6 +172,6 @@ export class ReferenceTypeListingComponent extends BaseListingComponent<Referenc
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -187,6 +187,6 @@ export class ReferenceListingComponent extends BaseListingComponent<Reference, R
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -171,6 +171,6 @@ export class TenantListingComponent extends BaseListingComponent<Tenant, TenantL
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -184,7 +184,7 @@ export class UserListingComponent extends BaseListingComponent<User, UserLookup>
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
onUserRowActivated(event: RowActivateEvent, baseRoute: string = null) {

View File

@ -1,54 +0,0 @@
import { Component, Inject, OnInit } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service';
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dataset-preview-dialog-component',
templateUrl: 'dataset-preview-dialog.component.html',
styleUrls: ['./dataset-preview-dialog.component.scss'],
})
export class DatasetPreviewDialogComponent extends BaseComponent implements OnInit {
datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel;
datasetProfileDefinitionFormGroup: UntypedFormGroup;
progressIndication = false;
constructor(
public dialogRef: MatDialogRef<DatasetPreviewDialogComponent>,
private datasetWizardService: DatasetWizardService,
private progressIndicationService: ProgressIndicationService,
@Inject(MAT_DIALOG_DATA) public data: any
) {
super();
}
ngOnInit(): void {
this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => {
setTimeout(() => { this.progressIndication = x; });
});
if (this.data && this.data.template) {
this.datasetWizardService.getDefinition(this.data.template.id)
.pipe(takeUntil(this._destroyed))
.subscribe(item => {
this.datasetProfileDefinitionModel = new DatasetDescriptionFormEditorModel().fromModel(item);
this.datasetProfileDefinitionFormGroup = this.datasetProfileDefinitionModel.buildForm();
this.datasetProfileDefinitionFormGroup.disable();
});
}
}
select(): void {
this.dialogRef.close(true);
}
closeDialog(): void {
this.dialogRef.close();
}
}

View File

@ -1,20 +0,0 @@
import { NgModule } from '@angular/core';
import { FormattingModule } from '@app/core/formatting.module';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { DatasetPreviewDialogComponent } from './dataset-preview-dialog.component';
@NgModule({
imports: [
CommonUiModule,
CommonFormsModule,
FormattingModule,
],
declarations: [
DatasetPreviewDialogComponent,
],
exports: [
DatasetPreviewDialogComponent,
]
})
export class DatasetPreviewDialogModule { }

View File

@ -565,7 +565,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
// this.selectedSystemFields = this.selectedSystemFieldDisabled();
this.descriptionEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
if (this.editorModel.status == DescriptionStatus.Finalized) {
if (this.editorModel.status == DescriptionStatus.Finalized || this.isDeleted) {
this.formGroup.disable();
}
}

View File

@ -1,5 +1,6 @@
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { DescriptionStatus } from "@app/core/common/enum/description-status";
import { DescriptionTemplate } from "@app/core/model/description-template/description-template";
import { Description, DescriptionField, DescriptionFieldPersist, DescriptionPersist, DescriptionReference, DescriptionReferencePersist, PropertyDefinition, PropertyDefinitionPersist } from "@app/core/model/description/description";
import { ReferencePersist } from "@app/core/model/reference/reference";
import { BaseEditorModel } from "@common/base/base-form-editor-model";
@ -15,7 +16,7 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
descriptionTemplateId: Guid;
status: DescriptionStatus;
description: string;
properties: DescriptionPropertyDefinitionEditorModel;
properties: DescriptionPropertyDefinitionEditorModel = new DescriptionPropertyDefinitionEditorModel();
tags: string[];
references: DescriptionReferenceEditorModel[];
permissions: string[];
@ -25,7 +26,7 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
constructor() { super(); }
public fromModel(item: Description): DescriptionEditorModel {
public fromModel(item: Description, descriptionTemplate?: DescriptionTemplate): DescriptionEditorModel {
if (item) {
super.fromModel(item);
this.label = item.label;

View File

@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateComboBoxOption, DescriptionTemplateDefinition, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplatePage, DescriptionTemplateRule, DescriptionTemplateSection, DescriptionTemplateWordListData } from '@app/core/model/description-template/description-template';
import { Description, DescriptionField, DescriptionReference, DescriptionTag, PropertyDefinition } from '@app/core/model/description/description';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection, FieldInSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
import { Dmp, DmpDescriptionTemplate } from '@app/core/model/dmp/dmp';
import { Reference } from '@app/core/model/reference/reference';
import { Tag } from '@app/core/model/tag/tag';
@ -53,56 +53,7 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmpDescriptionTemplate), nameof<DmpDescriptionTemplate>(x => x.sectionId)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.version)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.pages), nameof<DescriptionTemplatePage>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.pages), nameof<DescriptionTemplatePage>(x => x.ordinal)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.pages), nameof<DescriptionTemplatePage>(x => x.title)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.ordinal)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.defaultVisibility)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.multiplicity)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.numbering)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.page)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.title)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.description)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.extendedDescription)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.ordinal)].join('.'), // TODO: need to sort based on that
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.sections)].join('.'), // TODO: it is recursive here
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.ordinal)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.numbering)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.title)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.description)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.extendedDescription)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.additionalInformation)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.hasCommentField)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.multiplicity), nameof<DescriptionTemplateMultiplicity>(x => x.min)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.multiplicity), nameof<DescriptionTemplateMultiplicity>(x => x.max)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.multiplicity), nameof<DescriptionTemplateMultiplicity>(x => x.placeholder)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.multiplicity), nameof<DescriptionTemplateMultiplicity>(x => x.tableView)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.id)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.ordinal)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.numbering)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.schematics)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.defaultValue)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.defaultValue)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.fieldType)].join('.'),
// [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.includeInExport)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.validations)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.visibilityRules), nameof<DescriptionTemplateRule>(x => x.target)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.visibilityRules), nameof<DescriptionTemplateRule>(x => x.value)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateBaseFieldData>(x => x.label)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateBaseFieldData>(x => x.fieldType)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.options)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.options), nameof<DescriptionTemplateComboBoxOption>(x => x.label)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.options), nameof<DescriptionTemplateComboBoxOption>(x => x.value)].join('.'),
[nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.multiList)].join('.'),
...DescriptionEditorResolver.descriptionTemplateLookupFields(nameof<Description>(x => x.descriptionTemplate)),
[nameof<Description>(x => x.properties), nameof<PropertyDefinition>(x => x.fields), nameof<DescriptionField>(x => x.key)].join('.'),
[nameof<Description>(x => x.properties), nameof<PropertyDefinition>(x => x.fields), nameof<DescriptionField>(x => x.value)].join('.'),
@ -121,6 +72,41 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
]
}
public static descriptionTemplateLookupFields(prefix?: string): string[] {
return [
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.label)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.version)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.pages), nameof<DescriptionTemplatePage>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.pages), nameof<DescriptionTemplatePage>(x => x.ordinal)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.pages), nameof<DescriptionTemplatePage>(x => x.title)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.ordinal)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.page)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.title)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.description)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.extendedDescription)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.ordinal)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.title)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.description)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.extendedDescription)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.additionalInformation)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.hasCommentField)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.id)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.defaultValue)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.validations)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.visibilityRules), nameof<DescriptionTemplateRule>(x => x.target)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.visibilityRules), nameof<DescriptionTemplateRule>(x => x.value)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateBaseFieldData>(x => x.label)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateBaseFieldData>(x => x.fieldType)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.options)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.options), nameof<DescriptionTemplateComboBoxOption>(x => x.label)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.options), nameof<DescriptionTemplateComboBoxOption>(x => x.value)].join('.'),
(prefix ? prefix + '.' : '') + [nameof<DescriptionTemplate>(x => x.definition), nameof<DescriptionTemplateDefinition>(x => x.sections), nameof<DescriptionTemplateSection>(x => x.fieldSets), nameof<DescriptionTemplateFieldSet>(x => x.fields), nameof<DescriptionTemplateField>(x => x.data), nameof<DescriptionTemplateWordListData>(x => x.multiList)].join('.'),
]
}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const fields = [

View File

@ -181,7 +181,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
buildForm() {
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditDescription));
if (this.editorModel.status == DmpStatus.Finalized) {
if (this.editorModel.status == DmpStatus.Finalized || this.isDeleted) {
this.formGroup.disable();
}

View File

@ -170,6 +170,6 @@ export class MineInAppNotificationListingComponent extends BaseListingComponent<
onCallbackSuccess(): void {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.ngOnInit();
this.refresh();
}
}

View File

@ -2121,6 +2121,10 @@
"EXPORT": "Export users"
}
},
"REFERENCE-FIELD-COMPONENT": {
"EXTERNAL-SOURCE": "Source",
"INTERNAL-SOURCE": "Not bind with source"
},
"TYPES": {
"APP-ROLE": {
"ADMIN": "Admin",

View File

@ -148,6 +148,9 @@ export abstract class BaseListingComponent<ItemModel, LookupModel extends Lookup
}
this.loadingPipe$.next();
}
refresh() {
this.onPageLoad({ offset: 0 } as PageLoadEvent);
}
alterPage(event: PageLoadEvent) {
if (event) {
this.lookup.page.offset = event.offset * (event.pageSize ?? this.lookup.page.size);