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

admin-ui: Support custom field controls in FulfillmentDetail & OrderTable #887

Closed
Wanztwurst opened this issue May 19, 2021 · 1 comment
Closed
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@Wanztwurst
Copy link
Contributor

order-table.component.html and fulfillment-detail.component.html are not using the component vdr-custom-field-control for their custom fields – hence the controls are not configurable to use a different module with registerCustomFieldComponent().

Is this specialized behaviour intentional?

fulfillment-detail:

<ng-container *ngFor="let customField of customFields">
    <vdr-labeled-data [label]="customField.key">
        <vdr-object-tree
            *ngIf="customFieldIsObject(customField.value); else primitive"
            [value]="{ object: customField.value }"
        ></vdr-object-tree>
        <ng-template #primitive>
            {{ customField.value }}
        </ng-template>
    </vdr-labeled-data>
</ng-container>

order-table:

<div class="order-line-custom-fields">
    <div class="custom-field" *ngFor="let field of customFields">
        <vdr-labeled-data [label]="field.config | customFieldLabel">
            <div class="mt2" [ngSwitch]="field.config.type">
                <ng-template [ngSwitchCase]="'datetime'">
                    <span [title]="field.value">{{ field.value }}</span>
                </ng-template>
                <ng-template [ngSwitchCase]="'boolean'">
                    <ng-template [ngIf]="field.value === true">
                        <clr-icon shape="check"></clr-icon>
                    </ng-template>
                    <ng-template [ngIf]="field.value === false">
                        <clr-icon shape="times"></clr-icon>
                    </ng-template>
                </ng-template>
                <ng-template ngSwitchDefault>
                    {{ field.value }}
                </ng-template>
            </div>
        </vdr-labeled-data>
    </div>
</div>
@Wanztwurst Wanztwurst added the type: bug 🐛 Something isn't working label May 19, 2021
@michaelbromley
Copy link
Member

I think its like this just because I wanted to at least display the values of the custom fields. But you are right that we should support custom controls here too.

I'll add it to the backlog for the next minor release.

@michaelbromley michaelbromley changed the title bug(admin-ui): two components not using vdr-custom-field-control for customFields admin-ui: Support custom field controls in FulfillmentDetail & OrderTable May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants