more ui changes

This commit is contained in:
Diamantis Tziotzios 2023-11-30 10:12:41 +02:00
parent 17d57dbc7a
commit 40ae38e8d9
12 changed files with 165 additions and 102 deletions

View File

@ -455,26 +455,26 @@ permissions:
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
# DmpUser Permissions # DmpUser Permissions
BrowseDmpUser: BrowseDmpUser:
roles: roles:
- Admin - Admin
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
EditDmpUser: EditDmpUser:
roles: roles:
- Admin - Admin
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
DeleteDmpUser: DeleteDmpUser:
roles: roles:
- Admin - Admin
claims: [ ] claims: [ ]
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
# SupportiveMaterial Permissions # SupportiveMaterial Permissions
BrowseSupportiveMaterial: BrowseSupportiveMaterial:
@ -540,44 +540,44 @@ permissions:
allowAuthenticated: false allowAuthenticated: false
# DmpDescriptionTemplate Permissions # DmpDescriptionTemplate Permissions
BrowseDmpDescriptionTemplate: BrowseDmpDescriptionTemplate:
roles: roles:
- Admin - Admin
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
EditDmpDescriptionTemplate: EditDmpDescriptionTemplate:
roles: roles:
- Admin - Admin
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
DeleteDmpDescriptionTemplate: DeleteDmpDescriptionTemplate:
roles: roles:
- Admin - Admin
claims: [ ] claims: [ ]
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
# DescriptionReference Permissions # DescriptionReference Permissions
BrowseDescriptionReference: BrowseDescriptionReference:
roles: roles:
- Admin - Admin
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
EditDescriptionReference: EditDescriptionReference:
roles: roles:
- Admin - Admin
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false
DeleteDescriptionReference: DeleteDescriptionReference:
roles: roles:
- Admin - Admin
claims: [ ] claims: [ ]
clients: [ ] clients: [ ]
allowAnonymous: false allowAnonymous: false
allowAuthenticated: false allowAuthenticated: false

View File

