[ADF-5362] - showing in the confirm dialog only the propery of the cu… (#6909)

* [ADF-5362] - showing in the confirm dialog only the propery of the custom type not the inherited ones

* fxed lint
This commit is contained in:
Vito
2021-04-12 11:59:44 +01:00
committed by GitHub
parent be355cc6b4
commit 7d01a9315b
3 changed files with 16 additions and 3 deletions

View File

@@ -12,8 +12,8 @@
{{'CORE.METADATA.CONTENT_TYPE.DIALOG.VIEW_DETAILS' | translate}}
</mat-panel-title>
</mat-expansion-panel-header>
<table mat-table [dataSource]="currentContentType?.entry?.properties"
*ngIf="currentContentType?.entry?.properties?.length > 0" class="adf-content-type-table">
<table mat-table [dataSource]="typeProperties"
*ngIf="typeProperties?.length > 0" class="adf-content-type-table">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> {{'CORE.METADATA.CONTENT_TYPE.DIALOG.PROPERTY.NAME' |
translate}} </th>

View File

@@ -29,9 +29,20 @@ const elementCustom: TypeEntry = {
entry: {
id: 'ck:pippobaudo',
title: 'PIPPO-BAUDO',
model: { id: 'what', namespacePrefix: 'ck' },
description: 'Doloro reaepgfihawpefih peahfa powfj p[qwofhjaq[ fq[owfj[qowjf[qowfgh[qowh f[qowhfj [qwohf',
parentId: 'cm:content',
properties: [
{
id: 'lm:PropA',
dataType: 'lm:notshowed',
defaultValue: 'I NEVER show uP',
description: 'A inherited property',
isMandatory: false,
isMandatoryEnforced: false,
isMultiValued: false,
title: 'PropertyHidden'
},
{
id: 'ck:PropA',
dataType: 'ck:propA',
@@ -135,7 +146,7 @@ describe('Content Type Dialog Component', () => {
fixture.detectChanges();
});
it('should show the property of the aspect', async () => {
it('should show the property with the aspect prefix not the inherited ones', async () => {
const showPropertyAccordon: HTMLButtonElement = fixture.nativeElement.querySelector('.adf-content-type-accordion .mat-expansion-panel-header');
expect(showPropertyAccordon).toBeDefined();
showPropertyAccordon.click();

View File

@@ -35,6 +35,7 @@ export class ContentTypeDialogComponent implements OnInit {
confirmMessage: string;
currentContentType: TypeEntry;
typeProperties: any[] = [];
propertyColumns: string[] = ['name', 'title', 'dataType'];
@@ -48,6 +49,7 @@ export class ContentTypeDialogComponent implements OnInit {
this.contentTypeService.getContentTypeByPrefix(this.nodeType).subscribe((contentTypeEntry) => {
this.currentContentType = contentTypeEntry;
this.typeProperties = this.currentContentType.entry.properties.filter((property) => property.id.startsWith(this.currentContentType.entry.model.namespacePrefix));
});
}