minor fixes

This commit is contained in:
Diamantis Tziotzios 2019-12-12 11:26:19 +02:00
parent 7c2a3b298d
commit e85c0cc68f
7 changed files with 21 additions and 12 deletions

View File

@ -120,11 +120,12 @@ public class RemoteFetcher {
private List<Map<String, String>> getAll(List<UrlConfiguration> urlConfigs, FetchStrategy fetchStrategy, ExternalUrlCriteria externalUrlCriteria) throws NoURLFound, HugeResultSet { private List<Map<String, String>> getAll(List<UrlConfiguration> urlConfigs, FetchStrategy fetchStrategy, ExternalUrlCriteria externalUrlCriteria) throws NoURLFound, HugeResultSet {
if (urlConfigs == null || urlConfigs.isEmpty()) List<Map<String, String>> results = new LinkedList<>();
throw new NoURLFound("No Repository urls found in configuration");
if (urlConfigs == null || urlConfigs.isEmpty()) return results;
// throw new NoURLFound("No Repository urls found in configuration");
urlConfigs.sort(Comparator.comparing(UrlConfiguration::getOrdinal)); urlConfigs.sort(Comparator.comparing(UrlConfiguration::getOrdinal));
List<Map<String, String>> results = new LinkedList<>();
for (UrlConfiguration urlConfig : urlConfigs) { for (UrlConfiguration urlConfig : urlConfigs) {
ifFunderQueryExist(urlConfig, externalUrlCriteria); ifFunderQueryExist(urlConfig, externalUrlCriteria);
if (urlConfig.getType() == null || urlConfig.getType().equals("External")) { if (urlConfig.getType() == null || urlConfig.getType().equals("External")) {

View File

@ -156,7 +156,7 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC
getPublicDatasets() { getPublicDatasets() {
const dmpCriteria = new ExploreDatasetCriteriaModel(); const dmpCriteria = new ExploreDatasetCriteriaModel();
const fields: Array<string> = new Array<string>(); const fields: Array<string> = new Array<string>();
fields.push('asc'); fields.push('-modified');
const dataTableRequest: DataTableRequest<ExploreDatasetCriteriaModel> = new DataTableRequest(0, 4, { fields: fields }); const dataTableRequest: DataTableRequest<ExploreDatasetCriteriaModel> = new DataTableRequest(0, 4, { fields: fields });
dataTableRequest.criteria = dmpCriteria; dataTableRequest.criteria = dmpCriteria;
return this.datasetService.getPublicPaged(dataTableRequest).pipe(takeUntil(this._destroyed)).subscribe(result => { this.datasetListingItems = result.data; }); return this.datasetService.getPublicPaged(dataTableRequest).pipe(takeUntil(this._destroyed)).subscribe(result => { this.datasetListingItems = result.data; });

View File

@ -27,6 +27,7 @@ export class DraftsComponent implements OnInit {
ngOnInit() { ngOnInit() {
const fields: Array<string> = []; const fields: Array<string> = [];
fields.push('-modified');
const dmpDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 2, { fields: fields }); const dmpDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 2, { fields: fields });
dmpDataTableRequest.criteria = new DatasetCriteria(); dmpDataTableRequest.criteria = new DatasetCriteria();
dmpDataTableRequest.criteria.status = DmpStatus.Draft; dmpDataTableRequest.criteria.status = DmpStatus.Draft;

View File

@ -94,7 +94,8 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
if (resetPages) this._paginator.pageIndex = 0; if (resetPages) this._paginator.pageIndex = 0;
const startIndex = this._paginator.pageIndex * this._paginator.pageSize; const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
let fields: Array<string> = new Array(); let fields: Array<string> = new Array();
if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } fields.push('-modified');
//if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; }
const request = new DataTableRequest<DatasetCriteria>(startIndex, this._paginator.pageSize, { fields: fields }); const request = new DataTableRequest<DatasetCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
let value = this.criteria.formGroup.value; let value = this.criteria.formGroup.value;
request.criteria = { request.criteria = {

View File

@ -31,7 +31,7 @@
{{formGroup.get('profiles').getError('backendError').message}}</mat-error> {{formGroup.get('profiles').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('profiles').hasError('required')"> <mat-error *ngIf="formGroup.get('profiles').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<button matSuffix class="input-btn" [disabled]="formGroup.get('profiles').disabled" (click)="availableProfiles()"> <button matSuffix class="input-btn" [disabled]="formGroup.get('profiles').disabled" (click)="availableProfiles($event)">
<mat-icon class="icon-btn">view_list</mat-icon> <mat-icon class="icon-btn">view_list</mat-icon>
</button> </button>
</mat-form-field> </mat-form-field>
@ -56,7 +56,7 @@
{{formGroup.get('researchers').getError('backendError').message}}</mat-error> {{formGroup.get('researchers').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('researchers').hasError('required')"> <mat-error *ngIf="formGroup.get('researchers').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<button matSuffix class="input-btn" [disabled]="formGroup.get('researchers').disabled" type="button" (click)="addResearcher()"> <button matSuffix class="input-btn" [disabled]="formGroup.get('researchers').disabled" type="button" (click)="addResearcher($event)">
<mat-icon class="icon-btn">add_circle</mat-icon> <mat-icon class="icon-btn">add_circle</mat-icon>
</button> </button>
</mat-form-field> </mat-form-field>

View File

@ -142,25 +142,30 @@ export class GeneralTabComponent extends BaseComponent implements OnInit {
return this._service.searchDMPProfiles(request); return this._service.searchDMPProfiles(request);
} }
addResearcher() { addResearcher(event: MouseEvent) {
event.stopPropagation();
const dialogRef = this.dialog.open(AddResearcherComponent, { const dialogRef = this.dialog.open(AddResearcherComponent, {
data: this.formGroup.get('researchers') data: this.formGroup.get('researchers')
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) { if (result) {
const fullName = result.firstName + " " + result.lastName; const fullName = result.firstName + " " + result.lastName;
this.formGroup.get('researchers').value.push({ const newItem = {
label: null, label: null,
name: fullName, name: fullName,
id: "dmp:" + fullName, id: "dmp:" + fullName,
status: 0, status: 0,
tag: "Internal", tag: "Internal",
}); };
const researchersArray = this.formGroup.get('researchers').value || [];
researchersArray.push(newItem);
this.formGroup.get('researchers').setValue(researchersArray);
} }
}); });
} }
availableProfiles() { availableProfiles(event: MouseEvent) {
event.stopPropagation();
const dialogRef = this.dialog.open(AvailableProfilesComponent, { const dialogRef = this.dialog.open(AvailableProfilesComponent, {
data: { data: {
profiles: this.formGroup.get('profiles') profiles: this.formGroup.get('profiles')

View File

@ -108,7 +108,8 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
if (resetPages) this._paginator.pageIndex = 0; if (resetPages) this._paginator.pageIndex = 0;
const startIndex = this._paginator.pageIndex * this._paginator.pageSize; const startIndex = this._paginator.pageIndex * this._paginator.pageSize;
let fields: Array<string> = new Array(); let fields: Array<string> = new Array();
if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } // if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; }
fields.push('-modified');
const request = new DataTableRequest<DmpCriteria>(startIndex, this._paginator.pageSize, { fields: fields }); const request = new DataTableRequest<DmpCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
let value = this.criteria.formGroup.value; let value = this.criteria.formGroup.value;
request.criteria = { request.criteria = {