slice-machine-ui 2.8.1-beta.1 → 2.8.1-beta.2
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/out/404.html +1 -1
- package/out/_next/static/9odHTDRwqbGU-9wLdN7o7/_buildManifest.js +1 -0
- package/out/_next/static/chunks/150-e3d2b02540447045.js +1 -0
- package/out/_next/static/chunks/{183-1298bf7953a6f2a0.js → 183-b1a9f55f45cb8d8e.js} +1 -1
- package/out/_next/static/chunks/{18539003-9b393c900c89e552.js → 18539003-c65c99f4e1d8f6a8.js} +3 -3
- package/out/_next/static/chunks/{372-cfee53700e416e09.js → 372-295e09136ef6fd8c.js} +1 -1
- package/out/_next/static/chunks/{441-76bd8e7cf8cc22da.js → 441-29739f872f8d0039.js} +6 -6
- package/out/_next/static/chunks/{627-092c9e4c99442c08.js → 479-6205c85aa978fc0b.js} +2 -2
- package/out/_next/static/chunks/50-586dc7ab5e584e76.js +1 -0
- package/out/_next/static/chunks/764-e040bcebe6027fea.js +1 -0
- package/out/_next/static/chunks/{772-db5f72095641ec1d.js → 772-58d0c8f8ae1c6791.js} +1 -1
- package/out/_next/static/chunks/{882-32959ffa63fa455c.js → 882-0286cc56ae67376e.js} +1 -1
- package/out/_next/static/chunks/{591-a272f15a4bf9830a.js → 918-38ab72e6ee071fec.js} +2 -2
- package/out/_next/static/chunks/pages/{_app-be6b83d484e3ae6f.js → _app-23712efc496c1618.js} +157 -157
- package/out/_next/static/chunks/pages/{changelog-86f30b15d852e710.js → changelog-f9055af0d38a0c24.js} +1 -1
- package/out/_next/static/chunks/pages/{changes-6c05ef623617785e.js → changes-5f02b3fe08918de1.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-fd2416081ef2ffca.js → [customTypeId]-2eb64c9ea82fcd0a.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-5de2dd7b9b93236e.js → custom-types-ddc20cfdd8049c04.js} +1 -1
- package/out/_next/static/chunks/pages/{index-2d7f95201a656c12.js → index-17f953c11b46cb20.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-81cf5c5f09fa0bda.js → labs-867606e5aff179cd.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-59e143620505f73f.js → [pageTypeId]-e5a5e6b345081e0a.js} +1 -1
- package/out/_next/static/chunks/pages/settings-80b9910a0643abb5.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-908e779f6d24760d.js → simulator-783b6577bd4e3728.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-0b6162eb591ee324.js → [variation]-743fc5c3feab52f8.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-317ec2bd3451566e.js → slices-0f6e50acfb5957ed.js} +1 -1
- package/out/_next/static/css/{4840a6c8541a6625.css → aeaa4dcbac2fb8d0.css} +1 -1
- package/out/_next/static/css/cc25c43805d5a292.css +1 -0
- 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/settings.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/settings/git/GitRepositoryConnectDialog.tsx +2 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +111 -114
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +134 -140
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +75 -72
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.tsx +91 -71
- package/src/legacy/components/Forms/formsValidator.ts +1 -1
- package/src/theme.ts +0 -4
- package/out/_next/static/3qbqGvjPz_LCGtwI1SVmH/_buildManifest.js +0 -1
- package/out/_next/static/chunks/150-96a0c443c430ec4b.js +0 -1
- package/out/_next/static/chunks/588-d017e0fe2a651a87.js +0 -1
- package/out/_next/static/chunks/750-aa35f21031ee1f96.js +0 -1
- package/out/_next/static/chunks/pages/settings-80e0d6f1c79282d3.js +0 -1
- package/out/_next/static/css/e5c7f63f02ff4d0f.css +0 -1
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css +0 -5
- package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.module.css.d.ts +0 -5
- /package/out/_next/static/{3qbqGvjPz_LCGtwI1SVmH → 9odHTDRwqbGU-9wLdN7o7}/_ssgManifest.js +0 -0
|
@@ -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/
|
|
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/cc25c43805d5a292.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc25c43805d5a292.css" data-n-g=""/><link rel="preload" href="/_next/static/css/850c81be38195a0f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/850c81be38195a0f.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-23712efc496c1618.js" defer=""></script><script src="/_next/static/chunks/59b4e022-8e544a511d670317.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-642bc2ece03445a4.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/183-b1a9f55f45cb8d8e.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/349-6ad3cca7ea294292.js" defer=""></script><script src="/_next/static/chunks/479-6205c85aa978fc0b.js" defer=""></script><script src="/_next/static/chunks/772-58d0c8f8ae1c6791.js" defer=""></script><script src="/_next/static/chunks/372-295e09136ef6fd8c.js" defer=""></script><script src="/_next/static/chunks/882-0286cc56ae67376e.js" defer=""></script><script src="/_next/static/chunks/150-e3d2b02540447045.js" defer=""></script><script src="/_next/static/chunks/pages/page-types/%5BpageTypeId%5D-e5a5e6b345081e0a.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_buildManifest.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_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":"9odHTDRwqbGU-9wLdN7o7","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/settings.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/
|
|
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/cc25c43805d5a292.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc25c43805d5a292.css" data-n-g=""/><link rel="preload" href="/_next/static/css/e5f781f20e24a5ea.css" as="style"/><link rel="stylesheet" href="/_next/static/css/e5f781f20e24a5ea.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-23712efc496c1618.js" defer=""></script><script src="/_next/static/chunks/pages/settings-80b9910a0643abb5.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_buildManifest.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/settings","query":{},"buildId":"9odHTDRwqbGU-9wLdN7o7","runtimeConfig":{"sentryEnvironment":"beta"},"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/
|
|
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/cc25c43805d5a292.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc25c43805d5a292.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-23712efc496c1618.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/18539003-c65c99f4e1d8f6a8.js" defer=""></script><script src="/_next/static/chunks/441-29739f872f8d0039.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D/simulator-783b6577bd4e3728.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_buildManifest.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_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":"9odHTDRwqbGU-9wLdN7o7","runtimeConfig":{"sentryEnvironment":"beta"},"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/
|
|
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/cc25c43805d5a292.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc25c43805d5a292.css" data-n-g=""/><link rel="preload" href="/_next/static/css/aeaa4dcbac2fb8d0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/aeaa4dcbac2fb8d0.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-23712efc496c1618.js" defer=""></script><script src="/_next/static/chunks/59b4e022-8e544a511d670317.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-642bc2ece03445a4.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/183-b1a9f55f45cb8d8e.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/349-6ad3cca7ea294292.js" defer=""></script><script src="/_next/static/chunks/772-58d0c8f8ae1c6791.js" defer=""></script><script src="/_next/static/chunks/882-0286cc56ae67376e.js" defer=""></script><script src="/_next/static/chunks/639-175fa5cb82faf87c.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D-743fc5c3feab52f8.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_buildManifest.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_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":"9odHTDRwqbGU-9wLdN7o7","runtimeConfig":{"sentryEnvironment":"beta"},"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/
|
|
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/cc25c43805d5a292.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc25c43805d5a292.css" data-n-g=""/><link rel="preload" href="/_next/static/css/b5323377600915db.css" as="style"/><link rel="stylesheet" href="/_next/static/css/b5323377600915db.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-23712efc496c1618.js" defer=""></script><script src="/_next/static/chunks/59b4e022-8e544a511d670317.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/772-58d0c8f8ae1c6791.js" defer=""></script><script src="/_next/static/chunks/639-175fa5cb82faf87c.js" defer=""></script><script src="/_next/static/chunks/pages/slices-0f6e50acfb5957ed.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_buildManifest.js" defer=""></script><script src="/_next/static/9odHTDRwqbGU-9wLdN7o7/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices","query":{},"buildId":"9odHTDRwqbGU-9wLdN7o7","runtimeConfig":{"sentryEnvironment":"beta"},"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.8.1-beta.
|
|
3
|
+
"version": "2.8.1-beta.2",
|
|
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": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@radix-ui/react-visually-hidden": "1.0.3",
|
|
39
|
-
"@slicemachine/manager": "0.20.7-beta.
|
|
40
|
-
"start-slicemachine": "0.12.31-beta.
|
|
39
|
+
"@slicemachine/manager": "0.20.7-beta.2",
|
|
40
|
+
"start-slicemachine": "0.12.31-beta.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@emotion/react": "11.11.1",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@prismicio/client": "7.11.0",
|
|
46
46
|
"@prismicio/editor-fields": "0.4.49",
|
|
47
47
|
"@prismicio/editor-support": "0.4.49",
|
|
48
|
-
"@prismicio/editor-ui": "0.4.
|
|
48
|
+
"@prismicio/editor-ui": "0.4.49",
|
|
49
49
|
"@prismicio/mock": "0.3.3",
|
|
50
50
|
"@prismicio/mocks": "2.4.0",
|
|
51
51
|
"@prismicio/simulator": "0.1.4",
|
|
@@ -25,6 +25,8 @@ type GitRepositoryConnectDialogProps = {
|
|
|
25
25
|
trigger: ReactNode;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
// TODO: Update form to make it work with editor-ui Form component when
|
|
29
|
+
// we start to work again on Git integration
|
|
28
30
|
export const GitRepositoryConnectDialog: FC<
|
|
29
31
|
GitRepositoryConnectDialogProps
|
|
30
32
|
> = ({ linkRepo, repo, trigger }) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useOnChange } from "@prismicio/editor-support/React";
|
|
1
2
|
import {
|
|
2
3
|
Box,
|
|
3
4
|
Dialog,
|
|
@@ -6,17 +7,20 @@ import {
|
|
|
6
7
|
DialogCancelButton,
|
|
7
8
|
DialogContent,
|
|
8
9
|
DialogHeader,
|
|
10
|
+
Form,
|
|
9
11
|
FormInput,
|
|
10
12
|
ScrollArea,
|
|
11
13
|
Select,
|
|
12
14
|
SelectItem,
|
|
13
15
|
Text,
|
|
14
16
|
} from "@prismicio/editor-ui";
|
|
15
|
-
import {
|
|
16
|
-
import type { FC } from "react";
|
|
17
|
+
import { type FC, useState } from "react";
|
|
17
18
|
import { useSelector } from "react-redux";
|
|
18
19
|
|
|
19
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
SliceModalValuesValidity,
|
|
22
|
+
validateSliceModalValues as validateAsNewSliceValues,
|
|
23
|
+
} from "@/legacy/components/Forms/formsValidator";
|
|
20
24
|
import { pascalize } from "@/legacy/lib/utils/str";
|
|
21
25
|
import { getRemoteSlices } from "@/modules/slices";
|
|
22
26
|
import { SliceMachineStoreType } from "@/redux/type";
|
|
@@ -24,6 +28,11 @@ import { SliceMachineStoreType } from "@/redux/type";
|
|
|
24
28
|
import styles from "./ConvertLegacySliceButton.module.css";
|
|
25
29
|
import { DialogProps } from "./types";
|
|
26
30
|
|
|
31
|
+
type FormValues = {
|
|
32
|
+
from: string;
|
|
33
|
+
sliceName: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
27
36
|
export const ConvertLegacySliceAsNewSliceDialog: FC<DialogProps> = ({
|
|
28
37
|
isOpen,
|
|
29
38
|
close,
|
|
@@ -36,6 +45,36 @@ export const ConvertLegacySliceAsNewSliceDialog: FC<DialogProps> = ({
|
|
|
36
45
|
remoteSlices: getRemoteSlices(store),
|
|
37
46
|
}));
|
|
38
47
|
|
|
48
|
+
const defaultValues = {
|
|
49
|
+
from: libraries[0]?.name,
|
|
50
|
+
sliceName: pascalize(slice.key),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const [values, setValues] = useState<FormValues>(defaultValues);
|
|
54
|
+
const [errors, setErrors] = useState<SliceModalValuesValidity>();
|
|
55
|
+
|
|
56
|
+
useOnChange(isOpen, () => {
|
|
57
|
+
if (!isOpen) {
|
|
58
|
+
setValues(defaultValues);
|
|
59
|
+
setErrors(undefined);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
function handleValueChange(values: FormValues) {
|
|
64
|
+
setValues(values);
|
|
65
|
+
setErrors(
|
|
66
|
+
validateAsNewSliceValues(values, libraries, remoteSlices, "create"),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function handleSubmit() {
|
|
71
|
+
if (errors && Object.keys(errors).length > 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
onSubmit({ libraryID: values.from, sliceID: values.sliceName });
|
|
76
|
+
}
|
|
77
|
+
|
|
39
78
|
return (
|
|
40
79
|
<Dialog
|
|
41
80
|
open={isOpen}
|
|
@@ -44,117 +83,75 @@ export const ConvertLegacySliceAsNewSliceDialog: FC<DialogProps> = ({
|
|
|
44
83
|
>
|
|
45
84
|
<DialogHeader title="Upgrade slice" />
|
|
46
85
|
<DialogContent>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</Text>
|
|
117
|
-
) : null}
|
|
118
|
-
</label>
|
|
119
|
-
<Select
|
|
120
|
-
size="medium"
|
|
121
|
-
color="grey"
|
|
122
|
-
startIcon="folder"
|
|
123
|
-
flexContent={true}
|
|
124
|
-
value={formik.values.from}
|
|
125
|
-
onValueChange={(value) =>
|
|
126
|
-
value
|
|
127
|
-
? void formik.setFieldValue("from", value)
|
|
128
|
-
: null
|
|
129
|
-
}
|
|
130
|
-
>
|
|
131
|
-
{libraries.map((library) => (
|
|
132
|
-
<SelectItem key={library.name} value={library.name}>
|
|
133
|
-
{library.name}
|
|
134
|
-
</SelectItem>
|
|
135
|
-
))}
|
|
136
|
-
</Select>
|
|
137
|
-
<Text variant="normal" color="grey11">
|
|
138
|
-
The library where we'll store your slice
|
|
139
|
-
</Text>
|
|
140
|
-
</Box>
|
|
141
|
-
</ScrollArea>
|
|
142
|
-
<DialogActions>
|
|
143
|
-
<DialogCancelButton size="medium" />
|
|
144
|
-
<DialogActionButton
|
|
145
|
-
size="medium"
|
|
146
|
-
loading={isLoading}
|
|
147
|
-
disabled={!formik.isValid}
|
|
148
|
-
onClick={() => void formik.submitForm()}
|
|
149
|
-
>
|
|
150
|
-
Upgrade
|
|
151
|
-
</DialogActionButton>
|
|
152
|
-
</DialogActions>
|
|
153
|
-
</Box>
|
|
154
|
-
</form>
|
|
155
|
-
);
|
|
156
|
-
}}
|
|
157
|
-
</Formik>
|
|
86
|
+
<Form onSubmit={handleSubmit}>
|
|
87
|
+
<Box flexDirection="column">
|
|
88
|
+
<ScrollArea className={styles.scrollArea}>
|
|
89
|
+
<Text variant="normal" color="grey11">
|
|
90
|
+
This will create a new slice with the same fields. The new slice
|
|
91
|
+
will replace the legacy slice in all of your types, and the
|
|
92
|
+
existing slice content will be re-mapped to the new slice.
|
|
93
|
+
</Text>
|
|
94
|
+
<Text variant="normal" color="grey11">
|
|
95
|
+
This will not migrate your component. You will need to do that
|
|
96
|
+
manually.
|
|
97
|
+
</Text>
|
|
98
|
+
<Box flexDirection="column" gap={4}>
|
|
99
|
+
<FormInput
|
|
100
|
+
label="Slice name *"
|
|
101
|
+
placeholder={`Pascalised Slice API ID (e.g. ${pascalize(
|
|
102
|
+
slice.key,
|
|
103
|
+
)})`}
|
|
104
|
+
error={errors?.sliceName}
|
|
105
|
+
value={values.sliceName}
|
|
106
|
+
onValueChange={(value) =>
|
|
107
|
+
handleValueChange({
|
|
108
|
+
...values,
|
|
109
|
+
sliceName: value.slice(0, 30),
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
data-testid="slice-name-input"
|
|
113
|
+
/>
|
|
114
|
+
<Text variant="normal" color="grey11">
|
|
115
|
+
A display name for the slice
|
|
116
|
+
</Text>
|
|
117
|
+
</Box>
|
|
118
|
+
<Box flexDirection="column" gap={4}>
|
|
119
|
+
<label className={styles.label}>
|
|
120
|
+
<Text variant="bold">Slice library *</Text>
|
|
121
|
+
</label>
|
|
122
|
+
<Select
|
|
123
|
+
size="medium"
|
|
124
|
+
color="grey"
|
|
125
|
+
startIcon="folder"
|
|
126
|
+
flexContent={true}
|
|
127
|
+
value={values.from}
|
|
128
|
+
onValueChange={(value) => {
|
|
129
|
+
if (value) handleValueChange({ ...values, from: value });
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
{libraries.map((library) => (
|
|
133
|
+
<SelectItem key={library.name} value={library.name}>
|
|
134
|
+
{library.name}
|
|
135
|
+
</SelectItem>
|
|
136
|
+
))}
|
|
137
|
+
</Select>
|
|
138
|
+
<Text variant="normal" color="grey11">
|
|
139
|
+
The library where we'll store your slice
|
|
140
|
+
</Text>
|
|
141
|
+
</Box>
|
|
142
|
+
</ScrollArea>
|
|
143
|
+
<DialogActions>
|
|
144
|
+
<DialogCancelButton size="medium" />
|
|
145
|
+
<DialogActionButton
|
|
146
|
+
size="medium"
|
|
147
|
+
loading={isLoading}
|
|
148
|
+
disabled={errors && Object.keys(errors).length > 0}
|
|
149
|
+
>
|
|
150
|
+
Upgrade
|
|
151
|
+
</DialogActionButton>
|
|
152
|
+
</DialogActions>
|
|
153
|
+
</Box>
|
|
154
|
+
</Form>
|
|
158
155
|
</DialogContent>
|
|
159
156
|
</Dialog>
|
|
160
157
|
);
|