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
|
# Frontend
|
||||||
*.vite/
|
*.vite/
|
||||||
**/public/administration/js/
|
**/public/administration/assets/
|
||||||
**/public/static/js/
|
**/public/static/js/
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ check() { # <label> <entry-glob-prefix> <expected path in zip>
|
|||||||
fi
|
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/"
|
check storefront src/Resources/app/storefront/src "Resources/app/storefront/dist/"
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
import './acl';
|
import './acl';
|
||||||
import './page/aeon-dump-manager-list';
|
|
||||||
import deDE from './snippet/de-DE.json';
|
import deDE from './snippet/de-DE.json';
|
||||||
import enGB from './snippet/en-GB.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', {
|
Shopware.Module.register('aeon-dump-manager', {
|
||||||
type: 'plugin',
|
type: 'plugin',
|
||||||
name: 'DumpManager',
|
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.
|
settingsItem: [{
|
||||||
// Same mechanism every core settings module uses in 6.6 and 6.7 (no sidebar entry).
|
group: 'plugins',
|
||||||
settingsItem: {
|
|
||||||
group: 'system',
|
|
||||||
to: 'aeon.dump.manager.list',
|
to: 'aeon.dump.manager.list',
|
||||||
icon: 'regular-database',
|
icon: 'regular-database',
|
||||||
privilege: 'aeon_dump_manager.viewer',
|
privilege: 'aeon_dump_manager.viewer',
|
||||||
},
|
}],
|
||||||
});
|
});
|
||||||
+8
-8
@@ -1,7 +1,7 @@
|
|||||||
{% block aeon_dump_manager_list %}
|
{% block aeon_dump_manager_list %}
|
||||||
<sw-page class="aeon-dump-manager-list">
|
<sw-page class="aeon-dump-manager-list">
|
||||||
<template #smart-bar-actions>
|
<template #smart-bar-actions>
|
||||||
<sw-button
|
<mt-button
|
||||||
v-if="acl.can('aeon_dump_manager.creator')"
|
v-if="acl.can('aeon_dump_manager.creator')"
|
||||||
variant="primary"
|
variant="primary"
|
||||||
:is-loading="pendingJob !== null"
|
:is-loading="pendingJob !== null"
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
@click="onCreate"
|
@click="onCreate"
|
||||||
>
|
>
|
||||||
{{ $tc('aeon-dump-manager.list.buttonCreate') }}
|
{{ $tc('aeon-dump-manager.list.buttonCreate') }}
|
||||||
</sw-button>
|
</mt-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #content>
|
<template #content>
|
||||||
@@ -87,18 +87,18 @@
|
|||||||
>
|
>
|
||||||
<div class="aeon-dump-manager-list__progress-wrapper">
|
<div class="aeon-dump-manager-list__progress-wrapper">
|
||||||
<template v-if="pendingJob.status === 'done'">
|
<template v-if="pendingJob.status === 'done'">
|
||||||
<sw-alert variant="success">
|
<mt-banner variant="positive">
|
||||||
{{ $tc('aeon-dump-manager.list.createSuccess') }}
|
{{ $tc('aeon-dump-manager.list.createSuccess') }}
|
||||||
</sw-alert>
|
</mt-banner>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="pendingJob.status === 'failed'">
|
<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 || '' }) }}
|
{{ $tc('aeon-dump-manager.list.createFailed', 0, { error: pendingJob.errorMessage || '' }) }}
|
||||||
</sw-alert>
|
</mt-banner>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<sw-progress-bar
|
<mt-progress-bar
|
||||||
:value="pendingJob.percent || 0"
|
:model-value="pendingJob.percent || 0"
|
||||||
:max-value="100"
|
:max-value="100"
|
||||||
/>
|
/>
|
||||||
<span class="aeon-dump-manager-list__progress-text">
|
<span class="aeon-dump-manager-list__progress-text">
|
||||||
|
|||||||
+5
-4
@@ -1,7 +1,8 @@
|
|||||||
import template from './aeon-dump-manager-list.html.twig';
|
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 {
|
interface PendingJob {
|
||||||
status: string;
|
status: string;
|
||||||
@@ -45,7 +46,7 @@ interface ComponentInstance extends ComponentData {
|
|||||||
listFilters: Record<string, unknown>[];
|
listFilters: Record<string, unknown>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.register('aeon-dump-manager-list', {
|
export default Shopware.Component.wrapComponentConfig({
|
||||||
template,
|
template,
|
||||||
|
|
||||||
mixins: [
|
mixins: [
|
||||||
@@ -147,7 +148,7 @@ Component.register('aeon-dump-manager-list', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy(this: ComponentInstance) {
|
beforeUnmount(this: ComponentInstance) {
|
||||||
this.stopPolling();
|
this.stopPolling();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user