Fixes how "creation time" is displayed on "ADD Dataset Description (Wizard)" view. (Issue #223)

This commit is contained in:
gkolokythas 2020-01-17 18:14:21 +02:00
parent ed5c87d729
commit 15c256e7eb
2 changed files with 8 additions and 7 deletions

View File

@ -18,6 +18,8 @@ import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadC
import { BaseComponent } from '@common/base/base.component'; import { BaseComponent } from '@common/base/base.component';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators'; import { map, takeUntil } from 'rxjs/operators';
import { DatePipe } from "@angular/common";
import { TranslateService } from "@ngx-translate/core";
@Component({ @Component({
selector: 'dataset-dmp-selector-component', selector: 'dataset-dmp-selector-component',
@ -36,10 +38,10 @@ export class DatasetDmpSelector extends BaseComponent implements OnInit, IBreadC
availableProfiles: DatasetProfileModel[] = []; availableProfiles: DatasetProfileModel[] = [];
constructor( constructor(
private router: Router,
private route: ActivatedRoute,
public dmpService: DmpService, public dmpService: DmpService,
private datasetWizardService: DatasetWizardService, private datasetWizardService: DatasetWizardService,
private language: TranslateService,
private datepipe: DatePipe
) { ) {
super(); super();
} }
@ -50,7 +52,7 @@ export class DatasetDmpSelector extends BaseComponent implements OnInit, IBreadC
initialItems: (extraData) => this.searchDmp(''), initialItems: (extraData) => this.searchDmp(''),
displayFn: (item) => item['label'], displayFn: (item) => item['label'],
titleFn: (item) => item['label'], titleFn: (item) => item['label'],
subtitleFn: (item) => new Date(item['creationTime']).toISOString() subtitleFn: (item) => this.language.instant('QUICKWIZARD.CREATE-ADD.ADD.CREATED') + " " + this.datepipe.transform(item['creationTime'], 'yyyy-MM-dd')
}; };
this.formGroup.get('dmp').valueChanges this.formGroup.get('dmp').valueChanges

View File

@ -1146,9 +1146,7 @@
"CREATE-NEW-FUNDER": "Add Funder", "CREATE-NEW-FUNDER": "Add Funder",
"EXIST-FUNDER": "Use Existing Funder", "EXIST-FUNDER": "Use Existing Funder",
"CREATE-NEW-PROJECT": "Add Project", "CREATE-NEW-PROJECT": "Add Project",
"EXIST-PROJECT": "Use Existing Project", "EXIST-PROJECT": "Use Existing Project"
"CREATE-NEW-FUNDER": "Add Funder",
"EXIST-FUNDER": "Use Existing Funder"
}, },
"FIRST-STEP": { "FIRST-STEP": {
"TITLE": "Grant", "TITLE": "Grant",
@ -1200,7 +1198,8 @@
"TITLE": "Add a Dataset Description into an existing DMP", "TITLE": "Add a Dataset Description into an existing DMP",
"DATASET-WIZARD": "Dataset Description Wizard", "DATASET-WIZARD": "Dataset Description Wizard",
"POST-SELECTION-INFO": "This wizard simplifies the process of adding new Dataset Descriptions into existing DMPs, guiding you through and requesting only the most essential pieces of information for completing the task. Full access to the attributes of a Dataset Description can be obtained afterwards via the Dataset Description access menus of the System.", "POST-SELECTION-INFO": "This wizard simplifies the process of adding new Dataset Descriptions into existing DMPs, guiding you through and requesting only the most essential pieces of information for completing the task. Full access to the attributes of a Dataset Description can be obtained afterwards via the Dataset Description access menus of the System.",
"SUBTITLE": "This wizard allows you to describe additional Dataset Descriptions managed in the context of a DMP providing only the essential information for their description." "SUBTITLE": "This wizard allows you to describe additional Dataset Descriptions managed in the context of a DMP providing only the essential information for their description.",
"CREATED": "Created on"
} }
}, },
"SAVE-DIALOG": { "SAVE-DIALOG": {