Skip to content

#604 new mirakl import#581

Merged
BranDavidSebastian merged 1 commit intomasterfrom
development
Mar 26, 2026
Merged

#604 new mirakl import#581
BranDavidSebastian merged 1 commit intomasterfrom
development

Conversation

@BranDavidSebastian
Copy link
Copy Markdown
Collaborator

@BranDavidSebastian BranDavidSebastian commented Mar 26, 2026

Summary by Sourcery

Add support for Mirakl product imports with file upload and dedicated import detail view.

New Features:

  • Introduce a multi-step Mirakl import wizard that supports both schema and product imports, including XLSX file uploads for product imports.
  • Add a Mirakl import detail page and route to display import status, settings, progress, errors, and uploaded files.

Bug Fixes:

  • Ensure integration navigation for Mirakl product types uses the correct nested sales channel proxy ID.

Enhancements:

  • Update Mirakl import listing links and routing to use a Mirakl-specific import show page.
  • Extend GraphQL API layer with queries and mutations for Mirakl import processes and their export files, and adjust Mirakl product type sales channel shape handling.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 26, 2026

Reviewer's Guide

Adds a multi-step Mirakl import flow that supports uploading product export files and a dedicated Mirakl import detail page, wires them into routing and listings, and adjusts GraphQL schema usage for Mirakl-related entities.

Sequence diagram for the new Mirakl product import creation flow with file uploads

sequenceDiagram
  actor User
  participant MiraklImporter as MiraklImporterVue
  participant Router
  participant Apollo as ApolloClient
  participant GQL as GraphQLAPI
  participant ImportProcess as MiraklImportProcess
  participant ExportFile as MiraklImportExportFile

  User->>MiraklImporter: Open Mirakl import wizard
  MiraklImporter->>Apollo: getMiraklChannelQuery(integrationId)
  Apollo->>GQL: getMiraklChannelQuery
  GQL-->>Apollo: miraklChannel(salesChannel.id, hasFinishedSchema)
  Apollo-->>MiraklImporter: miraklChannel data

  User->>MiraklImporter: Select importType products
  User->>MiraklImporter: Configure importSettings
  User->>MiraklImporter: Upload .xlsx export files
  MiraklImporter->>MiraklImporter: onUploaded(files) filter and store exportFiles

  User->>MiraklImporter: Click Finish
  MiraklImporter->>MiraklImporter: handleFinish()
  MiraklImporter->>MiraklImporter: validate salesChannelId and exportFiles

  MiraklImporter->>Apollo: createMiraklImportProcessMutation(data)
  Apollo->>GQL: createMiraklImportProcess
  GQL-->>Apollo: createMiraklImportProcess(id)
  Apollo-->>MiraklImporter: importProcessId
  MiraklImporter->>ImportProcess: create pending process (logical)

  loop for each file in exportFiles
    MiraklImporter->>Apollo: createMiraklImportExportFileMutation(data)
    Apollo->>GQL: createMiraklImportExportFile
    GQL-->>Apollo: created exportFile(id, fileUrl)
    Apollo-->>MiraklImporter: exportFile result
    MiraklImporter->>ExportFile: associate file with process (logical)
  end

  MiraklImporter->>User: Toast.success(integrations.imports.create.success)
  MiraklImporter->>Router: push(name integrations.integrations.show, query tab imports)
Loading

File-Level Changes

Change Details Files
Enhance Mirakl importer to support a wizard with product file upload, validation, and async process creation with associated export files.
  • Extend importer state with wizard step tracking, loading state for finalization, and storage for uploaded export files
  • Dynamically compute wizard steps and next-step eligibility based on import type and presence of files
  • Integrate DropZone for XLSX uploads, deduplicating files and allowing removal, with helper utilities for file keying and size formatting
  • Refactor import creation into separate functions for creating the import process and its export files, including error handling and success routing
  • Disable navigation while loading and enforce that product imports must have at least one uploaded file
src/core/integrations/integrations/integrations-show/containers/imports/containers/create-import/containers/mirakl/mirakl-importer/MiraklImporter.vue
Expose Mirakl import process details via GraphQL and a new detail controller page, and hook it into routing and listing navigation.
  • Add GraphQL query to fetch Mirakl import process including export files and related sales channel
  • Add GraphQL mutation to create Mirakl import export file records
  • Introduce a Mirakl import show controller page to display import metadata, status, progress, options, and uploaded files with download links
  • Register a new route for viewing Mirakl import processes and update the Mirakl imports listing to link to it using the internal id instead of proxyId
src/shared/api/queries/salesChannels.js
src/shared/api/mutations/salesChannels.js
src/core/integrations/routes.ts
src/core/integrations/integrations/integrations-show/containers/imports/components/MiraklImportsListing.vue
src/core/integrations/integrations/integrations-show/containers/imports/containers/import-show/MiraklImportShowController.vue
Adjust Mirakl-related product type handling to use nested sales channel pointer proxy IDs instead of direct proxyId access.
  • Change computed integrationShowId for imported remote product types to read proxyId from saleschannelPtr on the salesChannel
  • Apply the same saleschannelPtr-based proxyId access for remotely mapped remote product types
