-
Notifications
You must be signed in to change notification settings - Fork 34
feat: make 6.7 compatible #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cefa71a to
cd18cf1
Compare
cd18cf1 to
58dcb48
Compare
58dcb48 to
c41212c
Compare
WalkthroughThe changes expand dependency compatibility in Changes
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
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📒 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 thedeprecatedattribute 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 thedeprecatedattribute 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
Thedeprecatedflag 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
Addingdeprecatedhere 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
deprecatedattribute on thesw-cardcomponent 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-listingcomponent 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
deprecatedattribute 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: Marksw-cardas deprecated
The cache card component is now flagged with thedeprecatedboolean 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 thedeprecatedprop 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 namedgridslot
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
deprecatedattributes 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
deprecatedattribute to thesw-cardcomponent aligns with the 6.7 compatibility objective and follows the proper deprecation pattern.
13-13: LGTM! Consistent deprecation marking applied.The
deprecatedattributes are correctly added to both thesw-buttonandsw-iconcomponents, maintaining consistency with the overall deprecation strategy.Also applies to: 19-19
33-54: LGTM! Grid restructuring correctly implemented.The
sw-data-gridandsw-paginationcomponents 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
deprecatedattribute 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
#gridslot 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 theelasticsearchAvailablecheck) 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
deprecatedattributes 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
deprecatedattributes 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-currenttemplate 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:
- Proper
<sw-card-section>wrapper for the success alert with bottom divider- Consistent grid slot structure
- 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 ofdeprecatedon 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, addingdeprecatedon 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.
|
@frosh-automation create-instance |
|
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. |
Summary by CodeRabbit