diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html
index b53e87f72..1a82038bb 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html
@@ -1,17 +1,27 @@
-
-
-
- {{formGroup.get('label').getError('backendError').message}}
- {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
-
-
- {{formGroup.get('uri').getError('backendError').message}}
- {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
-
-
- {{formGroup.get('description').getError('backendError').message}}
- {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
+
+
+
+
+
+
+ {{formGroup.get('label').getError('backendError').message}}
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+
+
+
+
+ {{formGroup.get('uri').getError('backendError').message}}
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+
+
+
+
+ {{formGroup.get('description').getError('backendError').message}}
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+
+
+
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html
index 3d1387380..ecc42e566 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html
@@ -1,4 +1,114 @@
+
+
-
-
+
+
+
+
-
+
+
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss
index 5c53329ef..a3b62250a 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss
@@ -1,47 +1,92 @@
.dataset-wizard {
- .step-container {
- margin-top: 1em;
- }
- .external-item-card {
- margin-top: 1em;
- }
- .external-item-action-row,
- .description-action-row {
- margin-top: 1em;
- }
- .deleteButton {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- .saveButton {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- .saveAndFinalizeButton {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- .downloadPDF {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- .downloadXML {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- .downloadDOCX {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- .updateDatasetProfile {
- margin-top: 15px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
+ .step-container {
+ margin-top: 1em;
+ }
+ .external-item-card {
+ margin-top: 1em;
+ }
+ .external-item-action-row,
+ .description-action-row {
+ margin-top: 1em;
+ }
+ .deleteButton {
+ margin-top: 15px;
+ margin-bottom: 15px;
+ margin-right: 15px;
+ }
+ .cancelButton {
+ margin-top: 15px;
+ margin-bottom: 15px;
+ margin-right: 15px;
+ }
+ .saveButton {
+ margin-top: 15px;
+ margin-bottom: 15px;
+ margin-right: 15px;
+ }
+ .saveAndFinalizeButton {
+ margin-top: 15px;
+ margin-bottom: 15px;
+ margin-right: 15px;
+ }
+ .downloadPDF {
+ margin-top: 15px;
+ margin-bottom: 15px;
+ margin-right: 15px;
+ }
+ .downloadXML {
+ margin-top: 15px;
+ margin-bottom: 15px;
+ margin-right: 15px;
+ }
+ .downloadDOCX {
+ margin-top: 15px;
+ margin-bottom: 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;
}
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts
index cc583ff98..239988f19 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts
@@ -1,7 +1,7 @@
-import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
-import { FormGroup } from '@angular/forms';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { FormControl, FormGroup } from '@angular/forms';
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 * as FileSaver from 'file-saver';
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 { BaseComponent } from '../../../core/common/base/base.component';
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 { DmpModel } from '../../../core/model/dmp/dmp';
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 { ExternalSourcesConfigurationService } from '../../../core/services/external-sources/external-sources-configuration.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 { 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 { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
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 { FormControl } from '@angular/forms';
-import { error } from 'selenium-webdriver';
+import { DatasetWizardEditorModel } from './dataset-wizard-editor.model';
@Component({
selector: 'app-dataset-wizard-component',
@@ -50,7 +49,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
datasetWizardModel: DatasetWizardEditorModel;
isNew = true;
isCopy = false;
- formGroup: FormGroup;
+ formGroup: FormGroup = null;
datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel;
availableProfiles: DatasetProfileModel[] = [];
@@ -322,18 +321,50 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
this.formGroup.get('dmp').valueChanges
.pipe(takeUntil(this._destroyed))
.subscribe(x => {
- if (x) { this.loadDatasetProfiles(); }
- else {
- this.availableProfiles = [];
- this.formGroup.get('profile').reset();
- }
+ this.dmpValueChanged(x);
});
+ 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))
- .subscribe((params: Params) => {
- const itemId = params['id'];
- if (itemId != null) { setTimeout(() => this.stepper.selectedIndex = 2); }
+ .subscribe(x => {
+ this.datasetProfileValueChanged(x);
});
}
@@ -360,20 +391,18 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
}
public cancel(): void {
- //this.router.navigate(['/plans']);
+ this.router.navigate(['/datasets']);
}
getDefinition() {
- if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
- if (this.isNew) {
- this.datasetWizardService.getDefinition(this.formGroup.get('profile').value)
- .pipe(takeUntil(this._destroyed))
- .subscribe(item => {
- this.datasetWizardModel.datasetProfileDefinition = new DatasetDescriptionFormEditorModel().fromModel(item);
- this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
- this.formGroup.addControl('datasetProfileDefinition', this.datasetProfileDefinitionModel.buildForm());
- });
- }
+ // if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
+ this.datasetWizardService.getDefinition(this.formGroup.get('profile').value)
+ .pipe(takeUntil(this._destroyed))
+ .subscribe(item => {
+ this.datasetWizardModel.datasetProfileDefinition = new DatasetDescriptionFormEditorModel().fromModel(item);
+ this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
+ this.formGroup.addControl('datasetProfileDefinition', this.datasetProfileDefinitionModel.buildForm());
+ });
}
formSubmit(): void {
@@ -389,17 +418,17 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
this.datasetWizardService.createDataset(this.formGroup.value)
.pipe(takeUntil(this._destroyed))
.subscribe(
- complete => {
- this.datasetWizardService.getSingle(complete.id)
- .pipe(takeUntil(this._destroyed))
- .subscribe(
- result => {
- this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(result);
- }
- );
- this.onCallbackSuccess();
- },
- error => this.onCallbackError(error)
+ complete => {
+ this.datasetWizardService.getSingle(complete.id)
+ .pipe(takeUntil(this._destroyed))
+ .subscribe(
+ result => {
+ this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(result);
+ }
+ );
+ this.onCallbackSuccess();
+ },
+ error => this.onCallbackError(error)
);
}
@@ -439,8 +468,6 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
}
downloadPDF(): void {
-
-
this.datasetWizardService.downloadPDF(this.downloadDocumentId)
.pipe(takeUntil(this._destroyed))
.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 {
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 {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
- //maxWidth: '300px',
+ maxWidth: '300px',
data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-ITEM'),
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)
.pipe(takeUntil(this._destroyed))
.subscribe(
- complete => { this.onCallbackSuccess(); this.router.navigateByUrl('/datasets') },
- error => this.onCallbackError(error)
+ complete => { this.onCallbackSuccess(); this.router.navigateByUrl('/datasets') },
+ error => this.onCallbackError(error)
);
}
});
diff --git a/dmp-frontend/src/app/ui/dataset/dataset.module.ts b/dmp-frontend/src/app/ui/dataset/dataset.module.ts
index 791f285ff..1296235b4 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset.module.ts
+++ b/dmp-frontend/src/app/ui/dataset/dataset.module.ts
@@ -19,6 +19,7 @@ import { DatasetListingComponent } from './listing/dataset-listing.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 { DatasetListingItemComponent } from './listing/listing-item/dataset-listing-item.component';
+import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
@NgModule({
imports: [
@@ -28,6 +29,7 @@ import { DatasetListingItemComponent } from './listing/listing-item/dataset-list
ConfirmationDialogModule,
AutoCompleteModule,
ExternalSourcesModule,
+ ExportMethodDialogModule,
DatasetDescriptionFormModule,
DatasetRoutingModule
],
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss
index d9df0bba6..80e23cb0a 100644
--- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss
+++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss
@@ -1,5 +1,6 @@
.dynamic-form-section {
.expansion-panel {
+ background-color: #eeeeee54;
margin-bottom: 1em;
}
.addOneFieldButton {
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html
index e0ad30eb6..4780ce4c1 100644
--- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html
+++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html
@@ -1,5 +1,5 @@