Merge remote-tracking branch 'origin/ui-redesign' into ui-redesign

This commit is contained in:
George Kalampokis 2020-09-14 18:10:10 +03:00
commit 31ab0747b2
11 changed files with 71 additions and 40 deletions

View File

@ -85,8 +85,9 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
this.form = this.dataModel.buildForm();
}
this.prepareForm();
} catch {
} catch (error) {
this.logger.error('Could not parse MasterItem: ' + data);
console.log(error)
this.uiNotificationService.snackBarNotification(this.language.instant('NOTIFICATIONS.DEFAULT.ERROR'), SnackBarNotificationLevel.Error);
}
},

View File

@ -1,9 +1,10 @@
<div class="main-content listing-main-container h-100">
<div class="container-fluid">
<div class="d-flex flex-direction-row">
<div class="card mt-0" [style.display]="isVisible ? 'block' : 'none'">
<a class="col-auto d-flex" (click)="closeCard()"><span class="ml-auto pt-3 material-icons clear-icon">clear</span></a>
<div class="card-content info-text mb-0 pt-0">
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0" class="card mt-0">
<!-- <div class="card mt-0" [style.display]="isVisible ? 'block' : 'none'"> -->
<!-- <a class="col-auto d-flex" (click)="closeCard()"><span class="ml-auto pt-3 material-icons clear-icon">clear</span></a> -->
<div class="card-content info-text mb-0">
<p>{{'DATASET-LISTING.TEXT-INFO' | translate}} <u class="pointer" [routerLink]="['/explore']">{{'DATASET-LISTING.LINK-PUBLIC-DATASETS' | translate}}</u> {{'DATASET-LISTING.TEXT-INFO-REST' | translate}}</p>
<p class="mt-4 pt-2">{{'DATASET-LISTING.TEXT-INFO-PAR' | translate}}
<div class="col pl-0 pt-3">
@ -13,7 +14,15 @@
</div>
</div>
</div>
<div class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="scrollbar ? '57px' : '37px'" (click)="openFiltersDialog()">
<p *ngIf="listingItems && listingItems.length > 0" class="col-auto header-title">{{'GENERAL.TITLES.DATASETS' | translate}}</p>
<div *ngIf="listingItems && listingItems.length > 0" class="ml-auto">
<div class="col-auto">
<button mat-raised-button class="add-dataset align-self-center yellow-btn" [routerLink]="['/new/dataset/']">
{{'DASHBOARD.ACTIONS.ADD-DATASET' | translate}}
</button>
</div>
</div>
<div *ngIf="listingItems && listingItems.length > 0" class="filter-btn" [style.right]="dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="scrollbar ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0">
<mat-icon class="mr-4">filter_alt</mat-icon>
</button>
@ -21,11 +30,11 @@
</div>
<div>
<div class="listing row pb-2">
<div class="col-md-12">
<div *ngIf="listingItems && listingItems.length > 0" class="col-md-12">
<div class="d-flex flex-direction-row pt-4">
<!-- Sort by -->
<span class="d-flex align-items-center">{{'DMP-LISTING.SORT-BY' | translate}}:</span>
<mat-form-field appearance="outline" class="sort-form col-auto pr-0">
<mat-form-field class="sort-form col-auto pr-0">
<mat-select placeholder="{{'CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')">
<mat-option *ngIf="!isPublic" [value]="order.MODIFIED">{{enumUtils.toRecentActivityOrderString(order.MODIFIED)}}</mat-option>
<mat-option *ngIf="isPublic" [value]="order.DATASETPUBLISHED">{{enumUtils.toRecentActivityOrderString(order.DATASETPUBLISHED)}}</mat-option>
@ -37,12 +46,12 @@
<!-- End of Sort by -->
<div class="d-flex flex-row ml-auto">
<!-- Guided Tour -->
<div class="center-content" [style.display]=" (!isVisible && isAuthenticated()) ? 'block' : 'none'" (click)="restartTour()">
<div class="center-content" (click)="restartTour()">
{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}
</div>
<!-- End of Guided Tour -->
<!-- Search Filter-->
<mat-form-field *ngIf="listingItems && listingItems.length > 0" appearance="outline" class="search-form ml-auto col-auto" floatLabel="never">
<mat-form-field class="search-form ml-auto col-auto" floatLabel="never">
<mat-icon matSuffix>search</mat-icon>
<input matInput placeholder="{{'CRITERIA.DATA-SETS.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
@ -59,7 +68,7 @@
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center" *ngIf="listingItems.length === 0">
<div class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4" *ngIf="hasListingItems && listingItems && listingItems.length === 0">
<span class="empty-list">{{'DATASET-LISTING.EMPTY-LIST' | translate}}</span>
</div>
</div>

View File