src/core/integrations/integrations/integrations-show/containers/rules/containers/remote-product-types/containers/ImportedRemoteProductType.vue
src/core/integrations/integrations/integrations-show/containers/rules/containers/remote-product-types/containers/RemotelyMappedRemoteProductType.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • In MiraklImportShowController.vue, integrationId is taken from miraklImportProcess.salesChannel.id and then used to build the integrations.integrations.show breadcrumb link; if that route expects the sales channel’s proxyId (as in other components you updated), this will navigate with the wrong identifier and should be aligned.
  • fetchImport in MiraklImportShowController.vue swallows query errors and only flips loading; consider at least logging or surfacing a toast/empty state when the query fails so the user isn’t left with an indefinite loader or a blank card.
  • result, miraklImport, and miraklExportFiles in MiraklImportShowController.vue are all typed as any/implicit any; adding a small interface for the GraphQL response and using proper generics on apolloClient.query would make the component safer and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `MiraklImportShowController.vue`, `integrationId` is taken from `miraklImportProcess.salesChannel.id` and then used to build the `integrations.integrations.show` breadcrumb link; if that route expects the sales channel’s `proxyId` (as in other components you updated), this will navigate with the wrong identifier and should be aligned.
- `fetchImport` in `MiraklImportShowController.vue` swallows query errors and only flips `loading`; consider at least logging or surfacing a toast/empty state when the query fails so the user isn’t left with an indefinite loader or a blank card.
- `result`, `miraklImport`, and `miraklExportFiles` in `MiraklImportShowController.vue` are all typed as `any`/implicit `any`; adding a small interface for the GraphQL response and using proper generics on `apolloClient.query` would make the component safer and easier to maintain.

## Individual Comments

### Comment 1
<location path="src/core/integrations/integrations/integrations-show/containers/imports/containers/import-show/MiraklImportShowController.vue" line_range="61-70" />
<code_context>
+  void fetchImport();
+});
+
+const formatDate = (dateString: string) => {
+  const date = new Date(dateString);
+  return new Intl.DateTimeFormat('en-GB', {
+    year: 'numeric',
+    month: '2-digit',
+    day: '2-digit',
+    hour: '2-digit',
+    minute: '2-digit',
+    hour12: false,
+  }).format(date);
+};
+</script>
</code_context>
<issue_to_address>
**suggestion:** Use the active i18n locale for date formatting instead of hardcoding 'en-GB'

`formatDate` currently uses `new Intl.DateTimeFormat('en-GB', ...)`, which bypasses the user’s chosen locale and can diverge from the rest of the UI. Since `useI18n` is available, please build the formatter from `t`/`d` or `i18n.locale.value` (or a shared date-format utility) so dates honor the active locale.

Suggested implementation:

```
const formatDate = (dateString: string) => {
  const date = new Date(dateString);
  return new Intl.DateTimeFormat(locale.value, {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    hour12: false,
  }).format(date);
};

```

To make this work you also need to:
1. Ensure `useI18n` is imported in the `<script setup>` of this file (if not already): `import { useI18n } from 'vue-i18n';`
2. Destructure `locale` from `useI18n` at the top level of the script (next to where `t` is likely used), e.g.:
   `const { t, locale } = useI18n();`
If the project uses a shared date-formatting utility based on i18n, consider replacing `formatDate` entirely with that utility instead of using `Intl.DateTimeFormat` directly.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +61 to +70
const formatDate = (dateString: string) => {
const date = new Date(dateString);
return new Intl.DateTimeFormat('en-GB', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
hour12: false,
}).format(date);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Use the active i18n locale for date formatting instead of hardcoding 'en-GB'

formatDate currently uses new Intl.DateTimeFormat('en-GB', ...), which bypasses the user’s chosen locale and can diverge from the rest of the UI. Since useI18n is available, please build the formatter from t/d or i18n.locale.value (or a shared date-format utility) so dates honor the active locale.

Suggested implementation:

const formatDate = (dateString: string) => {
  const date = new Date(dateString);
  return new Intl.DateTimeFormat(locale.value, {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    hour12: false,
  }).format(date);
};

To make this work you also need to:

  1. Ensure useI18n is imported in the <script setup> of this file (if not already): import { useI18n } from 'vue-i18n';
  2. Destructure locale from useI18n at the top level of the script (next to where t is likely used), e.g.:
    const { t, locale } = useI18n();
    If the project uses a shared date-formatting utility based on i18n, consider replacing formatDate entirely with that utility instead of using Intl.DateTimeFormat directly.

@BranDavidSebastian BranDavidSebastian merged commit f0c3ab2 into master Mar 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant