slice-machine-ui 2.18.3-beta.3 → 2.19.1-alpha.lg-page-routes.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +0 -1
- package/out/404.html +1 -1
- package/out/_next/static/{hVq9KNBKJbvE6x_LTwP9b → 3cOO4HEvSau6Y1yz7EUS5}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/248-9279b5f2476db636.js +1 -0
- package/out/_next/static/chunks/429-75740c7d201da3a4.js +3 -0
- package/out/_next/static/chunks/{489-ce3053e1d81ade83.js → 489-54c4b419d1c29727.js} +1 -1
- package/out/_next/static/chunks/603-a9b88d45a34ae9e9.js +1 -0
- package/out/_next/static/chunks/630-29fe0800ff72bf48.js +1 -0
- package/out/_next/static/chunks/pages/{_app-47c364b06ad99a80.js → _app-e3718a2c5ee36f46.js} +2 -2
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-af9376721beb489e.js → [customTypeId]-7a7d9d920c64b34b.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-5acd56959b60346f.js → custom-types-7a68a3b96227a3e7.js} +1 -1
- package/out/_next/static/chunks/pages/{index-0d8cb369de720a35.js → index-40fafc651e4e3685.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-a24665e91b882169.js → [pageTypeId]-50bbb6b2d4870d26.js} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +4 -4
- package/src/features/customTypes/EditDropdown.tsx +22 -0
- package/src/features/customTypes/actions/updateCustomTypeRoute.ts +55 -0
- package/src/features/environments/actions/getActiveEnvironment.ts +2 -1
- package/src/features/environments/actions/getEnvironments.ts +2 -1
- package/src/legacy/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +43 -2
- package/src/legacy/components/Forms/CustomTypeRouteModal/CustomTypeRouteModal.tsx +101 -0
- package/src/legacy/components/Forms/CustomTypeRouteModal/index.ts +1 -0
- package/src/legacy/lib/builders/common/EditModal/index.jsx +2 -2
- package/src/legacy/lib/models/common/CustomType/index.ts +1 -0
- package/test/__setup__.ts +12 -5
- package/test/__testutils__/createTestPlugin.ts +1 -0
- package/out/_next/static/chunks/248-84a5987f0499b074.js +0 -1
- package/out/_next/static/chunks/429-aab52070cad2884b.js +0 -3
- package/out/_next/static/chunks/630-2bf927bca082a191.js +0 -1
- package/out/_next/static/chunks/647-aa094286bc248d52.js +0 -1
- /package/out/_next/static/{hVq9KNBKJbvE6x_LTwP9b → 3cOO4HEvSau6Y1yz7EUS5}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{95759:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types/[customTypeId]",function(){return t(60802)}])},60802:function(n,u,t){"use strict";t.r(u),t.d(u,{default:function(){return _.H}});var _=t(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,344,256,422,34,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{95759:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types/[customTypeId]",function(){return t(60802)}])},60802:function(n,u,t){"use strict";t.r(u),t.d(u,{default:function(){return _.H}});var _=t(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,344,256,422,34,603,630,907,489,888,774,179],function(){return n(n.s=95759)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[379],{70320:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types",function(){return t(41194)}])},41194:function(n,u,t){"use strict";t.r(u);var _=t(52322),s=t(38241);u.default=()=>(0,_.jsx)(s.F,{format:"custom"})}},function(n){n.O(0,[397,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[379],{70320:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types",function(){return t(41194)}])},41194:function(n,u,t){"use strict";t.r(u);var _=t(52322),s=t(38241);u.default=()=>(0,_.jsx)(s.F,{format:"custom"})}},function(n){n.O(0,[397,603,248,888,774,179],function(){return n(n.s=70320)}),_N_E=n.O()}]);
|
package/out/_next/static/chunks/pages/{index-0d8cb369de720a35.js → index-40fafc651e4e3685.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(n,u,_){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return _(17134)}])},17134:function(n,u,_){"use strict";_.r(u);var t=_(52322),e=_(38241);u.default=()=>(0,t.jsx)(e.F,{format:"page"})}},function(n){n.O(0,[397,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(n,u,_){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return _(17134)}])},17134:function(n,u,_){"use strict";_.r(u);var t=_(52322),e=_(38241);u.default=()=>(0,t.jsx)(e.F,{format:"page"})}},function(n){n.O(0,[397,603,248,888,774,179],function(){return n(n.s=87314)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[936],{61367:function(n,u,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page-types/[pageTypeId]",function(){return e(89173)}])},89173:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return t.H}});var t=e(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,344,256,422,34,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[936],{61367:function(n,u,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page-types/[pageTypeId]",function(){return e(89173)}])},89173:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return t.H}});var t=e(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,344,256,422,34,603,630,907,489,888,774,179],function(){return n(n.s=61367)}),_N_E=n.O()}]);
|
package/out/changelog.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/870-a72b74312773efea.js" defer=""></script><script src="/_next/static/chunks/pages/changelog-8514e0696e90a1b2.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changelog","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/changes.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/d98ebc475f8423a3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d98ebc475f8423a3.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/d98ebc475f8423a3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d98ebc475f8423a3.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/8eec4907-b712959d9f984b68.js" defer=""></script><script src="/_next/static/chunks/918-fa4f2563cb5fd014.js" defer=""></script><script src="/_next/static/chunks/34-28725deef8b874b1.js" defer=""></script><script src="/_next/static/chunks/658-8231c0b729e0124a.js" defer=""></script><script src="/_next/static/chunks/pages/changes-8af4acbb8f974cb2.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changes","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-480e426e4b1cfef3.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-09fb3b997ad1eb70.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/344-fdb3008f4bb3b0c1.js" defer=""></script><script src="/_next/static/chunks/256-07f768a2b19b0a0e.js" defer=""></script><script src="/_next/static/chunks/422-c9192a1dbdd2ae0e.js" defer=""></script><script src="/_next/static/chunks/34-28725deef8b874b1.js" defer=""></script><script src="/_next/static/chunks/603-a9b88d45a34ae9e9.js" defer=""></script><script src="/_next/static/chunks/630-29fe0800ff72bf48.js" defer=""></script><script src="/_next/static/chunks/907-180eb33eefccc237.js" defer=""></script><script src="/_next/static/chunks/489-54c4b419d1c29727.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types/%5BcustomTypeId%5D-7a7d9d920c64b34b.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types/[customTypeId]","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/custom-types.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/603-a9b88d45a34ae9e9.js" defer=""></script><script src="/_next/static/chunks/248-9279b5f2476db636.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types-7a68a3b96227a3e7.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/603-a9b88d45a34ae9e9.js" defer=""></script><script src="/_next/static/chunks/248-9279b5f2476db636.js" defer=""></script><script src="/_next/static/chunks/pages/index-40fafc651e4e3685.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/labs.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/pages/labs-56fd818a63553497.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/labs","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-480e426e4b1cfef3.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-09fb3b997ad1eb70.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/344-fdb3008f4bb3b0c1.js" defer=""></script><script src="/_next/static/chunks/256-07f768a2b19b0a0e.js" defer=""></script><script src="/_next/static/chunks/422-c9192a1dbdd2ae0e.js" defer=""></script><script src="/_next/static/chunks/34-28725deef8b874b1.js" defer=""></script><script src="/_next/static/chunks/603-a9b88d45a34ae9e9.js" defer=""></script><script src="/_next/static/chunks/630-29fe0800ff72bf48.js" defer=""></script><script src="/_next/static/chunks/907-180eb33eefccc237.js" defer=""></script><script src="/_next/static/chunks/489-54c4b419d1c29727.js" defer=""></script><script src="/_next/static/chunks/pages/page-types/%5BpageTypeId%5D-50bbb6b2d4870d26.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/page-types/[pageTypeId]","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/72585f70-28b4d7d5384b3703.js" defer=""></script><script src="/_next/static/chunks/429-75740c7d201da3a4.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D/simulator-faeb6d2f77d97096.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]/simulator","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/e8e03c0d4003d1eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/e8e03c0d4003d1eb.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/e8e03c0d4003d1eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/e8e03c0d4003d1eb.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-480e426e4b1cfef3.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-09fb3b997ad1eb70.js" defer=""></script><script src="/_next/static/chunks/52d4c156-89c6ec6efca0a0bb.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/344-fdb3008f4bb3b0c1.js" defer=""></script><script src="/_next/static/chunks/256-07f768a2b19b0a0e.js" defer=""></script><script src="/_next/static/chunks/500-d3989390f5e8da53.js" defer=""></script><script src="/_next/static/chunks/484-3e011e79c41f0342.js" defer=""></script><script src="/_next/static/chunks/34-28725deef8b874b1.js" defer=""></script><script src="/_next/static/chunks/630-29fe0800ff72bf48.js" defer=""></script><script src="/_next/static/chunks/658-8231c0b729e0124a.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D-e973a443d8b8a75d.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/slices.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/efa5152b7c0f35c0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/efa5152b7c0f35c0.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><link rel="preload" href="/_next/static/css/efa5152b7c0f35c0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/efa5152b7c0f35c0.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-24ddb02bea621501.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-de87250a4e0c9fcf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3718a2c5ee36f46.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/52d4c156-89c6ec6efca0a0bb.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/344-fdb3008f4bb3b0c1.js" defer=""></script><script src="/_next/static/chunks/500-d3989390f5e8da53.js" defer=""></script><script src="/_next/static/chunks/34-28725deef8b874b1.js" defer=""></script><script src="/_next/static/chunks/658-8231c0b729e0124a.js" defer=""></script><script src="/_next/static/chunks/907-180eb33eefccc237.js" defer=""></script><script src="/_next/static/chunks/pages/slices-81c1c3f1bcad60f4.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_buildManifest.js" defer=""></script><script src="/_next/static/3cOO4HEvSau6Y1yz7EUS5/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices","query":{},"buildId":"3cOO4HEvSau6Y1yz7EUS5","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slice-machine-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.1-alpha.lg-page-routes.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A visual builder for your Slice Models with all the tools you need to generate data models and mock CMS content locally.",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"start-slicemachine": "./bin/start-slicemachine.cjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@slicemachine/manager": "0.25.
|
|
39
|
-
"start-slicemachine": "0.12.
|
|
38
|
+
"@slicemachine/manager": "0.25.6-alpha.lg-page-routes.1",
|
|
39
|
+
"start-slicemachine": "0.12.64-alpha.lg-page-routes.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@emotion/react": "11.11.1",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"yup": "0.32.11",
|
|
135
135
|
"zod": "3.23.8"
|
|
136
136
|
},
|
|
137
|
-
"stableVersion": "2.
|
|
137
|
+
"stableVersion": "2.19.0"
|
|
138
138
|
}
|
|
@@ -12,6 +12,7 @@ import { useRouter } from "next/router";
|
|
|
12
12
|
import { type FC, useState } from "react";
|
|
13
13
|
|
|
14
14
|
import { DeleteCustomTypeModal } from "@/legacy/components/DeleteCTModal";
|
|
15
|
+
import { CustomTypeRouteModal } from "@/legacy/components/Forms/CustomTypeRouteModal";
|
|
15
16
|
import { RenameCustomTypeModal } from "@/legacy/components/Forms/RenameCustomTypeModal";
|
|
16
17
|
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
17
18
|
|
|
@@ -38,6 +39,8 @@ export const EditDropdown: FC<EditDropdownProps> = ({
|
|
|
38
39
|
useState(false);
|
|
39
40
|
const [isRenameCustomTypeModalOpen, setIsRenameCustomTypeModalOpen] =
|
|
40
41
|
useState(false);
|
|
42
|
+
const [isCustomTypeRouteModalOpen, setIsCustomTypeRouteModalOpen] =
|
|
43
|
+
useState(false);
|
|
41
44
|
const [isCustomTypeBeingConverted, setCustomTypeBeingConverted] =
|
|
42
45
|
useState(false);
|
|
43
46
|
|
|
@@ -89,6 +92,16 @@ export const EditDropdown: FC<EditDropdownProps> = ({
|
|
|
89
92
|
>
|
|
90
93
|
Rename
|
|
91
94
|
</DropdownMenuItem>
|
|
95
|
+
{format === "page" && (
|
|
96
|
+
<DropdownMenuItem
|
|
97
|
+
startIcon={<Icon name="link" />}
|
|
98
|
+
onSelect={() => {
|
|
99
|
+
setIsCustomTypeRouteModalOpen(true);
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
Configure route
|
|
103
|
+
</DropdownMenuItem>
|
|
104
|
+
)}
|
|
92
105
|
{format === "custom" && !isChangesLocal && (
|
|
93
106
|
<DropdownMenuItem
|
|
94
107
|
startIcon={<Icon name="driveFileMove" />}
|
|
@@ -125,6 +138,15 @@ export const EditDropdown: FC<EditDropdownProps> = ({
|
|
|
125
138
|
setLocalCustomType={setLocalCustomType}
|
|
126
139
|
/>
|
|
127
140
|
) : null}
|
|
141
|
+
{isCustomTypeRouteModalOpen ? (
|
|
142
|
+
<CustomTypeRouteModal
|
|
143
|
+
// format={format}
|
|
144
|
+
customType={customType}
|
|
145
|
+
isChangesLocal={isChangesLocal}
|
|
146
|
+
onClose={() => setIsCustomTypeRouteModalOpen(false)}
|
|
147
|
+
setLocalCustomType={setLocalCustomType}
|
|
148
|
+
/>
|
|
149
|
+
) : null}
|
|
128
150
|
</>
|
|
129
151
|
);
|
|
130
152
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
+
import { CustomTypeFormat } from "@slicemachine/manager";
|
|
3
|
+
import { toast } from "react-toastify";
|
|
4
|
+
|
|
5
|
+
import { managerClient } from "@/managerClient";
|
|
6
|
+
|
|
7
|
+
import { CUSTOM_TYPES_MESSAGES } from "../customTypesMessages";
|
|
8
|
+
|
|
9
|
+
type UpdateCustomTypeRouteArgs = {
|
|
10
|
+
model: CustomType;
|
|
11
|
+
newRoute: string;
|
|
12
|
+
onSuccess: (updatedCustomType: CustomType) => void;
|
|
13
|
+
};
|
|
14
|
+
export async function updateCustomTypeRoute({
|
|
15
|
+
model,
|
|
16
|
+
newRoute,
|
|
17
|
+
onSuccess,
|
|
18
|
+
}: UpdateCustomTypeRouteArgs) {
|
|
19
|
+
const customTypesMessages =
|
|
20
|
+
CUSTOM_TYPES_MESSAGES[model.format as CustomTypeFormat];
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const updatedCustomType = {
|
|
24
|
+
...model,
|
|
25
|
+
route: newRoute,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const { errors } = await managerClient.customTypes.updateCustomTypeRoute({
|
|
29
|
+
model: updatedCustomType,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (errors.length > 0) {
|
|
33
|
+
throw errors;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onSuccess(updatedCustomType);
|
|
37
|
+
|
|
38
|
+
toast.success(
|
|
39
|
+
`${customTypesMessages.name({
|
|
40
|
+
start: true,
|
|
41
|
+
plural: false,
|
|
42
|
+
})} route updated`,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
//
|
|
46
|
+
} catch (e) {
|
|
47
|
+
const errorMessage = `Internal Error: ${customTypesMessages.name({
|
|
48
|
+
start: true,
|
|
49
|
+
plural: false,
|
|
50
|
+
})} could not be updated`;
|
|
51
|
+
|
|
52
|
+
console.error(errorMessage, e);
|
|
53
|
+
toast.error(errorMessage);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
createCustomType,
|
|
11
11
|
CustomTypeOrigin,
|
|
12
12
|
} from "@/features/customTypes/actions/createCustomType";
|
|
13
|
+
import { updateCustomTypeRoute } from "@/features/customTypes/actions/updateCustomTypeRoute";
|
|
13
14
|
import { CUSTOM_TYPES_CONFIG } from "@/features/customTypes/customTypesConfig";
|
|
14
15
|
import { CUSTOM_TYPES_MESSAGES } from "@/features/customTypes/customTypesMessages";
|
|
15
16
|
import { useOnboarding } from "@/features/onboarding/useOnboarding";
|
|
@@ -31,6 +32,7 @@ interface FormValues {
|
|
|
31
32
|
id: string;
|
|
32
33
|
label: string;
|
|
33
34
|
repeatable: boolean;
|
|
35
|
+
route: string;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
type CreateCustomTypeModalProps = {
|
|
@@ -50,7 +52,8 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
|
|
|
50
52
|
onCreateChange,
|
|
51
53
|
onOpenChange,
|
|
52
54
|
}) => {
|
|
53
|
-
const { createCustomTypeSuccess } =
|
|
55
|
+
const { createCustomTypeSuccess, saveCustomTypeSuccess } =
|
|
56
|
+
useSliceMachineActions();
|
|
54
57
|
const { completeStep } = useOnboarding();
|
|
55
58
|
|
|
56
59
|
const { customTypeIds, customTypeLabels } = useSelector(
|
|
@@ -64,7 +67,7 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
|
|
|
64
67
|
const { syncChanges } = useAutoSync();
|
|
65
68
|
const router = useRouter();
|
|
66
69
|
|
|
67
|
-
const onSubmit = async ({ id, label, repeatable }: FormValues) => {
|
|
70
|
+
const onSubmit = async ({ id, label, repeatable, route }: FormValues) => {
|
|
68
71
|
onCreateChange(true);
|
|
69
72
|
|
|
70
73
|
await createCustomType({
|
|
@@ -88,6 +91,17 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
|
|
|
88
91
|
syncChanges();
|
|
89
92
|
|
|
90
93
|
if (format === "page") void completeStep("createPageType");
|
|
94
|
+
|
|
95
|
+
if (format === "page") {
|
|
96
|
+
await updateCustomTypeRoute({
|
|
97
|
+
model: newCustomType,
|
|
98
|
+
newRoute: route,
|
|
99
|
+
onSuccess: (savedCustomType) => {
|
|
100
|
+
saveCustomTypeSuccess(savedCustomType);
|
|
101
|
+
syncChanges();
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
}
|
|
91
105
|
},
|
|
92
106
|
});
|
|
93
107
|
|
|
@@ -126,6 +140,17 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
|
|
|
126
140
|
setIsIdFieldPristine(false);
|
|
127
141
|
};
|
|
128
142
|
|
|
143
|
+
const handleRouteChange = (
|
|
144
|
+
e: React.ChangeEvent<HTMLInputElement>,
|
|
145
|
+
setFieldValue: (
|
|
146
|
+
field: string,
|
|
147
|
+
value: string,
|
|
148
|
+
shouldValidate?: boolean,
|
|
149
|
+
) => Promise<unknown>,
|
|
150
|
+
) => {
|
|
151
|
+
void setFieldValue("route", e.target.value);
|
|
152
|
+
};
|
|
153
|
+
|
|
129
154
|
return (
|
|
130
155
|
<ModalFormCard
|
|
131
156
|
testId="create-ct-modal"
|
|
@@ -145,12 +170,14 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
|
|
|
145
170
|
repeatable: true,
|
|
146
171
|
id: "",
|
|
147
172
|
label: "",
|
|
173
|
+
route: "",
|
|
148
174
|
}}
|
|
149
175
|
validate={({ id, label }) => {
|
|
150
176
|
const errors: FormikErrors<{
|
|
151
177
|
repeatable: boolean;
|
|
152
178
|
id: string;
|
|
153
179
|
label: string;
|
|
180
|
+
route: string;
|
|
154
181
|
}> = {};
|
|
155
182
|
|
|
156
183
|
if (!label || !label.length) {
|
|
@@ -231,6 +258,20 @@ export const CreateCustomTypeModal: React.FC<CreateCustomTypeModalProps> = ({
|
|
|
231
258
|
error={touched.id ? errors.id : undefined}
|
|
232
259
|
onChange={(e) => handleIdChange(e, setFieldValue)}
|
|
233
260
|
/>
|
|
261
|
+
{format === "page" && (
|
|
262
|
+
<InputBox
|
|
263
|
+
name="route"
|
|
264
|
+
testId="ct-route-input"
|
|
265
|
+
label={`${customTypesMessages.name({
|
|
266
|
+
start: true,
|
|
267
|
+
plural: false,
|
|
268
|
+
})} Route`}
|
|
269
|
+
placeholder="/your-route"
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
271
|
+
error={touched.route ? errors.route : undefined}
|
|
272
|
+
onChange={(e) => handleRouteChange(e, setFieldValue)}
|
|
273
|
+
/>
|
|
274
|
+
)}
|
|
234
275
|
</Box>
|
|
235
276
|
)}
|
|
236
277
|
</ModalFormCard>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { CustomType } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
+
import { FormikErrors } from "formik";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Box } from "theme-ui";
|
|
5
|
+
|
|
6
|
+
import { updateCustomTypeRoute } from "@/features/customTypes/actions/updateCustomTypeRoute";
|
|
7
|
+
import { useAutoSync } from "@/features/sync/AutoSyncProvider";
|
|
8
|
+
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
9
|
+
|
|
10
|
+
import ModalFormCard from "../../ModalFormCard";
|
|
11
|
+
import { InputBox } from "../components/InputBox";
|
|
12
|
+
|
|
13
|
+
interface CustomTypeRouteModalProps {
|
|
14
|
+
isChangesLocal: boolean;
|
|
15
|
+
customType: CustomType;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
setLocalCustomType?: (args: { customType: CustomType }) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const CustomTypeRouteModal: React.FC<CustomTypeRouteModalProps> = ({
|
|
21
|
+
isChangesLocal,
|
|
22
|
+
customType,
|
|
23
|
+
onClose,
|
|
24
|
+
setLocalCustomType,
|
|
25
|
+
}) => {
|
|
26
|
+
const customTypeName = customType?.label ?? "";
|
|
27
|
+
const customTypeId = customType?.id ?? "";
|
|
28
|
+
const { saveCustomTypeSuccess } = useSliceMachineActions();
|
|
29
|
+
const { syncChanges } = useAutoSync();
|
|
30
|
+
|
|
31
|
+
const [isUpdatingRoute, setIsUpdatingRoute] = useState(false);
|
|
32
|
+
|
|
33
|
+
const handleOnSubmit = async (values: { route: string }) => {
|
|
34
|
+
setIsUpdatingRoute(true);
|
|
35
|
+
if (isChangesLocal && setLocalCustomType) {
|
|
36
|
+
setLocalCustomType({
|
|
37
|
+
customType: { ...customType, route: values.route },
|
|
38
|
+
});
|
|
39
|
+
await updateCustomTypeRoute({
|
|
40
|
+
model: customType,
|
|
41
|
+
newRoute: values.route,
|
|
42
|
+
onSuccess: (savedCustomType) => {
|
|
43
|
+
saveCustomTypeSuccess(savedCustomType);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
await updateCustomTypeRoute({
|
|
48
|
+
model: customType,
|
|
49
|
+
newRoute: values.route,
|
|
50
|
+
onSuccess: (savedCustomType) => {
|
|
51
|
+
saveCustomTypeSuccess(savedCustomType);
|
|
52
|
+
syncChanges();
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
setIsUpdatingRoute(false);
|
|
57
|
+
onClose();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<ModalFormCard
|
|
62
|
+
isOpen
|
|
63
|
+
testId="rename-custom-type-modal"
|
|
64
|
+
widthInPx="530px"
|
|
65
|
+
formId={`rename-custom-type-modal-${customTypeId}`}
|
|
66
|
+
buttonLabel="Rename"
|
|
67
|
+
close={onClose}
|
|
68
|
+
onSubmit={(values) => void handleOnSubmit(values)}
|
|
69
|
+
initialValues={{
|
|
70
|
+
route: customType.route ?? "",
|
|
71
|
+
}}
|
|
72
|
+
isLoading={isUpdatingRoute}
|
|
73
|
+
content={{
|
|
74
|
+
title: `Configure route for ${customTypeName}`,
|
|
75
|
+
}}
|
|
76
|
+
validate={({ route: newRoute }: { route: string }) => {
|
|
77
|
+
const errors: FormikErrors<{
|
|
78
|
+
route: string;
|
|
79
|
+
}> = {};
|
|
80
|
+
|
|
81
|
+
if (!newRoute || !newRoute.length) {
|
|
82
|
+
errors.route = "Cannot be empty.";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return Object.keys(errors).length > 0 ? errors : undefined;
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{({ errors }) => (
|
|
89
|
+
<Box>
|
|
90
|
+
<InputBox
|
|
91
|
+
name="route"
|
|
92
|
+
label="Route"
|
|
93
|
+
placeholder="/test"
|
|
94
|
+
error={errors.route}
|
|
95
|
+
testId="custom-type-route-input"
|
|
96
|
+
/>
|
|
97
|
+
</Box>
|
|
98
|
+
)}
|
|
99
|
+
</ModalFormCard>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomTypeRouteModal } from "./CustomTypeRouteModal";
|
|
@@ -95,8 +95,8 @@ const EditModal = ({ close, data, fields, onSave, zoneType }) => {
|
|
|
95
95
|
),
|
|
96
96
|
};
|
|
97
97
|
} catch (e) {
|
|
98
|
-
|
|
99
|
-
return { err
|
|
98
|
+
const err = e instanceof Error ? e : new Error(String(e));
|
|
99
|
+
return { err };
|
|
100
100
|
}
|
|
101
101
|
})();
|
|
102
102
|
|