Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add filter functionality in export job for category and product expor…#326

Open
ranjan-webkul wants to merge 1 commit into
unopim:masterfrom
ranjan-webkul:fix/add-filter-exportjob
Open

Add filter functionality in export job for category and product expor…#326
ranjan-webkul wants to merge 1 commit into
unopim:masterfrom
ranjan-webkul:fix/add-filter-exportjob

Conversation

@ranjan-webkul
Copy link
Copy Markdown

Issue Reference

Feature: Conditional Filter Visibility for Export Profiles (Categories vs Products)

Description

This PR enhances the Export Profile creation and edit forms by adding conditional logic to the filter settings. The goal is to streamline the UI by hiding irrelevant filters based on the selected entity type.

Key Changes:

1- Conditional Visibility: The Channel filter is now hidden when the "Categories" entity type is selected, as categories are typically global or not channel-specific in this context.

2- Persistent Filters: The Locale filter remains visible for all entity types (Categories, Products, etc.) to allow multi-language data exports.

3- State Preservation: Updated the entityType watcher and form reset logic to ensure the entity_type value is preserved during UI updates, preventing the dropdown from clearing.

4- Robust Detection: Improved the isCategory() and parseValue() methods to correctly identify the selected entity, whether the data is passed as a raw string or a JSON object.

How to Check (Testing Steps for Reviewer):

1- Create Export Profile:

  • Navigate to Settings > Data Transfer > Exports > Create.
  • Select Categories from the Type dropdown.
  • Verify: The "Channel" filter should disappear, but the "Locale" filter should remain visible.
  • Switch the Type to Products.
  • Verify: Both "Channel" and "Locale" filters should now be visible.

2- Edit Export Profile:

  • Open an existing Category export profile for editing.
  • Verify: Only the "Locale" filter is displayed in the accordion.
  • Open an existing Product export profile.
  • Verify: Both filters are displayed correctly.

3- Data Integrity:

  • Save a profile after switching types and ensure the entity_type and selected filters are correctly stored in the database.

Expected Export Result:

When the user runs the export, the generated CSV file will now be correctly filtered based on these settings:

  • For Categories: The CSV will contain data filtered only by the selected Locale.
  • For Products: The CSV will be filtered by both the selected Channel and Locale, ensuring the exported data is accurate to the specific store view.

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