Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -12,8 +12,8 @@ <h4 data-automation-id="content-type-dialog-description">{{description | transla
{{'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>
Expand Down
Expand Up @@ -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',
Expand Down Expand Up @@ -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();
Expand Down
Expand Up @@ -35,6 +35,7 @@ export class ContentTypeDialogComponent implements OnInit {
confirmMessage: string;

currentContentType: TypeEntry;
typeProperties: any[] = [];

propertyColumns: string[] = ['name', 'title', 'dataType'];

Expand All @@ -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));
});
}

Expand Down