@ -1,13 +1,14 @@
import { Lookup } from '@common/model/lookup'; import { Lookup } from '@common/model/lookup';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { IsActive } from '../common/enum/is-active.enum'; import { IsActive } from '../common/enum/is-active.enum';
import { DmpBlueprintStatus } from '../common/enum/dmp-blueprint-status';
export class DmpBlueprintLookup extends Lookup implements DmpBlueprintFilter { export class DmpBlueprintLookup extends Lookup implements DmpBlueprintFilter {
ids: Guid[]; ids: Guid[];
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;
isActive: IsActive[]; isActive: IsActive[];
typeIds: Guid[]; statuses: DmpBlueprintStatus[];
constructor() { constructor() {
super(); super();
@ -19,5 +20,5 @@ export interface DmpBlueprintFilter {
excludedIds: Guid[]; excludedIds: Guid[];
like: string; like: string;
isActive: IsActive[]; isActive: IsActive[];
typeIds: Guid[]; statuses: DmpBlueprintStatus[];
} }

View File

@ -1,30 +1,32 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type';
import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status';
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
import { DmpBlueprintStatus } from '@app/core/common/enum/dmp-blueprint-status';
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/dmp-blueprint-system-field-type';
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
import { ReferenceFieldDataType } from '@app/core/common/enum/reference-field-data-type';
import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type';
import { ReferenceType } from '@app/core/common/enum/reference-type';
import { ReferenceTypeExternalApiHTTPMethodType } from '@app/core/common/enum/reference-type-external-api-http-method-type';
import { ReferenceTypeSourceType } from '@app/core/common/enum/reference-type-source-type';
import { Role } from '@app/core/common/enum/role';
import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type';
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
import { UserDescriptionTemplateRole } from '@app/core/common/enum/user-description-template-role';
import { ViewStyleType } from '@app/ui/admin/dataset-profile/editor/components/field/view-style-enum';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { AppRole } from '../../common/enum/app-role'; import { AppRole } from '../../common/enum/app-role';
import { DatasetProfileComboBoxType } from '../../common/enum/dataset-profile-combo-box-type'; import { DatasetProfileComboBoxType } from '../../common/enum/dataset-profile-combo-box-type';
import { DatasetProfileFieldViewStyle } from '../../common/enum/dataset-profile-field-view-style'; import { DatasetProfileFieldViewStyle } from '../../common/enum/dataset-profile-field-view-style';
import { DatasetProfileInternalDmpEntitiesType } from '../../common/enum/dataset-profile-internal-dmp-entities-type';
import { DatasetStatus } from '../../common/enum/dataset-status'; import { DatasetStatus } from '../../common/enum/dataset-status';
import { DmpBlueprintExtraFieldDataType } from '../../common/enum/dmp-blueprint-field-type'; import { DmpBlueprintExtraFieldDataType } from '../../common/enum/dmp-blueprint-field-type';
import { DmpBlueprintType } from '../../common/enum/dmp-blueprint-type'; import { DmpBlueprintType } from '../../common/enum/dmp-blueprint-type';
import { DmpStatus } from '../../common/enum/dmp-status'; import { DmpStatus } from '../../common/enum/dmp-status';
import { ValidationType } from '../../common/enum/validation-type'; import { ValidationType } from '../../common/enum/validation-type';
import { DatasetProfileInternalDmpEntitiesType } from '../../common/enum/dataset-profile-internal-dmp-entities-type'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
import { Role } from '@app/core/common/enum/role';
import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type';
import { ViewStyleType } from '@app/ui/admin/dataset-profile/editor/components/field/view-style-enum';
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/dmp-blueprint-system-field-type';
import { DmpBlueprintStatus } from '@app/core/common/enum/dmp-blueprint-status';
import { DescriptionTemplateStatus } from '@app/core/common/enum/description-template-status';
import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type';
import { ReferenceFieldDataType } from '@app/core/common/enum/reference-field-data-type';
import { ReferenceTypeSourceType } from '@app/core/common/enum/reference-type-source-type';
import { ReferenceTypeExternalApiHTTPMethodType } from '@app/core/common/enum/reference-type-external-api-http-method-type';
import { UserDescriptionTemplateRole } from '@app/core/common/enum/user-description-template-role';
import { ReferenceType } from '@app/core/common/enum/reference-type';
import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type';
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
@Injectable() @Injectable()
export class EnumUtils { export class EnumUtils {
@ -43,6 +45,13 @@ export class EnumUtils {
return []; return [];
} }
toIsActiveString(status: IsActive): string {
switch (status) {
case IsActive.Active: return this.language.instant('TYPES.IS-ACTIVE.ACTIVE');
case IsActive.Inactive: return this.language.instant('TYPES.IS-ACTIVE.INACTIVE');
}
}
toAppRoleString(status: AppRole): string { toAppRoleString(status: AppRole): string {
switch (status) { switch (status) {
case AppRole.Admin: return this.language.instant('TYPES.APP-ROLE.ADMIN'); case AppRole.Admin: return this.language.instant('TYPES.APP-ROLE.ADMIN');
@ -118,7 +127,7 @@ export class EnumUtils {
case DatasetProfileFieldViewStyle.Validation: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.VALIDATION'); case DatasetProfileFieldViewStyle.Validation: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.VALIDATION');
} }
} }
toDatasetProfileViewTypeString(status: ViewStyleType) :string{ toDatasetProfileViewTypeString(status: ViewStyleType): string {
switch (status) { switch (status) {
case ViewStyleType.BooleanDecision: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.BOOLEAN-DECISION'); case ViewStyleType.BooleanDecision: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.BOOLEAN-DECISION');
case ViewStyleType.CheckBox: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.CHECKBOX'); case ViewStyleType.CheckBox: return this.language.instant('TYPES.DATASET-PROFILE-FIELD-VIEW-STYLE.CHECKBOX');
@ -250,7 +259,7 @@ export class EnumUtils {
} }
} }
toDescriptionTemplateFieldTypeString(status: DescriptionTemplateFieldType) :string{ toDescriptionTemplateFieldTypeString(status: DescriptionTemplateFieldType): string {
switch (status) { switch (status) {
case DescriptionTemplateFieldType.COMBO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.COMBO-BOX'); case DescriptionTemplateFieldType.COMBO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.COMBO-BOX');
case DescriptionTemplateFieldType.AUTO_COMPLETE: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.AUTO-COMPLETE'); case DescriptionTemplateFieldType.AUTO_COMPLETE: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.AUTO-COMPLETE');
@ -284,7 +293,7 @@ export class EnumUtils {
case DescriptionTemplateFieldType.VALIDATION: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.VALIDATION'); case DescriptionTemplateFieldType.VALIDATION: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.VALIDATION');
} }
} }
toReferenceTypeSourceTypeString(status: ReferenceTypeSourceType): string { toReferenceTypeSourceTypeString(status: ReferenceTypeSourceType): string {
switch (status) { switch (status) {
case ReferenceTypeSourceType.API: return this.language.instant('TYPES.REFERENCE-TYPE-SOURCE-TYPE.API'); case ReferenceTypeSourceType.API: return this.language.instant('TYPES.REFERENCE-TYPE-SOURCE-TYPE.API');
@ -351,4 +360,12 @@ export class EnumUtils {
} }
} }
toDescriptionStatusString(status: DescriptionStatus): string {
switch (status) {
case DescriptionStatus.Draft: return this.language.instant('TYPES.DESCRIPTION-STATUS.DRAFT');
case DescriptionStatus.Finalized: return this.language.instant('TYPES.DESCRIPTION-STATUS.FINALIZED');
case DescriptionStatus.Canceled: return this.language.instant('TYPES.DESCRIPTION-STATUS.CANCELED');
}
}
} }

View File

@ -27,6 +27,7 @@ import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component'; import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component';
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
@Component({ @Component({
@ -121,6 +122,12 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.UPDATED-AT', languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.UPDATED-AT',
pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short') pipe: this.pipeService.getPipe<DataTableDateTimeFormatPipe>(DataTableDateTimeFormatPipe).withFormat('short')
}, },
{
prop: nameof<DmpBlueprint>(x => x.isActive),
sortable: true,
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.IS-ACTIVE',
pipe: this.pipeService.getPipe<IsActiveTypePipe>(IsActiveTypePipe)
},
{ {
alwaysShown: true, alwaysShown: true,
cellTemplate: this.actions, cellTemplate: this.actions,

View File

@ -20,6 +20,10 @@
{{'DMP-BLUEPRINT-LISTING.FILTER.IS-ACTIVE' | translate}} {{'DMP-BLUEPRINT-LISTING.FILTER.IS-ACTIVE' | translate}}
</mat-slide-toggle> </mat-slide-toggle>
<mat-select multiple [(ngModel)]="internalFilters.statuses">
<mat-option *ngFor="let blueprintStatus of dmpBlueprintStatusEnumValues" [value]="blueprintStatus">{{enumUtils.toDmpBlueprintStatusString(blueprintStatus)}}</mat-option>
</mat-select>
<div class="d-flex justify-content-end align-items-center mt-4 gap-1-rem"> <div class="d-flex justify-content-end align-items-center mt-4 gap-1-rem">
<button mat-stroked-button color="primary" (click)="filterMenuTrigger?.closeMenu()"> <button mat-stroked-button color="primary" (click)="filterMenuTrigger?.closeMenu()">
{{'DMP-BLUEPRINT-LISTING.FILTER.CANCEL' | translate}} {{'DMP-BLUEPRINT-LISTING.FILTER.CANCEL' | translate}}
@ -33,4 +37,4 @@
</mat-menu> </mat-menu>
<app-expandable-search-field [(value)]=internalFilters.like (valueChange)="onSearchTermChange($event)" /> <app-expandable-search-field [(value)]=internalFilters.like (valueChange)="onSearchTermChange($event)" />
</div> </div>

View File

@ -1,4 +1,5 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { DmpBlueprintStatus } from '@app/core/common/enum/dmp-blueprint-status';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { DmpBlueprintFilter } from '@app/core/query/dmp-blueprint.lookup'; import { DmpBlueprintFilter } from '@app/core/query/dmp-blueprint.lookup';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
@ -16,6 +17,8 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
@Input() readonly filter: DmpBlueprintFilter; @Input() readonly filter: DmpBlueprintFilter;
@Output() filterChange = new EventEmitter<DmpBlueprintFilter>(); @Output() filterChange = new EventEmitter<DmpBlueprintFilter>();
dmpBlueprintStatusEnumValues = this.enumUtils.getEnumValues<DmpBlueprintStatus>(DmpBlueprintStatus);
// * State // * State
internalFilters: DmpBlueprintListingFilters = this._getEmptyFilters(); internalFilters: DmpBlueprintListingFilters = this._getEmptyFilters();
@ -46,12 +49,12 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
} }
protected applyFilters(): void { protected applyFilters(): void {
const { isActive, like, typeIds } = this.internalFilters ?? {} const { isActive, like, statuses } = this.internalFilters ?? {}
this.filterChange.emit({ this.filterChange.emit({
...this.filter, ...this.filter,
like, like,
isActive: isActive ? [IsActive.Active] : [IsActive.Inactive], isActive: isActive ? [IsActive.Active] : [IsActive.Inactive],
typeIds statuses
}) })
} }
@ -61,12 +64,12 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
return this._getEmptyFilters(); return this._getEmptyFilters();
} }
let { excludedIds, ids, isActive, like, typeIds } = inputFilter; let { excludedIds, ids, isActive, like, statuses } = inputFilter;
return { return {
isActive: (isActive ?? [])?.includes(IsActive.Active) || !isActive?.length, isActive: (isActive ?? [])?.includes(IsActive.Active) || !isActive?.length,
like: like, like: like,
typeIds: typeIds statuses: statuses
} }
} }
@ -75,7 +78,7 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
return { return {
isActive: true, isActive: true,
like: null, like: null,
typeIds: null, statuses: null,
} }
} }
@ -95,5 +98,5 @@ export class DmpBlueprintListingFiltersComponent extends BaseComponent implement
interface DmpBlueprintListingFilters { interface DmpBlueprintListingFilters {
isActive: boolean; isActive: boolean;
like: string; like: string;
typeIds: Guid[]; statuses: DmpBlueprintStatus[];
} }

