Adrim template editor. Save and discard buttons on the left side.
This commit is contained in:
parent
66d9f41081
commit
c6b8ad5639
|
@ -152,7 +152,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
|
|||
setTimeout(() => {
|
||||
const el = this.myElement.nativeElement.querySelector("#"+this.idprefix+id);
|
||||
if(el){
|
||||
el.scrollIntoView({behavior: "smooth"});
|
||||
el.scrollIntoView({behavior: "smooth", block:'end'});
|
||||
}
|
||||
}, 700);
|
||||
}
|
||||
|
@ -169,57 +169,8 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
|
|||
}
|
||||
ngOnInit() {
|
||||
|
||||
// console.log('<-- element created');
|
||||
// this.initialize();
|
||||
|
||||
|
||||
|
||||
//TODO
|
||||
// this.form.root.get('pages').valueChanges
|
||||
// .pipe(takeUntil(this._destroyed))
|
||||
// .subscribe(x =>
|
||||
// this.keepPageSelectionValid(x)
|
||||
// );
|
||||
}
|
||||
|
||||
drop(event: CdkDragDrop<string[]>) {
|
||||
// if(!this.links || !this.links.length) return;
|
||||
|
||||
if(event.container === event.previousContainer){
|
||||
// moveItemInArray(this.links, event.previousIndex, event.currentIndex);
|
||||
|
||||
let arrayToUpdate: FormArray = this.form.get('fieldSets') as FormArray;
|
||||
// if(this.parentLink && this.parentLink.form){
|
||||
// switch(this.parentLink.subEntriesType){
|
||||
// case this.tocEntryType.Field:
|
||||
// arrayToUpdate = (this.parentLink.form.get('fields') as FormArray);
|
||||
// break;
|
||||
// case this.tocEntryType.FieldSet:
|
||||
// arrayToUpdate = (this.parentLink.form.get('fieldSets') as FormArray);
|
||||
// break;
|
||||
// case this.tocEntryType.Section:
|
||||
// arrayToUpdate = (this.parentLink.form.get('sections') as FormArray);
|
||||
// break
|
||||
// }
|
||||
|
||||
// }
|
||||
if(arrayToUpdate.controls){
|
||||
moveItemInArray(arrayToUpdate.controls, event.previousIndex, event.currentIndex);
|
||||
//update ordinality
|
||||
arrayToUpdate.controls.forEach((element,idx ) => {
|
||||
element.get('ordinal').setValue(idx);
|
||||
element.updateValueAndValidity();
|
||||
});
|
||||
}
|
||||
|
||||
this.dataNeedsRefresh.emit();
|
||||
}else{
|
||||
console.log('not same container');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
onRemoveFieldSet(fieldsetId: string){
|
||||
this.removeFieldSet.emit(fieldsetId);
|
||||
}
|
||||
|
@ -231,58 +182,6 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
|
|||
this.addNewFieldSet.emit(this.form);
|
||||
}
|
||||
|
||||
|
||||
// addField() {
|
||||
// const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
|
||||
// fieldSet.ordinal = (this.form.get('fieldSets') as FormArray).length;
|
||||
|
||||
// const field: FieldEditorModel = new FieldEditorModel();
|
||||
// field.id = Guid.create().toString();
|
||||
// field.ordinal = 0;//first field in fields
|
||||
// fieldSet.fields.push(field);
|
||||
// // if (this.dataModel.fieldSets) {
|
||||
// fieldSet.id = Guid.create().toString();
|
||||
// //this.dataModel.fieldSets.push(fieldSet);
|
||||
// //}
|
||||
// const fieldsetsArray = this.form.get('fieldSets') as FormArray;
|
||||
// fieldsetsArray.push(fieldSet.buildForm());
|
||||
|
||||
// const fieldSetForm = fieldsetsArray.at(fieldsetsArray.length-1);
|
||||
// //emit id inserted
|
||||
// if(fieldSetForm){
|
||||
// const id: string = fieldSetForm.get('id').value;
|
||||
// this.fieldsetAdded.emit(id);
|
||||
// }
|
||||
// }
|
||||
|
||||
// addSectioninSection() {
|
||||
// const section: SectionEditorModel = new SectionEditorModel();
|
||||
// //this.dataModel.sections.push(section);
|
||||
// (<FormArray>this.form.get('sections')).push(section.buildForm());
|
||||
// }
|
||||
|
||||
// DeleteSectionInSection(index) {
|
||||
// //this.dataModel.sections.splice(index, 1);
|
||||
// (<FormArray>this.form.get('sections')).removeAt(index);
|
||||
// }
|
||||
|
||||
// deleteFieldSet(index) {
|
||||
// //this.dataModel.fieldSets.splice(index, 1);
|
||||
// (<FormArray>this.form.get('fieldSets')).removeAt(index);
|
||||
// }
|
||||
|
||||
// keepPageSelectionValid(pagesJson: Array<any>) {
|
||||
// const selectedPage = this.form.get('page').value as String;
|
||||
// // const pages: Array<PageEditorModel> = JsonSerializer.fromJSONArray(pagesJson, Page);
|
||||
// if (pagesJson.find(elem => elem.id === selectedPage) === undefined) {
|
||||
// this.form.get('page').reset();
|
||||
// }
|
||||
// }
|
||||
|
||||
// getFieldTile(formGroup: FormGroup, index: number) {
|
||||
// if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; }
|
||||
// return "Field " + (index + 1);
|
||||
// }
|
||||
private _findTocEntryById(id: string, tocentries: ToCEntry[]): ToCEntry{
|
||||
if(!tocentries){
|
||||
return null;
|
||||
|
|
|
@ -8,11 +8,10 @@
|
|||
|
||||
<!-- Total steps: {{stepper.steps.length}} -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex" id="title-column">
|
||||
|
||||
<div class="row" style="padding: 2em; margin-bottom: 1em; background: #F5F5F5 0% 0% no-repeat padding-box;" >
|
||||
|
||||
<div class="col-12 d-flex" style="margin-bottom: 4em; justify-content: space-between; align-items: baseline;padding-right: 15px;">
|
||||
<div>
|
||||
<div style="padding-left: 2em;">
|
||||
<h3 *ngIf="isNew && !isClone && !isNewVersion">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE' | translate}}</h3>
|
||||
<h3 *ngIf="isNew && isClone">
|
||||
<span *ngIf="isClone">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-CLONE' | translate}}</span>
|
||||
|
@ -25,7 +24,8 @@
|
|||
|
||||
<h3 *ngIf="!isNew">{{form.get('label').value}}</h3>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end" style="gap: 1em">
|
||||
|
||||
<!-- <div class="d-flex justify-content-end" style="gap: 1em">
|
||||
<button mat-raised-button *ngIf="form.get('status').value==1" class="template_action_btn" (click)="downloadXML();" type="button" [@action-btn]>{{
|
||||
'DATASET-WIZARD.ACTIONS.DOWNLOAD-XML' | translate }}</button>
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
|||
(click)='onSubmit()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |
|
||||
translate}}</button>
|
||||
</ng-container>
|
||||
<!-- SAVE BUTTON WHEN FINALIZED-->
|
||||
<ng-container *ngIf="showUpdateButton()">
|
||||
<button mat-raised-button class="template_action_btn" type="button"
|
||||
*ngIf="stepper.selectedIndex !=2 && !newVersionId"
|
||||
|
@ -48,16 +47,20 @@
|
|||
(click)='updateFinalized()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |
|
||||
translate}}</button>
|
||||
</ng-container>
|
||||
<!-- DELETE BUTTON -->
|
||||
<ng-container *ngIf="!isNew">
|
||||
<button mat-raised-button class="template_action_btn" (click)="delete()" [@action-btn]>
|
||||
<mat-icon>delete</mat-icon>{{'DATASET-PROFILE-EDITOR.ACTIONS.DELETE' | translate}}
|
||||
</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row stepper-navigation-outer-wrapper" >
|
||||
|
||||
|
||||
<!-- Steps Navigation -->
|
||||
<div id="stepper-navigation-wrapper">
|
||||
<div class="col-12 d-flex" *ngIf="steps" id="stepper-navigation">
|
||||
<div class="col-7 bg-white" style="overflow: hidden; padding: 0px" id="progress-container">
|
||||
<div id="progress" [ngStyle]="progressStyle"></div>
|
||||
|
@ -117,6 +120,9 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -129,45 +135,53 @@
|
|||
<!-- <ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate}}
|
||||
</ng-template> -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="heading">1.1 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME'| translate}} *</div>
|
||||
<div class="hint">{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME-HINT'| translate}}</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
<input matInput [formControl]="form.get('label')"
|
||||
placeholder="{{'DATASET-PROFILE-EDITOR.FIELDS.DATASET-TITLE' | translate}}">
|
||||
<mat-error *ngIf="form.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
||||
translate}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="heading">1.2 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION'| translate}} *</div>
|
||||
<!-- <div class="hint">{{'DMP-EDITOR.MAIN-INFO.HINT' | translate}}</div> -->
|
||||
<div class="hint">{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION-HINT'| translate}}</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
<textarea matInput [formControl]="form.get('description')" cdkTextareaAutosize cdkAutosizeMinRows="4" cdkAutosizeMaxRows="5"
|
||||
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER'| translate}}">
|
||||
</textarea>
|
||||
<mat-error *ngIf="form.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED'
|
||||
| translate}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-3" style="display: flex; height: 40vh;">
|
||||
<ng-container *ngTemplateOutlet="actions">
|
||||
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-12">
|
||||
<div class="heading">1.1 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME'| translate}} *</div>
|
||||
<div class="hint">{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME-HINT'| translate}}</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
<input matInput [formControl]="form.get('label')"
|
||||
placeholder="{{'DATASET-PROFILE-EDITOR.FIELDS.DATASET-TITLE' | translate}}">
|
||||
<mat-error *ngIf="form.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
||||
translate}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="heading">1.2 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION'| translate}} *</div>
|
||||
<!-- <div class="hint">{{'DMP-EDITOR.MAIN-INFO.HINT' | translate}}</div> -->
|
||||
<div class="hint">{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION-HINT'| translate}}</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
<textarea matInput [formControl]="form.get('description')" cdkTextareaAutosize cdkAutosizeMinRows="4" cdkAutosizeMaxRows="5"
|
||||
placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION-PLACEHOLDER'| translate}}">
|
||||
</textarea>
|
||||
<mat-error *ngIf="form.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED'
|
||||
| translate}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<!-- <div class="heading">1.3 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}</div> -->
|
||||
<div class="heading">1.3 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-LANGUAGE'| translate}} *</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
<!-- <input matInput formControlName="description" placeholder="{{'DATASET-PROFILE-EDITOR.FIELDS.DATASET-DESCRIPTION' | translate}}" required> -->
|
||||
<mat-select [formControl]="form.get('language')" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-SELECT-LANGUAGE'| translate}}">
|
||||
<mat-option *ngFor="let lang of getLanguageInfos()" [value]="lang.code">
|
||||
{{ lang.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="form.get('language').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
||||
translate}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<!-- <div class="heading">1.3 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}</div> -->
|
||||
<div class="heading">1.3 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-LANGUAGE'| translate}} *</div>
|
||||
<mat-form-field class="full-width basic-info-input">
|
||||
<!-- <input matInput formControlName="description" placeholder="{{'DATASET-PROFILE-EDITOR.FIELDS.DATASET-DESCRIPTION' | translate}}" required> -->
|
||||
<mat-select [formControl]="form.get('language')" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-SELECT-LANGUAGE'| translate}}">
|
||||
<mat-option *ngFor="let lang of getLanguageInfos()" [value]="lang.code">
|
||||
{{ lang.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="form.get('language').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
||||
translate}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-12">
|
||||
|
@ -225,17 +239,6 @@
|
|||
</div> -->
|
||||
</div>
|
||||
</mat-step>
|
||||
<!-- <mat-step>
|
||||
<ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.PAGES.TITLE' | translate}}</ng-template>
|
||||
<div class="row">
|
||||
<app-dataset-profile-editor-page-component class="col-12" [form]="form.get('pages')"
|
||||
[viewOnly]="viewOnly"></app-dataset-profile-editor-page-component>
|
||||
<div class="col-12">
|
||||
<button mat-button class="full-width" (click)="addPage()"
|
||||
[disabled]="viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.ADD-PAGE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</mat-step> -->
|
||||
<mat-step [label]="'DATASET-PROFILE-EDITOR.STEPS.FORM.TITLE' | translate" [completed]="form.valid">
|
||||
<!-- <ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.FORM.TITLE' | translate}}</ng-template> -->
|
||||
<div class="row">
|
||||
|
@ -244,8 +247,9 @@
|
|||
<div class="col-3">
|
||||
|
||||
|
||||
<div class="row sticky-top" style="top : 2em;">
|
||||
<div class="row sticky-top" style="top : 7em;">
|
||||
<dataset-profile-table-of-contents class="toc-pane-container col"
|
||||
style="margin-bottom: 2em;"
|
||||
[links]="toCEntries"
|
||||
(itemClick)="displayItem($event)"
|
||||
(createEntry) = "addNewEntry($event)"
|
||||
|
@ -255,6 +259,9 @@
|
|||
(dataNeedsRefresh)="onDataNeedsRefresh($event)"
|
||||
[colorizeInvalid]="colorizeInvalid">
|
||||
</dataset-profile-table-of-contents>
|
||||
<ng-container *ngIf="true then actions">
|
||||
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -342,102 +349,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- TOOLBAR -->
|
||||
<!-- <div class="col-auto"
|
||||
*ngIf="((selectedTocEntry?.type == tocEntryEnumValues.Section)||(selectedTocEntry?.type == tocEntryEnumValues.FieldSet) )&&(selectedTocEntry?.subEntriesType != tocEntryEnumValues.Section) && !viewOnly">
|
||||
<div class="row" class="actions-list bg-white sticky-top" style="top: 2em;">
|
||||
<nav *ngIf="!viewOnly">
|
||||
<label class="action-list-label">{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.GENERAL-TOOLS' | translate}}</label>
|
||||
<ul class="list-unstyled">
|
||||
<li *ngIf="selectedTocEntry.type === tocEntryEnumValues.FieldSet" class="mli">
|
||||
<div class="action-list-item" (click)="addNewEntry({childType: tocEntryEnumValues.FieldSet,parent: {form: selectedTocEntry.form.parent.parent}})">
|
||||
<img src="/assets/images/editor/icons/add_input_set.svg" class="input_icon" alt="Add Question icon">
|
||||
<mat-icon class="action-list-icon">folder</mat-icon>
|
||||
<span class="action-list-text" >{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.NEW-INPUT-SET' | translate}}</span>
|
||||
</div>
|
||||
</li>
|
||||
<li *ngIf="selectedTocEntry.type === tocEntryEnumValues.Section" class="mli">
|
||||
<div class="action-list-item" (click)="addNewEntry({childType: tocEntryEnumValues.FieldSet,parent: selectedTocEntry})">
|
||||
<mat-icon class="action-list-icon">folder</mat-icon>
|
||||
<img src="/assets/images/editor/icons/add_input_set.svg" class="input_icon" alt="Add Question icon">
|
||||
<span class="action-list-text" >{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.NEW-INPUT-SET' | translate}}</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<li *ngIf="selectedTocEntry.type === tocEntryEnumValues.FieldSet" class="mli">
|
||||
<div class="action-list-item" (click)="cloneFieldSet(selectedTocEntry.form)">
|
||||
<mat-icon class="action-list-icon">file_copy</mat-icon>
|
||||
<img src="/assets/images/editor/icons/clone.svg" class="input_icon" alt="Clone icon">
|
||||
<span class="action-list-text">{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.CLONE' | translate}}</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="selectedTocEntry.type === tocEntryEnumValues.FieldSet" class="mli">
|
||||
<div class="action-list-item" (click)="onRemoveEntry(selectedTocEntry)">
|
||||
<mat-icon class="action-list-icon">delete</mat-icon>
|
||||
<span class="action-list-text">{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.DELETE' | translate}}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav> -->
|
||||
|
||||
<!-- <ng-container *ngIf="!viewOnly">
|
||||
<h3 matSubheader>{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.GENERAL-TOOLS' | translate}}</h3>
|
||||
<mat-list-item *ngIf="selectedTocEntry.type === tocEntryEnumValues.FieldSet" class="mli">
|
||||
<div class="action-list-item">
|
||||
<mat-icon class="action-list-icon">folder</mat-icon>
|
||||
<span class="action-list-text" (click)="addNewEntry({childType: tocEntryEnumValues.FieldSet,parent: {form: selectedTocEntry.form.parent.parent}})" >{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.NEW-INPUT-SET' | translate}}</span>
|
||||
</div>
|
||||
</mat-list-item>
|
||||
<mat-list-item *ngIf="selectedTocEntry.type === tocEntryEnumValues.Section" class="mli">
|
||||
<div class="action-list-item">
|
||||
<mat-icon class="action-list-icon">folder</mat-icon>
|
||||
<span class="action-list-text" (click)="addNewEntry({childType: tocEntryEnumValues.FieldSet,parent: selectedTocEntry})" >{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.NEW-INPUT-SET' | translate}}</span>
|
||||
</div>
|
||||
</mat-list-item>
|
||||
|
||||
|
||||
<mat-list-item *ngIf="selectedTocEntry.type === tocEntryEnumValues.FieldSet" class="mli">
|
||||
<div class="action-list-item">
|
||||
<mat-icon class="action-list-icon">file_copy</mat-icon>
|
||||
<span class="action-list-text" (click)="cloneFieldSet(selectedTocEntry.form)">{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.CLONE' | translate}}</span>
|
||||
</div>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item *ngIf="selectedTocEntry.type === tocEntryEnumValues.FieldSet" class="mli">
|
||||
<div class="action-list-item">
|
||||
<mat-icon class="action-list-icon">delete</mat-icon>
|
||||
<span class="action-list-text" (click)="onRemoveEntry(selectedTocEntry)">{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.DELETE' | translate}}</span>
|
||||
</div>
|
||||
</mat-list-item>
|
||||
</ng-container> -->
|
||||
|
||||
<!-- </div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<mat-accordion class="col-12" [multi]="true">
|
||||
<mat-expansion-panel *ngFor="let section of dataModel.sections; let i=index;" #panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title class="toc-page-header">{{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}
|
||||
</mat-panel-title>
|
||||
<button mat-icon-button type="button" class="deleteBtn" (click)="DeleteSection(i);"
|
||||
[disabled]="viewOnly">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</mat-expansion-panel-header>
|
||||
<div id="{{'s' + i}}" class="row" *ngIf="panel.expanded">
|
||||
<app-dataset-profile-editor-section-component class="col-12"
|
||||
[form]="form.get('sections').get(''+i)" [dataModel]="section"
|
||||
[indexPath]="'s' + i" [viewOnly]="viewOnly">
|
||||
</app-dataset-profile-editor-section-component>
|
||||
</div>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-12">
|
||||
|
@ -450,10 +362,20 @@
|
|||
<!-- {{'DATASET-PROFILE-EDITOR.ACTIONS.PREVIEW-AND-FINALIZE' | translate}} -->
|
||||
<!-- <button (click)="generatePreviewForm()">foo</button> -->
|
||||
<ng-container *ngIf="formGroup">
|
||||
<div class="row">
|
||||
<div class="col-3 sticky-top" style="display: flex; height: 40vh;">
|
||||
|
||||
<app-final-preview-component [formGroup]="formGroup" [visibilityRules]="visibilityRules">
|
||||
<ng-container *ngTemplateOutlet="actions">
|
||||
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="col">
|
||||
<app-final-preview-component [formGroup]="formGroup" [visibilityRules]="visibilityRules">
|
||||
|
||||
</app-final-preview-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</app-final-preview-component>
|
||||
|
||||
<!--
|
||||
|
||||
|
@ -548,3 +470,12 @@
|
|||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<ng-template #actions>
|
||||
<div class="actions-template">
|
||||
<button mat-raised-button class="template_action_btn" (click)="discardChanges()">{{'DMP-EDITOR.ACTIONS.DISCARD' | translate}}</button>
|
||||
<button mat-raised-button class="template_action_btn save-btn" (click)="onSubmit()" [disabled]="!form.valid || viewOnly">{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |translate}}</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -135,9 +135,23 @@ $blue-color-light: #5cf7f2;
|
|||
background: transparent;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
height: 2.5em;
|
||||
box-shadow: 0px 3px 6px #1E202029;
|
||||
color: #129D99;
|
||||
flex: 0 0 auto;
|
||||
&.save-btn{
|
||||
background-color: #f7dd72;
|
||||
border: 1px solid transparent;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
box-shadow: 0px 3px 6px #1E202029;
|
||||
color: #212121;
|
||||
|
||||
transition-property: background-color, color;
|
||||
transition-duration: 200ms;
|
||||
transition-delay: 50ms;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
&:disabled{
|
||||
background-color: #CBCBCB;
|
||||
color: #FFF;
|
||||
|
@ -305,3 +319,36 @@ $blue-color-light: #5cf7f2;
|
|||
bottom: 2em;
|
||||
right: 2em;
|
||||
}
|
||||
|
||||
|
||||
#stepper-navigation-wrapper{
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
#stepper-navigation{
|
||||
background-color: #f4f4f4;
|
||||
z-index: 99;
|
||||
}
|
||||
}
|
||||
|
||||
.actions-template{
|
||||
align-self:flex-end;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.stepper-navigation-outer-wrapper{
|
||||
padding: 2em;
|
||||
margin-bottom: 1em;
|
||||
background: #f4f4f4;
|
||||
position: sticky;
|
||||
top: 0.01em;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
#title-column{
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
|
|
@ -238,14 +238,6 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
|||
// if(!this.userFormDisabled)
|
||||
this.inputUserState = 'untriggered';
|
||||
});
|
||||
// combineLatest(this._inputUserButton$.asObservable(),this._inputUserField$.asObservable())
|
||||
// .pipe(takeUntil(this._destroyed))
|
||||
// .pipe(debounceTime(200))
|
||||
// .pipe(filter(_=> _[0] || _[1]))
|
||||
// .subscribe(_=>{
|
||||
// // if(!this.userFormDisabled)
|
||||
// this.inputUserState = 'triggered';
|
||||
// });
|
||||
}
|
||||
|
||||
private _initializeToCEntries(){
|
||||
|
@ -257,8 +249,11 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
|||
this.selectedTocEntry = tocentries[0];
|
||||
}
|
||||
setTimeout(() => {
|
||||
const stepperNavigation = document.getElementById('stepper-navigation');
|
||||
if(stepperNavigation){
|
||||
// const stepperNavigation = document.getElementById('stepper-navigation');
|
||||
const titleColumn = document.getElementById('title-column');
|
||||
// const stepperNavigationWrapper = document.getElementById('stepper-navigation-wrapper');
|
||||
|
||||
if(titleColumn){
|
||||
if(this.stepperNavigationObserver){
|
||||
this.stepperNavigationObserver.disconnect();
|
||||
this.stepperNavigationObserver = null;
|
||||
|
@ -267,12 +262,16 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
|||
e.forEach(_=>{
|
||||
if(_.isIntersecting){
|
||||
this.showScrollOnTopButton = false;
|
||||
// stepperNavigation.classList.remove('fixed-navigation');
|
||||
// stepperNavigationWrapper.classList.remove('fixed-navigation');
|
||||
}else{
|
||||
this.showScrollOnTopButton = true;
|
||||
// stepperNavigation.classList.add('fixed-navigation');
|
||||
// stepperNavigationWrapper.classList.add('fixed-navigation');
|
||||
}
|
||||
})
|
||||
}, {root:null, rootMargin:'0px', threshold:1});
|
||||
this.stepperNavigationObserver.observe(stepperNavigation);
|
||||
}, {root:null, rootMargin:'0px', threshold:0});
|
||||
this.stepperNavigationObserver.observe(titleColumn);
|
||||
}else{
|
||||
console.log('Could not load scroll On Top Observer')
|
||||
}
|
||||
|
@ -1987,6 +1986,11 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
|||
}
|
||||
|
||||
}
|
||||
discardChanges(){
|
||||
this.router.navigate([
|
||||
'dataset-profiles'
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue