diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index 332354b43..c2defedee 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -101,10 +101,6 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn } this.datasetWizardModel = new DatasetWizardEditorModel(); - this.registerFormListeners(); - // if (this.isNewDataset) { - // this.loadDatasetProfiles(); - // } this.profilesAutoCompleteConfiguration = { filterFn: this.filterProfiles.bind(this), @@ -113,53 +109,6 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn titleFn: (item) => item['label'], subtitleFn: (item) => item['description'] }; - - // if (this.datasetId) { - // this.datasetWizardService.getSingle(this.datasetId) - // .pipe(takeUntil(this._destroyed)) - // .subscribe(data => { - // this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => { - // this.lockStatus = lockStatus; - // this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); - // this.needsUpdate(); - // this.formGroup = this.datasetWizardModel.buildForm(); - // this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft; - // if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) { - // this.formGroup.disable(); - // this.viewOnly = true; - // } - // if (!lockStatus && !isNullOrUndefined(this.authService.current())) { - // this.lock = new LockModel(data.id, this.authService.current()); - - // this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => { - // this.lock.id = Guid.parse(result); - // interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock()); - // }); - // } - // // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. - // this.loadDatasetProfiles(); - // this.registerFormListeners(); - // // this.availableProfiles = this.datasetWizardModel.dmp.profiles; - - // this.onChanges(); - // this.formChanged.emit(this.formGroup); - // }) - // }, - // error => { - // switch (error.status) { - // case 403: - // this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.DATASET-NOT-ALLOWED'), SnackBarNotificationLevel.Error); - // break; - // case 404: - // this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.DATASET-NOT-FOUND'), SnackBarNotificationLevel.Error); - // break; - // default: - // this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'), SnackBarNotificationLevel.Error); - // } - // this.router.navigate(['/datasets/']); - // return observableOf(null); - // }); - // } } public dashboardTourDmp: GuidedTour = { diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index f1b724541..fba7b8927 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -77,17 +77,6 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { if (this.formGroup.get('definition')) { this.selectedDmpProfileDefinition = this.formGroup.get('definition').value; } this.registerFormEventsForDmpProfile(); - if (this.isNewVersion) { - this.formGroup.get('label').disable(); - } - - if (!this.isUserOwner && !this.isClone) { - this.formGroup.disable(); - } - if (isNullOrUndefined(this.formGroup.get('extraProperties').get('publicDate').value)) { - this.formGroup.get('extraProperties').get('publicDate').patchValue(new Date()); - } - if (this.hasDmpId) { this.loadDatasetProfiles(); this.profilesAutoCompleteConfiguration = { @@ -98,23 +87,6 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { subtitleFn: (item) => item['description'] }; } - // if (this.formGroup.get('datasets')['controls'][0]) { - // this.formGroup.get('datasets')['controls'][0].get('dmp').valueChanges.pipe(takeUntil(this._destroyed)) - // .subscribe(x => { - // //this.registerFormListeners(); - // if (this.formGroup.get('datasets')['controls'][0].get('dmp').value) { - // this.loadDatasetProfiles(); - // this.profilesAutoCompleteConfiguration = { - // filterFn: this.filterProfiles.bind(this), - // initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - // displayFn: (item) => item['label'], - // titleFn: (item) => item['label'], - // subtitleFn: (item) => item['description'] - // }; - // this.onFormChanged.emit(); - // } - // }); - // } } // Researchers diff --git a/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts index aa0e6f215..43b6123c4 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.ts @@ -60,7 +60,6 @@ export class FundingInfoComponent extends BaseComponent implements OnInit { } ngOnInit() { - const grantRequestItem: RequestItem = new RequestItem(); grantRequestItem.criteria = new GrantCriteria(); @@ -81,7 +80,6 @@ export class FundingInfoComponent extends BaseComponent implements OnInit { this.formGroup.valueChanges.pipe(takeUntil(this._destroyed)) .subscribe(x => { this.configureAutoCompletes(); - // this.onFormChanged.emit(); }); } diff --git a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts index 4d2ff78b5..05f1c97dc 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.ts @@ -49,24 +49,7 @@ export class LicenseInfoComponent extends BaseComponent implements OnInit { } ngOnInit() { - // if (this.formGroup.get('definition')) { this.selectedDmpProfileDefinition = this.formGroup.get('definition').value; } - // this.registerFormEventsForDmpProfile(); - if (this.isNewVersion) { - this.formGroup.get('label').disable(); - } - - if (!this.isUserOwner && !this.isClone) { - this.formGroup.disable(); - } - if (isNullOrUndefined(this.formGroup.get('extraProperties').get('publicDate').value)) { - this.formGroup.get('extraProperties').get('publicDate').patchValue(new Date()); - } - - this.formGroup.valueChanges.pipe(takeUntil(this._destroyed)) - .subscribe(x => { - // this.onFormChanged.emit(); - }); } getLanguageInfos(): LanguageInfo[] { diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts index d5e28d8d9..653380fbb 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts @@ -87,9 +87,6 @@ export class MainInfoComponent extends BaseComponent implements OnInit { } ngOnInit() { - // if (this.formGroup.get('definition')) { this.selectedDmpProfileDefinition = this.formGroup.get('definition').value; } - // this.registerFormEventsForDmpProfile(); - if (this.isNewVersion) { this.formGroup.get('label').disable(); } @@ -112,11 +109,6 @@ export class MainInfoComponent extends BaseComponent implements OnInit { if (isNullOrUndefined(this.formGroup.get('extraProperties').get('contact').value)) { this.formGroup.get('extraProperties').get('contact').patchValue(associate.id); } - - // this.formGroup.valueChanges.pipe(takeUntil(this._destroyed)) - // .subscribe(x => { - // this.onFormChanged.emit(); - // }); } // Researchers