DM-535 - Components without references not displayed in Component View
This commit is contained in:
parent
a8e116e167
commit
3a0b5f415b
@ -10,7 +10,7 @@
|
|||||||
<div class="table-header">{{ 'component-log-dialog.table-header.annotation-references' | translate }}</div>
|
<div class="table-header">{{ 'component-log-dialog.table-header.annotation-references' | translate }}</div>
|
||||||
|
|
||||||
<ng-container *ngFor="let entry of componentLogEntries; let index = index">
|
<ng-container *ngFor="let entry of componentLogEntries; let index = index">
|
||||||
<div class="bold">{{ entry.name.replaceAll('_', ' ').toLowerCase() }}</div>
|
<div class="bold">{{ entry.name }}</div>
|
||||||
<div [id]="getValueCellId(index)">
|
<div [id]="getValueCellId(index)">
|
||||||
<iqser-editable-input
|
<iqser-editable-input
|
||||||
(save)="saveEdit($event, entry.name)"
|
(save)="saveEdit($event, entry.name)"
|
||||||
@ -49,7 +49,7 @@
|
|||||||
'component-log-dialog.annotations'
|
'component-log-dialog.annotations'
|
||||||
| translate
|
| translate
|
||||||
: {
|
: {
|
||||||
type: entry.name,
|
type: parseType(reference.type),
|
||||||
page: reference.page,
|
page: reference.page,
|
||||||
ruleNumber: reference.entityRuleId
|
ruleNumber: reference.entityRuleId
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,10 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
|
|||||||
return this.exportJSON();
|
return this.exportJSON();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parseType(type: string) {
|
||||||
|
return type.replaceAll('_', ' ').replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
async toggleOpenScmDialogByDefault() {
|
async toggleOpenScmDialogByDefault() {
|
||||||
await this.userPreferences.toggleOpenScmDialogByDefault();
|
await this.userPreferences.toggleOpenScmDialogByDefault();
|
||||||
await this.userPreferences.reload();
|
await this.userPreferences.reload();
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export class ComponentLogService extends GenericService<void> {
|
|||||||
.pipe(
|
.pipe(
|
||||||
map(data => data.componentDetails),
|
map(data => data.componentDetails),
|
||||||
catchError(() => of({} as ComponentDetails)),
|
catchError(() => of({} as ComponentDetails)),
|
||||||
map(componentDetails => this.#filterComponentDetails(componentDetails)),
|
map(componentDetails => this.#mapComponentDetails(componentDetails)),
|
||||||
mapEach(log => new ComponentLogEntry(log)),
|
mapEach(log => new ComponentLogEntry(log)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -61,12 +61,7 @@ export class ComponentLogService extends GenericService<void> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#filterComponentDetails(componentDetails: ComponentDetails): IComponentLogEntry[] {
|
#mapComponentDetails(componentDetails: ComponentDetails): IComponentLogEntry[] {
|
||||||
return Object.keys(componentDetails)
|
return Object.keys(componentDetails).reduce((res, key) => (res.push(componentDetails[key]), res), []);
|
||||||
.filter(function (key) {
|
|
||||||
const component = componentDetails[key];
|
|
||||||
return !!component.componentValues[0].entityReferences.length;
|
|
||||||
})
|
|
||||||
.reduce((res, key) => (res.push(componentDetails[key]), res), []);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export class ComponentLogEntry implements IComponentLogEntry {
|
|||||||
readonly componentValues: ComponentValue[];
|
readonly componentValues: ComponentValue[];
|
||||||
|
|
||||||
constructor(entry: IComponentLogEntry) {
|
constructor(entry: IComponentLogEntry) {
|
||||||
this.name = entry.name;
|
this.name = entry.name.replaceAll('_', ' ');
|
||||||
this.componentValues = entry.componentValues;
|
this.componentValues = entry.componentValues;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user