diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfile.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfile.java index cdc7e3879..09b6c6497 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfile.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/DatasetProfile.java @@ -18,7 +18,7 @@ import java.util.UUID; public class DatasetProfile implements DataEntity { public enum Status { - ACTIVE((short) 1), INACTIVE((short) 0), DELETED((short) 99); + SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99); private short value; @@ -33,9 +33,9 @@ public class DatasetProfile implements DataEntity { public static Status fromInteger(int value) { switch (value) { case 0: - return INACTIVE; + return SAVED; case 1: - return ACTIVE; + return FINALIZED; case 99: return DELETED; default: diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java index e9a431da0..2d0416abf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Admin.java @@ -55,6 +55,7 @@ public class Admin extends BaseController { eu.eudat.data.entities.DatasetProfile modelDefinition = AdminManager.generateViewStyleDefinition(profile, getApiContext()); eu.eudat.data.entities.DatasetProfile datasetprofile = this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id)); datasetprofile.setDefinition(modelDefinition.getDefinition()); + datasetprofile.setStatus(modelDefinition.getStatus()); this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(datasetprofile); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.NO_MESSAGE)); } @@ -64,6 +65,7 @@ public class Admin extends BaseController { eu.eudat.data.entities.DatasetProfile profile = this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id)); eu.eudat.models.data.admin.composite.DatasetProfile datasetprofile = AdminManager.generateDatasetProfileModel(profile); datasetprofile.setLabel(profile.getLabel()); + datasetprofile.setStatus(profile.getStatus()); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.NO_MESSAGE).payload(datasetprofile)); } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/AdminManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/AdminManager.java index b0f297120..2af5d5455 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/AdminManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/AdminManager.java @@ -26,7 +26,7 @@ public class AdminManager { String xml = XmlBuilder.generateXml(viewStyleDoc); eu.eudat.data.entities.DatasetProfile datasetProfile = apiContext.getOperationsContext().getBuilderFactory().getBuilder(DatasetProfileBuilder.class).definition(xml).label(profile.getLabel()) - .status((short) 1).created(new Date()) + .status(profile.getStatus()).created(new Date()) .build(); return datasetProfile; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/admin/composite/DatasetProfile.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/admin/composite/DatasetProfile.java index 8eb7b08e9..8c7e7ecc9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/admin/composite/DatasetProfile.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/admin/composite/DatasetProfile.java @@ -10,6 +10,7 @@ public class DatasetProfile { private String label; private List
sections; private List pages; + private Short status; public List
getSections() { return sections; @@ -35,6 +36,14 @@ public class DatasetProfile { this.pages = pages; } + public Short getStatus() { + return status; + } + + public void setStatus(Short status) { + this.status = status; + } + public void buildProfile(eu.eudat.models.data.entities.xmlmodels.datasetprofiledefinition.ViewStyleModel viewStyle) { this.sections = new ModelBuilder().fromViewStyleDefinition(viewStyle.getSections(), Section.class); this.pages = new ModelBuilder().fromViewStyleDefinition(viewStyle.getPages(), Page.class); diff --git a/dmp-frontend/src/app/core/common/enum/dataset-profile.ts b/dmp-frontend/src/app/core/common/enum/dataset-profile.ts new file mode 100644 index 000000000..fcf5d9224 --- /dev/null +++ b/dmp-frontend/src/app/core/common/enum/dataset-profile.ts @@ -0,0 +1,5 @@ +export enum DatasetProfileEnum { + SAVED = 0, + FINALIZED = 1, + DELETED = 99 +} diff --git a/dmp-frontend/src/app/core/model/admin/dataset-profile/dataset-profile.ts b/dmp-frontend/src/app/core/model/admin/dataset-profile/dataset-profile.ts index 9badb6cfc..81c2ebd31 100644 --- a/dmp-frontend/src/app/core/model/admin/dataset-profile/dataset-profile.ts +++ b/dmp-frontend/src/app/core/model/admin/dataset-profile/dataset-profile.ts @@ -4,6 +4,7 @@ export interface DatasetProfile { label: string; sections: Section[]; pages: Page[]; + status: number; } export interface Page { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html index 121f1b05f..da3c28de1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html @@ -1,13 +1,13 @@
-

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.TITLE' +

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.TITLE' | translate}}

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.SIMPLE-FIELD-TITLE' | translate}}

- {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMPOSITE-CHECKBOX' + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMPOSITE-CHECKBOX' | translate}} - {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-CHECKBOX' + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-CHECKBOX' | translate}} - {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMMENT-CHECKBOX' + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMMENT-CHECKBOX' | translate}}
@@ -51,7 +51,7 @@ [formControl]="this.form.get('extendedDescription')"> + [showOrdinal]="false" [indexPath]="indexPath + 'f' + 0" [viewOnly]="viewOnly">

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.SUB-FIELDS-TITLE' | @@ -61,16 +61,16 @@ {{i + 1}}. {{getFieldTile(field, i)}}
-
- +

-
- \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index d74872513..2ada995c2 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -11,6 +11,7 @@ export class DatasetProfileEditorCompositeFieldComponent implements OnInit { @Input() form: FormGroup; @Input() indexPath: string; + @Input() viewOnly: boolean; isComposite = false; isMultiplicityEnabled = false; diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html index bdd0ad836..908050c10 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html @@ -1,7 +1,7 @@
- + {{'GENERAL.VALIDATION.REQUIRED' | translate}} {{'GENERAL.VALIDATION.PATTERN-_' | translate}} @@ -16,18 +16,16 @@ {{enumUtils.toDatasetProfileFieldViewStyleString(viewStyleEnum.RadioBox)}} {{enumUtils.toDatasetProfileFieldViewStyleString(viewStyleEnum.TextArea)}} - {{'GENERAL.VALIDATION.REQUIRED' - | translate}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + + [viewStyle]="form.get('viewStyle').get('renderStyle').value" [form]="this.form.get('defaultValue').get('value')" [formArrayOptions]="form.get('data')?.get('options')" + [comboBoxType]="this.form.get('data')?.get('type')?.value" placeHolder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.DEFAULT-VALUE' | translate}}" + [required]="defaulValueRequired(form.get('viewStyle').get('renderStyle').value)"> @@ -48,11 +46,12 @@
-

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | - translate}}

- -
-
\ No newline at end of file +

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | translate}} +