@ -19,6 +19,14 @@
position: relative;
}
.header-title {
text-align: left;
font-size: 1.25rem;
font-weight: 300;
color: #212121;
padding: 0px;
}
.header-text-container {
background: rgba(255, 255, 255, 0.7);
position: absolute;
@ -146,7 +154,7 @@
font-size: 0.875rem;
font-weight: 600;
letter-spacing: 0.02rem;
color: #2D72D6;
color: #2d72d6;
cursor: pointer;
}
@ -179,8 +187,8 @@
}
::ng-deep .sort-form .mat-form-field-wrapper {
background-color: white !important;
padding-bottom: 0 !important;
background-color: white !important;
padding-bottom: 0 !important;
}
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {

View File

@ -46,6 +46,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
totalCount: number;
dmpSearchEnabled = true;
listingItems: DatasetListingModel[] = [];
hasListingItems = null;
isPublic: boolean = false;
public isVisible = true
@ -195,6 +196,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
// if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
this.totalCount = result.totalCount;
this.listingItems = result.data;
this.hasListingItems = true;
});
}
@ -211,6 +213,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
// if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
// this.listingItems = this.listingItems.concat(result.data);
this.listingItems = this.listingItems.length > 0 ? this.mergeTwoSortedLists(this.listingItems, result.data, this.formGroup.get('order').value) : result.data;
this.hasListingItems = true;
});
}

View File

@ -48,12 +48,12 @@
</div>
</div>
<div class="row mb-4 pb-3">
<button *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DMP-LISTING.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="isDraftDataset(dataset) && !lockStatus" (click)="editClicked(dataset)" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DMP-LISTING.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
</button>
<button *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DMP-LISTING.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="isUserDatasetRelated() && !lockStatus" (click)="deleteClicked()" mat-mini-fab class="mr-3 actions-btn" matTooltip="{{'DMP-LISTING.ACTIONS.DELETE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button>

View File

@ -53,6 +53,6 @@ export class AvailableProfilesComponent extends BaseComponent implements OnInit
}
isOptionSelected(profile: any) {
return this.formGroup.value.map(x => x.id).indexOf(profile.id) !== -1;
return this.formGroup.value ? this.formGroup.value.map(x => x.id).indexOf(profile.id) !== -1 : null;
}
}

View File

@ -1,14 +1,16 @@
<div class="main-content listing-main-container h-100">
<div class="container-fluid">
<div class="d-flex flex-direction-row">
<div class="card mt-0" [style.display]="isVisible ? 'block' : 'none'">
<a class="col-auto d-flex" (click)="closeCard()"><span class="ml-auto pt-3 material-icons clear-icon">clear</span></a>
<div class="card-content info-text mb-0 pt-0">
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0" class="card mt-0">
<!-- <div *ngIf="listingItems && listingItems.length === 0" class="card mt-0" [style.display]="isVisible ? 'block' : 'none'"> -->
<!-- <a class="col-auto d-flex" (click)="closeCard()"><span class="ml-auto pt-3 material-icons clear-icon">clear</span></a> -->
<div class="card-content info-text mb-0">
<p>{{'DMP-LISTING.TEXT-INFO' | translate}}</p>
<p class="mt-4 pt-2">{{'DMP-LISTING.TEXT-INFO-QUESTION' | translate}} <a class="zenodo-link" href="https://zenodo.org/communities/liber-dmp-cat/?page=1&size=20" target="_blank">{{'DMP-LISTING.LINK-ZENODO' | translate}}</a> {{'DMP-LISTING.GET-IDEA' | translate}}</p>
</div>
</div>
<div class="filter-btn" [style.right]="dialogAnimation.dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="scrollbar ? '57px' : '37px'" (click)="openFiltersDialog()">
<p *ngIf="listingItems && listingItems.length > 0" class="col-auto header-title">{{'GENERAL.TITLES.PLANS' | translate}}</p>
<div *ngIf="listingItems && listingItems.length > 0" class="filter-btn" [style.right]="dialogAnimation.dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="scrollbar ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0">
<mat-icon class="mr-4">filter_alt</mat-icon>
</button>
@ -16,11 +18,11 @@
</div>
<div>
<div class="listing row pb-2">
<div class="col-md-12">
<div *ngIf="listingItems && listingItems.length > 0" class="col-md-12">
<div class="d-flex flex-direction-row pt-4">
<!-- Sort by -->
<span class="d-flex align-items-center">{{'DMP-LISTING.SORT-BY' | translate}}:</span>
<mat-form-field appearance="outline" class="sort-form col-auto">
<mat-form-field class="sort-form col-auto">
<mat-select placeholder="{{'CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')">
<mat-option *ngIf="!isPublic" [value]="order.MODIFIED">{{enumUtils.toRecentActivityOrderString(order.MODIFIED)}}</mat-option>
<mat-option *ngIf="isPublic" [value]="order.PUBLISHED">{{enumUtils.toRecentActivityOrderString(order.PUBLISHED)}}</mat-option>
@ -32,13 +34,11 @@
<!-- End of Sort by -->
<div class="d-flex flex-row ml-auto">
<!-- Guided Tour -->
<div class="center-content"
[style.display]="!isVisible && isAuthenticated()? 'block' : 'none'" (click)="restartTour()">
{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}
</div>
<!-- <div class="center-content" [style.display]="!isVisible && isAuthenticated()? 'block' : 'none'" (click)="restartTour()"> -->
<div class="center-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
<!-- End of Guided Tour -->
<!-- Search Filter-->
<mat-form-field *ngIf="listingItems && listingItems.length > 0" appearance="outline" class="search-form ml-auto col-auto pr-0"
<mat-form-field class="search-form ml-auto col-auto pr-0"
floatLabel="never">
<mat-icon matSuffix>search</mat-icon>
<input matInput placeholder="{{'CRITERIA.DMP.LIKE'| translate}}" name="likeCriteria"
@ -58,7 +58,7 @@
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
</div>
</div>
<div class="col-md-12 d-flex justify-content-center" *ngIf="listingItems && listingItems.length === 0">
<div class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4" *ngIf="hasListingItems && listingItems && listingItems.length === 0">
<span class="empty-list">{{'DMP-LISTING.EMPTY-LIST' | translate}}</span>
</div>
</div>

