fix(admin-ui) Custom batch job activity card (#5288)
This commit is contained in:
1 parent
9ff22110a6
commit
2057d3b247
3 files changed
+9
-13
No files matched your search
@@ -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 MedusaIcon from "../../fundamentals/icons/medusa-icon"
|
||||||
import { ActivityCard } from "../../molecules/activity-card"
|
import { ActivityCard } from "../../molecules/activity-card"
|
||||||
import BatchJobFileCard from "../../molecules/batch-job-file-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"
|
import CrossIcon from "../../fundamentals/icons/cross-icon"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,12 +86,8 @@ const BatchJobActivityCard = (props: { batchJob: BatchJob }) => {
|
|||||||
to: batchJob.created_at,
|
to: batchJob.created_at,
|
||||||
})
|
})
|
||||||
|
|
||||||
const operation = {
|
let operation = batchJob.type.split("-").pop()
|
||||||
"product-import": BatchJobOperation.Import,
|
operation = operation.charAt(0).toUpperCase() + operation.slice(1)
|
||||||
"price-list-import": BatchJobOperation.Import,
|
|
||||||
"product-export": BatchJobOperation.Export,
|
|
||||||
"order-export": BatchJobOperation.Export,
|
|
||||||
}[batchJob.type]
|
|
||||||
|
|
||||||
const batchJobActivityDescription = batchJobDescriptionBuilder(
|
const batchJobActivityDescription = batchJobDescriptionBuilder(
|
||||||
batchJob,
|
batchJob,
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
import { BatchJob } from "@medusajs/medusa/dist"
|
import { BatchJob } from "@medusajs/medusa/dist"
|
||||||
|
|
||||||
export enum BatchJobOperation {
|
|
||||||
Import = "Import",
|
|
||||||
Export = "Export",
|
|
||||||
}
|
|
||||||
|
|
||||||
export function batchJobDescriptionBuilder(
|
export function batchJobDescriptionBuilder(
|
||||||
batchJob: BatchJob,
|
batchJob: BatchJob,
|
||||||
operation: BatchJobOperation,
|
operation: string,
|
||||||
elapsedTime?: number
|
elapsedTime?: number
|
||||||
): string {
|
): string {
|
||||||
let description = ""
|
let description = ""
|
||||||
|
|||||||
Reference in new issue
Block a user