+ +
+ +
+ diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index 969519b53..4dd3c74d3 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -20,7 +20,7 @@ import { RuleEditorModel } from '../../../admin/rule-editor-model'; styleUrls: ['./dataset-profile-editor-field.component.scss'] }) export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit { - + @Input() viewOnly: boolean; @Input() form: FormGroup; @Input() showOrdinal = true; @Input() indexPath: string; @@ -82,7 +82,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements case DatasetProfileFieldViewStyle.BooleanDecision: return false; default: - return false; + return false; } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.html index d36923a0f..9017f02f1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.html @@ -6,8 +6,8 @@ [formControl]="pageControl.get('title')" required> {{'GENERAL.VALIDATION.REQUIRED' | translate}} - - \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts index 52e35cb03..ad52d3acc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component.ts @@ -9,6 +9,7 @@ import { FormArray } from '@angular/forms'; export class DatasetProfileEditorPageComponent { @Input() form: FormArray; + @Input() viewOnly: boolean; removePage(index) { (this.form).removeAt(index); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html index efb53db32..b92190104 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html @@ -17,8 +17,8 @@ -
- \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts index 88a2b9623..37e753353 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts @@ -17,7 +17,7 @@ export class DatasetProfileEditorRuleComponent { @Input() formControlForCheck: FormControl; @Input() formArrayOptionsForCheck: FormArray; @Input() comboBoxTypeForCheck: DatasetProfileComboBoxType; - + @Input() viewOnly: boolean; targetValidation() { //TODO diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html index 4660a5b46..b0dc5f47b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html @@ -35,14 +35,14 @@
{{i + 1}}. {{getFieldTile(fieldControl, i)}} - - +
-

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.SECTION.FIELDS.SUB-SECTIONS-TITLE' | translate}}

@@ -52,18 +52,18 @@ {{i + 1}}. {{form.get('sections').get(''+i).get('title').value}}
-
+ [indexPath]="indexPath + 's' + i" [viewOnly]="viewOnly">
-
- \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts index 23c999112..98b885051 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.ts @@ -17,6 +17,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen @Input() form: FormGroup; @Input() dataModel: SectionEditorModel; @Input() indexPath: string; + @Input() viewOnly: boolean; constructor() { super(); } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts index 1dc3c2a4e..01fd7d981 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor-model.ts @@ -10,11 +10,13 @@ export class DatasetProfileEditorModel extends BaseFormModel { public sections: Array = new Array(); public pages: Array = new Array(); public label: string; + public status: number; fromModel(item: DatasetProfile): DatasetProfileEditorModel { if (item.sections) { this.sections = item.sections.map(x => new SectionEditorModel().fromModel(x)); } if (item.pages) { this.pages = item.pages.map(x => new PageEditorModel().fromModel(x)); } this.label = item.label; + this.status = item.status; return this; } @@ -34,8 +36,8 @@ export class DatasetProfileEditorModel extends BaseFormModel { pagesFormArray.push(form); }); formGroup.addControl('pages', this.formBuilder.array(pagesFormArray)); - formGroup.addControl('label', new FormControl(this.label, Validators.required)); + formGroup.addControl('status', new FormControl(this.status)); return formGroup; } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html index cf7342ce8..20f81b709 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html @@ -1,7 +1,6 @@ 
- + {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -9,9 +8,10 @@ {{'DATASET-PROFILE-EDITOR.STEPS.PAGES.TITLE' | translate}}
- -
+ +
+ +
@@ -21,18 +21,19 @@ {{i + 1}}. {{form.get('sections').get(''+i).get('title').value}} -
+ [indexPath]="'s' + i" [viewOnly]="viewOnly">
-
+
+ +
- +
+
+ +
+ +
+
-
- \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index 720264e3e..7f4025b8e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -15,6 +15,7 @@ import { PageEditorModel } from '../admin/page-editor-model'; import { SectionEditorModel } from '../admin/section-editor-model'; import { DatasetProfileEditorModel } from './dataset-profile-editor-model'; import { ConfirmationDialogComponent } from '../../../../library/confirmation-dialog/confirmation-dialog.component'; +import { DatasetProfileEnum } from '../../../../core/common/enum/dataset-profile'; @Component({ selector: 'app-dataset-profile-editor-component', @@ -31,7 +32,7 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn private datasetProfileId: string; dataWizardModel: DatasetWizardModel; @ViewChild('stepper') stepper: MatHorizontalStepper; - + viewOnly = false; constructor( private datasetProfileService: DatasetProfileService, @@ -48,7 +49,6 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn } ngOnInit() { - this.route.paramMap.pipe(takeUntil(this._destroyed)).subscribe((paramMap: ParamMap) => { this.datasetProfileId = paramMap.get('id'); const cloneId = paramMap.get('cloneid'); @@ -58,39 +58,48 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn this.datasetProfileService.getDatasetProfileById(this.datasetProfileId) .pipe(map(data => data as DatasetProfile), takeUntil(this._destroyed)) .subscribe( - data => { - try { - this.dataModel = new DatasetProfileEditorModel().fromModel(data); - // this.isDeleted = this.masterItem.isActive === IsActive.Inactive; - this.form = this.dataModel.buildForm(); - this.prepareForm(); - } catch { - this.logger.error('Could not parse MasterItem: ' + data); - this.uiNotificationService.snackBarNotification(this.language.instant('NOTIFICATIONS.DEFAULT.ERROR'), SnackBarNotificationLevel.Error); + data => { + try { + this.dataModel = new DatasetProfileEditorModel().fromModel(data); + // this.isDeleted = this.masterItem.isActive === IsActive.Inactive; + this.form = this.dataModel.buildForm(); + if (this.dataModel.status === DatasetProfileEnum.FINALIZED) { + this.form.disable(); + this.viewOnly = true; } - }, - error => this.onCallbackError(error) + this.prepareForm(); + } catch { + this.logger.error('Could not parse MasterItem: ' + data); + this.uiNotificationService.snackBarNotification(this.language.instant('NOTIFICATIONS.DEFAULT.ERROR'), SnackBarNotificationLevel.Error); + } + }, + error => this.onCallbackError(error) ); } else if (cloneId != null) { this.datasetProfileService.clone(cloneId) .pipe(map(data => data as DatasetProfile), takeUntil(this._destroyed)) .subscribe( - data => { - try { - this.dataModel = new DatasetProfileEditorModel().fromModel(data); - // this.isDeleted = this.masterItem.isActive === IsActive.Inactive; - this.form = this.dataModel.buildForm(); - this.prepareForm(); - } catch { - this.logger.error('Could not parse MasterItem: ' + data); - this.uiNotificationService.snackBarNotification(this.language.instant('NOTIFICATIONS.DEFAULT.ERROR'), SnackBarNotificationLevel.Error); - } - }, - error => this.onCallbackError(error) + data => { + try { + this.dataModel = new DatasetProfileEditorModel().fromModel(data); + // this.isDeleted = this.masterItem.isActive === IsActive.Inactive; + this.dataModel.status = DatasetProfileEnum.SAVED; + this.form = this.dataModel.buildForm(); + this.prepareForm(); + } catch { + this.logger.error('Could not parse MasterItem: ' + data); + this.uiNotificationService.snackBarNotification(this.language.instant('NOTIFICATIONS.DEFAULT.ERROR'), SnackBarNotificationLevel.Error); + } + }, + error => this.onCallbackError(error) ); } else { this.dataModel = new DatasetProfileEditorModel(); this.form = this.dataModel.buildForm(); + if (this.dataModel.status === DatasetProfileEnum.FINALIZED) { + this.form.disable(); + this.viewOnly = true; + } this.addSection(); this.addPage(); } @@ -155,6 +164,13 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn } } + finalize() { + //const data = this.form.value; + this.form.get('status').setValue(DatasetProfileEnum.FINALIZED); + + this.onSubmit(); + } + isStepActive(step: number) { return this.stepper && this.stepper.selectedIndex === step; } @@ -174,7 +190,6 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn // } } - // DELETE Function public delete(): void { if (this.datasetProfileId && !this.isNew) { @@ -190,14 +205,14 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn this.datasetProfileService.delete(this.datasetProfileId) .pipe(takeUntil(this._destroyed)) .subscribe( - complete => { - this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DATASET-PROFILE-DELETE'), SnackBarNotificationLevel.Success); - this.router.navigate(['/dataset-profiles']); - }, - error => { - this.onCallbackError(error); - this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DATASET-PROFILE-DELETE'), SnackBarNotificationLevel.Success); - } + complete => { + this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DATASET-PROFILE-DELETE'), SnackBarNotificationLevel.Success); + this.router.navigate(['/dataset-profiles']); + }, + error => { + this.onCallbackError(error); + this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DATASET-PROFILE-DELETE'), SnackBarNotificationLevel.Success); + } ); } }); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts index 035888617..dc678c874 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.ts @@ -71,7 +71,6 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI getDefaultCriteria(dmpId: String): DatasetProfileCriteria { const defaultCriteria = new DatasetProfileCriteria(); - return defaultCriteria; } @@ -83,7 +82,6 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI // debugger; // this.datasetService.makeDatasetPublic(id).pipe(takeUntil(this._destroyed)).subscribe(); // } - } export class DatasetDataSource extends DataSource { 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 d48759d1b..5e478ef80 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 @@ -146,7 +146,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr this.formGroup.disable(); this.viewOnly = true; } - if (this.viewOnly) { this.formGroup.disable(); } + // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. this.loadDatasetProfiles(); }); } else if (dmpId != null) { @@ -191,7 +191,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr this.formGroup.disable(); this.viewOnly = true; } - if (this.viewOnly) { this.formGroup.disable(); } + //if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. this.formGroup.get('dmp').valueChanges .pipe(takeUntil(this._destroyed)) .subscribe(x => {