register media section from media domain
This commit is contained in:
@@ -54,6 +54,7 @@ import type { ManifestTypes } from '@umbraco-cms/models';
|
||||
|
||||
// Domains
|
||||
import '../documents';
|
||||
import '../media';
|
||||
import '../translation';
|
||||
|
||||
@defineElement('umb-backoffice')
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { ManifestDashboard } from '@umbraco-cms/models';
|
||||
|
||||
const dashboards: Array<ManifestDashboard> = [
|
||||
{
|
||||
type: 'dashboard',
|
||||
alias: 'Umb.Dashboard.Welcome',
|
||||
name: 'Welcome Dashboard',
|
||||
loader: () => import('./welcome/dashboard-welcome.element'),
|
||||
weight: 20,
|
||||
meta: {
|
||||
label: 'Welcome',
|
||||
sections: ['Umb.Section.Content'],
|
||||
pathname: 'welcome',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'dashboard',
|
||||
alias: 'Umb.Dashboard.RedirectManagement',
|
||||
name: 'Redirect Management Dashboard',
|
||||
loader: () => import('./redirect-management/dashboard-redirect-management.element'),
|
||||
weight: 10,
|
||||
meta: {
|
||||
label: 'Redirect Management',
|
||||
sections: ['Umb.Section.Content'],
|
||||
pathname: 'redirect-management',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests = [...dashboards];
|
||||
@@ -1,43 +0,0 @@
|
||||
import type { ManifestDashboard, ManifestSection } from '@umbraco-cms/models';
|
||||
|
||||
const sectionAlias = 'Umb.Section.Content';
|
||||
|
||||
const section: ManifestSection = {
|
||||
type: 'section',
|
||||
alias: sectionAlias,
|
||||
name: 'Content Section',
|
||||
weight: 600,
|
||||
meta: {
|
||||
label: 'Content',
|
||||
pathname: 'content',
|
||||
},
|
||||
};
|
||||
|
||||
const dashboards: Array<ManifestDashboard> = [
|
||||
{
|
||||
type: 'dashboard',
|
||||
alias: 'Umb.Dashboard.Welcome',
|
||||
name: 'Welcome Dashboard',
|
||||
loader: () => import('../../core/dashboards/welcome/dashboard-welcome.element'),
|
||||
weight: 20,
|
||||
meta: {
|
||||
label: 'Welcome',
|
||||
sections: [sectionAlias],
|
||||
pathname: 'welcome',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'dashboard',
|
||||
alias: 'Umb.Dashboard.RedirectManagement',
|
||||
name: 'Redirect Management Dashboard',
|
||||
loader: () => import('../../core/dashboards/redirect-management/dashboard-redirect-management.element'),
|
||||
weight: 10,
|
||||
meta: {
|
||||
label: 'Redirect Management',
|
||||
sections: [sectionAlias],
|
||||
pathname: 'redirect-management',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests = [section, ...dashboards];
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { ManifestSection } from '@umbraco-cms/models';
|
||||
|
||||
const sectionAlias = 'Umb.Section.Content';
|
||||
|
||||
const section: ManifestSection = {
|
||||
type: 'section',
|
||||
alias: sectionAlias,
|
||||
name: 'Content Section',
|
||||
weight: 600,
|
||||
meta: {
|
||||
label: 'Content',
|
||||
pathname: 'content',
|
||||
},
|
||||
};
|
||||
|
||||
export const manifests = [section];
|
||||
@@ -1,3 +1,4 @@
|
||||
import { manifests as contentSectionManifests } from './content-section/manifests';
|
||||
import { manifests as documentBlueprintManifests } from './document-blueprints/manifests';
|
||||
import { manifests as documentTypeManifests } from './document-types/manifests';
|
||||
|
||||
@@ -10,4 +11,4 @@ const registerExtensions = (manifests: Array<ManifestTypes> | Array<ManifestType
|
||||
});
|
||||
};
|
||||
|
||||
registerExtensions([...documentBlueprintManifests, ...documentTypeManifests]);
|
||||
registerExtensions([...contentSectionManifests, ...documentBlueprintManifests, ...documentTypeManifests]);
|
||||
|
||||
12
src/Umbraco.Web.UI.Client/src/backoffice/media/index.ts
Normal file
12
src/Umbraco.Web.UI.Client/src/backoffice/media/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { manifests as mediaSectionManifests } from './media-section/manifests';
|
||||
|
||||
import { ManifestTypes, umbExtensionsRegistry } from '@umbraco-cms/extensions-registry';
|
||||
|
||||
const registerExtensions = (manifests: Array<ManifestTypes> | Array<ManifestTypes>) => {
|
||||
manifests.forEach((manifest) => {
|
||||
if (umbExtensionsRegistry.isRegistered(manifest.alias)) return;
|
||||
umbExtensionsRegistry.register(manifest);
|
||||
});
|
||||
};
|
||||
|
||||
registerExtensions([...mediaSectionManifests]);
|
||||
@@ -24,7 +24,7 @@ const dashboards: Array<ManifestDashboardCollection> = [
|
||||
sections: [sectionAlias],
|
||||
pathname: 'media-management',
|
||||
entityType: 'media',
|
||||
storeAlias: 'umbMediaStore'
|
||||
storeAlias: 'umbMediaStore',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// TODO: temp file until we have a way to register from each extension
|
||||
|
||||
import { manifests as userSectionManifests } from '../auth/users-section/manifests';
|
||||
import { manifests as contentSectionManifests } from './documents/content-section/content-section.manifest';
|
||||
import { manifests as mediaSectionManifests } from './media/media-section/manifests';
|
||||
import { manifests as memberSectionManifests } from './members/members-section/manifests';
|
||||
import { manifests as packageSectionManifests } from './packages/packages-section/manifests';
|
||||
import { manifests as settingsSectionManifests } from './core/settings-section/manifests';
|
||||
@@ -15,11 +13,4 @@ import type {
|
||||
} from '@umbraco-cms/models';
|
||||
|
||||
export const manifests: Array<ManifestSection | ManifestDashboardCollection | ManifestDashboard | ManifestSectionView> =
|
||||
[
|
||||
...contentSectionManifests,
|
||||
...mediaSectionManifests,
|
||||
...memberSectionManifests,
|
||||
...packageSectionManifests,
|
||||
...settingsSectionManifests,
|
||||
...userSectionManifests,
|
||||
];
|
||||
[...memberSectionManifests, ...packageSectionManifests, ...settingsSectionManifests, ...userSectionManifests];
|
||||
|
||||
Reference in New Issue
Block a user