View File

@ -9,7 +9,9 @@ import { ActivatedRoute, Params, Router } from '@angular/router';
import { DescriptionStatus } from '@app/core/common/enum/description-status'; import { DescriptionStatus } from '@app/core/common/enum/description-status';
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { Description } from '@app/core/model/description/description'; import { Description, DescriptionReference } from '@app/core/model/description/description';
import { Dmp, DmpUser } from '@app/core/model/dmp/dmp';
import { Reference } from '@app/core/model/reference/reference';
import { DescriptionLookup } from '@app/core/query/description.lookup'; import { DescriptionLookup } from '@app/core/query/description.lookup';
import { DmpLookup } from '@app/core/query/dmp.lookup'; import { DmpLookup } from '@app/core/query/dmp.lookup';
import { AuthService } from '@app/core/services/auth/auth.service'; import { AuthService } from '@app/core/services/auth/auth.service';
@ -173,6 +175,19 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit
fields: [ fields: [
nameof<Description>(x => x.id), nameof<Description>(x => x.id),
nameof<Description>(x => x.label), nameof<Description>(x => x.label),
nameof<Description>(x => x.status),
nameof<Description>(x => x.updatedAt),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
[nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.roles)].join('.'),
[nameof<Description>(x => x.descriptionReferences), nameof<DescriptionReference>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionReferences), nameof<DescriptionReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
[nameof<Description>(x => x.descriptionReferences), nameof<DescriptionReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
[nameof<Description>(x => x.descriptionReferences), nameof<DescriptionReference>(x => x.reference), nameof<Reference>(x => x.type)].join('.'),
[nameof<Description>(x => x.descriptionReferences), nameof<DescriptionReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
] ]
}; };
this.descriptionService.query(lookup).pipe(takeUntil(this._destroyed)) this.descriptionService.query(lookup).pipe(takeUntil(this._destroyed))

