Skip to content

Conversation

@shyim
Copy link
Member

@shyim shyim commented Apr 20, 2025

Summary by CodeRabbit

  • New Features
    • Improved error detection for file listing by handling unexpected HTML responses.
  • Bug Fixes
    • Enhanced compatibility with newer versions of core dependencies.
  • Refactor
    • Restructured several UI templates for improved slot usage and markup organization.
  • Style
    • Updated SCSS for better structure and added new styling for alert wrappers.
  • Chores
    • Marked various UI components as deprecated across multiple administration tabs.
  • Documentation
    • Added deprecation indicators in template markup for user awareness.

@shyim shyim force-pushed the 67-compat branch 2 times, most recently from cefa71a to cd18cf1 Compare April 20, 2025 17:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 2, 2025

Walkthrough

The changes expand dependency compatibility in composer.json, enhance error detection in a controller, and update multiple UI templates by marking components as deprecated and restructuring grid renderings. SCSS was refactored for better nesting, and a computed property now prefers a new context source. No public APIs or exported entities were altered.

Changes

File(s) Change Summary
composer.json Expanded version constraints for "shopware/core" and "shopware/elasticsearch" to include both ~6.6.0 and ~6.7.0.
src/Controller/ShopwareFilesController.php Broadened error detection in listShopwareFiles to handle Cloudflare HTML fallback responses.
src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-/.twig Added deprecated attributes to UI components; wrapped grids in <template #grid> slots; minor markup tweaks.
src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/style.scss Refactored SCSS for nesting; added a new alert wrapper class.
src/Resources/app/administration/src/module/frosh-tools/page/index/index.js Modified computed property to prefer Shopware.Store over Shopware.State for config access.
src/Resources/app/administration/src/module/frosh-tools/page/index/template.twig Removed <sw-container> wrapper; inlined <sw-tabs-item> elements for cleaner structure.
src/Resources/app/administration/src/overrides/sw-data-grid-inline-edit/template.twig Added deprecated attribute to <sw-datepicker> components for date/datetime inline edit types.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (Admin Module)
    participant Controller
    participant External API (Shopware/Cloudflare)

    User->>UI (Admin Module): Interacts with tabs (e.g., refresh, view files)
    UI (Admin Module)->>Controller: Sends request (e.g., listShopwareFiles)
    Controller->>External API: Makes HTTP request for file data
    External API-->>Controller: Returns data (JSON or HTML fallback)
    Controller-->>UI (Admin Module): Returns JSON data or error if empty/HTML fallback
    UI (Admin Module)-->>User: Displays files or error message
Loading

Poem

A bunny hopped through code so wide,
Marking old UI with "deprecated" pride.
Grids now nest in tidy slots,
While error checks connect the dots.
With broader versions, all is right—
The tools are ready, day and night!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/Resources/app/administration/src/module/frosh-tools/page/index/index.js (1)

10-20: Simplify conditional check using optional chaining.

The logic for handling the API preference between Shopware.Store and Shopware.State is sound for version compatibility. However, the conditional check can be simplified using optional chaining as suggested by static analysis.

Apply this diff to use optional chaining:

