Adds subtitle message on null or undefined source

This commit is contained in:
apapachristou 2019-09-04 10:37:44 +03:00
parent 72a613a380
commit 7b921a7ede
3 changed files with 16 additions and 15 deletions

View File

@ -69,7 +69,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
initialItems: (type) => this.searchDatasetExternalDatasets('', type),//.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1), initialItems: (type) => this.searchDatasetExternalDatasets('', type),//.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1),
displayFn: (item) => item ? item.label : null, displayFn: (item) => item ? item.label : null,
titleFn: (item) => item ? item.label : null, titleFn: (item) => item ? item.label : null,
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : null, subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}; };
this.registriesAutoCompleteConfiguration = { this.registriesAutoCompleteConfiguration = {
@ -77,7 +77,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
initialItems: (type) => this.searchDatasetExternalRegistries('', type), initialItems: (type) => this.searchDatasetExternalRegistries('', type),
displayFn: (item) => item ? item.label : null, displayFn: (item) => item ? item.label : null,
titleFn: (item) => item ? item.label : null, titleFn: (item) => item ? item.label : null,
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : null subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}; };
this.dataRepositoriesAutoCompleteConfiguration = { this.dataRepositoriesAutoCompleteConfiguration = {
@ -85,7 +85,7 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
initialItems: (type) => this.searchDatasetExternalDataRepositories('', type), initialItems: (type) => this.searchDatasetExternalDataRepositories('', type),
displayFn: (item) => item ? item.name : null, displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null, titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : null subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}; };
this.servicesAutoCompleteConfiguration = { this.servicesAutoCompleteConfiguration = {
@ -93,14 +93,14 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
initialItems: (type) => this.searchDatasetExternalServices('', type), initialItems: (type) => this.searchDatasetExternalServices('', type),
displayFn: (item) => item ? item.label : null, displayFn: (item) => item ? item.label : null,
titleFn: (item) => item ? item.label : null, titleFn: (item) => item ? item.label : null,
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : null subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}; };
this.tagsAutoCompleteConfiguration = { this.tagsAutoCompleteConfiguration = {
filterFn: this.searchDatasetTags.bind(this), filterFn: this.searchDatasetTags.bind(this),
initialItems: (type) => this.searchDatasetTags('', type), initialItems: (type) => this.searchDatasetTags('', type),
displayFn: (item) => item ? item.name : null, displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.name : null titleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.name : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}; };
} }

View File

@ -47,12 +47,20 @@ export class GrantTabComponent implements OnInit {
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem(); const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
grantRequestItem.criteria = new GrantCriteria(); grantRequestItem.criteria = new GrantCriteria();
this.funderAutoCompleteConfiguration = {
filterFn: this.searchFunder.bind(this),
initialItems: (extraData) => this.searchFunder(''),
displayFn: (item) => item['label'],
titleFn: (item) => item['label'],
subtitleFn: (item) => item['source'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}
this.grantAutoCompleteConfiguration = { this.grantAutoCompleteConfiguration = {
filterFn: this.searchGrant.bind(this), filterFn: this.searchGrant.bind(this),
initialItems: (extraData) => this.searchGrant(''), initialItems: (extraData) => this.searchGrant(''),
displayFn: (item) => item['label'], displayFn: (item) => item['label'],
titleFn: (item) => item['label'], titleFn: (item) => item['label'],
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : null subtitleFn: (item) => item['source'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}; };
this.projectAutoCompleteConfiguration = { this.projectAutoCompleteConfiguration = {
@ -60,15 +68,7 @@ export class GrantTabComponent implements OnInit {
initialItems: (extraData) => this.searchProject(''), initialItems: (extraData) => this.searchProject(''),
displayFn: (item) => item['label'], displayFn: (item) => item['label'],
titleFn: (item) => item['label'], titleFn: (item) => item['label'],
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : null subtitleFn: (item) => item['source'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
}
this.funderAutoCompleteConfiguration = {
filterFn: this.searchFunder.bind(this),
initialItems: (extraData) => this.searchFunder(''),
displayFn: (item) => item['label'],
titleFn: (item) => item['label'],
subtitleFn: (item) => item ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['source'] : null
} }
this.isCreateNew = (this.grantformGroup.get('label').value != null && this.grantformGroup.get('label').value.length > 0); this.isCreateNew = (this.grantformGroup.get('label').value != null && this.grantformGroup.get('label').value.length > 0);

View File

@ -765,6 +765,7 @@
"SOURCE": "Source", "SOURCE": "Source",
"SOURCES": "Sources", "SOURCES": "Sources",
"SOURCE:": "Source: ", "SOURCE:": "Source: ",
"NO-SOURCE": "Not bind with source",
"OUTPUT": "Output" "OUTPUT": "Output"
}, },
"DMP": { "DMP": {