View File

@ -2,17 +2,17 @@
<a [routerLink]="getItemLink()" class="pointer"> <a [routerLink]="getItemLink()" class="pointer">
<div class="d-flex flex-direction-row"> <div class="d-flex flex-direction-row">
<div class="col-auto description-label">{{'DATASET-LISTING.DESCRIPTION' | translate}}</div> <div class="col-auto description-label">{{'DATASET-LISTING.DESCRIPTION' | translate}}</div>
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{description.modified | dateTimeCultureFormatter: "d MMMM y"}}</div> <div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{description.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.PUBLISHED' | translate}}: {{description.dmpPublishedAt | dateTimeCultureFormatter: "d MMMM y"}}</div> <div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.PUBLISHED' | translate}}: {{description.dmpPublishedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
</div> </div>
<div *ngIf="description.status === 1" class="col-auto description-title">{{description.label}}</div> <div *ngIf="description.status === descriptionStatusEnum.Finalized" class="col-auto description-title">{{description.label}}</div>
<div *ngIf="description.status === 0" class="col-auto description-title-draft">{{description.label}}</div> <div *ngIf="description.status === descriptionStatusEnum.Draft" class="col-auto description-title-draft">{{description.label}}</div>
<div class="description-subtitle"> <div class="description-subtitle">
<span *ngIf="isUserDescriptionRelated()" class="col-auto">{{ roleDisplay(description.users) }}</span> <span *ngIf="isUserDescriptionRelated()" class="col-auto">{{ roleDisplay(description.users) }}</span>
<span *ngIf="isUserDescriptionRelated()">.</span> <span *ngIf="isUserDescriptionRelated()">.</span>
<!-- <span class="col-auto" *ngIf="description.status === 1 && description.public === true"><span class="material-icons icon-align">public</span>{{'DATASET-LISTING.STATES.PUBLIC' | translate}}</span> --> <span class="col-auto" *ngIf="description.status === descriptionStatusEnum.Finalized && description.dmp.accessType === dmpAccessTypeEnum.Public"><span class="material-icons icon-align">public</span>{{'DATASET-LISTING.STATES.PUBLIC' | translate}}</span>
<!-- <span *ngIf="description.status === 1 && description.public === false" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDmpStatusString(description.status) }}</span> --> <span *ngIf="description.status === descriptionStatusEnum.Finalized && description.dmp.accessType != dmpAccessTypeEnum.Public" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
<span *ngIf="description.status === 0" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDmpStatusString(description.status) }}</span> <span *ngIf="description.status === descriptionStatusEnum.Draft" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDescriptionStatusString(description.status) }}</span>
<span>.</span> <span>.</span>
<!-- <span class="col">{{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{description.grant}}</span> --> <!-- <span class="col">{{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{description.grant}}</span> -->
</div> </div>
@ -20,12 +20,12 @@
<div class="col-auto description-subtitle pr-0">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}} <div class="col-auto description-subtitle pr-0">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}}
<div class="col-auto dmp-label ml-3">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div> <div class="col-auto dmp-label ml-3">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div>
</div> </div>
<div class="col dmp-title">{{description.dmp}}</div> <div class="col dmp-title">{{description.dmp?.label}}</div>
</div> </div>
</a> </a>
<div class="description-card-actions"> <div class="description-card-actions">
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a> <a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isUserOwner" (click)="openShareDialog(description.dmpId, description.dmp)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a> <a class="col-auto border-right pointer" *ngIf="isUserOwner" (click)="openShareDialog(description.dmp.id, description.dmp.label)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DATASET-WIZARD.ACTIONS.COPY-DESCRIPTION' | translate}}</a> <a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DATASET-WIZARD.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
<a class="col-auto border-right pointer" *ngIf="isAuthenticated() && isUserDescriptionRelated()" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}</a> <a class="col-auto border-right pointer" *ngIf="isAuthenticated() && isUserDescriptionRelated()" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}</a>
</div> </div>

