Compare commits

...

2 Commits

Author SHA1 Message Date
Valentin Mihai
98f6fbc132 RED-8342 - Component Editor not showing all values for a multi-value-component 2024-02-15 13:28:49 +02:00
Valentin Mihai
c411676c6c Merge branch 'master' into VM/RED-8342 2024-02-15 13:25:41 +02:00
3 changed files with 39 additions and 28 deletions

View File

@ -13,24 +13,27 @@
<div class="bold">{{ entry.name }}</div> <div class="bold">{{ entry.name }}</div>
<div [id]="getValueCellId(index)"> <div [id]="getValueCellId(index)">
<iqser-editable-input <iqser-editable-input
*ngFor="let componentValue of entry.componentValues; let componentValueIndex = index"
(save)="saveEdit($event, entry.originalKey)" (save)="saveEdit($event, entry.originalKey)"
[canEdit]="canEdit" [canEdit]="canEdit"
[cancelTooltip]="'component-log-dialog.actions.cancel-edit' | translate" [cancelTooltip]="'component-log-dialog.actions.cancel-edit' | translate"
[editTooltip]="'component-log-dialog.actions.edit' | translate" [editTooltip]="'component-log-dialog.actions.edit' | translate"
[id]="'value-' + index" [attr.id]="getValueId(index, componentValueIndex)"
[id]="getValueId(index, componentValueIndex)"
[parentId]="getValueCellId(index)" [parentId]="getValueCellId(index)"
[saveTooltip]="'component-log-dialog.actions.save' | translate" [saveTooltip]="'component-log-dialog.actions.save' | translate"
[value]="entry.componentValues[0].value ?? entry.componentValues[0].originalValue" [value]="componentValue.value ?? componentValue.originalValue"
[lastChild]="componentValueIndex === entry.componentValues.length - 1"
[attr.helpModeKey]="'scm_edit_DIALOG'" [attr.helpModeKey]="'scm_edit_DIALOG'"
> >
<ng-container slot="editing"> <ng-container slot="editing">
<iqser-circle-button <iqser-circle-button
(action)="undo(entry.originalKey)" (action)="undo(entry.originalKey)"
*ngIf="entry.componentValues[0].value !== entry.componentValues[0].originalValue && canEdit" *ngIf="componentValue.value !== componentValue.originalValue && canEdit"
[showDot]="true" [showDot]="true"
[tooltip]=" [tooltip]="
'component-log-dialog.actions.undo' 'component-log-dialog.actions.undo'
| translate: { value: entry.componentValues[0].originalValue } | translate: { value: componentValue.originalValue }
| replaceNbsp | replaceNbsp
" "
[attr.help-mode-key]="'scm_undo_DIALOG'" [attr.help-mode-key]="'scm_undo_DIALOG'"
@ -42,9 +45,10 @@
</div> </div>
<div>{{ entry.componentValues[0].valueDescription }}</div> <div>{{ entry.componentValues[0].valueDescription }}</div>
<div> <div>
<ul *ngIf="entry.componentValues[0].entityReferences; else noReferences" class="pl-0"> <ng-container *ngFor="let componentValue of entry.componentValues; let index = index">
<ul *ngIf="componentValue.entityReferences; else noReferences" class="pl-0">
<li <li
*ngFor="let reference of entry.componentValues[0].entityReferences" *ngFor="let reference of componentValue.entityReferences"
[innerHTML]=" [innerHTML]="
'component-log-dialog.annotations' 'component-log-dialog.annotations'
| translate | translate
@ -59,6 +63,7 @@
</ul> </ul>
<ng-template #noReferences>-</ng-template> <ng-template #noReferences>-</ng-template>
</ng-container>
</div> </div>
</ng-container> </ng-container>
</div> </div>

View File

@ -60,6 +60,10 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
return `value-cell-${index}`; return `value-cell-${index}`;
} }
getValueId(index: number, componentValueIndex: number) {
return `value-${index}-${componentValueIndex}`;
}
originalOrder = (): number => 0; originalOrder = (): number => 0;
exportJSON() { exportJSON() {
@ -87,7 +91,7 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
} }
parseType(type: string) { parseType(type: string) {
return type.replaceAll('_', ' ').replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase()); return type?.replaceAll('_', ' ').replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase());
} }
async toggleOpenScmDialogByDefault() { async toggleOpenScmDialogByDefault() {
@ -126,7 +130,8 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
const dictionaries = this.data.dictionaries; const dictionaries = this.data.dictionaries;
for (const componentLog of componentLogs) { for (const componentLog of componentLogs) {
let foundDictionary: Dictionary; let foundDictionary: Dictionary;
for (const reference of componentLog.componentValues[0].entityReferences) { for (const componentLogValue of componentLog.componentValues) {
for (const reference of componentLogValue.entityReferences) {
if (foundDictionary) { if (foundDictionary) {
reference.displayValue = foundDictionary.label; reference.displayValue = foundDictionary.label;
continue; continue;
@ -137,4 +142,5 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp
} }
} }
} }
}
} }

@ -1 +1 @@
Subproject commit 42cc494e2f3ff18182198bced1320b40c8b41d5e Subproject commit 82b11d2ebad8d49a2b784e830c8da511b1e7dc3e