diff --git a/.changeset/ninety-hairs-reflect.md b/.changeset/chilled-apricots-grab.md similarity index 62% rename from .changeset/ninety-hairs-reflect.md rename to .changeset/chilled-apricots-grab.md index 63e294545..7dde86221 100644 --- a/.changeset/ninety-hairs-reflect.md +++ b/.changeset/chilled-apricots-grab.md @@ -2,4 +2,4 @@ "@shopware-ag/meteor-component-library": patch --- -move mt-loader over to plain css +Add translation for mt-banner diff --git a/.changeset/stupid-toes-punch.md b/.changeset/dry-dancers-boil.md similarity index 60% rename from .changeset/stupid-toes-punch.md rename to .changeset/dry-dancers-boil.md index 2b8263126..40c6e4222 100644 --- a/.changeset/stupid-toes-punch.md +++ b/.changeset/dry-dancers-boil.md @@ -2,4 +2,4 @@ "@shopware-ag/meteor-component-library": patch --- -Allow disabling individual tab items +Add focus styles for checkbox diff --git a/.changeset/green-poems-drop.md b/.changeset/green-poems-drop.md new file mode 100644 index 000000000..d5b37514f --- /dev/null +++ b/.changeset/green-poems-drop.md @@ -0,0 +1,5 @@ +--- +"@shopware-ag/meteor-component-library": patch +--- + +Migrate mt-select over to the custom built i18n composable diff --git a/.changeset/grumpy-kangaroos-attack.md b/.changeset/grumpy-kangaroos-attack.md new file mode 100644 index 000000000..609d465b4 --- /dev/null +++ b/.changeset/grumpy-kangaroos-attack.md @@ -0,0 +1,5 @@ +--- +"@shopware-ag/meteor-component-library": patch +--- + +Migrate mt-data-table over to the custom built i18n composable diff --git a/.changeset/curvy-walls-dress.md b/.changeset/nervous-countries-cry.md similarity index 54% rename from .changeset/curvy-walls-dress.md rename to .changeset/nervous-countries-cry.md index e7599f244..0f5f09a4e 100644 --- a/.changeset/curvy-walls-dress.md +++ b/.changeset/nervous-countries-cry.md @@ -2,4 +2,4 @@ "@shopware-ag/meteor-component-library": patch --- -Deprecated the mt-url-field component +Add missing translation for data table filters diff --git a/.changeset/quiet-trains-impress.md b/.changeset/quiet-trains-impress.md deleted file mode 100644 index 2e8d07cba..000000000 --- a/.changeset/quiet-trains-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopware-ag/meteor-component-library": patch ---- - -remove default margin of banner component, hidden by future flag diff --git a/.changeset/rare-starfishes-compete.md b/.changeset/rare-starfishes-compete.md deleted file mode 100644 index e38b0140a..000000000 --- a/.changeset/rare-starfishes-compete.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopware-ag/meteor-component-library": minor ---- - -Add external and internal variants for link component diff --git a/.changeset/serious-avocados-destroy.md b/.changeset/six-readers-melt.md similarity index 65% rename from .changeset/serious-avocados-destroy.md rename to .changeset/six-readers-melt.md index e3aef71bd..43448ac9c 100644 --- a/.changeset/serious-avocados-destroy.md +++ b/.changeset/six-readers-melt.md @@ -2,4 +2,4 @@ "@shopware-ag/meteor-component-library": patch --- -Improve a11y of help text +Update focus style of switch diff --git a/.changeset/soft-roses-reply.md b/.changeset/soft-roses-reply.md new file mode 100644 index 000000000..439ba2483 --- /dev/null +++ b/.changeset/soft-roses-reply.md @@ -0,0 +1,5 @@ +--- +"@shopware-ag/meteor-component-library": patch +--- + +Migrate mt-data-table-settings over to the composition api diff --git a/.changeset/tender-llamas-sleep.md b/.changeset/tender-llamas-sleep.md deleted file mode 100644 index 3eaa9d27b..000000000 --- a/.changeset/tender-llamas-sleep.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopware-ag/meteor-component-library": patch ---- - -Remove default margin from base field, hidden by future flag diff --git a/.changeset/gentle-plants-flash.md b/.changeset/twenty-coins-fix.md similarity index 53% rename from .changeset/gentle-plants-flash.md rename to .changeset/twenty-coins-fix.md index 07ac2ee21..f61516337 100644 --- a/.changeset/gentle-plants-flash.md +++ b/.changeset/twenty-coins-fix.md @@ -2,4 +2,4 @@ "@shopware-ag/meteor-component-library": patch --- -Deprecated mt-external link component +Migrate mt-label to custom built i18n composable diff --git a/.changeset/violet-books-kick.md b/.changeset/violet-books-kick.md deleted file mode 100644 index 8ad813946..000000000 --- a/.changeset/violet-books-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shopware-ag/meteor-component-library": patch ---- - -Migrate mt-loader over to the composition api diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63a7ce609..67563e92c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,3 +152,116 @@ jobs: with: name: meteor-admin-sdk--playwright-test-results path: packages/admin-sdk/playwright-report/ + + + tested-versions: + name: tested-versions + runs-on: ubuntu-latest + outputs: + first-version: ${{ steps.versions.outputs.first-version }} + latest-version: ${{ steps.versions.outputs.latest-version }} + lts-first-version: ${{ steps.versions.outputs.lts-first-version }} + lts-latest-version: ${{ steps.versions.outputs.lts-latest-version }} + steps: + - name: Generate versions + id: versions + uses: shopware/github-actions/versions@main + + ats: + name: Acceptance tests + timeout-minutes: 20 + runs-on: ubuntu-latest + needs: + - circular-dependencies + - unit-tests + - static-analysis + - tested-versions + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + TZ: Europe/Berlin + strategy: + fail-fast: false + matrix: + shopware-version: + # TODO: add again with next major, does not work right now because 6.5 does not support vue3 + # - ${{ needs.tested-versions.outputs.lts-latest-version }} + - ${{ needs.tested-versions.outputs.first-version }} + - trunk + steps: + - name: Setup shopware + uses: shopware/setup-shopware@main + with: + path: shopware/ + install: "true" + install-admin: "true" + install-storefront: "true" + shopware-version: "${{ matrix.shopware-version }}" + env: dev + + - name: Checkout + uses: actions/checkout@v4 + with: + path: meteor/ + + - name: Symlink plugin + working-directory: shopware/custom/plugins/ + run: ln -s ../../../meteor/examples/admin-sdk-plugin TestPlugin + + - name: Activate TestPlugin + working-directory: shopware/ + run: | + bin/console plugin:refresh + bin/console plugin:install --activate TestPlugin + bin/console cache:clear + + - uses: pnpm/action-setup@v3 + with: + version: 9 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "pnpm" + cache-dependency-path: "**/pnpm-lock.yaml" + + - name: Install dependencies + working-directory: meteor/ + run: pnpm install --frozen-lockfile --prefer-offline + + - name: Build packages + working-directory: meteor/ + run: npx turbo run build + + - name: Build assets + working-directory: shopware/ + run: | + composer run build:js + bin/console assets:install + + - name: Start webserver + working-directory: shopware/ + run: symfony server:start --allow-http --no-tls --port=8000 -d + + - name: Install playwright + working-directory: meteor/examples/admin-sdk-plugin/tests/acceptance/ + run: | + pnpm install --frozen-lockfile --prefer-offline + npx playwright install --with-deps + + - name: Run Playwrigth + working-directory: meteor/examples/admin-sdk-plugin/tests/acceptance/ + run: npx playwright test --retries=2 --reporter=github --trace=on-first-retry --project chromium + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: ats-test-results-${{ matrix.project }} + path: meteor/examples/admin-sdk-plugin/tests/acceptance/test-results/ + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: ats-report-${{ matrix.project }} + path: meteor/examples/admin-sdk-plugin/tests/acceptance/playwright-report/ diff --git a/.github/workflows/visual-tests.yml b/.github/workflows/visual-tests.yml index 38ab306af..45bfedc37 100644 --- a/.github/workflows/visual-tests.yml +++ b/.github/workflows/visual-tests.yml @@ -41,7 +41,7 @@ jobs: run: pnpm dlx playwright install-deps - name: Install Playwright - run: pnpm dlx playwright@1.44.0 install + run: pnpm dlx playwright@1.47.2 install - name: Build storybook run: pnpx turbo run build:storybook --filter=@shopware-ag/meteor-component-library -- --test diff --git a/examples/admin-sdk-app/CHANGELOG.md b/examples/admin-sdk-app/CHANGELOG.md index 1e7cfe15b..5b73cd46c 100644 --- a/examples/admin-sdk-app/CHANGELOG.md +++ b/examples/admin-sdk-app/CHANGELOG.md @@ -1,5 +1,21 @@ # meteor-admin-sdk-app +## 1.0.22 + +### Patch Changes + +- Updated dependencies [cc754b9] +- Updated dependencies [47063ae] +- Updated dependencies [62be382] +- Updated dependencies [28f5cb1] +- Updated dependencies [001adb3] +- Updated dependencies [6d32afa] +- Updated dependencies [936ccf3] +- Updated dependencies [2f0a666] +- Updated dependencies [07e243a] + - @shopware-ag/meteor-component-library@3.14.0 + - @shopware-ag/meteor-admin-sdk@5.5.1 + ## 1.0.21 ### Patch Changes diff --git a/examples/admin-sdk-app/package.json b/examples/admin-sdk-app/package.json index 0d0987432..85e04fe27 100644 --- a/examples/admin-sdk-app/package.json +++ b/examples/admin-sdk-app/package.json @@ -1,6 +1,6 @@ { "name": "meteor-admin-sdk-app", - "version": "1.0.21", + "version": "1.0.22", "private": true, "description": "", "repository": { diff --git a/examples/admin-sdk-plugin/README.md b/examples/admin-sdk-plugin/README.md new file mode 100644 index 000000000..8c01956ad --- /dev/null +++ b/examples/admin-sdk-plugin/README.md @@ -0,0 +1,25 @@ +# Meteor Admin SDK Example Plugin + +This package contains an example plugin. It uses the [Meteor Admin SDK](https://github.com/shopware/meteor/tree/main/packages/admin-sdk) to extend the administration. + +## Prerequisites +We assume that you have a functioning Shopware 6 setup on your local machine. + +## Plugin setup + +1. Install all meteor dependencies: `cd && pnpm install` +2. Build all meteor packages: `cd && turbo run build` +3. Symlink the plugin to your Shopware 6 installation: `cd /custom/plugins && ln -s /examples/admin-sdk-plugin TestPlugin` +4. It's important that the plugin Folder is named `TestPlugin` inside `custom/plugins` +5. Activate the plugin : `cd && php bin/console plugin:refresh && php bin/console plugin:install -a -c TestPlugin` +6. Built the administration Javascript: `cd && composer run build:js:admin` + +Now you should see the plugin installed when opening the Shopware Admin and looking in "Extensions" -> "My Extensions". + +## Acceptance tests + +1. Create a `.env` file in `/examples/admin-sdk-plugin/tests/acceptance` +2. Specify your Shopware instance app url: `APP_URL=https://dev.local/` +3. Run the tests: `cd && pnpm --filter @shopware-ag/meteor-admin-sdk-example-plugin run test:ats` + + diff --git a/examples/admin-sdk-plugin/composer.json b/examples/admin-sdk-plugin/composer.json new file mode 100644 index 000000000..1429e2173 --- /dev/null +++ b/examples/admin-sdk-plugin/composer.json @@ -0,0 +1,18 @@ +{ + "name": "swag/sdk-test-plugin", + "description": "Meteor Admin SDK Testplugin", + "type": "shopware-platform-plugin", + "license": "MIT", + "autoload": { + "psr-4": { + "TestPlugin\\": "src/" + } + }, + "extra": { + "shopware-plugin-class": "TestPlugin\\TestPlugin", + "label": { + "de-DE": "SDK Testplugin", + "en-GB": "SDK Testplugin" + } + } +} diff --git a/examples/admin-sdk-plugin/src/.gitignore b/examples/admin-sdk-plugin/src/.gitignore new file mode 100644 index 000000000..e1ec14d22 --- /dev/null +++ b/examples/admin-sdk-plugin/src/.gitignore @@ -0,0 +1,2 @@ +Resources/app/administration/node_modules/ +Resources/public diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/build/webpack.config.js b/examples/admin-sdk-plugin/src/Resources/app/administration/build/webpack.config.js new file mode 100644 index 000000000..e2877652c --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/build/webpack.config.js @@ -0,0 +1,9 @@ +module.exports = () => { + return { + resolve: { + alias: { + vue$: 'vue/dist/vue.esm-browser.js' + } + } + }; +}; diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/index.html b/examples/admin-sdk-plugin/src/Resources/app/administration/index.html new file mode 100644 index 000000000..925c77bf5 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/index.html @@ -0,0 +1,13 @@ + + + + + + + Test plugin example + + +
+ + diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/package.json b/examples/admin-sdk-plugin/src/Resources/app/administration/package.json new file mode 100644 index 000000000..93be7ec60 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/package.json @@ -0,0 +1,22 @@ +{ + "name": "administration", + "version": "1.0.0", + "private": true, + "description": "", + "license": "MIT", + "author": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@shopware-ag/meteor-admin-sdk": "workspace:*", + "@shopware-ag/meteor-component-library": "workspace:*", + "regenerator-runtime": "^0.14.1", + "vue": "3.4.21", + "vue-router": "4.4.5" + }, + "devDependencies": { + "typescript": "^5.6.2" + } +} diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/base/mainCommands.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/base/mainCommands.ts new file mode 100644 index 000000000..692e3ef09 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/base/mainCommands.ts @@ -0,0 +1,169 @@ +import { notification, ui, context } from '@shopware-ag/meteor-admin-sdk'; + +// location/index +ui.componentSection.add({ + component: 'card', + positionId: 'sw-product-properties__before', + props: { + title: 'Location tests', + subtitle: 'Testing if the location methods work correctly', + locationId: 'location-index', + }, +}); + +ui.componentSection.add({ + component: 'card', + positionId: 'sw-product-properties__after', + props: { + title: 'Card tabs tests', + subtitle: 'Testing if the the card tabs work correctly', + locationId: 'card-tabs', + tabs: [ + { + name: 'card-tab-1', + label: 'Tab 1', + locationId: 'card-tab-1', + }, + { + name: 'card-tab-2', + label: 'Tab 2', + locationId: 'card-tab-2', + }, + ], + }, +}); + +ui.componentSection.add({ + component: 'card', + positionId: 'ui-tabs-product-example-tab', + props: { + title: 'Hello in the new tab', + locationId: 'ui-modals', + }, +}); + +ui.componentSection.add({ + component: 'card', + positionId: 'sw-sales-channel-detail-base-options-delete__after', + props: { + title: 'Dataset testing', + locationId: 'data-dataset', + }, +}); + +ui.tabs('sw-product-detail').addTabItem({ + label: 'Example', + componentSectionId: 'ui-tabs-product-example-tab', +}); + +ui.tabs('sw-custom-field-set-renderer').addTabItem({ + label: 'Example', + componentSectionId: 'ui-tabs-product-example-tab', +}); + +ui.actionButton.add({ + name: 'activateLanguageSubscription', + entity: 'product', + view: 'detail', + label: 'Activate language subscription', + callback: () => { + // context / subscribe on language changes + context.subscribeLanguage(({ languageId, systemLanguageId }) => { + notification.dispatch({ + title: 'Language changes', + message: `languageId: ${languageId}

systemLanguageId: ${systemLanguageId}`, + }); + }); + + notification.dispatch({ + title: 'Subscriber activated', + message: 'The subscriber for language changes was activated', + variant: 'info', + }); + }, +}); + +ui.actionButton.add({ + name: 'activateLocaleSubscription', + entity: 'product', + view: 'detail', + label: 'Activate locale subscription', + callback: () => { + // context / subscribe on locale changes + context.subscribeLocale(({ fallbackLocale, locale }) => { + notification.dispatch({ + title: 'Locale changes', + message: `locale: ${locale}

fallbackLocale: ${fallbackLocale}`, + }); + }); + + notification.dispatch({ + title: 'Subscriber activated', + message: 'The subscriber for locale changes was activated', + variant: 'info', + }); + }, +}); + +ui.settings.addSettingsItem({ + label: 'App Settings', + locationId: 'ui-menu-item-add-menu-item-with-searchbar', + icon: 'default-object-books', + displaySearchBar: true, + tab: 'plugins', +}); + +ui.settings.addSettingsItem({ + label: 'Without searchbar', + locationId: 'ui-menu-item-add-menu-item', + icon: 'default-action-cloud-upload', + displaySearchBar: false, + tab: 'shop', +}); + +ui.actionButton.add({ + action: 'ui-action-button', + entity: 'product', + view: 'detail', + label: 'Test action', + callback: () => { + // nothing + notification.dispatch({ + title: 'Action button click', + message: 'The action button in the product detail page was clicked', + }); + }, +}); + +ui.mainModule.addMainModule({ + heading: 'My App', + locationId: 'ui-main-module-add-main-module', + displaySearchBar: false, +}); + +ui.menu.addMenuItem({ + label: 'Test item', + locationId: 'ui-main-module-add-main-module', + displaySearchBar: false, + parent: 'sw-order', +}); +ui.menu.addMenuItem({ + label: 'Test with searchbar', + locationId: 'ui-menu-item-add-menu-item-with-searchbar', + displaySearchBar: true, + parent: 'sw-extension', +}); +ui.menu.addMenuItem({ + label: 'First item', + locationId: 'ui-menu-item-add-menu-item-with-searchbar', + displaySearchBar: true, + parent: 'sw-extension', + position: 10, +}); +// For testing the third level menu entry +ui.menu.addMenuItem({ + label: 'Third level', + locationId: 'ui-main-module-add-main-module', + displaySearchBar: false, + parent: 'sw-manufacturer', +}); diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/main.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/main.ts new file mode 100644 index 000000000..1b70d1fee --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/main.ts @@ -0,0 +1,16 @@ +import "regenerator-runtime/runtime"; +import { location } from '@shopware-ag/meteor-admin-sdk'; + +// Only execute extensionSDK commands when +// it is inside a iFrame (only needed for plugins) +// @ts-ignore +if (location.isIframe() && !window.parent.__Cypress__) { + if (location.is(location.MAIN_HIDDEN)) { + // Execute the base commands + import('./base/mainCommands'); + } else { + console.log('rendering view'); + // Render different views + import('./viewRenderer'); + } +} diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/viewRenderer.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/viewRenderer.ts new file mode 100644 index 000000000..3c8263f60 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/viewRenderer.ts @@ -0,0 +1,46 @@ +import { createApp, defineAsyncComponent } from 'vue'; +import { location } from '@shopware-ag/meteor-admin-sdk'; +import '@shopware-ag/meteor-component-library/dist/style.css'; + +// watch for height changes +location.startAutoResizer(); + +// start app views +const app = createApp({ + data() { + return { location } + }, + components: { + // ui/main-module/add-main-module + 'UiMainModuleAddMainModule': defineAsyncComponent(() => import('./views/ui/main-module/add-main-module')), + // ui/menu-item/ + 'UiMenuItemAddMenuItem': defineAsyncComponent(() => import('./views/ui/menu-item/add-menu-item')), + 'UiMenuItemAddMenuItemWithSearchBar': defineAsyncComponent(() => import('./views/ui/menu-item/add-menu-item-with-searchbar')), + // ui/modals + 'UiModals': defineAsyncComponent(() => import('./views/ui/modals/modals')), + 'UiModalsModalContent': defineAsyncComponent(() => import('./views/ui/modals/modal-content')), + // location/general + 'LocationIndex': defineAsyncComponent(() => import('./views/location/index')), + 'CardTab1': defineAsyncComponent(() => import('./views/card-tabs/tab-1')), + 'CardTab2': defineAsyncComponent(() => import('./views/card-tabs/tab-2')), + // data/dataset + 'DataDataset': defineAsyncComponent(() => import('./views/data/dataset')), + }, + template: ` + + + + + + + + + + `, +}) + +// Hack to fake i18n +app.config.globalProperties.$tc = (s) => s; +app.config.globalProperties.$t = (s) => s; + +app.mount('#app'); diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/card-tabs/tab-1.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/card-tabs/tab-1.ts new file mode 100644 index 000000000..6c1a8fc9d --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/card-tabs/tab-1.ts @@ -0,0 +1,10 @@ +import { defineComponent } from 'vue'; + +export default defineComponent({ + template: ` +
+

Tab 1

+
+ `, +}); + diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/card-tabs/tab-2.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/card-tabs/tab-2.ts new file mode 100644 index 000000000..875d21d27 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/card-tabs/tab-2.ts @@ -0,0 +1,10 @@ +import { defineComponent } from 'vue'; + +export default defineComponent({ + template: ` +
+

Tab 2

+
+ `, +}); + diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/data/dataset/index.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/data/dataset/index.ts new file mode 100644 index 000000000..7b7e2f8a4 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/data/dataset/index.ts @@ -0,0 +1,109 @@ +import { defineComponent } from 'vue' +import { data } from '@shopware-ag/meteor-admin-sdk'; +import { SwButton, SwTextField } from "@shopware-ag/meteor-component-library"; + + +// make background color white +document.body.style.backgroundColor = 'white'; + +export default defineComponent({ + template: ` +
+ Get dataset + Subscribe dataset + +
+
+ +

Clicked on: {{ clicked }}

+

+ {{ returnValue }} + {{ JSON.stringify(returnValue) }} +

+ +
+
+ +

Returned name: {{ salesChannel.name }}

+

Returned active state: {{ salesChannel.active }}

+ +
+
+ + + Update to main +
+`, + components: { + 'sw-button': SwButton, + 'sw-text-field': SwTextField, + }, + data(): { + salesChannel: { + name?: string, + active?: boolean, + }, + clicked: string, + returnValue: unknown, + retryCounter: number, + } { + return { + salesChannel: {}, + clicked: '', + returnValue: undefined, + retryCounter: 0, + } + }, + methods: { + getDataset() { + if (this.retryCounter >= 10) { + this.returnValue = 'Retry limit reached'; + + return; + } + + this.clicked = 'getDataset'; + this.retryCounter++; + + data.get({ + id: 'sw-sales-channel-detail__salesChannel', + selectors: ['name', 'active'], + }).then((data) => { + this.retryCounter = 0; + this.returnValue = data; + // @ts-expect-error + const { name, active } = data; + + this.salesChannel = { name, active }; + }).catch((error) => { + this.returnValue = error; + + window.setTimeout(() => { + this.getDataset(); + }, 500); + }); + }, + async updateDataset() { + this.clicked = 'updateDataset'; + + await data.update({ + id: 'sw-sales-channel-detail__salesChannel', + data: this.salesChannel, + }) + }, + subscribeData() { + this.clicked = 'subscribeData'; + + data.subscribe('sw-sales-channel-detail__salesChannel', (data) => { + this.returnValue = data; + + this.salesChannel = { + // @ts-expect-error + name: data.data.name, + } + }, { + selectors: ['name'], + }); + } + } +}) diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/location/index.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/location/index.ts new file mode 100644 index 000000000..afdcd1d68 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/location/index.ts @@ -0,0 +1,68 @@ +import { defineComponent } from 'vue' +import { location } from "@shopware-ag/meteor-admin-sdk"; +import { MtButton, MtNumberField } from '@shopware-ag/meteor-component-library'; + +export default defineComponent({ + components: { + 'sw-button': MtButton, + 'sw-number-field': MtNumberField, + }, + template: ` +
+

Auto-Resize: {{ isAutoResizing ? 'On' : 'Off' }}

+ + +

+ + Update height using auto resizing +
+ Update height manually + +

+ + Start auto resizing + Stop auto resizing + +
+ `, + data() { + return { + heightInput: 123, + height: 400, + isAutoResizing: true, + } + }, + computed: { + componentStyling(): {} { + return { + height: `${this.height}px`, + backgroundColor: '#0e82ff', + padding: '10px', + } + } + }, + methods: { + setHeightInput(height: number): void { + this.heightInput = height; + }, + + changeHeight():void { + this.height = Math.floor(this.heightInput); + }, + + changeHeightManually():void { + void location.updateHeight(this.heightInput); + }, + + async stopAutoResizing(): Promise { + await location.stopAutoResizer(); + this.isAutoResizing = false; + }, + + async startAutoResizing(): Promise { + await location.startAutoResizer(); + this.isAutoResizing = false; + } + } +}) + diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/main-module/add-main-module.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/main-module/add-main-module.ts new file mode 100644 index 000000000..d0d2361f0 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/main-module/add-main-module.ts @@ -0,0 +1,282 @@ +import { defineComponent } from 'vue'; +import { notification, context, data, window } from '@shopware-ag/meteor-admin-sdk'; +import { SwButton, SwTextField, SwTextarea } from '@shopware-ag/meteor-component-library'; + +const { repository, Classes: { Criteria } } = data; + +export default defineComponent({ + mounted() { + console.log('mounted main module'); + }, + components: { + 'sw-button': SwButton, + 'sw-text-field': SwTextField, + 'sw-text-area': SwTextarea, + }, + template: ` +
+

Hello from the new Menu Page

+ +
+

Context - Get current language

+ Get current language + +

+ system-language-ID: {{ systemLanguageId }} +
+ languageId: {{ languageId }} +

+
+ +
+

Context - Get current environment

+ Get current environment + +

+ Environment: {{ environment }} +

+
+ +
+

Context - Get current locale

+ Get current locale + +

+ Locale: {{ locale }} +
+ Fallback Locale: {{ fallbackLocale }} +

+
+ +
+

Context - Get current currency

+ Get current currency + +

+ System Currency Id: {{ systemCurrencyId }} +
+ System Currency ISOCode: {{ systemCurrencyISOCode }} +

+
+ +
+

Context - Get current Shopware version

+ Get current Shopware version + +

+ Shopware version: {{ shopwareVersion }} +

+
+ +
+

Context - Get app information

+ Get app information + +

+ App name: {{ appName }} +
+ App version (empty in plugins): {{ appVersion }} +
+ App type: {{ appType }} +

+
+ +
+

Context - Get module information

+ Get module information + +

+ Id: {{ moduleInformation.id }} +
+ Display search bar: {{ moduleInformation.displaySearchBar }} +
+ Heading: {{ moduleInformation.heading }} +
+ LocationId: {{ moduleInformation.locationId }} +

+
+ +
+

Window - Router Push

+ Push route +
+ +
+ +
+

Notification - Dispatch a notification

+ + Dispatch a notification +
+ +
+

Notification - Reload page

+ + Reload page +
+ +
+
Test
+ DB Query + + Save name +
+
+ `, + data() { + return { + languageId: '', + systemLanguageId: '', + environment: '', + locale: '', + fallbackLocale: '', + systemCurrencyId: '', + systemCurrencyISOCode: '', + shopwareVersion: '', + appName: '', + appType: '', + appVersion: '', + moduleInformations: [], + routeInformation: ` +{ + "name": "sw.dashboard.index", + "params": {} +}`, + apiLanguageEntity: null, + } + }, + methods: { + // context / get current language + getLanguage() { + context.getLanguage().then(language => { + this.languageId = language.languageId; + this.systemLanguageId = language.systemLanguageId; + }) + }, + + // context / get current environment + async getEnvironment() { + this.environment = await context.getEnvironment(); + }, + + // context / get current locale + getLocale() { + context.getLocale().then(({ locale, fallbackLocale }) => { + this.locale = locale; + this.fallbackLocale = fallbackLocale; + }) + }, + + // context / get current locale + getCurrency() { + context.getCurrency().then(({ systemCurrencyId, systemCurrencyISOCode }) => { + this.systemCurrencyId = systemCurrencyId; + this.systemCurrencyISOCode = systemCurrencyISOCode; + }) + }, + + // context / get current Shopware version + async getShopwareVersion() { + this.shopwareVersion = await context.getShopwareVersion(); + }, + + // context / get App information + getAppInformation() { + context.getAppInformation().then(({ name, type, version }) => { + this.appName = name; + this.appVersion = version; + this.appType = type; + }) + }, + + // context / get module information + getModuleInformation() { + context.getModuleInformation().then(({ modules }) => { + // @ts-ignore + this.moduleInformations = modules; + }) + }, + + // window / router push + pushRoute() { + let routeObject = {}; + + try { + routeObject = JSON.parse(this.routeInformation); + } catch (e){ + notification.dispatch({ + title: 'Push route', + message: 'The content of the textarea could not be parsed' + }) + } + + void window.routerPush(routeObject); + }, + + dispatchNotification() { + notification.dispatch({ + title: 'Your title', + message: 'Your message', + variant: 'success', + appearance: 'notification', + growl: true, + actions: [ + { + label: 'Yes', + method: () => { + alert('Yes') + } + }, + { + label: 'No', + method: () => { + alert('No') + } + }, + { + label: 'Redirect to Shopware', + method: () => { + window.redirect({ + url: 'https://www.shopware.com', + newTab: true, + }) + }, + } + ] + }) + }, + + reloadPage() { + void window.reload(); + }, + + getApilanguage() { + const exampleCriteria = new Criteria(); + repository('language').search(exampleCriteria).then(response => { + if (!response) { + return; + } + // @ts-expect-error + this.apiLanguageEntity = response.first(); + }) + }, + saveApilanguage() { + repository('language').save(this.apiLanguageEntity) + .then(() => { + notification.dispatch({ + title: 'Speicherung erfolgreich', + message: 'Sprache wurde gespeichert', + variant: "success" + }) + + this.getApilanguage() + }).catch(() => { + notification.dispatch({ + title: 'Error', + message: 'The Language could not be saved', + variant: 'error', + }) + }) + } + } +}) diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/menu-item/add-menu-item-with-searchbar.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/menu-item/add-menu-item-with-searchbar.ts new file mode 100644 index 000000000..23a271e09 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/menu-item/add-menu-item-with-searchbar.ts @@ -0,0 +1,10 @@ +import { defineComponent } from 'vue'; + +export default defineComponent({ + template: ` +
+

Hello from the new menu page with searchbar

+
+ `, + methods: {} +}) diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/menu-item/add-menu-item.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/menu-item/add-menu-item.ts new file mode 100644 index 000000000..3f02ae2b9 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/menu-item/add-menu-item.ts @@ -0,0 +1,10 @@ +import { defineComponent } from 'vue'; + +export default defineComponent({ + template: ` +
+

Hello from the new Menu Page

+
+ `, + methods: {} +}) diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/modals/modal-content.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/modals/modal-content.ts new file mode 100644 index 000000000..c662a5e70 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/modals/modal-content.ts @@ -0,0 +1,19 @@ +import { defineComponent } from 'vue' +import { ui } from '@shopware-ag/meteor-admin-sdk'; + +export default defineComponent({ + template: ` +
+

Hello from the plugin 👋🏻

+ +
+`, + + methods: { + closeModal() { + ui.modal.close({ + locationId: 'ui-modals-modal-content' + }) + } + } +}) diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/modals/modals.ts b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/modals/modals.ts new file mode 100644 index 000000000..d4dbb82c6 --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/src/views/ui/modals/modals.ts @@ -0,0 +1,90 @@ +import { defineComponent } from 'vue' +import { ui } from '@shopware-ag/meteor-admin-sdk'; + +// make background color white +document.body.style.backgroundColor = 'white'; + +export default defineComponent({ + template: ` +
+

Hello in the example card

+ + + + +
+`, + methods: { + openModal() { + ui.modal.open({ + title: 'Hello from the plugin', + locationId: 'ui-modals-modal-content', + buttons: [ + { + label: 'Close modal', + variant: 'primary', + method: () => { + ui.modal.close({ + locationId: 'ui-modals-modal-content' + }) + } + } + ] + }) + }, + openModalnoHeader() { + ui.modal.open({ + title: 'Hello from the plugin', + showHeader: false, + locationId: 'ui-modals-modal-content', + buttons: [ + { + label: 'Close modal', + variant: 'primary', + method: () => { + ui.modal.close({ + locationId: 'ui-modals-modal-content' + }) + } + } + ] + }) + }, + openModalsmallVariant() { + ui.modal.open({ + title: 'Hello from the plugin', + variant: "small", + locationId: 'ui-modals-modal-content', + buttons: [ + { + label: 'Close modal', + variant: 'primary', + method: () => { + ui.modal.close({ + locationId: 'ui-modals-modal-content' + }) + } + } + ] + }) + }, + openModalnoneClosable() { + ui.modal.open({ + title: 'Hello from the plugin', + closable: false, + locationId: 'ui-modals-modal-content', + buttons: [ + { + label: 'Close modal', + variant: 'primary', + method: () => { + ui.modal.close({ + locationId: 'ui-modals-modal-content' + }) + } + } + ] + }); + }, + } +}) diff --git a/examples/admin-sdk-plugin/src/Resources/app/administration/tsconfig.json b/examples/admin-sdk-plugin/src/Resources/app/administration/tsconfig.json new file mode 100644 index 000000000..3ffa57bad --- /dev/null +++ b/examples/admin-sdk-plugin/src/Resources/app/administration/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es2016", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true + } +} diff --git a/examples/admin-sdk-plugin/src/TestPlugin.php b/examples/admin-sdk-plugin/src/TestPlugin.php new file mode 100644 index 000000000..d0720bec6 --- /dev/null +++ b/examples/admin-sdk-plugin/src/TestPlugin.php @@ -0,0 +1,9 @@ + { + // Wait for the iframe to be present in the DOM + const iframeLocator = page.frameLocator( + `iframe[src*="location-id=${locationId}"]`, + ); + + // Wait for the iframe's content to be loaded + await expect(iframeLocator.locator('body')).not.toBeEmpty(); + + // Get the Frame object + const frame = page.frame({ url: new RegExp(`location-id=${locationId}`) }); + + if (!frame) { + throw new Error(`Unable to find iframe with location-id=${locationId}`); + } + + return frame; +} + +/** + * Mocks the check updates call to return null. + * + * This method is called before each test case to prevent the "Updates available" + * notification from interfering with tests on older Shopware versions. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export async function mockUpdateApi(page: Page): Promise { + return page.route('*/**/_action/update/check', async (route) => { + const json = null; + await route.fulfill({ json }); + }); +} diff --git a/examples/admin-sdk-plugin/tests/acceptance/package.json b/examples/admin-sdk-plugin/tests/acceptance/package.json new file mode 100644 index 000000000..42a4a548b --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/package.json @@ -0,0 +1,30 @@ +{ + "name": "@shopware-ag/meteor-admin-sdk-example-plugin", + "version": "1.0.0", + "private": true, + "description": "", + "keywords": [], + "license": "ISC", + "author": "", + "type": "module", + "main": "index.js", + "scripts": { + "format": "prettier ./tests --write", + "lint:eslint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "test:ats": "playwright test", + "test:ats:dev": "playwright test --ui" + }, + "dependencies": { + "@shopware-ag/acceptance-test-suite": "^3.8.4" + }, + "devDependencies": { + "@playwright/test": "^1.45.0", + "@types/node": "^22.5.5", + "@typescript-eslint/eslint-plugin": "^5.47.0", + "@typescript-eslint/parser": "^5.47.0", + "eslint": "^8.49.0", + "eslint-plugin-playwright": "^1.6.2", + "prettier": "3.3.3" + } +} diff --git a/examples/admin-sdk-plugin/tests/acceptance/playwright.config.ts b/examples/admin-sdk-plugin/tests/acceptance/playwright.config.ts new file mode 100644 index 000000000..0406bf77e --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/playwright.config.ts @@ -0,0 +1,82 @@ +import { PlaywrightTestConfig, devices } from '@playwright/test'; +import dotenv from 'dotenv'; + +// Read from default ".env" file. +dotenv.config(); + +process.env['SHOPWARE_ADMIN_USERNAME'] = + process.env['SHOPWARE_ADMIN_USERNAME'] || 'admin'; +process.env['SHOPWARE_ADMIN_PASSWORD'] = + process.env['SHOPWARE_ADMIN_PASSWORD'] || 'shopware'; + +process.env['APP_URL'] = process.env['APP_URL'] ?? 'http://localhost:8000'; + +// make sure APP_URL ends with a slash +process.env['APP_URL'] = process.env['APP_URL'].replace(/\/+$/, '') + '/'; +if (process.env['ADMIN_URL']) { + process.env['ADMIN_URL'] = process.env['ADMIN_URL'].replace(/\/+$/, '') + '/'; +} else { + process.env['ADMIN_URL'] = process.env['APP_URL'] + 'admin/'; +} + +/** + * See https://playwright.dev/docs/test-configuration. + */ +const config: PlaywrightTestConfig = { + testDir: './tests', + + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: [ + ['html', { open: true, outputDir: 'artifacts' }], + ['json', { outputFile: 'artifacts/test-results/results.json' }], + ['junit', { outputFile: 'artifacts/test-results/results.xml' }], + ], + + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 0, + + /* Base URL to use in actions like `await page.goto('/')`. */ + // baseURL: 'http://localhost:3000', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + + /* Project-specific settings. */ + use: { + ...devices['Desktop Chrome'], + }, + }, + ], + + /* Folder for test artifacts such as screenshots, videos, traces, etc. */ + outputDir: './artifacts/playwright-test-results/', +}; +export default config; diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/action-button.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/action-button.spec.ts new file mode 100644 index 000000000..e00d9d9f0 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/action-button.spec.ts @@ -0,0 +1,32 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, TestDataService, AdminProductDetail }) => { + await mockUpdateApi(ShopAdmin.page); + + const product = await TestDataService.createBasicProduct(); + ShopAdmin.goesTo(AdminProductDetail.url(product.id)); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: action button', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-app-actions').click(); + await ShopAdmin.page + .locator('.sw-context-menu__content .sw-app-action-button', { + hasText: 'Test action', + }) + .click(); + + await expect( + ShopAdmin.page.locator('.sw-alert__title', { + hasText: 'Action button click', + }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-alert__message', { + hasText: 'The action button in the product detail page was clicked', + }), + ).toBeVisible(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/component-section.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/component-section.spec.ts new file mode 100644 index 000000000..d94980024 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/component-section.spec.ts @@ -0,0 +1,49 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, TestDataService, AdminProductDetail }) => { + await mockUpdateApi(ShopAdmin.page); + + const product = await TestDataService.createBasicProduct(); + ShopAdmin.goesTo(AdminProductDetail.url(product.id)); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: add a component section', async ({ ShopAdmin }) => { + await ShopAdmin.page.getByRole('link', { name: 'Specifications' }).click(); + + await expect( + ShopAdmin.page.locator('.sw-card__title', { hasText: 'Location tests' }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-card__subtitle', { + hasText: 'Testing if the location methods work correctly', + }), + ).toBeVisible(); + + await getSDKiFrame(ShopAdmin.page, 'location-index'); +}); + +test('@sdk: add a component section with tabs', async ({ ShopAdmin }) => { + await ShopAdmin.page.getByRole('link', { name: 'Specifications' }).click(); + + await expect( + ShopAdmin.page.locator('.sw-card__title', { hasText: 'Card tabs tests' }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-card__subtitle', { + hasText: 'Testing if the the card tabs work correctly', + }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-tabs-item', { hasText: 'Tab 1' }), + ).toBeVisible(); + + await getSDKiFrame(ShopAdmin.page, 'card-tab-1'); + + await ShopAdmin.page.locator('.sw-tabs-item', { hasText: 'Tab 2' }).click(); + + await getSDKiFrame(ShopAdmin.page, 'card-tab-2'); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/context.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/context.spec.ts new file mode 100644 index 000000000..61d3aa829 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/context.spec.ts @@ -0,0 +1,256 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +// Defaults +const DEFAULT_LANGUAGE_ID = '2fbb5fe2e29a4d70aa5854ce7ce3e20b'; +const LOCALE = 'en-GB'; +const FALLBACK_LOCALE = 'en-GB'; + +// Used to keep track of the current product id +let productId = ''; + +test.beforeEach(async ({ ShopAdmin, TestDataService, AdminDashboard }) => { + await mockUpdateApi(ShopAdmin.page); + + // Create product and assign id + const product = await TestDataService.createBasicProduct(); + productId = product.id; + + // Go to dashboard + await ShopAdmin.goesTo(AdminDashboard.url()); + + // The main hidden iFrame should exist + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: get current language', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Get current language' }).click(); + + await expect( + frame.locator('p', { + hasText: `system-language-ID: ${DEFAULT_LANGUAGE_ID}`, + }), + ).toBeVisible(); + await expect( + frame.locator('p', { hasText: `languageId: ${DEFAULT_LANGUAGE_ID}` }), + ).toBeVisible(); +}); + +test('@sdk: subscribe on language changes', async ({ + ShopAdmin, + AdminProductDetail, +}) => { + // Go to product directly + await ShopAdmin.goesTo(AdminProductDetail.url(productId)); + + // Open app action buttons + await ShopAdmin.page.locator('.sw-app-actions').click(); + await expect( + ShopAdmin.page.locator('.sw-context-menu__content'), + ).toBeVisible(); + + // activate language subscription + await ShopAdmin.page + .locator('.sw-context-menu__content .sw-app-action-button', { + hasText: 'Activate language subscription', + }) + .click(); + + // expect notification + await expect( + ShopAdmin.page.locator('.sw-alert__title', { + hasText: 'Subscriber activated', + }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-alert__message', { + hasText: 'The subscriber for language changes was activated', + }), + ).toBeVisible(); + + // close notification + await ShopAdmin.page.locator('.sw-alert__close').click(); + + // change language + await ShopAdmin.page.locator('.sw-language-switch input').click(); + await ShopAdmin.page + .locator('.sw-select-result', { hasText: 'Deutsch' }) + .click(); + + // check for subscriber alert + await expect( + ShopAdmin.page.locator('.sw-alert__title', { + hasText: 'Language changes', + }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-alert__message', { hasText: 'languageId: ' }), + ).toBeVisible(); // this id is random therefore no explicit check + await expect( + ShopAdmin.page.locator('.sw-alert__message', { + hasText: `systemLanguageId: ${DEFAULT_LANGUAGE_ID}`, + }), + ).toBeVisible(); +}); + +test('@sdk: get current environment', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Get current environment' }).click(); + + await expect( + frame.locator('p', { hasText: 'Environment: production' }), + ).toBeVisible(); +}); + +test('@sdk: get current locale', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Get current locale' }).click(); + + await expect(frame.locator('p', { hasText: `Locale: ${LOCALE}` })).toBeVisible(); + await expect( + frame.locator('p', { hasText: `Fallback Locale: ${FALLBACK_LOCALE}` }), + ).toBeVisible(); +}); + +test('@sdk: subscribe on locale changes', async ({ + ShopAdmin, + AdminProductDetail, +}) => { + // Go to product directly + await ShopAdmin.goesTo(AdminProductDetail.url(productId)); + + // Open app action buttons + await ShopAdmin.page.locator('.sw-app-actions').click(); + await expect( + ShopAdmin.page.locator('.sw-context-menu__content'), + ).toBeVisible(); + + // activate locale subscription + await ShopAdmin.page + .locator('.sw-context-menu__content .sw-app-action-button', { + hasText: 'Activate locale subscription', + }) + .click(); + + // expect notification + await expect( + ShopAdmin.page.locator('.sw-alert__title', { + hasText: 'Subscriber activated', + }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-alert__message', { + hasText: 'The subscriber for locale changes was activated', + }), + ).toBeVisible(); + + // close notification + await ShopAdmin.page.locator('.sw-alert__close').click(); + + // change locale + await ShopAdmin.page.locator('.sw-admin-menu__user-name').click(); + await ShopAdmin.page.getByRole('link', { name: 'Your profile' }).click(); + await expect( + ShopAdmin.page.locator('.smart-bar__header', { hasText: 'Your Profile' }), + ).toBeVisible(); + await ShopAdmin.page + .locator('select', { hasText: 'English (United Kingdom)' }) + .selectOption('German (Germany)'); + await ShopAdmin.page.locator('button', { hasText: 'Save' }).click(); + await ShopAdmin.page.locator('#sw-field--confirm-password').fill('shopware'); + await ShopAdmin.page.locator('button', { hasText: 'Confirm' }).click(); + + // check for subscriber alert + await expect( + ShopAdmin.page.locator('.sw-alert__title', { hasText: 'Locale changes' }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-alert__message', { + hasText: 'locale: de-DE', + }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-alert__message', { + hasText: 'fallbackLocale: en-GB', + }), + ).toBeVisible(); +}); + +test('@sdk: get current shopware version', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame + .locator('button', { hasText: 'Get current Shopware version' }) + .click(); + + await expect( + frame.locator('p', { hasText: 'Shopware version: 6.' }), + ).toBeVisible(); +}); + +test('@sdk: get app information', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Get app information' }).click(); + + await expect( + frame.locator('p', { hasText: 'App name: TestPlugin' }), + ).toBeVisible(); + await expect( + frame.locator('p', { hasText: 'App type: plugin' }), + ).toBeVisible(); +}); + +test('@sdk: get module information', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Get module information' }).click(); + + await expect( + frame.locator('p', { + hasText: + 'Display search bar: true Heading: App Settings LocationId: ui-menu-item-add-menu-item-with-searchbar', + }), + ).toBeVisible(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/dataset.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/dataset.spec.ts new file mode 100644 index 000000000..edf70a6bd --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/dataset.spec.ts @@ -0,0 +1,65 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin }) => { + await mockUpdateApi(ShopAdmin.page); + + // Go to settings + await ShopAdmin.goesTo('/admin/#sw/settings/index/shop'); + + // The main hidden iFrame should exist + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: dataset get', async ({ ShopAdmin }) => { + await ShopAdmin.page + .locator('.sw-admin-menu__navigation-link', { hasText: 'Storefront' }) + .click(); + + const frame = await getSDKiFrame(ShopAdmin.page, 'data-dataset'); + await frame.locator('button', { hasText: 'Get dataset' }).click(); + + await expect( + frame.locator('p', { hasText: 'Returned name: Storefront' }), + ).toBeVisible(); + await expect( + frame.locator('p', { hasText: 'Returned active state: true' }), + ).toBeVisible(); +}); + +test('@sdk: dataset subscribe', async ({ ShopAdmin }) => { + await ShopAdmin.page + .locator('.sw-admin-menu__navigation-link', { hasText: 'Storefront' }) + .click(); + + const frame = await getSDKiFrame(ShopAdmin.page, 'data-dataset'); + await frame.locator('button', { hasText: 'Subscribe dataset' }).click(); + + await expect( + frame.locator('p', { hasText: 'Returned name: Storefront' }), + ).toBeVisible(); +}); + +test('@sdk: dataset update', async ({ ShopAdmin }) => { + await ShopAdmin.page + .locator('.sw-admin-menu__navigation-link', { hasText: 'Storefront' }) + .click(); + + const frame = await getSDKiFrame(ShopAdmin.page, 'data-dataset'); + await frame.locator('button', { hasText: 'Get dataset' }).click(); + + await expect( + frame.locator('p', { hasText: 'Returned name: Storefront' }), + ).toBeVisible(); + + await frame.locator('input').clear(); + await frame.locator('input').fill('Shoppingfront'); + await frame.locator('button', { hasText: 'Update to main' }).click(); + + await expect( + ShopAdmin.page.locator('.smart-bar__header', { + hasText: 'Shoppingfront', + }), + ).toBeVisible(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/location.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/location.spec.ts new file mode 100644 index 000000000..41f4b88c2 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/location.spec.ts @@ -0,0 +1,67 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, TestDataService, AdminProductDetail }) => { + await mockUpdateApi(ShopAdmin.page); + + // Create product and open detail page + const product = await TestDataService.createBasicProduct(); + await ShopAdmin.goesTo(AdminProductDetail.url(product.id)); + + // The main hidden iFrame should exist + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: update the height of the location iFrame', async ({ + ShopAdmin, +}) => { + await ShopAdmin.page.getByRole('link', { name: 'Specifications' }).click(); + await expect( + ShopAdmin.page.locator('.sw-card__title', { hasText: 'Location tests' }), + ).toBeVisible(); + + const frame = await getSDKiFrame(ShopAdmin.page, 'location-index'); + await frame.locator('button', { hasText: 'Stop auto resizing' }).click(); + + await expect( + frame.locator('p', { hasText: 'Auto-Resize: Off' }), + ).toBeVisible(); + + await frame.locator('input').clear(); + await frame.locator('input').fill('456'); + await frame.locator('button', { hasText: 'Update height manually' }).click(); + + await expect( + ShopAdmin.page.locator(`iframe[src*='location-id=location-index']`), + ).toHaveAttribute('height', '456px'); +}); + +test('@sdk: start auto resizing of the iFrame height', async ({ + ShopAdmin, +}) => { + await ShopAdmin.page.getByRole('link', { name: 'Specifications' }).click(); + await expect( + ShopAdmin.page.locator('.sw-card__title', { hasText: 'Location tests' }), + ).toBeVisible(); + + const frame = await getSDKiFrame(ShopAdmin.page, 'location-index'); + await expect( + frame.locator('p', { hasText: 'Auto-Resize: On' }), + ).toBeVisible(); + + await frame.locator('input').clear(); + await frame.locator('input').fill('700'); + await frame + .locator('button', { hasText: 'Update height using auto resizing' }) + .click(); + + /** + * Value is higher because the margin and padding inside the iFrame + * are also considered in automatic height + */ + await frame.locator('button', { hasText: 'Stop auto resizing' }).click(); + await expect( + ShopAdmin.page.locator(`iframe[src*='location-id=location-index']`), + ).toHaveAttribute('height', '736px'); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/main-module.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/main-module.spec.ts new file mode 100644 index 000000000..92bf41efa --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/main-module.spec.ts @@ -0,0 +1,58 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin }) => { + await mockUpdateApi(ShopAdmin.page); + + await ShopAdmin.goesTo('/admin/#/sw/extension/my-extensions/listing/'); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: add main module', async ({ ShopAdmin }) => { + await expect( + ShopAdmin.page.locator('.sw-meteor-page__smart-bar-title'), + ).toBeVisible(); + await ShopAdmin.page + .locator('.sw-meteor-card__content-wrapper', { hasText: 'SDK Testplugin' }) + .locator('.sw-context-button > button') + .click(); + await ShopAdmin.page + .locator('.sw-context-menu-item__text', { hasText: 'Open extension' }) + .click(); + + await expect( + ShopAdmin.page.locator('.smart-bar__content', { hasText: 'My App' }), + ).toBeVisible(); +}); + +test('@sdk: check main module with searchbar', async ({ ShopAdmin }) => { + await expect( + ShopAdmin.page.locator('.sw-meteor-page__smart-bar-title'), + ).toBeVisible(); + + await ShopAdmin.page.locator('.navigation-list-item__sw-extension').click(); + await expect( + ShopAdmin.page.getByRole('link', { name: 'Store' }).first(), + ).toBeVisible(); + + await ShopAdmin.page + .getByRole('link', { name: 'Test with searchbar' }) + .first() + .click(); + await expect( + ShopAdmin.page.locator('.smart-bar__content', { + hasText: 'Test with searchbar', + }), + ).toBeVisible(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-menu-item-add-menu-item-with-searchbar', + ); + await expect( + frame.getByRole('heading', { name: 'Hello from the new menu page' }), + ).toBeVisible(); + await expect(ShopAdmin.page.locator('.sw-page__search-bar')).toBeVisible(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/menu-item.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/menu-item.spec.ts new file mode 100644 index 000000000..3bda10cac --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/menu-item.spec.ts @@ -0,0 +1,80 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, AdminDashboard }) => { + await mockUpdateApi(ShopAdmin.page); + + await ShopAdmin.goesTo(AdminDashboard.url()); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: add menu item', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-order').click(); + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + + await expect( + frame.getByRole('heading', { name: 'Hello from the new Menu Page' }), + ).toBeVisible(); +}); + +test('@sdk: add menu item at third level', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-catalogue').click(); + + // Trigger hover manually - Both statements are needed! + await ShopAdmin.page + .getByRole('link', { name: 'Manufacturers' }) + .first() + .hover(); + await ShopAdmin.page.evaluate(() => { + const element = document.querySelector( + '.sw-admin-menu__navigation-link-label[title="Manufacturers"]', + ); + if (element) { + element.dispatchEvent(new MouseEvent('mouseover', { bubbles: true })); + } + }); + await ShopAdmin.page + .getByRole('link', { name: 'Third level' }) + .nth(1) + .click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await expect( + frame.getByRole('heading', { name: 'Hello from the new Menu Page' }), + ).toBeVisible(); +}); + +test('@sdk: check menu position', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.navigation-list-item__sw-extension').click(); + await expect( + ShopAdmin.page.getByRole('link', { name: 'Store' }).first(), + ).toBeVisible(); + + await ShopAdmin.page + .getByRole('link', { name: 'Test with searchbar' }) + .first() + .click(); + await expect( + ShopAdmin.page.locator('.smart-bar__content', { + hasText: 'Test with searchbar', + }), + ).toBeVisible(); + + await expect( + ShopAdmin.page + .locator( + '.sw-admin-menu__item--sw-extension > .sw-admin-menu__sub-navigation-list > .navigation-list-item__type-plugin', + ) + .first(), + ).toHaveText('First item'); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/modals.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/modals.spec.ts new file mode 100644 index 000000000..7826492b4 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/modals.spec.ts @@ -0,0 +1,63 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, TestDataService, AdminProductDetail }) => { + await mockUpdateApi(ShopAdmin.page); + + const product = await TestDataService.createBasicProduct(); + await ShopAdmin.goesTo(AdminProductDetail.url(product.id)); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: modals', async ({ ShopAdmin }) => { + await ShopAdmin.page.getByRole('link', { name: 'Example' }).click(); + await expect( + ShopAdmin.page.locator('.sw-card', { hasText: 'Hello in the new tab' }), + ).toBeVisible(); + + const frame = await getSDKiFrame(ShopAdmin.page, 'ui-modals'); + await expect( + frame.getByRole('heading', { name: 'Hello in the example card' }), + ).toBeVisible(); + + await frame.getByRole('button', { name: 'Open Modal' }).click(); + await expect( + ShopAdmin.page.locator('.sw-modal', { hasText: 'Hello from the plugin' }), + ).toBeVisible(); + + // Open and close modal via SDK + const contentFrame = await getSDKiFrame( + ShopAdmin.page, + 'ui-modals-modal-content', + ); + await expect( + contentFrame.getByRole('heading', { name: 'Hello from the plugin 👋🏻' }), + ).toBeVisible(); + await contentFrame.getByRole('button', { name: 'Close modal' }).click(); + + // Close modal via Shopware + await frame.getByRole('button', { name: 'Open Modal' }).click(); + await expect( + ShopAdmin.page.locator('.sw-modal', { hasText: 'Hello from the plugin' }), + ).toBeVisible(); + await ShopAdmin.page.getByRole('button', { name: 'Close modal' }).click(); + + // Modal without header + await frame.getByRole('button', { name: 'Open No Header' }).click(); + await expect( + ShopAdmin.page.locator('.sw-modal__header'), + ).not.toBeInViewport(); + await ShopAdmin.page.getByRole('button', { name: 'Close modal' }).click(); + + // Small modal + await frame.getByRole('button', { name: 'Open small variant' }).click(); + await expect(ShopAdmin.page.locator('.sw-modal--small')).toBeVisible(); + await ShopAdmin.page.getByRole('button', { name: 'Close modal' }).click(); + + // Open modal which is not closable without action + await frame.getByRole('button', { name: 'Open none closable' }).click(); + await expect(ShopAdmin.page.locator('.sw-modal__close')).not.toBeInViewport(); + await ShopAdmin.page.getByRole('button', { name: 'Close modal' }).click(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/notification.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/notification.spec.ts new file mode 100644 index 000000000..2a3228a88 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/notification.spec.ts @@ -0,0 +1,28 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, AdminDashboard }) => { + await mockUpdateApi(ShopAdmin.page); + + await ShopAdmin.goesTo(AdminDashboard.url()); + + // The main hidden iFrame should exist + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: dispatch a notification', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-admin-menu__item--sw-order').click(); + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Dispatch a notification' }).click(); + + ShopAdmin.page.locator('.sw-alert__title', { hasText: 'Your title' }); + ShopAdmin.page.locator('.sw-alert__message', { + hasText: 'Your message', + }); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/settings-item.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/settings-item.spec.ts new file mode 100644 index 000000000..d6eae45a1 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/settings-item.spec.ts @@ -0,0 +1,50 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin }) => { + await mockUpdateApi(ShopAdmin.page); + + await ShopAdmin.goesTo('/admin/#sw/settings/index/shop'); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: add settings without searchbar', async ({ ShopAdmin }) => { + await ShopAdmin.page + .locator('#ui-menu-item-add-menu-item', { hasText: 'Without searchbar' }) + .click(); + await expect(ShopAdmin.page.locator('.smart-bar__content')).toHaveText( + 'Without searchbar', + ); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-menu-item-add-menu-item', + ); + await expect( + frame.getByRole('heading', { name: 'Hello from the new Menu Page' }), + ).toBeVisible(); + await expect( + ShopAdmin.page.locator('.sw-page__search-bar'), + ).not.toBeInViewport(); +}); + +test('@sdk: add settings with searchbar', async ({ ShopAdmin }) => { + await ShopAdmin.goesTo('/admin/#sw/settings/index/plugins'); + await ShopAdmin.page.getByRole('link', { name: 'App Settings' }).click(); + await expect(ShopAdmin.page.locator('.smart-bar__content')).toHaveText( + 'App Settings', + ); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-menu-item-add-menu-item', + ); + await expect( + frame.getByRole('heading', { + name: 'Hello from the new menu page with searchbar', + }), + ).toBeVisible(); + await expect(ShopAdmin.page.locator('.sw-page__search-bar')).toBeVisible(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/tabs.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/tabs.spec.ts new file mode 100644 index 000000000..f82242a20 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/tabs.spec.ts @@ -0,0 +1,27 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, TestDataService, AdminProductDetail }) => { + await mockUpdateApi(ShopAdmin.page); + + const product = await TestDataService.createBasicProduct(); + await ShopAdmin.goesTo(AdminProductDetail.url(product.id)); + + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: Check tab existence', async ({ ShopAdmin }) => { + await ShopAdmin.page.getByRole('link', { name: 'Example' }).click(); + await expect( + ShopAdmin.page.locator('.sw-card', { hasText: 'Hello in the new tab' }), + ).toBeVisible(); + + await getSDKiFrame(ShopAdmin.page, 'ui-modals'); + + // Reload and make sure the tab still exists + await ShopAdmin.page.reload(); + await expect( + ShopAdmin.page.locator('.sw-card', { hasText: 'Hello in the new tab' }), + ).toBeVisible(); +}); diff --git a/examples/admin-sdk-plugin/tests/acceptance/tests/window.spec.ts b/examples/admin-sdk-plugin/tests/acceptance/tests/window.spec.ts new file mode 100644 index 000000000..806808495 --- /dev/null +++ b/examples/admin-sdk-plugin/tests/acceptance/tests/window.spec.ts @@ -0,0 +1,51 @@ +import { test, expect } from '../fixtures/AcceptanceTest'; +import { getSDKiFrame, mockUpdateApi } from '../fixtures/Helper'; + +test.beforeEach(async ({ ShopAdmin, AdminDashboard }) => { + await mockUpdateApi(ShopAdmin.page); + + await ShopAdmin.goesTo(AdminDashboard.url()); + + // The main hidden iFrame should exist + const mainHidden = await getSDKiFrame(ShopAdmin.page, 'sw-main-hidden'); + await expect(mainHidden.locator('body')).not.toBeEmpty(); +}); + +test('@sdk: redirect to another URL', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-admin-menu__item--sw-order').click(); + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Dispatch a notification' }).click(); + + // Click the button that opens the new tab + await ShopAdmin.page + .locator('.sw-button__content', { hasText: 'Redirect to Shopware' }) + .click(); + // Wait for the new page to be created + const pagePromise = ShopAdmin.page.context().waitForEvent('page'); + + // Wait for the new page to be created and load + const newPage = await pagePromise; + + // Check the URL of the new page + expect(newPage.url()).toBe('https://www.shopware.com/en/'); +}); + +test('@sdk: push router', async ({ ShopAdmin }) => { + await ShopAdmin.page.locator('.sw-admin-menu__item--sw-order').click(); + await ShopAdmin.page.getByRole('link', { name: 'Test item' }).first().click(); + + const frame = await getSDKiFrame( + ShopAdmin.page, + 'ui-main-module-add-main-module', + ); + await frame.locator('button', { hasText: 'Push route' }).click(); + + await expect( + ShopAdmin.page.locator('.sw-card__title', { hasText: 'Orders' }), + ).toBeVisible(); +}); diff --git a/examples/nuxt-app/CHANGELOG.md b/examples/nuxt-app/CHANGELOG.md index 360526b76..7309c5be2 100644 --- a/examples/nuxt-app/CHANGELOG.md +++ b/examples/nuxt-app/CHANGELOG.md @@ -1,5 +1,20 @@ # nuxt-app +## 0.0.15 + +### Patch Changes + +- Updated dependencies [cc754b9] +- Updated dependencies [47063ae] +- Updated dependencies [62be382] +- Updated dependencies [28f5cb1] +- Updated dependencies [001adb3] +- Updated dependencies [6d32afa] +- Updated dependencies [936ccf3] +- Updated dependencies [2f0a666] +- Updated dependencies [07e243a] + - @shopware-ag/meteor-component-library@3.14.0 + ## 0.0.14 ### Patch Changes diff --git a/examples/nuxt-app/package.json b/examples/nuxt-app/package.json index bbecae723..e6fafa85c 100644 --- a/examples/nuxt-app/package.json +++ b/examples/nuxt-app/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-app", - "version": "0.0.14", + "version": "0.0.15", "private": true, "type": "module", "scripts": { @@ -19,7 +19,7 @@ "vue-router": "^4.3.0" }, "devDependencies": { - "@playwright/test": "^1.44.0", + "@playwright/test": "^1.45.0", "@types/node": "^20.11.28" } } diff --git a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png index 395f4c625..91a0c41d9 100644 Binary files a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png and b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png differ diff --git a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png index eca03a672..9fa8c716a 100644 Binary files a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png and b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png differ diff --git a/packages/admin-sdk/CHANGELOG.md b/packages/admin-sdk/CHANGELOG.md index 3fb6d1245..65aea55b6 100644 --- a/packages/admin-sdk/CHANGELOG.md +++ b/packages/admin-sdk/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 5.5.1 + +### Patch Changes + +- Updated dependencies [cc754b9] +- Updated dependencies [47063ae] +- Updated dependencies [62be382] +- Updated dependencies [28f5cb1] +- Updated dependencies [001adb3] +- Updated dependencies [6d32afa] +- Updated dependencies [936ccf3] +- Updated dependencies [2f0a666] +- Updated dependencies [07e243a] + - @shopware-ag/meteor-component-library@3.14.0 + ## 5.5.0 ### Minor Changes diff --git a/packages/admin-sdk/e2e/channel.spec.ts b/packages/admin-sdk/e2e/channel.spec.ts index 2b0d0ee7a..dcf181dcd 100644 --- a/packages/admin-sdk/e2e/channel.spec.ts +++ b/packages/admin-sdk/e2e/channel.spec.ts @@ -825,7 +825,7 @@ test.describe('Privilege tests', () => { if (browserName !== 'firefox') { // Expect console error to be thrown const consoleError = await waitForConsoleError; - expect(consoleError.text()).toContain('Error: Your app is missing the privileges read:product for action "datasetSubscribe".'); + expect(consoleError.text()).toContain('Your app is missing the privileges read:product for action "datasetSubscribe".'); } // check if receiving value matches diff --git a/packages/admin-sdk/package.json b/packages/admin-sdk/package.json index 165695eff..ef6a5ed5d 100644 --- a/packages/admin-sdk/package.json +++ b/packages/admin-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@shopware-ag/meteor-admin-sdk", - "version": "5.5.0", + "version": "5.5.1", "description": "The Meteor SDK for the Shopware Administration.", "keywords": [ "iframe", @@ -91,7 +91,7 @@ "@shopware-ag/meteor-component-library": "workspace:*" }, "devDependencies": { - "@playwright/test": "^1.44.0", + "@playwright/test": "^1.45.0", "@types/jest": "^27.4.1", "@types/lodash": "^4.14.191", "@types/node": "^18.11.17", diff --git a/packages/component-library/CHANGELOG.md b/packages/component-library/CHANGELOG.md index af4f1659a..86736e374 100644 --- a/packages/component-library/CHANGELOG.md +++ b/packages/component-library/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 3.14.0 + +### Minor Changes + +- 001adb3: Add external and internal variants for link component + +### Patch Changes + +- cc754b9: Deprecated the mt-url-field component +- 47063ae: Deprecated mt-external link component +- 62be382: move mt-loader over to plain css +- 28f5cb1: remove default margin of banner component, hidden by future flag +- 6d32afa: Improve a11y of help text +- 936ccf3: Allow disabling individual tab items +- 2f0a666: Remove default margin from base field, hidden by future flag +- 07e243a: Migrate mt-loader over to the composition api + ## 3.13.0 ### Minor Changes diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png index 60ca35f11..9bdd0b218 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png and b/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-correct-multi-selection-wrapping-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-correct-multi-selection-wrapping-snap.png index 54f96fec2..4dbc6481c 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-correct-multi-selection-wrapping-snap.png and b/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-correct-multi-selection-wrapping-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-selection-opens-via-indicators-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-selection-opens-via-indicators-snap.png new file mode 100644 index 000000000..d961e2946 Binary files /dev/null and b/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-ensure-selection-opens-via-indicators-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-multi-select-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-multi-select-snap.png index c51cfea89..9d4d8b83b 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-multi-select-snap.png and b/packages/component-library/__snapshots__/interaction-tests-form-mt-select--visual-test-multi-select-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-snap.png index 660a42ae5..c74ccbdec 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-hero-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-hero-snap.png index 4929b8e2d..156aa5594 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-hero-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-hero-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-opened-context-actions-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-opened-context-actions-snap.png index 62e637bb0..3191900c5 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-opened-context-actions-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-with-opened-context-actions-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-avatar-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-avatar-snap.png index ebc26255d..b28baf010 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-avatar-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-avatar-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-context-actions-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-context-actions-snap.png index 34160d360..082dc4681 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-context-actions-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-context-actions-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-footer-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-footer-snap.png index 2f4665a63..2eabb6352 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-footer-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-footer-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-header-right-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-header-right-snap.png index d455ff534..225cfe6ef 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-header-right-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-header-right-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-tabs-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-tabs-snap.png index 03470b524..e225ca888 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-tabs-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-tabs-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-toolbar-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-toolbar-snap.png index 39a97482c..15b575d81 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-toolbar-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-extended-page-without-toolbar-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-snap.png index 60f98b791..962d4ca49 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-custom-footer-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-custom-footer-snap.png index 3c4de4f68..c43f844e7 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-custom-footer-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-custom-footer-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-unlinked-inheritance-snap.png b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-unlinked-inheritance-snap.png index 69c751773..13dbf8c94 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-unlinked-inheritance-snap.png and b/packages/component-library/__snapshots__/interaction-tests-layout-mt-card--visual-test-minimal-page-with-unlinked-inheritance-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-base-snap.png b/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-base-snap.png index 4f7b252ca..4519f36d9 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-base-snap.png and b/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-base-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-second-level-snap.png b/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-second-level-snap.png index bbf26f978..aff1699e9 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-second-level-snap.png and b/packages/component-library/__snapshots__/interaction-tests-navigation-mt-segmented-control--visual-test-render-segmented-control-with-popover-second-level-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-navigation-mt-tabs--visual-test-render-tabs-with-context-menu-badge-snap.png b/packages/component-library/__snapshots__/interaction-tests-navigation-mt-tabs--visual-test-render-tabs-with-context-menu-badge-snap.png index a94e60e4d..66fe8a042 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-navigation-mt-tabs--visual-test-render-tabs-with-context-menu-badge-snap.png and b/packages/component-library/__snapshots__/interaction-tests-navigation-mt-tabs--visual-test-render-tabs-with-context-menu-badge-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-popover-snap.png b/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-popover-snap.png index a17b74c70..45f38644a 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-popover-snap.png and b/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-popover-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-without-float-snap.png b/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-without-float-snap.png index fa5e482a4..847f229f0 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-without-float-snap.png and b/packages/component-library/__snapshots__/interaction-tests-overlay-mt-popover--visual-test-render-without-float-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-column-indicator-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-column-indicator-snap.png index 73eedc076..e0a247809 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-column-indicator-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-column-indicator-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-filter-menu-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-filter-menu-snap.png index d9d26d8ce..1a06f695a 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-filter-menu-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-filter-menu-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-icon-button-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-icon-button-snap.png index 67db94e79..1095b6370 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-icon-button-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-filter-via-icon-button-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-new-column-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-new-column-snap.png index ec95ba7ea..81a2923ec 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-new-column-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-new-column-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-option-via-the-filter-edit-menu-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-option-via-the-filter-edit-menu-snap.png index 678215250..62d9710c5 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-option-via-the-filter-edit-menu-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-add-option-via-the-filter-edit-menu-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-blank-table-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-blank-table-snap.png index 8105331ca..3b8065778 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-blank-table-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-blank-table-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-bar-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-bar-snap.png index 503fd8a27..c72b0d54a 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-bar-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-bar-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-drop-ordering-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-drop-ordering-snap.png index d386381bd..5c13f782f 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-drop-ordering-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-drag-drop-ordering-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-snap.png index e5bf0524b..aa9aaa427 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-without-sort-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-without-sort-snap.png index a4be15279..e378f897e 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-without-sort-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-column-settings-popover-without-sort-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-data-sorting-in-column-settings-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-data-sorting-in-column-settings-snap.png index bab1e9ab4..440ee734b 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-data-sorting-in-column-settings-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-data-sorting-in-column-settings-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-emit-reload-event-on-clicking-reload-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-emit-reload-event-on-clicking-reload-snap.png index 477476150..3ef530a14 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-emit-reload-event-on-clicking-reload-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-emit-reload-event-on-clicking-reload-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-enable-row-numbering-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-enable-row-numbering-snap.png index a342d74fc..9e44a1841 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-enable-row-numbering-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-enable-row-numbering-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-outlines-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-outlines-snap.png index 4378560a9..97a5b1f82 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-outlines-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-outlines-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-stripes-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-stripes-snap.png index 336ea5a3c..cb13dce66 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-stripes-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-hide-stripes-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-column-settings-menu-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-column-settings-menu-snap.png index dca200925..07d2b6168 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-column-settings-menu-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-column-settings-menu-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-settings-menu-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-settings-menu-snap.png index f1a2c9ef1..252b9e44e 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-settings-menu-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-open-settings-menu-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-filter-menu-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-filter-menu-snap.png index 0fb1d19c6..dd0b29834 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-filter-menu-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-filter-menu-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-icon-button-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-icon-button-snap.png index b5ac5249d..f62c169db 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-icon-button-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-filter-via-icon-button-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-filter-edit-menu-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-filter-edit-menu-snap.png index 248e6aa7b..958cb318a 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-filter-edit-menu-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-filter-edit-menu-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-all-button-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-all-button-snap.png index b5ac5249d..39f2a74fd 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-all-button-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-all-button-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-button-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-button-snap.png index b5ac5249d..39f2a74fd 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-button-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-remove-option-via-the-remove-button-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-empty-state-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-empty-state-snap.png index bb2d40fb2..d808a3865 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-empty-state-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-empty-state-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-full-table-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-full-table-snap.png index 59f694800..623aba87e 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-full-table-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-full-table-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-skeleton-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-skeleton-snap.png index 663bef310..4df8539b2 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-skeleton-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-skeleton-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-snap.png index 7675e0a83..89ee9441d 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-sticky-header-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-sticky-header-snap.png index 378e4fdfb..12031754b 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-sticky-header-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-sticky-header-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-an-image-in-cell-table-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-an-image-in-cell-table-snap.png index dd3470050..85807b62a 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-an-image-in-cell-table-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-an-image-in-cell-table-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-scroll-shadows-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-scroll-shadows-snap.png index 7e2001ce7..c5ec7e07f 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-scroll-shadows-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-render-table-with-scroll-shadows-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-should-hide-the-last-column-with-via-disable-context-menu-and-settings-table-snap.png b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-should-hide-the-last-column-with-via-disable-context-menu-and-settings-table-snap.png index a26a335e4..5ab04d884 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-should-hide-the-last-column-with-via-disable-context-menu-and-settings-table-snap.png and b/packages/component-library/__snapshots__/interaction-tests-table-and-list-mt-data-table--visual-test-should-hide-the-last-column-with-via-disable-context-menu-and-settings-table-snap.png differ diff --git a/packages/component-library/package.json b/packages/component-library/package.json index aceca2a88..eca945faa 100644 --- a/packages/component-library/package.json +++ b/packages/component-library/package.json @@ -1,6 +1,6 @@ { "name": "@shopware-ag/meteor-component-library", - "version": "3.13.0", + "version": "3.14.0", "repository": { "type": "git", "url": "git+ssh://git@github.com:shopware/meteor.git" diff --git a/packages/component-library/src/components/_internal/mt-label.vue b/packages/component-library/src/components/_internal/mt-label.vue index f76cc8719..1ac2a66a6 100644 --- a/packages/component-library/src/components/_internal/mt-label.vue +++ b/packages/component-library/src/components/_internal/mt-label.vue @@ -10,7 +10,7 @@