Browse Source

fix(admin-ui): Fix display of facet value custom fields

Fixes #1282
Michael Bromley 4 years ago
parent
commit
f4a6dbda94

+ 1 - 12
packages/admin-ui/src/lib/catalog/src/components/facet-detail/facet-detail.component.html

@@ -119,20 +119,9 @@
                     </td>
                     <td class="align-middle"><input type="text" formControlName="code" readonly /></td>
                     <td class="" *ngIf="customValueFields.length">
-                        <!--                    <ng-container *ngFor="let customField of customValueFields">-->
-                        <!--                       -->
-                        <!--                            <vdr-custom-field-control-->
-                        <!--                                *ngIf="customValueFieldIsSet(i, customField.name)"-->
-                        <!--                                entityName="FacetValue"-->
-                        <!--                                [showLabel]="false"-->
-                        <!--                                [customFieldsFormGroup]="detailForm.get(['values', i, 'customFields'])"-->
-                        <!--                                [customField]="customField"-->
-                        <!--                            ></vdr-custom-field-control>-->
-                        <!--                      -->
-                        <!--                    </ng-container>-->
                         <vdr-tabbed-custom-fields
                             entityName="FacetValue"
-                            [customFields]="customFields"
+                            [customFields]="customValueFields"
                             [compact]="true"
                             [customFieldsFormGroup]="detailForm.get(['values', i, 'customFields'])"
                             [readonly]="!(updatePermission | hasPermission)"

+ 3 - 1
packages/admin-ui/src/lib/core/src/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.ts

@@ -40,6 +40,8 @@ export class TabbedCustomFieldsComponent implements OnInit {
                 tabMap.set(tabName, [field]);
             }
         }
-        return Array.from(tabMap.entries()).map(([tabName, customFields]) => ({ tabName, customFields }));
+        return Array.from(tabMap.entries())
+            .sort((a, b) => (a[0] < b[0] ? -1 : 1))
+            .map(([tabName, customFields]) => ({ tabName, customFields }));
     }
 }