refactor(admin): lazy registration, Meteor components, Settings card for 6.7
- register the list page lazily and wrap it with wrapComponentConfig - sw-button/sw-alert/sw-progress-bar -> mt-button/mt-banner/mt-progress-bar - beforeDestroy -> beforeUnmount (Vue 3) - split the combined `import type` that broke the Vite build - Vite outputs to public/administration/assets/: update .gitignore and the CI asset check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4abd77103e
commit
fa464bc20d
5 files changed
+21
-20
No files matched your search
+1
-1
@@ -14,7 +14,7 @@ composer.phar
|
||||
|
||||
# Frontend
|
||||
*.vite/
|
||||
**/public/administration/js/
|
||||
**/public/administration/assets/
|
||||
**/public/static/js/
|
||||
|
||||
# Environment
|
||||
|
||||
@@ -13,5 +13,5 @@ check() { # <label> <entry-glob-prefix> <expected path in zip>
|
||||
fi
|
||||
}
|
||||
|
||||
check admin src/Resources/app/administration/src "Resources/public/administration/js/"
|
||||
check admin src/Resources/app/administration/src "Resources/public/administration/assets/"
|
||||
check storefront src/Resources/app/storefront/src "Resources/app/storefront/dist/"
|
||||
@@ -1,8 +1,10 @@
|
||||
import './acl';
|
||||
import './page/aeon-dump-manager-list';
|
||||
import deDE from './snippet/de-DE.json';
|
||||
import enGB from './snippet/en-GB.json';
|
||||
|
||||
// Lazy (async) registration, as core does: the page chunk loads on first visit.
|
||||
Shopware.Component.register('aeon-dump-manager-list', () => import('./page/aeon-dump-manager-list'));
|
||||
|
||||
Shopware.Module.register('aeon-dump-manager', {
|
||||
type: 'plugin',
|
||||
name: 'DumpManager',
|
||||
@@ -27,12 +29,10 @@ Shopware.Module.register('aeon-dump-manager', {
|
||||
},
|
||||
},
|
||||
|
||||
// Card on the Settings overview page's "System" group, next to Plugins/Cache.
|
||||
// Same mechanism every core settings module uses in 6.6 and 6.7 (no sidebar entry).
|
||||
settingsItem: {
|
||||
group: 'system',
|
||||
settingsItem: [{
|
||||
group: 'plugins',
|
||||
to: 'aeon.dump.manager.list',
|
||||
icon: 'regular-database',
|
||||
privilege: 'aeon_dump_manager.viewer',
|
||||
},
|
||||
}],
|
||||
});
|
||||
+8
-8
@@ -1,7 +1,7 @@
|
||||
{% block aeon_dump_manager_list %}
|
||||
<sw-page class="aeon-dump-manager-list">
|
||||
<template #smart-bar-actions>
|
||||
<sw-button
|
||||
<mt-button
|
||||
v-if="acl.can('aeon_dump_manager.creator')"
|
||||
variant="primary"
|
||||
:is-loading="pendingJob !== null"
|
||||
@@ -9,7 +9,7 @@
|
||||
@click="onCreate"
|
||||
>
|
||||
{{ $tc('aeon-dump-manager.list.buttonCreate') }}
|
||||
</sw-button>
|
||||
</mt-button>
|
||||
</template>
|
||||
|
||||
<template #content>
|
||||
@@ -87,18 +87,18 @@
|
||||
>
|
||||
<div class="aeon-dump-manager-list__progress-wrapper">
|
||||
<template v-if="pendingJob.status === 'done'">
|
||||
<sw-alert variant="success">
|
||||
<mt-banner variant="positive">
|
||||
{{ $tc('aeon-dump-manager.list.createSuccess') }}
|
||||
</sw-alert>
|
||||
</mt-banner>
|
||||
</template>
|
||||
<template v-else-if="pendingJob.status === 'failed'">
|
||||
<sw-alert variant="error">
|
||||
<mt-banner variant="critical">
|
||||
{{ $tc('aeon-dump-manager.list.createFailed', 0, { error: pendingJob.errorMessage || '' }) }}
|
||||
</sw-alert>
|
||||
</mt-banner>
|
||||
</template>
|
||||
<template v-else>
|
||||
<sw-progress-bar
|
||||
:value="pendingJob.percent || 0"
|
||||
<mt-progress-bar
|
||||
:model-value="pendingJob.percent || 0"
|
||||
:max-value="100"
|
||||
/>
|
||||
<span class="aeon-dump-manager-list__progress-text">
|
||||
|
||||
+5
-4
@@ -1,7 +1,8 @@
|
||||
import template from './aeon-dump-manager-list.html.twig';
|
||||
import type DumpApiService, { DumpFile, DumpJob } from '../../../../service/dump-api.service';
|
||||
import type DumpApiService from '../../../../service/dump-api.service';
|
||||
import type { DumpFile, DumpJob } from '../../../../service/dump-api.service';
|
||||
|
||||
const { Component, Mixin } = Shopware;
|
||||
const { Mixin } = Shopware;
|
||||
|
||||
interface PendingJob {
|
||||
status: string;
|
||||
@@ -45,7 +46,7 @@ interface ComponentInstance extends ComponentData {
|
||||
listFilters: Record<string, unknown>[];
|
||||
}
|
||||
|
||||
Component.register('aeon-dump-manager-list', {
|
||||
export default Shopware.Component.wrapComponentConfig({
|
||||
template,
|
||||
|
||||
mixins: [
|
||||
@@ -147,7 +148,7 @@ Component.register('aeon-dump-manager-list', {
|
||||
},
|
||||
},
|
||||
|
||||
beforeDestroy(this: ComponentInstance) {
|
||||
beforeUnmount(this: ComponentInstance) {
|
||||
this.stopPolling();
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user