diff --git a/src/Umbraco.Web.UI.Client/src/mocks/handlers/server.handlers.ts b/src/Umbraco.Web.UI.Client/src/mocks/handlers/server.handlers.ts index 6d4d62c268..2aadc06168 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/handlers/server.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/handlers/server.handlers.ts @@ -1,10 +1,12 @@ const { rest } = window.MockServiceWorker; import { - type ServerStatusResponseModel, - type ServerInformationResponseModel, - type ServerTroubleshootingResponseModel, RuntimeLevelModel, RuntimeModeModel, + type GetServerUpgradeCheckResponse, + type GetServerTroubleshootingResponse, + type GetServerInformationResponse, + type GetServerConfigurationResponse, + type GetServerStatusResponse, } from '@umbraco-cms/backoffice/external/backend-api'; import { umbracoPath } from '@umbraco-cms/backoffice/utils'; @@ -12,7 +14,7 @@ export const serverRunningHandler = rest.get(umbracoPath('/server/status'), (_re return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ + ctx.json({ serverStatus: RuntimeLevelModel.RUN, }), ); @@ -22,7 +24,7 @@ export const serverMustInstallHandler = rest.get(umbracoPath('/server/status'), return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ + ctx.json({ serverStatus: RuntimeLevelModel.INSTALL, }), ); @@ -32,18 +34,39 @@ export const serverMustUpgradeHandler = rest.get(umbracoPath('/server/status'), return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ + ctx.json({ serverStatus: RuntimeLevelModel.UPGRADE, }), ); }); export const serverInformationHandlers = [ + rest.get(umbracoPath('/server/configuration'), (_req, res, ctx) => { + return res( + // Respond with a 200 status code + ctx.status(200), + ctx.json({ + allowPasswordReset: true, + versionCheckPeriod: 7, // days + }), + ); + }), + rest.get(umbracoPath('/server/upgrade-check'), (_req, res, ctx) => { + return res( + // Respond with a 200 status code + ctx.status(200), + ctx.json({ + type: 'Major', + comment: 'A new version is available', + url: 'https://our.umbraco.com/download/releases', + }), + ); + }), rest.get(umbracoPath('/server/information'), (_req, res, ctx) => { return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ + ctx.json({ version: '14.0.0-preview004', assemblyVersion: '14.0.0-preview004', baseUtcOffset: '01:00:00', @@ -55,7 +78,7 @@ export const serverInformationHandlers = [ return res( // Respond with a 200 status code ctx.status(200), - ctx.json({ + ctx.json({ items: [ { name: 'Umbraco base url', data: location.origin }, { name: 'Mocked server', data: 'true' },