diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/browser-handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/browser-handlers.ts index f677db74d5..e4c4db32d2 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/browser-handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/browser-handlers.ts @@ -34,7 +34,6 @@ const handlers = [ ...mediaHandlers, ...dataTypeHandlers, ...documentTypeHandlers, - ...manifestsHandlers.default, ...telemetryHandlers, ...publishedStatusHandlers, ...usersHandlers, diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/manifests.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/manifests.handlers.ts index bdb9806ecc..4b9ab7ba62 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/manifests.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/manifests.handlers.ts @@ -1,58 +1,77 @@ import { rest } from 'msw'; import { umbracoPath } from '@umbraco-cms/utils'; +import { ManifestTypes } from '@umbraco-cms/extensions-registry'; -type ManifestsResponse = Record; -type ManifestsPackagesInstalledResponse = ManifestsResponse; +// TODO: Update to server API types when they are available +type Package = { + name?: string; + version?: string; + extensions?: ManifestTypes[]; +}; +type ManifestsResponse = Package[]; export const manifestDevelopmentHandler = rest.get(umbracoPath('/manifests'), (_req, res, ctx) => { return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ - manifests: [ - { - type: 'section', - alias: 'My.Section.Custom', - name: 'Custom Section', - js: '/App_Plugins/section.js', - elementName: 'my-section-custom', - weight: 1, - meta: { - label: 'Custom', - pathname: 'my-custom', + ctx.json([ + { + name: 'Named Package', + version: '1.0.0', + extensions: [ + { + type: 'section', + alias: 'My.Section.Custom', + name: 'Custom Section', + js: '/App_Plugins/section.js', + elementName: 'my-section-custom', + weight: 1, + meta: { + label: 'Custom', + pathname: 'my-custom', + }, }, - }, - { - type: 'propertyEditorUI', - alias: 'My.PropertyEditorUI.Custom', - name: 'My Custom Property Editor UI', - js: '/App_Plugins/property-editor.js', - elementName: 'my-property-editor-ui-custom', - meta: { - label: 'My Custom Property', - icon: 'document', - group: 'Common', - propertyEditorModel: 'Umbraco.JSON', + { + type: 'propertyEditorUI', + alias: 'My.PropertyEditorUI.Custom', + name: 'My Custom Property Editor UI', + js: '/App_Plugins/property-editor.js', + elementName: 'my-property-editor-ui-custom', + meta: { + label: 'My Custom Property', + icon: 'document', + group: 'Common', + propertyEditorModel: 'Umbraco.JSON', + }, }, - }, - { - type: 'entrypoint', - name: 'My Custom Entry Point', - alias: 'My.Entrypoint.Custom', - js: '/App_Plugins/custom-entrypoint.js', - }, - { - type: 'packageView', - alias: 'My.PackageView.Custom', - name: 'My Custom Package View', - js: '/App_Plugins/package-view.js', - meta: { - packageAlias: 'my.package', + ], + }, + { + extensions: [ + { + type: 'entrypoint', + name: 'My Custom Entry Point', + alias: 'My.Entrypoint.Custom', + js: '/App_Plugins/custom-entrypoint.js', }, - }, - ], - }) + ], + }, + { + name: 'Package with a view', + extensions: [ + { + type: 'packageView', + alias: 'My.PackageView.Custom', + name: 'My Custom Package View', + js: '/App_Plugins/package-view.js', + meta: { + packageAlias: 'my.package', + }, + }, + ], + }, + ]) ); }); @@ -60,39 +79,6 @@ export const manifestEmptyHandler = rest.get(umbracoPath('/manifests'), (_req, r return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ - manifests: [], - }) + ctx.json([]) ); }); - -export default [ - rest.get(umbracoPath('/manifests/packages/installed'), (_req, res, ctx) => { - return res( - // Respond with a 200 status code - ctx.status(200), - ctx.json({ - packages: [ - { - id: '2a0181ec-244b-4068-a1d7-2f95ed7e6da6', - name: 'My very own package', - alias: 'my.package', - version: '1.0.0', - hasMigrations: false, - hasPendingMigrations: false, - plans: [], - }, - { - id: '240d95be-bfdb-4ca2-a601-ed2bfd5ed069', - name: 'Some other community package', - alias: 'our.package', - version: '2.0.1', - hasMigrations: false, - hasPendingMigrations: false, - plans: [], - }, - ], - }) - ); - }), -]; diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/e2e-handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/e2e-handlers.ts index 45fb7f2e96..bc02257b50 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/e2e-handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/e2e-handlers.ts @@ -23,7 +23,6 @@ export const handlers = [ ...userHandlers, ...dataTypeHandlers, ...documentTypeHandlers, - ...manifestsHandlers.default, ...telemetryHandlers, ...publishedStatusHandlers, ...examineManagementHandlers,