fix(admin-ui) Custom batch job activity card (#5288)
This commit is contained in:
committed by
GitHub
parent
9ff22110a6
commit
2057d3b247
5
.changeset/nervous-eels-explain.md
Normal file
5
.changeset/nervous-eels-explain.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/admin-ui": patch
|
||||
---
|
||||
|
||||
Fixes crash on the batch job activity card when using a custom batch job.
|
||||
@@ -18,7 +18,7 @@ import FileIcon from "../../fundamentals/icons/file-icon"
|
||||
import MedusaIcon from "../../fundamentals/icons/medusa-icon"
|
||||
import { ActivityCard } from "../../molecules/activity-card"
|
||||
import BatchJobFileCard from "../../molecules/batch-job-file-card"
|
||||
import { batchJobDescriptionBuilder, BatchJobOperation } from "./utils"
|
||||
import { batchJobDescriptionBuilder } from "./utils"
|
||||
import CrossIcon from "../../fundamentals/icons/cross-icon"
|
||||
|
||||
/**
|
||||
@@ -86,12 +86,8 @@ const BatchJobActivityCard = (props: { batchJob: BatchJob }) => {
|
||||
to: batchJob.created_at,
|
||||
})
|
||||
|
||||
const operation = {
|
||||
"product-import": BatchJobOperation.Import,
|
||||
"price-list-import": BatchJobOperation.Import,
|
||||
"product-export": BatchJobOperation.Export,
|
||||
"order-export": BatchJobOperation.Export,
|
||||
}[batchJob.type]
|
||||
let operation = batchJob.type.split("-").pop()
|
||||
operation = operation.charAt(0).toUpperCase() + operation.slice(1)
|
||||
|
||||
const batchJobActivityDescription = batchJobDescriptionBuilder(
|
||||
batchJob,
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import { BatchJob } from "@medusajs/medusa/dist"
|
||||
|
||||
export enum BatchJobOperation {
|
||||
Import = "Import",
|
||||
Export = "Export",
|
||||
}
|
||||
|
||||
export function batchJobDescriptionBuilder(
|
||||
batchJob: BatchJob,
|
||||
operation: BatchJobOperation,
|
||||
operation: string,
|
||||
elapsedTime?: number
|
||||
): string {
|
||||
let description = ""
|
||||
|
||||
Reference in New Issue
Block a user