Makes the "Add new Dataset" button on Quick Wizard to not be seen when in edit mode.

This commit is contained in:
Diamantis Tziotzios 2019-03-26 17:52:21 +02:00
parent b76d7dd5b8
commit 0432aed3cb
2 changed files with 86 additions and 88 deletions

View File

@ -4,12 +4,12 @@
</div>
<div class="col-auto">
<mat-button-toggle-group [ngModel]="_inputValue">
<mat-button-toggle value="list" (change)="onValChange($event.value)" matTooltip="Dataset List">
<mat-icon>format_align_left</mat-icon>
</mat-button-toggle>
<mat-button-toggle value="add" (change)="onValChange($event.value)" matTooltip="Add Dataset">
<mat-button-toggle value="add" *ngIf="listingMode()" (change)="onValChange($event.value)" matTooltip="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.THIRD-STEP.ADD-BUTTON-TOOLTIP' | translate}}">
<mat-icon>add</mat-icon>
</mat-button-toggle>
<mat-button-toggle value="list" (change)="onValChange($event.value)" matTooltip="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.THIRD-STEP.LIST-BUTTON-TOOLTIP' | translate}}">
<mat-icon>format_align_left</mat-icon>
</mat-button-toggle>
</mat-button-toggle-group>
</div>
<div class="col-12">
@ -43,9 +43,12 @@
<div *ngIf="toggleButton === 2 && editedDataset" class="col-12">
<div class="row">
<mat-form-field class="col-md-12">
<input matInput placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.THIRD-STEP.DATASET-LABEL' | translate}}" type="string" name="datasetLabel" [formControl]="this.formGroup.get('datasets').get('datasetsList')['controls'][lastIndexOfDataset].get('datasetLabel')" required>
<input matInput placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.THIRD-STEP.DATASET-LABEL' | translate}}"
type="string" name="datasetLabel" [formControl]="this.formGroup.get('datasets').get('datasetsList')['controls'][lastIndexOfDataset].get('datasetLabel')"
required>
</mat-form-field>
<app-dataset-description-form class="col-12" [form]="this.formGroup.get('datasets').get('datasetsList')['controls'][lastIndexOfDataset]" [visibilityRules]="this.datasetProfileDefinition.rules" [datasetProfileId]="datasetProfile.value.id">
<app-dataset-description-form class="col-12" [form]="this.formGroup.get('datasets').get('datasetsList')['controls'][lastIndexOfDataset]"
[visibilityRules]="this.datasetProfileDefinition.rules" [datasetProfileId]="datasetProfile.value.id">
</app-dataset-description-form>
</div>
</div>

View File

@ -13,12 +13,6 @@ import { QuickWizardDatasetDescriptionModel } from "./quick-wizard-dataset-descr
import { IfStmt } from "@angular/compiler";
import { TranslateService } from "@ngx-translate/core";
@Component({
selector: 'app-dataset-editor-wizard-component',
templateUrl: 'dataset-editor-wizard.component.html',
@ -44,7 +38,6 @@ export class DatasetEditorWizardComponent extends BaseComponent implements OnIni
super();
}
ngOnInit(): void {
this.datasetWizardService.getDefinition(this.datasetProfile.value["id"])
.pipe(takeUntil(this._destroyed))
@ -73,8 +66,8 @@ export class DatasetEditorWizardComponent extends BaseComponent implements OnIni
this.toggleButton = 2;
this._inputValue = "dataset";
}
}
editDataset(index: number) {
this.lastIndexOfDataset = index;
this.toggleButton = 2;
@ -105,5 +98,7 @@ export class DatasetEditorWizardComponent extends BaseComponent implements OnIni
this.editedDataset = true;
}
listingMode() {
if (this.toggleButton === 0) return true;
}
}