View File

@ -22,6 +22,7 @@ import { Description } from '@app/core/model/description/description';
import { DescriptionService } from '@app/core/services/description/description.service'; import { DescriptionService } from '@app/core/services/description/description.service';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
import { DmpAccessType } from '@app/core/common/enum/dmp-access-type';
@Component({ @Component({
selector: 'app-description-listing-item-component', selector: 'app-description-listing-item-component',
@ -38,6 +39,8 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
isDraft: boolean; isDraft: boolean;
isDeleted: boolean; isDeleted: boolean;
isUserOwner: boolean; isUserOwner: boolean;
descriptionStatusEnum = DescriptionStatus;
dmpAccessTypeEnum = DmpAccessType;
constructor( constructor(
private router: Router, private router: Router,

View File

@ -1828,11 +1828,10 @@
"INPUT": "Input" "INPUT": "Input"
} }
}, },
"DATASET-STATUS": { "DESCRIPTION-STATUS": {
"DRAFT": "Draft", "DRAFT": "Draft",
"FINALISED": "Finalized", "FINALISED": "Finalized",
"ANY": "Any", "CANCELED": "Canceled"
"DRAFT-DESC": "Draft Registrations"
}, },
"DATASET-ROLE": { "DATASET-ROLE": {
"OWNER": "Owner", "OWNER": "Owner",

View File

@ -4,6 +4,7 @@ import { DataTableDateFormatPipe, DateFormatPipe } from '@common/formatting/pipe
import { DataTableDateOnlyFormatPipe, DateOnlyPipe } from '@common/formatting/pipes/date-only-format.pipe'; import { DataTableDateOnlyFormatPipe, DateOnlyPipe } from '@common/formatting/pipes/date-only-format.pipe';
import { DataTableDateTimeFormatPipe, DateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe'; import { DataTableDateTimeFormatPipe, DateTimeFormatPipe } from '@common/formatting/pipes/date-time-format.pipe';
import { LowercaseFirstLetterPipe } from '@common/formatting/pipes/lowercase-first-letter.pipe'; import { LowercaseFirstLetterPipe } from '@common/formatting/pipes/lowercase-first-letter.pipe';
import { IsActiveTypePipe } from './pipes/is-active-type.pipe';
// //
// //
@ -20,7 +21,7 @@ import { LowercaseFirstLetterPipe } from '@common/formatting/pipes/lowercase-fir
ArrayToStringPipe, ArrayToStringPipe,
DateOnlyPipe, DateOnlyPipe,
DataTableDateOnlyFormatPipe, DataTableDateOnlyFormatPipe,
IsActiveTypePipe
], ],
exports: [ exports: [
@ -32,6 +33,7 @@ import { LowercaseFirstLetterPipe } from '@common/formatting/pipes/lowercase-fir
ArrayToStringPipe, ArrayToStringPipe,
DateOnlyPipe, DateOnlyPipe,
DataTableDateOnlyFormatPipe, DataTableDateOnlyFormatPipe,
IsActiveTypePipe
], ],
providers: [ providers: [
DateFormatPipe, DateFormatPipe,
@ -42,6 +44,7 @@ import { LowercaseFirstLetterPipe } from '@common/formatting/pipes/lowercase-fir
ArrayToStringPipe, ArrayToStringPipe,
DateOnlyPipe, DateOnlyPipe,
DataTableDateOnlyFormatPipe, DataTableDateOnlyFormatPipe,
IsActiveTypePipe
] ]
}) })
export class CommonFormattingModule { } export class CommonFormattingModule { }

View File

@ -0,0 +1,11 @@
import { Pipe, PipeTransform } from '@angular/core';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
@Pipe({ name: 'IsActiveTypeFormat' })
export class IsActiveTypePipe implements PipeTransform {
constructor(private enumUtils: EnumUtils) { }
public transform(value): any {
return this.enumUtils.toIsActiveString(value);
}
}