-            if (Shopware.Store && Shopware.Store.get('context')) {
+            if (Shopware.Store?.get('context')) {
                 return (
                     Shopware.Store.get('context').app.config.settings
                         ?.elasticsearchEnabled || false
                 );
             } else {
                 return (
                     Shopware.State.get('context').app.config.settings
                         ?.elasticsearchEnabled || false
                 );
             }
🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e15098c and c41212c.

📒 Files selected for processing (14)
  • composer.json (1 hunks)
  • src/Controller/ShopwareFilesController.php (1 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-cache/template.twig (2 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-elasticsearch/template.twig (4 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-files/template.twig (2 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/style.scss (1 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/template.twig (2 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-logs/template.twig (3 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-queue/template.twig (2 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-scheduled/template.twig (2 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-state-machines/template.html.twig (1 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/page/index/index.js (1 hunks)
  • src/Resources/app/administration/src/module/frosh-tools/page/index/template.twig (1 hunks)
  • src/Resources/app/administration/src/overrides/sw-data-grid-inline-edit/template.twig (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/Resources/app/administration/src/module/frosh-tools/page/index/index.js

[error] 10-10: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (36)
src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-state-machines/template.html.twig (1)

4-4: Component Deprecation Flag Added
The addition of the deprecated attribute to the <sw-card> aligns with the broader deprecation strategy across Frosh Tools templates and correctly signals future removal.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-queue/template.twig (7)

8-8: Mark <sw-card> as deprecated
Adding the deprecated attribute here will flag the entire card component for deprecation across the UI, which aligns with the 6.7 compatibility plan.


13-13: Deprecate toolbar refresh button
The deprecated flag on this <sw-button> ensures consistent deprecation styling for the refresh action.


18-18: Deprecate refresh icon
Good catch—marking the <sw-icon> as deprecated in tandem with its parent button maintains styling consistency.


23-23: Deprecate reset queue button
This <sw-button> is also correctly marked as deprecated, matching the rest of the toolbar.


30-38: Wrap grid in named slot
Refactoring the <sw-data-grid> into <template #grid> follows the established pattern for slot-based grid rendering. Please verify in the running UI that the grid still renders correctly under the new slot.


48-51: Deprecate modal cancel button
Adding deprecated here keeps the modal footer consistent with the overall deprecation strategy.


55-57: Deprecate modal reset button
The reset action in the modal footer is now properly flagged as deprecated. This completes the deprecation marking for this component.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-scheduled/template.twig (4)

8-8: Deprecation marking follows the migration pattern.

The deprecated attribute on the sw-card component aligns with the 6.7 compatibility migration. This is consistent with the broader pattern of marking UI components for future removal.


12-12: Toolbar buttons and icon correctly marked as deprecated.

The deprecation attributes on the toolbar buttons and refresh icon are properly applied. This maintains backward compatibility while signaling the transition to newer UI components.

Also applies to: 19-19, 23-23


31-90: Grid slot implementation looks correct.

The sw-entity-listing component has been properly wrapped within a <template #grid> slot. This restructuring:

  • Maintains all existing functionality (inline editing, actions, column templates)
  • Follows the new slot-based pattern for grid components
  • Preserves all attributes and event handlers
  • Keeps the internal template structure intact

The migration appears to be implemented correctly without breaking existing functionality.


107-107: Modal close button properly deprecated.

The deprecated attribute on the modal close button is consistent with the overall migration pattern.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-cache/template.twig (6)

2-5: Mark sw-card as deprecated
The cache card component is now flagged with the deprecated boolean prop to surface deprecation warnings in Shopware 6.7. This change aligns with the other Frosh Tools tabs.


12-16: Mark refresh button as deprecated
Adding the deprecated prop to the <sw-button> ensures the refresh control emits the proper deprecation notice under the new UI guidelines.


17-21: Mark undo icon as deprecated
The <sw-icon> inside the refresh button is correctly marked deprecated, matching the updated deprecation lifecycle for icon components in 6.7.


25-78: Wrap <sw-data-grid> inside the named grid slot
The data grid is now enclosed within <template #grid>, consistent with the new slot-based rendering in Shopware 6.7. Please verify that this named slot is supported in your target version and that the grid renders as expected.


80-83: Mark action card as deprecated
The actions card <sw-card> is also flagged deprecated, aligning with the broader deprecation strategy across module tabs.


88-91: Mark compile theme button as deprecated
The compile theme button is now marked deprecated, keeping consistency with other interactive controls in this template.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-files/template.twig (1)

9-9: LGTM: Systematic UI component deprecation for 6.7 compatibility.

The addition of deprecated attributes to various Shopware UI components (sw-card, sw-alert, sw-button, sw-icon) aligns with the PR objective of making the codebase compatible with version 6.7. This is a necessary step in the migration process and follows the broader pattern mentioned in the summary.

The changes are non-breaking and preserve all existing functionality while marking components for future replacement.

Also applies to: 13-13, 18-18, 26-26, 34-34, 39-39, 89-89, 93-96

src/Controller/ShopwareFilesController.php (1)

67-68: Excellent enhancement to error detection.

The addition of the HTML content check (str_contains($data, '<!DOCTYPE html>')) is a smart improvement that handles the edge case where Cloudflare serves HTML fallback pages instead of the expected file data. This prevents potential issues where HTML content could be mistakenly processed as file information.

The explanatory comment clearly documents the reasoning behind this change, making the code more maintainable.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-logs/template.twig (5)

8-8: LGTM! Deprecation marking is correctly applied.

The addition of the deprecated attribute to the sw-card component aligns with the 6.7 compatibility objective and follows the proper deprecation pattern.


13-13: LGTM! Consistent deprecation marking applied.

The deprecated attributes are correctly added to both the sw-button and sw-icon components, maintaining consistency with the overall deprecation strategy.

Also applies to: 19-19


33-54: LGTM! Grid restructuring correctly implemented.

The sw-data-grid and sw-pagination components have been properly moved into the new <template #grid> slot while preserving all original functionality, attributes, and event handlers. This restructuring aligns with the 6.7 compatibility requirements.


80-80: LGTM! Deprecation pattern completed consistently.

The deprecated attribute on the modal close icon completes the systematic deprecation marking of all UI components in the template, maintaining consistency with the 6.7 compatibility objective.


1-86: Excellent implementation of 6.7 compatibility changes.

The template update demonstrates a well-structured approach to version compatibility:

  • Consistent deprecation marking: All UI components (sw-card, sw-button, sw-icon) are systematically marked as deprecated
  • Proper grid restructuring: The data grid and pagination are correctly moved into the new #grid slot pattern
  • Functionality preservation: All existing behavior, data bindings, and event handlers remain intact
  • Clean implementation: Changes are minimal and focused, reducing the risk of introducing bugs

This aligns perfectly with the PR objective of making the codebase compatible with version 6.7 while maintaining backward compatibility.

composer.json (1)

38-38: LGTM! Version constraint expansion looks correct.

The dependency version updates properly expand compatibility to support both Shopware 6.6.x and 6.7.x series using the correct Composer version constraint syntax.

Also applies to: 41-41

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/style.scss (1)

1-16: Excellent SCSS refactoring following best practices.

The restructuring from flat selectors to nested SCSS improves code organization and readability. The new alert wrapper class aligns well with the template restructuring mentioned in the summary.

src/Resources/app/administration/src/module/frosh-tools/page/index/template.twig (1)

3-34: Template restructuring looks good.

The removal of the wrapping container and direct nesting of tab items under <sw-tabs> is a clean structural improvement. All routing logic and conditional rendering (including the elasticsearchAvailable check) remain intact.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-elasticsearch/template.twig (2)

4-4: Consistent deprecation marking for Shopware 6.7 compatibility.

The systematic addition of deprecated attributes to UI components (sw-card, sw-alert, sw-button, sw-icon) is consistent with the migration strategy for Shopware 6.7 compatibility. This approach provides clear indicators for future refactoring while maintaining current functionality.

Also applies to: 11-11, 42-42, 50-50, 56-56, 100-100, 105-105, 112-112, 118-118, 124-124, 130-130, 139-139, 154-154


62-95: Proper grid restructuring using slot-based rendering.

The restructuring of the <sw-data-grid> component inside a <template #grid> slot is well-implemented. The existing grid configuration, columns, and template slots are preserved, ensuring no functional changes while adopting the new slot-based rendering approach for Shopware 6.7.

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/template.twig (4)

7-7: Consistent deprecation marking across components.

The addition of deprecated attributes to various UI components follows the same systematic approach as other files in this migration, ensuring consistency across the Frosh Tools module for Shopware 6.7 compatibility.

Also applies to: 13-13, 17-17, 26-26, 83-83, 92-92


30-76: Well-structured grid slot implementation for health section.

The restructuring of the health data grid into a <template #grid> slot is properly implemented. The column templates maintain their functionality while adopting the new slot-based rendering approach.


38-61: Improved template structure for column rendering.

The simplification of the column-current template from nested <template> tags to a single <div> wrapper improves readability while maintaining the same conditional label rendering logic. This is a good refactoring that makes the code more maintainable.


85-144: Enhanced performance section with proper alert wrapping.

The performance section improvements include:

  1. Proper <sw-card-section> wrapper for the success alert with bottom divider
  2. Consistent grid slot structure
  3. Maintained functionality with improved structure

The addition of the card section wrapper provides better visual separation and follows UI component best practices.

src/Resources/app/administration/src/overrides/sw-data-grid-inline-edit/template.twig (2)

2-9: Marking the Date Picker Inline-Edit as Deprecated
The addition of deprecated on the <sw-datepicker> for "date" inline editing matches the deprecation pattern in other templates. Please ensure the new replacement component is documented in your 6.7 migration guide and that this override still renders correctly in the Admin.


11-18: Marking the DateTime Picker Inline-Edit as Deprecated
Similarly, adding deprecated on the <sw-datepicker> for "datetime" is consistent. Verify the datetime variant still functions as expected under 6.7 and that developers are directed to the preferred replacement in the docs.

@schneider-felix
Copy link
Member

@frosh-automation create-instance

@frosh-automation
Copy link
Contributor

Hey 👋,

I have created for you an Shopware Instalation with the current changes made here.

You can access the Shop here: https://mhh01mg-k56pr3hg3hedm.zrh2.namespaced.app

The URL is only for FriendsOfShopware members.

@shyim shyim merged commit cbd7d72 into main Jun 2, 2025
4 checks passed
@shyim shyim deleted the 67-compat branch June 2, 2025 15:14
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.

3 participants