Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
621ddd0aee
|
@ -295,19 +295,6 @@
|
|||
</property>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>cite-dev</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>cite-maven</id>
|
||||
<name>CITE Maven Repository</name>
|
||||
<url>https://crepo.cite.gr/repository/cite-maven/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
|
@ -8,7 +8,7 @@
|
|||
<mat-progress-bar color="primary" mode="indeterminate"></mat-progress-bar>
|
||||
</div>
|
||||
<div mat-dialog-content class="definition-content">
|
||||
<app-description-form *ngIf="formGroup && formGroup.get('properties')" [propertiesFormGroup]="formGroup.get('properties')" [descriptionId]="descriptionId" [descriptionTemplate]="descriptionTemplate" [visibilityRulesService]="visibilityRulesService"></app-description-form>
|
||||
<app-description-form *ngIf="formGroup && formGroup.get('properties')" [propertiesFormGroup]="previewPropertiesFormGroup" [descriptionId]="descriptionId" [descriptionTemplate]="descriptionTemplate" [visibilityRulesService]="visibilityRulesService"></app-description-form>
|
||||
</div>
|
||||
<div mat-mat-dialog-actions *ngIf="formGroup">
|
||||
<div class="col-auto d-flex pb-4 pt-2">
|
||||
|
|
|
@ -2,6 +2,7 @@ import { Component, Inject, OnInit } from '@angular/core';
|
|||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
import { Description } from '@app/core/model/description/description';
|
||||
import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
|
@ -24,6 +25,7 @@ export class DescriptionTemplatePreviewDialogComponent extends BaseComponent imp
|
|||
progressIndication = false;
|
||||
editorModel: DescriptionEditorModel;
|
||||
formGroup: UntypedFormGroup;
|
||||
previewPropertiesFormGroup: UntypedFormGroup;
|
||||
descriptionTemplate: DescriptionTemplate;
|
||||
|
||||
constructor(
|
||||
|
@ -57,7 +59,10 @@ export class DescriptionTemplatePreviewDialogComponent extends BaseComponent imp
|
|||
|
||||
prepareForm(data: DescriptionTemplate) {
|
||||
try {
|
||||
this.editorModel = new DescriptionEditorModel();
|
||||
const mockDescription: Description = {
|
||||
descriptionTemplate: this.descriptionTemplate
|
||||
}
|
||||
this.editorModel = new DescriptionEditorModel().fromModel(mockDescription, mockDescription.descriptionTemplate);;
|
||||
this.buildForm();
|
||||
} catch (error) {
|
||||
this.logger.error('Could not parse Description item: ' + data + error);
|
||||
|
@ -67,7 +72,8 @@ export class DescriptionTemplatePreviewDialogComponent extends BaseComponent imp
|
|||
|
||||
buildForm() {
|
||||
this.formGroup = this.editorModel.buildForm(null, true);
|
||||
this.visibilityRulesService.setContext(this.descriptionTemplate.definition, this.formGroup.get('properties'));
|
||||
this.previewPropertiesFormGroup = this.editorModel.properties.buildForm() as UntypedFormGroup;
|
||||
this.visibilityRulesService.setContext(this.descriptionTemplate.definition, this.previewPropertiesFormGroup);
|
||||
}
|
||||
|
||||
select(): void {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { Component, Input, OnInit, SimpleChanges } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||
import { DescriptionTemplatePersist } from '@app/core/model/description-template/description-template-persist';
|
||||
import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type';
|
||||
import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateDefinition, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateMultiplicity, DescriptionTemplatePage, DescriptionTemplateReferenceTypeData, DescriptionTemplateRule, DescriptionTemplateSection } from '@app/core/model/description-template/description-template';
|
||||
import { DescriptionTemplateBaseFieldDataPersist, DescriptionTemplateDefinitionPersist, DescriptionTemplateFieldPersist, DescriptionTemplateFieldSetPersist, DescriptionTemplateMultiplicityPersist, DescriptionTemplatePagePersist, DescriptionTemplatePersist, DescriptionTemplateReferenceTypeFieldPersist, DescriptionTemplateRulePersist, DescriptionTemplateSectionPersist } from '@app/core/model/description-template/description-template-persist';
|
||||
import { Description } from '@app/core/model/description/description';
|
||||
import { DescriptionEditorModel } from '@app/ui/description/editor/description-editor.model';
|
||||
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
|
||||
|
@ -23,7 +24,7 @@ export class FinalPreviewComponent implements OnInit {
|
|||
previewPropertiesFormGroup
|
||||
@Input() formGroup = null;
|
||||
|
||||
constructor(private visibilityRulesService: VisibilityRulesService) {
|
||||
constructor(public visibilityRulesService: VisibilityRulesService) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -52,11 +53,84 @@ export class FinalPreviewComponent implements OnInit {
|
|||
language: persist.language,
|
||||
type: undefined,
|
||||
status: persist.status,
|
||||
definition: persist.definition,
|
||||
definition: this.buildDescriptionTemplateDefinition(persist.definition),
|
||||
users: persist.users
|
||||
}
|
||||
}
|
||||
|
||||
private buildDescriptionTemplateDefinition(persist: DescriptionTemplateDefinitionPersist) : DescriptionTemplateDefinition{
|
||||
if (persist == null) return null;
|
||||
return {
|
||||
pages: persist.pages.map(x => this.buildDescriptionTemplatePage(x))
|
||||
}
|
||||
}
|
||||
|
||||
private buildDescriptionTemplatePage(persist: DescriptionTemplatePagePersist) : DescriptionTemplatePage{
|
||||
if (persist == null) return null;
|
||||
return {
|
||||
id: persist.id,
|
||||
ordinal: persist.ordinal,
|
||||
title: persist.title,
|
||||
sections: persist.sections.map(x => this.buildDescriptionTemplateSection(x)),
|
||||
}
|
||||
}
|
||||
|
||||
private buildDescriptionTemplateSection(persist: DescriptionTemplateSectionPersist) : DescriptionTemplateSection{
|
||||
if (persist == null) return null;
|
||||
return {
|
||||
id: persist.id,
|
||||
ordinal: persist.ordinal,
|
||||
defaultVisibility: persist.defaultVisibility,
|
||||
multiplicity: persist.multiplicity,
|
||||
title: persist.title,
|
||||
description: persist.description,
|
||||
sections: persist.sections.map(x => this.buildDescriptionTemplateSection(x)),
|
||||
fieldSets: persist.fieldSets.map(x => this.buildDescriptionTemplateFieldSet(x)),
|
||||
}
|
||||
}
|
||||
|
||||
private buildDescriptionTemplateFieldSet(persist: DescriptionTemplateFieldSetPersist) : DescriptionTemplateFieldSet{
|
||||
if (persist == null) return null;
|
||||
return {
|
||||
id: persist.id,
|
||||
ordinal: persist.ordinal,
|
||||
numbering: '',
|
||||
title: persist.title,
|
||||
description: persist.description,
|
||||
extendedDescription: persist.extendedDescription,
|
||||
additionalInformation: persist.additionalInformation,
|
||||
multiplicity: {
|
||||
max: persist.multiplicity.max, min: persist.multiplicity.min,
|
||||
placeholder: persist.multiplicity.placeholder, tableView: persist.multiplicity.tableView
|
||||
},
|
||||
hasCommentField: persist.hasCommentField,
|
||||
fields: persist.fields.map(x => this.buildDescriptionTemplateField(x)),
|
||||
}
|
||||
}
|
||||
|
||||
private buildDescriptionTemplateField (persist: DescriptionTemplateFieldPersist) : DescriptionTemplateField{
|
||||
if (persist == null) return null;
|
||||
let convertedField: DescriptionTemplateField ={
|
||||
id: persist.id,
|
||||
ordinal: persist.ordinal,
|
||||
schematics: persist.schematics,
|
||||
defaultValue: persist.defaultValue,
|
||||
visibilityRules: persist.visibilityRules,
|
||||
validations: persist.validations,
|
||||
includeInExport: persist.includeInExport,
|
||||
data: persist.data,
|
||||
}
|
||||
|
||||
if (persist.data.fieldType === DescriptionTemplateFieldType.REFERENCE_TYPES) {
|
||||
convertedField.data = persist.data;
|
||||
(convertedField.data as DescriptionTemplateReferenceTypeData).referenceType = {
|
||||
id: (persist.data as DescriptionTemplateReferenceTypeFieldPersist).referenceTypeId
|
||||
};
|
||||
} else {
|
||||
convertedField.data = persist.data;
|
||||
}
|
||||
return convertedField;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.generatePreviewForm();
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<div class="container form-container">
|
||||
<div class="container-fluid">
|
||||
<div class="row d-flex justify-content-between align-items-center">
|
||||
<div class="col-auto ml-auto" (click)="close()">
|
||||
<mat-icon class="close-icon">close</mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<mat-dialog-content>
|
||||
<div class="row">
|
||||
<!-- Create New Thread -->
|
||||
<div class="col-12">
|
||||
|
@ -179,4 +181,4 @@
|
|||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-dialog-content>
|
||||
|
|
|
@ -4,12 +4,6 @@ $mat-card-header-size: 40px !default;
|
|||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
width: 100%;
|
||||
min-height: 14rem;
|
||||
padding: 1rem 2rem 2rem 2rem;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 8.44rem;
|
||||
}
|
||||
|
@ -77,7 +71,7 @@ $mat-card-header-size: 40px !default;
|
|||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
padding: 7px;
|
||||
padding: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
</div>
|
||||
<div *ngIf="!fieldSet?.multiplicity?.tableView" class="col-12">
|
||||
<div class="row" *ngFor="let fieldSetItemPropertiesControl of propertiesFormGroup?.get('items')?.controls">
|
||||
<div class="col" *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[fieldSet.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value]">
|
||||
<div class="col" *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[fieldSet.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value] ?? true">
|
||||
<div class="row">
|
||||
<div *ngFor="let field of fieldSet.fields; let i = index;" class="col-12 compositeField">
|
||||
<ng-container *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[field.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value]">
|
||||
<ng-container *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[field.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value] ?? true">
|
||||
<div class="row">
|
||||
<h5 *ngIf="placeholderTitle" class="col-auto font-weight-bold">{{field.label}}</h5>
|
||||
</div>
|
||||
|
@ -48,9 +48,9 @@
|
|||
<th class="actions"></th>
|
||||
</tr>
|
||||
<ng-container *ngFor="let fieldSetItemPropertiesControl of propertiesFormGroup?.get('items')?.controls; let j = index">
|
||||
<tr *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[fieldSet.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value]">
|
||||
<tr *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[fieldSet.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value] ?? true">
|
||||
<td *ngFor="let field of fieldSet.fields;" class="text-wrap">
|
||||
<ng-container *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[field.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value]">
|
||||
<ng-container *ngIf="visibilityRulesService && visibilityRulesService.isVisibleMap[field.id + '_' + fieldSetItemPropertiesControl.get('ordinal').value] ?? true">
|
||||
{{fieldSetItemPropertiesControl.get('fields').get(field.id).get('value').getRawValue()}}
|
||||
</ng-container>
|
||||
</td>
|
||||
|
|
|
@ -1,80 +1,78 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="d-flex flex-direction-row mb-4 mt-4">
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && !hasLikeCriteria()" 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>{{'DESCRIPTION-LISTING.TEXT-INFO' | translate}} <u class="pointer" [routerLink]="['/explore-descriptions']">{{'DESCRIPTION-LISTING.LINK-PUBLIC-DATASETS' | translate}}</u> {{'DESCRIPTION-LISTING.TEXT-INFO-REST' | translate}}</p>
|
||||
<p class="mt-4 pt-2">{{'DESCRIPTION-LISTING.TEXT-INFO-PAR' | translate}}
|
||||
<div class="d-flex">
|
||||
<button mat-raised-button class="add-description align-self-center yellow-btn" (click)="addNewDescription()">
|
||||
{{'DESCRIPTION-LISTING.ACTIONS.ADD-DESCRIPTION' | translate}}
|
||||
</button>
|
||||
<img class="col-auto ml-auto laptop-img" src="../../../assets/images/dashboard-popup.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-auto header-title">{{(isPublic ? 'DESCRIPTION-LISTING.TITLE-EXPLORE' : 'DESCRIPTION-LISTING.TITLE') | translate}}</p>
|
||||
<div *ngIf="listingItems && listingItems.length > 0 && !isPublic || this.lookup.like" class="ml-auto">
|
||||
<div class="col-auto">
|
||||
<div class="main-content listing-main-container h-100">
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex flex-direction-row">
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && !hasLikeCriteria()" 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>{{'DESCRIPTION-LISTING.TEXT-INFO' | translate}} <u class="pointer" [routerLink]="['/explore-descriptions']">{{'DESCRIPTION-LISTING.LINK-PUBLIC-DATASETS' | translate}}</u> {{'DESCRIPTION-LISTING.TEXT-INFO-REST' | translate}}</p>
|
||||
<p class="mt-4 pt-2">{{'DESCRIPTION-LISTING.TEXT-INFO-PAR' | translate}}
|
||||
<div class="d-flex">
|
||||
<button mat-raised-button class="add-description align-self-center yellow-btn" (click)="addNewDescription()">
|
||||
{{'DESCRIPTION-LISTING.ACTIONS.ADD-DESCRIPTION' | translate}}
|
||||
</button>
|
||||
<img class="col-auto ml-auto laptop-img" src="../../../assets/images/dashboard-popup.png">
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO: implement filters -->
|
||||
<!-- <div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" 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>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<div class="listing row pb-2">
|
||||
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" 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 class="sort-form col-auto pr-0">
|
||||
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
||||
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
||||
<!-- <mat-option *ngIf="isPublic" [value]="order.DATASETPUBLISHED">{{enumUtils.toRecentActivityOrderString(order.DATASETPUBLISHED)}}</mat-option> -->
|
||||
<mat-option [value]="order.Label">{{enumUtils.toRecentActivityOrderString(order.Label)}}</mat-option>
|
||||
<mat-option *ngIf="!isPublic" [value]="order.Status">{{enumUtils.toRecentActivityOrderString(order.Status)}}</mat-option>
|
||||
<!-- <mat-option [value]="order.CREATED">{{enumUtils.toRecentActivityOrderString(order.CREATED)}}</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<!-- End of Sort by -->
|
||||
<div class="d-flex flex-row ml-auto">
|
||||
<!-- Guided Tour -->
|
||||
<div *ngIf="!isPublic" class="center-content" (click)="restartTour()">
|
||||
{{ 'DESCRIPTION-LISTING.ACTIONS.TAKE-A-TOUR'| translate }}
|
||||
</div>
|
||||
<!-- End of Guided Tour -->
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field class="search-form ml-auto col-auto" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- End of Search Filter -->
|
||||
<p *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-auto header-title">{{(isPublic ? 'DESCRIPTION-LISTING.TITLE-EXPLORE' : 'DESCRIPTION-LISTING.TITLE') | translate}}</p>
|
||||
<div *ngIf="listingItems && listingItems.length > 0 && !isPublic || this.lookup.like" class="ml-auto">
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button class="add-description align-self-center yellow-btn" (click)="addNewDescription()">
|
||||
{{'DESCRIPTION-LISTING.ACTIONS.ADD-DESCRIPTION' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO: implement filters -->
|
||||
<!-- <div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" 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>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<div class="listing row pb-2">
|
||||
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" 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 class="sort-form col-auto pr-0">
|
||||
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
||||
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
||||
<!-- <mat-option *ngIf="isPublic" [value]="order.DATASETPUBLISHED">{{enumUtils.toRecentActivityOrderString(order.DATASETPUBLISHED)}}</mat-option> -->
|
||||
<mat-option [value]="order.Label">{{enumUtils.toRecentActivityOrderString(order.Label)}}</mat-option>
|
||||
<mat-option *ngIf="!isPublic" [value]="order.Status">{{enumUtils.toRecentActivityOrderString(order.Status)}}</mat-option>
|
||||
<!-- <mat-option [value]="order.CREATED">{{enumUtils.toRecentActivityOrderString(order.CREATED)}}</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<!-- End of Sort by -->
|
||||
<div class="d-flex flex-row ml-auto">
|
||||
<!-- Guided Tour -->
|
||||
<div *ngIf="!isPublic" class="center-content" (click)="restartTour()">
|
||||
{{ 'DESCRIPTION-LISTING.ACTIONS.TAKE-A-TOUR'| translate }}
|
||||
</div>
|
||||
<!-- End of Guided Tour -->
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field class="search-form ml-auto col-auto" floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" name="likeCriteria" [formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- End of Search Filter -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-md-9">
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-description-listing-item-component [isPublic]="isPublic" [description]="item" [showDivider]="i != (listingItems.length - 1)"></app-description-listing-item-component>
|
||||
</div>
|
||||
<div *ngIf="listingItems && listingItems.length > 0 && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'DESCRIPTION-LISTING.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-md-9">
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-description-listing-item-component [isPublic]="isPublic" [description]="item" [showDivider]="i != (listingItems.length - 1)"></app-description-listing-item-component>
|
||||
</div>
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && this.lookup.like !== ''" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
|
||||
<span class="empty-list">{{'DESCRIPTION-LISTING.EMPTY-LIST' | translate}}</span>
|
||||
<div *ngIf="listingItems && listingItems.length > 0 && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'DESCRIPTION-LISTING.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && this.lookup.like !== ''" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
|
||||
<span class="empty-list">{{'DESCRIPTION-LISTING.EMPTY-LIST' | translate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -296,7 +296,7 @@
|
|||
<div class="heading">{{'DMP-EDITOR.FIELDS.DESCRIPTION-TEMPLATES' | translate}}</div>
|
||||
<mat-form-field class="w-100">
|
||||
<mat-label>{{'DMP-EDITOR.FIELDS.DESCRIPTION-TEMPLATES-HINT' | translate}}</mat-label>
|
||||
<app-multiple-auto-complete placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION-TEMPLATES-HINT' | translate}}" [hidePlaceholder]="true" required='true' [formControl]="formGroup.get('descriptionTemplates').get(section.id)" [configuration]="descriptionTemplateService.descriptionTempalteGroupMultipleAutocompleteConfiguration" (optionActionClicked)="onPreviewDescriptionTemplate($event, i)">
|
||||
<app-multiple-auto-complete placeholder="{{'DMP-EDITOR.FIELDS.DESCRIPTION-TEMPLATES-HINT' | translate}}" [hidePlaceholder]="true" required='true' [formControl]="formGroup.get('descriptionTemplates').get(section.id)" [configuration]="descriptionTemplateService.descriptionTempalteGroupMultipleAutocompleteConfiguration" (optionActionClicked)="onPreviewDescriptionTemplate($event, section.id)">
|
||||
</app-multiple-auto-complete>
|
||||
<mat-error *ngIf="formGroup.get('descriptionTemplates').get(section.id).hasError('backendError')">{{formGroup.get('descriptionTemplates').get(section.id).getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('descriptionTemplates').get(section.id).hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
|
|
|
@ -50,6 +50,7 @@ import { map, takeUntil } from 'rxjs/operators';
|
|||
import { DmpEditorModel } from './dmp-editor.model';
|
||||
import { DmpEditorResolver } from './dmp-editor.resolver';
|
||||
import { DmpEditorService } from './dmp-editor.service';
|
||||
import { DescriptionTemplatePreviewDialogComponent } from '@app/ui/admin/description-template/description-template-preview/description-template-preview-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-editor',
|
||||
|
@ -451,29 +452,29 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
//
|
||||
//
|
||||
|
||||
onPreviewDescriptionTemplate(event, sectionIndex: number) {
|
||||
// const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, {
|
||||
// width: '590px',
|
||||
// minHeight: '200px',
|
||||
// restoreFocus: false,
|
||||
// data: {
|
||||
// template: event
|
||||
// },
|
||||
// panelClass: 'custom-modalbox'
|
||||
// });
|
||||
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
// if (result) {
|
||||
// this.addProfile(event, sectionIndex);
|
||||
// this.profilesAutoCompleteConfiguration = {
|
||||
// filterFn: this.filterProfiles.bind(this),
|
||||
// initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
|
||||
// displayFn: (item) => item['label'],
|
||||
// titleFn: (item) => item['label'],
|
||||
// subtitleFn: (item) => item['description'],
|
||||
// popupItemActionIcon: 'visibility'
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
onPreviewDescriptionTemplate(event, sectionId: Guid) {
|
||||
const dialogRef = this.dialog.open(DescriptionTemplatePreviewDialogComponent, {
|
||||
width: '590px',
|
||||
minHeight: '200px',
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
descriptionTemplateId: event.id
|
||||
},
|
||||
panelClass: 'custom-modalbox'
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
// this.addProfile(event, sectionIndex);
|
||||
// this.profilesAutoCompleteConfiguration = {
|
||||
// filterFn: this.filterProfiles.bind(this),
|
||||
// initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
|
||||
// displayFn: (item) => item['label'],
|
||||
// titleFn: (item) => item['label'],
|
||||
// subtitleFn: (item) => item['description'],
|
||||
// popupItemActionIcon: 'visibility'
|
||||
// };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -1,65 +1,63 @@
|
|||
<div class="main-content listing-main-container h-100">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="d-flex flex-direction-row mb-4 mt-4">
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && !hasLikeCriteria()" class="card">
|
||||
<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 class="d-flex">
|
||||
<div *ngIf="!isPublic" class="col left-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
|
||||
<img class="col-auto ml-auto laptop-img" src="../../../assets/images/dashboard-popup.png">
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-direction-row">
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && !hasLikeCriteria()" class="card mt-0">
|
||||
<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 class="d-flex">
|
||||
<div *ngIf="!isPublic" class="col left-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
|
||||
<img class="col-auto ml-auto laptop-img" src="../../../assets/images/dashboard-popup.png">
|
||||
</div>
|
||||
<p *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-auto header-title">{{(isPublic ? 'GENERAL.TITLES.EXPLORE-PLANS' : 'GENERAL.TITLES.PLANS') | translate}}</p>
|
||||
<!-- TODO: implement filters -->
|
||||
<!-- <div class="filter-btn" [style.right]="this.dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="scrollbar || this.dialog.getDialogById('filters') ? '57px' : '37px'" (click)="openFiltersDialog()">
|
||||
<button mat-raised-button class="p-0">
|
||||
<mat-icon class="mr-4">filter_alt</mat-icon>
|
||||
</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<div class="listing row pb-2">
|
||||
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" 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 class="sort-form col-auto">
|
||||
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
||||
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
||||
<!-- <mat-option *ngIf="isPublic" [value]="order.PUBLISHED">{{enumUtils.toRecentActivityOrderString(order.PUBLISHED)}}</mat-option> -->
|
||||
<mat-option [value]="order.Label">{{enumUtils.toRecentActivityOrderString(order.Label)}}</mat-option>
|
||||
<mat-option *ngIf="!isPublic" [value]="order.Status">{{enumUtils.toRecentActivityOrderString(order.Status)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<div class="d-flex flex-row ml-auto">
|
||||
<div *ngIf="!isPublic" class="center-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
|
||||
<mat-form-field class="search-form ml-auto col-auto pr-0"
|
||||
floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" name="likeCriteria"
|
||||
[formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">
|
||||
{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-md-9">
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-dmp-listing-item-component [showDivider]="i != (listingItems.length - 1)" [dmp]="item" [isPublic]="isPublic"></app-dmp-listing-item-component>
|
||||
</div>
|
||||
<div *ngIf="listingItems && listingItems.length > 0 && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && this.lookup.like !== ''" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
|
||||
<span class="empty-list">{{'DMP-LISTING.EMPTY-LIST' | translate}}</span>
|
||||
</div>
|
||||
<p *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-auto header-title">{{(isPublic ? 'GENERAL.TITLES.EXPLORE-PLANS' : 'GENERAL.TITLES.PLANS') | translate}}</p>
|
||||
<!-- TODO: implement filters -->
|
||||
<!-- <div class="filter-btn" [style.right]="this.dialog.getDialogById('filters') ? '446px' : '0px'" [style.width]="scrollbar || this.dialog.getDialogById('filters') ? '57px' : '37px'" (click)="openFiltersDialog()">
|
||||
<button mat-raised-button class="p-0">
|
||||
<mat-icon class="mr-4">filter_alt</mat-icon>
|
||||
</button>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<div class="listing row pb-2">
|
||||
<div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" 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 class="sort-form col-auto">
|
||||
<mat-select placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" [formControl]="formGroup.get('order')" (selectionChange)="orderByChanged()">
|
||||
<mat-option *ngIf="!isPublic" [value]="order.UpdatedAt">{{enumUtils.toRecentActivityOrderString(order.UpdatedAt)}}</mat-option>
|
||||
<!-- <mat-option *ngIf="isPublic" [value]="order.PUBLISHED">{{enumUtils.toRecentActivityOrderString(order.PUBLISHED)}}</mat-option> -->
|
||||
<mat-option [value]="order.Label">{{enumUtils.toRecentActivityOrderString(order.Label)}}</mat-option>
|
||||
<mat-option *ngIf="!isPublic" [value]="order.Status">{{enumUtils.toRecentActivityOrderString(order.Status)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<div class="d-flex flex-row ml-auto">
|
||||
<div *ngIf="!isPublic" class="center-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
|
||||
<mat-form-field class="search-form ml-auto col-auto pr-0"
|
||||
floatLabel="never">
|
||||
<mat-icon matSuffix>search</mat-icon>
|
||||
<input matInput placeholder="{{'GENERAL.CRITERIA.LIKE'| translate}}" name="likeCriteria"
|
||||
[formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">
|
||||
{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-md-9">
|
||||
<div *ngFor="let item of listingItems; let i = index">
|
||||
<app-dmp-listing-item-component [showDivider]="i != (listingItems.length - 1)" [dmp]="item" [isPublic]="isPublic"></app-dmp-listing-item-component>
|
||||
</div>
|
||||
<div *ngIf="listingItems && listingItems.length > 0 && this.lookup?.page?.offset < this.totalCount - 1 && this.pageSize < this.totalCount - 1" class="d-flex justify-content-center">
|
||||
<button type="button" class="btn-load-more" (click)="loadMore()">{{'GENERAL.ACTIONS.LOAD-MORE' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="hasListingItems && listingItems && listingItems.length === 0 && this.lookup.like !== ''" class="col-md-12 d-flex justify-content-center pt-4 mt-4 mb-4 pb-4">
|
||||
<span class="empty-list">{{'DMP-LISTING.EMPTY-LIST' | translate}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="confirmation-dialog pt-1 pl-3 pr-3 pb-3">
|
||||
<div class="container-fluid confirmation-dialog">
|
||||
<div *ngIf="data.icon" class="row d-flex flex-row">
|
||||
<div class="col-auto close-btn justify-content-start">
|
||||
<mat-icon color="warn">{{ data.icon }}</mat-icon>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<div class="row mt-2 mb-2">
|
||||
<ng-container *ngFor="let title of data.titles; let i = index">
|
||||
<div class="col-auto mb-2">
|
||||
<button mat-raised-button type="button" (click)="apply(i)" class="confirm">{{ title }}</button>
|
||||
<button type="button" class="normal-btn" (click)="apply(i)">{{ title }}</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue