question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom order history timeline entries

See original GitHub issue

Is your feature request related to a problem? Please describe. I would like to display custom history entries with a custom HistoryEntryType.

Example: We have a marketplace and issue a payout for the product owner.

// Add history element to order to document the payout
await this.historyService.createHistoryEntryForOrder(
    {
        ctx,
        type: HistoryEntryType.ORDER_PAYOUT, //< custom type
        orderId: order.id,
        data: {
            // Data to display
            title, // display title
            link, // to navigate in the admin ui
            // Custom data
            amount,
            service,
            payoutId,
            ownerId,
        },
    } as any, //< because we have a custom type
    false,
);

But this entry will never be displayed in the admin UI, because the angular switchCase does not contain a default option. This default option should be a component that takes title and link from HistoryEntry.data and displays it. All other data should be displayed as JSON inside a popover (like for payments)

Describe the solution you’d like Add a default case for an history entry: https://github.com/vendure-ecommerce/vendure/blob/ce147dc13e139be6d734016f43f7abeed9fac8d9/packages/admin-ui/src/lib/order/src/components/order-history/order-history.component.html#L199

<ng-container *ngSwitchDefault>

  <div class="title" *ngIf="entry.data.title">
    {{ entry.data.title | translate }}
  </div>
  <div class="link" *ngIf="entry.data.link" >
     <a [routerLink]="entry.data.link"><clr-icon shape="cursor-hand-click"></clr-icon></a>
  </div>

<vdr-history-entry-detail *ngIf="entry.data">
  <component-to-show-json [data]="entry.data" />
</vdr-history-entry-detail>
</ng-container>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Draykeecommented, Jul 29, 2022

My idea would be to add a custom type that requires a few properties to display it in the UI but accepts any string as type

0reactions
michaelbromleycommented, Sep 8, 2022

Note: With this we should do the same for Customer history timeline.

Read more comments on GitHub >

github_iconTop Results From Across the Web

40+ Timeline Templates, Examples and Design Tips - Venngage
40+ customizable timeline templates & design tips. ... Plot it into a timeline template and insert it into your blog posts or guest...
Read more >
Timeline Templates to Edit Online and Download - Creately
Free timeline templates for any situation. Edit and export in PNG, JPEG, PDF or SVG formats for publishing, PowerPoint presentations, ...
Read more >
How to Create a Historical Timeline | How to Make a History ...
Developing a short list of themes and criteria for the timeline will help ensure that each entry stays on message and contributes to...
Read more >
Free Online Timeline Maker - Create Infographics - Canva
1. Go to Canva and look for “Timeline Infographics” in the search bar. Begin editing while logged out, or you can open your...
Read more >
Interactive History Timelines for Teachers and Students
Interactive history timelines arrange world history into chronological order starting with the most ancient all the way to the current period.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found