Dataset editor restyle - 1st commit
This commit is contained in:
parent
2e467f8277
commit
fdc0d3a8b8
|
@ -1,17 +1,27 @@
|
||||||
<div class=" row dataset-editor" [formGroup]="formGroup">
|
<div class="container-fluid">
|
||||||
<mat-form-field class="col-md-6">
|
<div class="row dataset-editor" [formGroup]="formGroup">
|
||||||
<input matInput placeholder="{{'DATASET-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required>
|
<div class="col-12">
|
||||||
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error>
|
<div class="row">
|
||||||
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-form-field class="col-6">
|
||||||
</mat-form-field>
|
<input matInput placeholder="{{'DATASET-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required>
|
||||||
<mat-form-field class="col-md-6">
|
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error>
|
||||||
<input matInput placeholder="{{'DATASET-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri">
|
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
<mat-error *ngIf="formGroup.get('uri').hasError('backendError')">{{formGroup.get('uri').getError('backendError').message}}</mat-error>
|
</mat-form-field>
|
||||||
<mat-error *ngIf="formGroup.get('uri').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
</div>
|
||||||
</mat-form-field>
|
<div class="row">
|
||||||
<mat-form-field class="col-12">
|
<mat-form-field class="col-6">
|
||||||
<textarea matInput class="description-area" placeholder="{{'DATASET-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"></textarea>
|
<input matInput placeholder="{{'DATASET-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri">
|
||||||
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">{{formGroup.get('description').getError('backendError').message}}</mat-error>
|
<mat-error *ngIf="formGroup.get('uri').hasError('backendError')">{{formGroup.get('uri').getError('backendError').message}}</mat-error>
|
||||||
<mat-error *ngIf="formGroup.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="formGroup.get('uri').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<mat-form-field class="col-6">
|
||||||
|
<textarea matInput class="description-area" placeholder="{{'DATASET-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description"></textarea>
|
||||||
|
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">{{formGroup.get('description').getError('backendError').message}}</mat-error>
|
||||||
|
<mat-error *ngIf="formGroup.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,114 @@
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card dataset-wizard">
|
||||||
|
<div class="card-header card-header-plain d-flex">
|
||||||
|
<div class="card-desc d-flex flex-column justify-content-center">
|
||||||
|
<h4 *ngIf="!isNew" class="card-title">{{datasetWizardModel?.label}}
|
||||||
|
<span *ngIf="this.formGroup && this.formGroup.dirty"> -
|
||||||
|
{{ 'GENERAL.STATUSES.EDIT' | translate }}</span>
|
||||||
|
</h4>
|
||||||
|
<div *ngIf="isNew" class="card-desc new-dataset d-flex flex-column justify-content-center">
|
||||||
|
<h4 class="card-title">{{ 'DATASET-WIZARD.TITLE.NEW' | translate }}</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex ml-auto p-2" *ngIf="datasetWizardModel && !isNew">
|
||||||
|
<button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon"
|
||||||
|
*ngIf="!publicMode" (click)="$event.stopImmediatePropagation();">
|
||||||
|
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
||||||
|
</button>
|
||||||
|
<mat-menu #actionsMenu="matMenu">
|
||||||
|
<button mat-menu-item (click)="openDmpSearchDialogue()" class="menu-item">
|
||||||
|
<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
|
||||||
|
</button>
|
||||||
|
<button mat-menu-item *ngIf="!viewOnly && !isCopy"
|
||||||
|
(click)="openConfirm(formGroup.get('label').value, formGroup.get('id').value)"
|
||||||
|
class="menu-item">
|
||||||
|
<mat-icon>delete</mat-icon>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}
|
||||||
|
</button>
|
||||||
|
<button mat-menu-item (click)="advancedClicked()" class="menu-item">
|
||||||
|
<mat-icon>save_alt</mat-icon>{{ 'DMP-LISTING.ACTIONS.ADV-EXP' | translate }}
|
||||||
|
</button>
|
||||||
|
<button mat-menu-item *ngIf="needsUpdate()" class="menu-item"
|
||||||
|
(click)="openUpdateDatasetProfileDialogue();">{{ 'DATASET-WIZARD.ACTIONS.UPDATE-DATASET-PROFILE' | translate }}</button>
|
||||||
|
</mat-menu>
|
||||||
|
<button mat-raised-button color="primary" (click)="downloadPDF()"
|
||||||
|
class="lightblue-btn ml-2 text-uppercase">
|
||||||
|
<mat-icon>save_alt</mat-icon> {{ 'DMP-LISTING.ACTIONS.EXPORT' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<form *ngIf="formGroup" (ngSubmit)="formSubmit()">
|
||||||
|
<div class="d-flex flex-column">
|
||||||
|
<mat-tab-group class="mt-3">
|
||||||
|
<mat-tab>
|
||||||
|
<ng-template mat-tab-label class="tab-label">
|
||||||
|
<i class="material-icons-outlined mr-2">view_agenda</i>
|
||||||
|
DATASET DETAILS
|
||||||
|
</ng-template>
|
||||||
|
<form *ngIf="formGroup" [formGroup]="formGroup" class="p-3">
|
||||||
|
<mat-form-field class="col-md-6">
|
||||||
|
<app-single-auto-complete [required]="true" [formControl]="formGroup.get('dmp')"
|
||||||
|
placeholder="{{'DATASET-EDITOR.FIELDS.DMP' | translate}}"
|
||||||
|
[configuration]="dmpAutoCompleteConfiguration">
|
||||||
|
</app-single-auto-complete>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="col-md-6">
|
||||||
|
<mat-select placeholder=" {{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}"
|
||||||
|
[required]="true" formControlName="profile">
|
||||||
|
<mat-option *ngFor="let profile of availableProfiles" [value]="profile.id" (onSelectionChange)="selctionChanged()">
|
||||||
|
{{profile.label}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<mat-error *ngIf="formGroup.get('profile').hasError('backendError')">
|
||||||
|
{{formGroup.get('profile').getError('backendError').message}}</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
<app-dataset-editor-component [formGroup]="formGroup"></app-dataset-editor-component>
|
||||||
|
</form>
|
||||||
|
</mat-tab>
|
||||||
|
<mat-tab>
|
||||||
|
<ng-template mat-tab-label>
|
||||||
|
<mat-icon class="mr-2">work_outline</mat-icon>
|
||||||
|
EXTERNAL REFERENCES
|
||||||
|
</ng-template>
|
||||||
|
<form *ngIf="formGroup" [formGroup]="formGroup" class="p-3">
|
||||||
|
<app-dataset-external-references-editor-component [formGroup]="formGroup"
|
||||||
|
[viewOnly]="viewOnly"></app-dataset-external-references-editor-component>
|
||||||
|
</form>
|
||||||
|
</mat-tab>
|
||||||
|
<mat-tab [disabled]="isNew && (formGroup.get('profile').disabled || formGroup.get('profile').invalid)">
|
||||||
|
<ng-template mat-tab-label>
|
||||||
|
<div class="d-flex">
|
||||||
|
<mat-icon class="mr-2">library_books</mat-icon>
|
||||||
|
DESCRIPTION
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<app-dataset-description-form
|
||||||
|
*ngIf="formGroup && datasetWizardModel && datasetWizardModel.datasetProfileDefinition"
|
||||||
|
[form]="this.formGroup.get('datasetProfileDefinition')"
|
||||||
|
[visibilityRules]="datasetWizardModel.datasetProfileDefinition.rules"
|
||||||
|
[datasetProfileId]="formGroup.get('profile').value">
|
||||||
|
</app-dataset-description-form>
|
||||||
|
</mat-tab>
|
||||||
|
</mat-tab-group>
|
||||||
|
|
||||||
|
<div class="actions">
|
||||||
|
<button mat-raised-button (click)="cancel()" type="button" class="cancelButton">
|
||||||
|
{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}
|
||||||
|
</button>
|
||||||
|
<button *ngIf="datasetWizardModel.status == 0 || isNew" mat-raised-button class="saveButton" (click)="save();"
|
||||||
|
type="button">{{ 'DATASET-WIZARD.ACTIONS.SAVE' | translate }}</button>
|
||||||
|
<button *ngIf="datasetWizardModel.status == 0 || isNew" mat-raised-button [disabled]="!formGroup.valid" class="saveAndFinalizeButton"
|
||||||
|
(click)="saveFinalize();"
|
||||||
|
type="button">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-FINALISE' | translate }}</button>
|
||||||
|
<div class="fill-space"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="main-content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="dataset-wizard">
|
<div class="dataset-wizard">
|
||||||
<h3 *ngIf="isNew">{{ 'DATASET-WIZARD.TITLE.NEW' | translate }}</h3>
|
<h3 *ngIf="isNew">{{ 'DATASET-WIZARD.TITLE.NEW' | translate }}</h3>
|
||||||
|
@ -18,9 +128,9 @@
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode">
|
<button mat-icon-button [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button> -->
|
||||||
|
|
||||||
<!-- <div class="col"></div>
|
<!-- <div class="col"></div>
|
||||||
<div class="col-auto" *ngIf=" !viewOnly">
|
<div class="col-auto" *ngIf=" !viewOnly">
|
||||||
<button *ngIf="!editMode" class="col-auto" mat-icon-button (click)="enableForm()">
|
<button *ngIf="!editMode" class="col-auto" mat-icon-button (click)="enableForm()">
|
||||||
<mat-icon class="mat-24">edit</mat-icon>
|
<mat-icon class="mat-24">edit</mat-icon>
|
||||||
|
@ -29,7 +139,8 @@
|
||||||
<mat-icon class="mat-24">lock</mat-icon>
|
<mat-icon class="mat-24">lock</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
|
||||||
|
<!-- </div>
|
||||||
<div *ngIf="this.datasetProfileDefinitionModel || this.datasetWizardModel?.datasetProfileDefinition">
|
<div *ngIf="this.datasetProfileDefinitionModel || this.datasetWizardModel?.datasetProfileDefinition">
|
||||||
<button mat-raised-button color="primary" *ngIf="!isNew && !viewOnly && !isCopy" class="deleteButton" (click)="openConfirm(formGroup.get('label').value, formGroup.get('id').value)"
|
<button mat-raised-button color="primary" *ngIf="!isNew && !viewOnly && !isCopy" class="deleteButton" (click)="openConfirm(formGroup.get('label').value, formGroup.get('id').value)"
|
||||||
type="button">{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}</button>
|
type="button">{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}</button>
|
||||||
|
@ -109,8 +220,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-step>
|
</mat-step> -->
|
||||||
<!-- <mat-step class="step-container">
|
|
||||||
|
<!-- <mat-step class="step-container">
|
||||||
<ng-template matStepLabel>{{'DATASET-WIZARD.FOURTH-STEP.TITLE' | translate}}</ng-template>
|
<ng-template matStepLabel>{{'DATASET-WIZARD.FOURTH-STEP.TITLE' | translate}}</ng-template>
|
||||||
<div *ngIf="this.isActiveStep(3)">
|
<div *ngIf="this.isActiveStep(3)">
|
||||||
<app-dynamic-form-pending-questions-display class="full-width" *ngIf="formGroup && datasetWizardModel && datasetWizardModel.datasetProfileDefinition" [form]="this.formGroup.get('datasetProfileDefinition')" [dataModel]="datasetWizardModel"></app-dynamic-form-pending-questions-display>
|
<app-dynamic-form-pending-questions-display class="full-width" *ngIf="formGroup && datasetWizardModel && datasetWizardModel.datasetProfileDefinition" [form]="this.formGroup.get('datasetProfileDefinition')" [dataModel]="datasetWizardModel"></app-dynamic-form-pending-questions-display>
|
||||||
|
@ -120,8 +232,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-step> -->
|
</mat-step> -->
|
||||||
</mat-horizontal-stepper>
|
|
||||||
|
<!-- </mat-horizontal-stepper>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
|
@ -1,47 +1,92 @@
|
||||||
.dataset-wizard {
|
.dataset-wizard {
|
||||||
.step-container {
|
.step-container {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
.external-item-card {
|
.external-item-card {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
.external-item-action-row,
|
.external-item-action-row,
|
||||||
.description-action-row {
|
.description-action-row {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
.deleteButton {
|
.deleteButton {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
.saveButton {
|
.cancelButton {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
.saveAndFinalizeButton {
|
.saveButton {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
.downloadPDF {
|
.saveAndFinalizeButton {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
.downloadXML {
|
.downloadPDF {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
.downloadDOCX {
|
.downloadXML {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
.updateDatasetProfile {
|
.downloadDOCX {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
.updateDatasetProfile {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions > button {
|
||||||
|
background-color: #0070c0 !important;
|
||||||
|
color: #ffffff;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more-horiz {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #aaaaaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more-icon :hover {
|
||||||
|
color: #4687e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.new-dataset {
|
||||||
|
height: 3.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item {
|
||||||
|
width: 248px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .mat-tab-labels {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .mat-tab-label-content {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .mat-ink-bar {
|
||||||
|
background-color: #0070c0 !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormControl, FormGroup } from '@angular/forms';
|
||||||
import { MatDialog, MatSnackBar, MatStepper } from '@angular/material';
|
import { MatDialog, MatSnackBar, MatStepper } from '@angular/material';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import * as FileSaver from 'file-saver';
|
import * as FileSaver from 'file-saver';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@ -9,6 +9,7 @@ import { takeUntil } from 'rxjs/operators';
|
||||||
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
|
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
|
||||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||||
import { DatasetStatus } from '../../../core/common/enum/dataset-status';
|
import { DatasetStatus } from '../../../core/common/enum/dataset-status';
|
||||||
|
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
|
||||||
import { DatasetProfileModel } from '../../../core/model/dataset/dataset-profile';
|
import { DatasetProfileModel } from '../../../core/model/dataset/dataset-profile';
|
||||||
import { DmpModel } from '../../../core/model/dmp/dmp';
|
import { DmpModel } from '../../../core/model/dmp/dmp';
|
||||||
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
|
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
|
||||||
|
@ -19,17 +20,15 @@ import { DatasetWizardService } from '../../../core/services/dataset-wizard/data
|
||||||
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
||||||
import { ExternalSourcesConfigurationService } from '../../../core/services/external-sources/external-sources-configuration.service';
|
import { ExternalSourcesConfigurationService } from '../../../core/services/external-sources/external-sources-configuration.service';
|
||||||
import { ExternalSourcesService } from '../../../core/services/external-sources/external-sources.service';
|
import { ExternalSourcesService } from '../../../core/services/external-sources/external-sources.service';
|
||||||
|
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
|
||||||
import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration';
|
import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration';
|
||||||
|
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
|
||||||
|
import { ExportMethodDialogComponent } from '../../../library/export-method-dialog/export-method-dialog.component';
|
||||||
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
|
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
|
||||||
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
|
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
|
||||||
import { DatasetDescriptionFormEditorModel } from '../../misc/dataset-description-form/dataset-description-form.model';
|
import { DatasetDescriptionFormEditorModel } from '../../misc/dataset-description-form/dataset-description-form.model';
|
||||||
import { DatasetWizardEditorModel } from './dataset-wizard-editor.model';
|
|
||||||
import { SnackBarNotificationLevel, UiNotificationService, SnackBarNotification } from '../../../core/services/notification/ui-notification-service';
|
|
||||||
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
|
|
||||||
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
|
|
||||||
import { DatasetCopyDialogueComponent } from './dataset-copy-dialogue/dataset-copy-dialogue.component';
|
import { DatasetCopyDialogueComponent } from './dataset-copy-dialogue/dataset-copy-dialogue.component';
|
||||||
import { FormControl } from '@angular/forms';
|
import { DatasetWizardEditorModel } from './dataset-wizard-editor.model';
|
||||||
import { error } from 'selenium-webdriver';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-wizard-component',
|
selector: 'app-dataset-wizard-component',
|
||||||
|
@ -50,7 +49,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
datasetWizardModel: DatasetWizardEditorModel;
|
datasetWizardModel: DatasetWizardEditorModel;
|
||||||
isNew = true;
|
isNew = true;
|
||||||
isCopy = false;
|
isCopy = false;
|
||||||
formGroup: FormGroup;
|
formGroup: FormGroup = null;
|
||||||
datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel;
|
datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel;
|
||||||
|
|
||||||
availableProfiles: DatasetProfileModel[] = [];
|
availableProfiles: DatasetProfileModel[] = [];
|
||||||
|
@ -322,18 +321,50 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
this.formGroup.get('dmp').valueChanges
|
this.formGroup.get('dmp').valueChanges
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(x => {
|
.subscribe(x => {
|
||||||
if (x) { this.loadDatasetProfiles(); }
|
this.dmpValueChanged(x);
|
||||||
else {
|
|
||||||
this.availableProfiles = [];
|
|
||||||
this.formGroup.get('profile').reset();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
this.formGroup.get('profile').valueChanges
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(x => {
|
||||||
|
this.datasetProfileValueChanged(x);
|
||||||
|
});
|
||||||
|
this.dmpValueChanged(null);
|
||||||
}
|
}
|
||||||
this.route.params
|
|
||||||
|
// this.route.params
|
||||||
|
// .pipe(takeUntil(this._destroyed))
|
||||||
|
// .subscribe((params: Params) => {
|
||||||
|
// const itemId = params['id'];
|
||||||
|
// if (itemId != null) { setTimeout(() => this.stepper.selectedIndex = 2); }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
dmpValueChanged(dmp: DmpListingModel) {
|
||||||
|
if (dmp) {
|
||||||
|
this.formGroup.get('profile').enable();
|
||||||
|
this.loadDatasetProfiles();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.availableProfiles = [];
|
||||||
|
this.formGroup.get('profile').reset();
|
||||||
|
this.formGroup.get('profile').disable();
|
||||||
|
this.formGroup.removeControl('datasetProfileDefinition');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
datasetProfileValueChanged(profiledId: string) {
|
||||||
|
console.log("inhere");
|
||||||
|
if (profiledId && profiledId.length > 0) {
|
||||||
|
this.formGroup.removeControl('datasetProfileDefinition');
|
||||||
|
this.getDefinition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
selctionChanged() {
|
||||||
|
this.formGroup.get('profile').valueChanges
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe((params: Params) => {
|
.subscribe(x => {
|
||||||
const itemId = params['id'];
|
this.datasetProfileValueChanged(x);
|
||||||
if (itemId != null) { setTimeout(() => this.stepper.selectedIndex = 2); }
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,20 +391,18 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
}
|
}
|
||||||
|
|
||||||
public cancel(): void {
|
public cancel(): void {
|
||||||
//this.router.navigate(['/plans']);
|
this.router.navigate(['/datasets']);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefinition() {
|
getDefinition() {
|
||||||
if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
|
// if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
|
||||||
if (this.isNew) {
|
this.datasetWizardService.getDefinition(this.formGroup.get('profile').value)
|
||||||
this.datasetWizardService.getDefinition(this.formGroup.get('profile').value)
|
.pipe(takeUntil(this._destroyed))
|
||||||
.pipe(takeUntil(this._destroyed))
|
.subscribe(item => {
|
||||||
.subscribe(item => {
|
this.datasetWizardModel.datasetProfileDefinition = new DatasetDescriptionFormEditorModel().fromModel(item);
|
||||||
this.datasetWizardModel.datasetProfileDefinition = new DatasetDescriptionFormEditorModel().fromModel(item);
|
this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
|
||||||
this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
|
this.formGroup.addControl('datasetProfileDefinition', this.datasetProfileDefinitionModel.buildForm());
|
||||||
this.formGroup.addControl('datasetProfileDefinition', this.datasetProfileDefinitionModel.buildForm());
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
formSubmit(): void {
|
formSubmit(): void {
|
||||||
|
@ -389,17 +418,17 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
this.datasetWizardService.createDataset(this.formGroup.value)
|
this.datasetWizardService.createDataset(this.formGroup.value)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => {
|
complete => {
|
||||||
this.datasetWizardService.getSingle(complete.id)
|
this.datasetWizardService.getSingle(complete.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
result => {
|
result => {
|
||||||
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(result);
|
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(result);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.onCallbackSuccess();
|
this.onCallbackSuccess();
|
||||||
},
|
},
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,8 +468,6 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadPDF(): void {
|
downloadPDF(): void {
|
||||||
|
|
||||||
|
|
||||||
this.datasetWizardService.downloadPDF(this.downloadDocumentId)
|
this.datasetWizardService.downloadPDF(this.downloadDocumentId)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(response => {
|
.subscribe(response => {
|
||||||
|
@ -474,6 +501,27 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
advancedClicked() {
|
||||||
|
const dialogRef = this.dialog.open(ExportMethodDialogComponent, {
|
||||||
|
maxWidth: '400px',
|
||||||
|
data: {
|
||||||
|
message: "Download as:",
|
||||||
|
XMLButton: "XML",
|
||||||
|
documentButton: "Document",
|
||||||
|
pdfButton: "PDF"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
|
if (result == "pdf") {
|
||||||
|
this.downloadPDF();
|
||||||
|
} else if (result == "xml") {
|
||||||
|
this.downloadXML();
|
||||||
|
} else if (result == "doc") {
|
||||||
|
this.downloadDOCX();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getFilenameFromContentDispositionHeader(header: string): string {
|
getFilenameFromContentDispositionHeader(header: string): string {
|
||||||
const regex: RegExp = new RegExp(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/g);
|
const regex: RegExp = new RegExp(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/g);
|
||||||
|
|
||||||
|
@ -530,7 +578,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
|
|
||||||
openConfirm(dmpLabel, id): void {
|
openConfirm(dmpLabel, id): void {
|
||||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||||
//maxWidth: '300px',
|
maxWidth: '300px',
|
||||||
data: {
|
data: {
|
||||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-ITEM'),
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-ITEM'),
|
||||||
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
||||||
|
@ -542,8 +590,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
this.datasetWizardService.delete(id)
|
this.datasetWizardService.delete(id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => { this.onCallbackSuccess(); this.router.navigateByUrl('/datasets') },
|
complete => { this.onCallbackSuccess(); this.router.navigateByUrl('/datasets') },
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { DatasetListingComponent } from './listing/dataset-listing.component';
|
||||||
import { DatasetCopyDialogueComponent } from './dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
|
import { DatasetCopyDialogueComponent } from './dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
|
||||||
import { DatasetUploadDialogue } from './listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component';
|
import { DatasetUploadDialogue } from './listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component';
|
||||||
import { DatasetListingItemComponent } from './listing/listing-item/dataset-listing-item.component';
|
import { DatasetListingItemComponent } from './listing/listing-item/dataset-listing-item.component';
|
||||||
|
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -28,6 +29,7 @@ import { DatasetListingItemComponent } from './listing/listing-item/dataset-list
|
||||||
ConfirmationDialogModule,
|
ConfirmationDialogModule,
|
||||||
AutoCompleteModule,
|
AutoCompleteModule,
|
||||||
ExternalSourcesModule,
|
ExternalSourcesModule,
|
||||||
|
ExportMethodDialogModule,
|
||||||
DatasetDescriptionFormModule,
|
DatasetDescriptionFormModule,
|
||||||
DatasetRoutingModule
|
DatasetRoutingModule
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
.dynamic-form-section {
|
.dynamic-form-section {
|
||||||
.expansion-panel {
|
.expansion-panel {
|
||||||
|
background-color: #eeeeee54;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
.addOneFieldButton {
|
.addOneFieldButton {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<form *ngIf="form" novalidate [formGroup]="form">
|
<form *ngIf="form" novalidate [formGroup]="form">
|
||||||
<div class="dynamic-form-editor row">
|
<div class="dynamic-form-editor">
|
||||||
<app-form-progress-indication class="col-12" *ngIf="form" [formGroup]="form"></app-form-progress-indication>
|
<app-form-progress-indication class="col-12" *ngIf="form" [formGroup]="form"></app-form-progress-indication>
|
||||||
|
|
||||||
<div class="col-12" id="form-container">
|
<div class="col-12" id="form-container">
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
.dynamic-form-editor {
|
.dynamic-form-editor {
|
||||||
mat-vertical-stepper {
|
mat-vertical-stepper {
|
||||||
background-color: #e0e0e0;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// .ng-sidebar {
|
// .ng-sidebar {
|
||||||
// width: 40%;
|
// width: 40%;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// /* .toc-container {
|
// /* .toc-container {
|
||||||
|
@ -31,12 +31,12 @@
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// .ng-sidebar-container {
|
// .ng-sidebar-container {
|
||||||
// overflow: inherit !important;
|
// overflow: inherit !important;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// /* .ng-sidebar__content {
|
// /* .ng-sidebar__content {
|
||||||
// overflow: inherit !important;
|
// overflow: inherit !important;
|
||||||
// } */
|
// } */
|
||||||
|
|
||||||
// .alignment-center{
|
// .alignment-center{
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
// .full-width{
|
// .full-width{
|
||||||
// width:100%;
|
// width:100%;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// .full-height{
|
// .full-height{
|
||||||
// height:100%;
|
// height:100%;
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
input:-webkit-autofill {
|
||||||
|
-webkit-box-shadow: inset 0 0 0px 9999px white;
|
||||||
|
}
|
||||||
|
|
||||||
*:focus {
|
*:focus {
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
}
|
}
|
||||||
|
@ -17,9 +21,9 @@ h4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
h6 {
|
h6 {
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.max-width-136 {
|
.max-width-136 {
|
||||||
|
@ -220,8 +224,8 @@ h6 {
|
||||||
/* font-size: 9px; */
|
/* font-size: 9px; */
|
||||||
/* font-weight: 500; */
|
/* font-weight: 500; */
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card [class*="card-header-"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
|
.card [class*="card-header-"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
|
||||||
|
|
Loading…
Reference in New Issue