+
{{formGroup.get('uri').getError('backendError').message}}
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts
index d2cad6024..725fda5c7 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.ts
@@ -11,6 +11,7 @@ import { BaseComponent } from '@common/base/base.component';
export class DatasetEditorComponent extends BaseComponent {
@Input() formGroup: FormGroup = null;
+ showUri: boolean = false;
constructor(
private router: Router,
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts
index 517fe5af0..d4319f40b 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component.ts
@@ -63,7 +63,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
initialItems: (type) => this.searchDatasetExternalDataRepositories('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
- subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
+ subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
servicesAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts
index 55c7d6a8f..1656c6965 100644
--- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts
+++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts
@@ -232,17 +232,21 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
const fields: Array = new Array();
fields.push('asc');
- if (this.isPublic) {
- const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields });
- dmpDataTableRequest.criteria = new ExploreDmpCriteriaModel();
- dmpDataTableRequest.criteria.like = value;
- return this.dmpService.getPublicPaged(dmpDataTableRequest, "autocomplete");
- } else {
+ // if (this.isPublic) {
+ // const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields });
+ // dmpDataTableRequest.criteria = new ExploreDmpCriteriaModel();
+ // dmpDataTableRequest.criteria.like = value;
+ // return this.dmpService.getPublicPaged(dmpDataTableRequest, "autocomplete");
+ // } else {
const dmpDataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields });
dmpDataTableRequest.criteria = new DmpCriteria();
dmpDataTableRequest.criteria.like = value;
- return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete");
+ if (this.isPublic) {
+ dmpDataTableRequest.criteria.isPublic = true;
+ dmpDataTableRequest.criteria.onlyPublic = true;
}
+ return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete");
+ // }
}
filterGrant(query: string) {
diff --git a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts
index e3ec8a6e6..a915fdb04 100644
--- a/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts
+++ b/dmp-frontend/src/app/ui/dmp/clone/dmp-clone.component.ts
@@ -17,6 +17,7 @@ import { TranslateService } from '@ngx-translate/core';
import { Observable, of as observableOf } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
+import { ExtraPropertiesFormModel } from '../editor/general-tab/extra-properties-form.model';
@Component({
@@ -60,6 +61,7 @@ export class DmpCloneComponent extends BaseComponent implements OnInit {
this.dmp.grant = new GrantTabModel();
this.dmp.project = new ProjectFormModel();
this.dmp.funder = new FunderFormModel();
+ this.dmp.extraProperties = new ExtraPropertiesFormModel();
this.dmp.fromModel(data);
this.dmp.status = DmpStatus.Draft;
this.formGroup = this.dmp.buildForm();
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts
index df0079530..b67f9549d 100644
--- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts
+++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts
@@ -21,6 +21,7 @@ import { BackendErrorValidator } from '@common/forms/validation/custom-validator
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
import { ExtraPropertiesFormModel } from './general-tab/extra-properties-form.model';
+import { isNullOrUndefined } from 'util';
export class DmpEditorModel {
public id: string;
@@ -71,7 +72,9 @@ export class DmpEditorModel {
if (item.dynamicFields) { item.dynamicFields.map(x => this.dynamicFields.push(new DmpDynamicFieldEditorModel().fromModel(x))); }
this.creator = item.creator;
this.modified = new Date(item.modified);
- this.extraProperties.fromModel(item.extraProperties);
+ if (!isNullOrUndefined(item.extraProperties)) {
+ this.extraProperties.fromModel(item.extraProperties);
+ }
return this;
}
diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts
index 5ac10bbf5..89d32c5ce 100644
--- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts
+++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts
@@ -4,9 +4,15 @@ import { BackendErrorValidator } from '@common/forms/validation/custom-validator
export class ExtraPropertiesFormModel {
public language: string;
+ public license: string;
+ public visible: boolean;
+ public publicDate: Date;
fromModel(item: any): ExtraPropertiesFormModel {
this.language = item.language;
+ this.license = item.license;
+ this.visible = item.visible;
+ this.publicDate = item.publicDate;
return this;
}
@@ -14,7 +20,10 @@ export class ExtraPropertiesFormModel {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
- language: [{ value: this.language, disabled: disabled }, context.getValidation('language').validators]
+ language: [{ value: this.language, disabled: disabled }, context.getValidation('language').validators],
+ license: [{ value: this.license, disabled: disabled }, context.getValidation('license').validators],
+ visible: [{ value: this.visible, disabled: disabled }, context.getValidation('visible').validators],
+ publicDate: [{ value: this.publicDate, disabled: disabled }, context.getValidation('publicDate').validators]
});
return formGroup;
}
@@ -22,6 +31,9 @@ export class ExtraPropertiesFormModel {
createValidationContext(): ValidationContext {
const baseContext: ValidationContext = new ValidationContext();
baseContext.validation.push({ key: 'language', validators: [] });
+ baseContext.validation.push({ key: 'license', validators: [] });
+ baseContext.validation.push({ key: 'visible', validators: [] });
+ baseContext.validation.push({ key: 'publicDate', validators: [] });
return baseContext;
}
diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html
index 943ed9ce5..ce433d868 100644
--- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html
+++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html
@@ -69,7 +69,7 @@
-
+
{{ lang.name }}
@@ -81,6 +81,49 @@
+
+
+
+
+
+
+ {{formGroup.get('extraProperties').get('language').getError('backendError').message}}
+
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+
+
+
+
+
+
+
+ {{vis.name | translate}}
+
+
+
+ {{formGroup.get('extraProperties').get('visible').getError('backendError').message}}
+
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+
+
+
+
+
+
+
+
+
+ {{formGroup.get('extraProperties').get('visible').getError('backendError').message}}
+
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+
+
diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts
index 8063f5f60..0dee0573f 100644
--- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts
+++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts
@@ -25,6 +25,12 @@ import { isNullOrUndefined } from 'util';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { LanguageInfoService } from '@app/core/services/culture/language-info-service';
import { LanguageInfo } from '@app/core/model/language-info';
+import { LicenseCriteria } from '@app/core/query/license/license-criteria';
+
+interface Visible {
+ value: boolean;
+ name: string;
+}
@Component({
selector: 'app-general-tab',
@@ -67,8 +73,20 @@ export class GeneralTabComponent extends BaseComponent implements OnInit {
titleFn: (item) => item['label']
};
+ licenseAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
+ filterFn: this.licenseSearch.bind(this),
+ initialItems: (excludedItems: any[]) => this.licenseSearch('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
+ displayFn: (item) => item['name'],
+ titleFn: (item) => item['name']
+ };
+
selectedDmpProfileDefinition: DmpProfileDefinition;
+ visibles: Visible[] = [
+ { value: true, name: 'DMP-EDITOR.VISIBILITY.PUBLIC' },
+ { value: false, name: 'DMP-EDITOR.VISIBILITY.RESTRICTED' }
+ ]
+
constructor(
private dmpProfileService: DmpProfileService,
private externalSourcesService: ExternalSourcesService,
@@ -92,6 +110,9 @@ export class GeneralTabComponent extends BaseComponent implements OnInit {
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());
+ }
}
registerFormEventsForDmpProfile(definitionProperties?: DmpProfileDefinition): void {
@@ -120,6 +141,14 @@ export class GeneralTabComponent extends BaseComponent implements OnInit {
return this.dmpProfileService.getPaged(request).pipe(map(x => x.data));
}
+ licenseSearch(query: string): Observable {
+ const request = new RequestItem();
+ request.criteria = new LicenseCriteria();
+ request.criteria.like = query;
+ request.criteria.type = '';
+ return this.externalSourcesService.searchLicense(request);
+ }
+
// onCallbackSuccess(): void {
// this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
// this.router.navigate(['/plans']);
@@ -147,7 +176,7 @@ export class GeneralTabComponent extends BaseComponent implements OnInit {
filterProfiles(value: string): Observable {
- const request = new DataTableRequest(null, null, {fields: ['+label']});
+ const request = new DataTableRequest(null, null, { fields: ['+label'] });
const criteria = new DatasetProfileCriteria();
criteria.like = value;
request.criteria = criteria;
diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss
index cf3220afb..9ceae05d1 100644
--- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss
+++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss
@@ -79,6 +79,16 @@
color: #129D99;
}
+.grant-title {
+ width: 130px;
+ color: #089dbb;
+ background-color: white;
+ padding: 0px 10px;
+ margin-top: -16px;
+ cursor: default;
+ text-transform: uppercase;
+}
+
.frame-btn, .finalize-btn {
background: #FFFFFF;
box-shadow: 0px 2px 6px #00000029;
diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts
index 7edeacf8d..7541a8b68 100644
--- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts
+++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts
@@ -15,6 +15,7 @@ import { BackendErrorValidator } from '@common/forms/validation/custom-validator
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
+import { ExtraPropertiesFormModel } from '../editor/general-tab/extra-properties-form.model';
export class DmpWizardEditorModel {
public id: string;
@@ -36,6 +37,7 @@ export class DmpWizardEditorModel {
public definition: DmpProfileDefinition;
public dynamicFields: Array = [];
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
+ public extraProperties: ExtraPropertiesFormModel;
fromModel(item: DmpModel): DmpWizardEditorModel {
this.id = item.id;
@@ -56,6 +58,7 @@ export class DmpWizardEditorModel {
if (item.definition) { this.definition = item.definition; }
if (item.dynamicFields) { item.dynamicFields.map(x => this.dynamicFields.push(new DmpDynamicFieldEditorModel().fromModel(x))); }
this.creator = item.creator;
+ this.extraProperties.fromModel(item.extraProperties);
return this;
}
@@ -78,6 +81,7 @@ export class DmpWizardEditorModel {
researchers: [{ value: this.researchers, disabled: disabled }, context.getValidation('researchers').validators],
profiles: [{ value: this.profiles, disabled: disabled }, context.getValidation('profiles').validators],
associatedUsers: [{ value: this.associatedUsers, disabled: disabled }, context.getValidation('associatedUsers').validators],
+ extraProperties: this.extraProperties.buildForm(),
});
const dynamicFields = new Array();
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html
index 0e064a31e..d811889f2 100644
--- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html
+++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html
@@ -244,4 +244,16 @@
+
+