View File

@ -81,6 +81,14 @@
position: relative;
}
.header-title {
text-align: left;
font-size: 1.25rem;
font-weight: 300;
color: #212121;
padding: 0px;
}
.header-text-container {
background: rgba(255, 255, 255, 0.7);
position: absolute;
@ -133,7 +141,7 @@
letter-spacing: 0px;
color: #212121;
padding-left: 40px;
padding-top: 36px;
padding-top: 38px;
padding-bottom: 36px;
padding-right: 55px;
opacity: 1;
@ -190,7 +198,7 @@
right: 0px;
z-index: 100;
width: 37px;
transition: right .3s;
transition: right 0.3s;
transition-timing-function: ease-in-out;
}
@ -225,7 +233,8 @@
color: black;
}
.pointer:hover, .zenodo-link:hover {
.pointer:hover,
.zenodo-link:hover {
color: #00b29f;
}
@ -235,8 +244,8 @@
}
::ng-deep .sort-form .mat-form-field-wrapper {
background-color: white !important;
padding-bottom: 0 !important;
background-color: white !important;
padding-bottom: 0 !important;
}
::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix {
@ -252,7 +261,7 @@
font-size: 0.875rem;
font-weight: 600;
letter-spacing: 0.02rem;
color: #2D72D6;
color: #2d72d6;
cursor: pointer;
}

View File

@ -52,6 +52,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
groupLabel: string;
isPublic: boolean = false;
public isVisible = true
hasListingItems = null;
startIndex: number = 0;
pageSize: number = 5;
@ -236,6 +237,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
return item;
});
this.listingItems = result.data;
this.hasListingItems = true;
this.totalCount = result.totalCount;
});
}
@ -260,6 +262,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
});
// this.listingItems = this.listingItems.concat(result.data);
this.listingItems = this.mergeTwoSortedLists(this.listingItems, result.data, this.formGroup.get('order').value);
this.hasListingItems = true;
});
}

View File

@ -51,12 +51,12 @@
</div>
</div>
<div class="row">
<button *ngIf="isAuthenticated()" (click)="cloneOrNewVersionClicked(dmp, false)" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-LISTING.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="isDraftDmp(dmp) && isUserOwner && !lockStatus" (click)="editClicked(dmp)" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-LISTING.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
</button>
<button *ngIf="isAuthenticated()" (click)="cloneOrNewVersionClicked(dmp, false)" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-LISTING.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="isUserOwner && !lockStatus" (click)="deleteClicked()" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-LISTING.ACTIONS.DELETE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button>

View File

@ -348,9 +348,7 @@ export class FormFieldComponent extends BaseComponent implements OnInit {
let stringValue = this.form.get('value').value;
stringValue = (<string>stringValue).replace(new RegExp('{', 'g'), '{"').replace(new RegExp('=', 'g'), '":"').replace(new RegExp(',', 'g'), '",').replace(new RegExp(', ', 'g'), ', "').replace(new RegExp('}', 'g'), '"}');
stringValue = stringValue.replace(new RegExp('}"', 'g'), '}').replace(new RegExp('"{', 'g'), '{');
console.log(stringValue);
const tagArray = JSON.parse(stringValue);
console.log(tagArray);
this.form.patchValue({'value': tagArray});
}