slice-machine-ui 1.21.2-dev-next-release.2 → 1.21.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/components/ChangesEmptyState/AuthErrorPage.tsx +46 -30
- package/components/Navigation/Environment.tsx +11 -3
- package/components/Navigation/index.tsx +8 -1
- package/out/404.html +1 -1
- package/out/_next/static/{rN76VAX6aeevNZTdoisFL → MdTAsVD-20JKDPs1agyRg}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/pages/{_app-f8ca304572f8be54.js → _app-02e85fec42f453b0.js} +2 -2
- package/out/_next/static/chunks/pages/changes-58e202426cfeb11f.js +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/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/pages/_app.tsx +28 -20
- package/pages/changes.tsx +1 -1
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +17 -10
- package/out/_next/static/chunks/pages/changes-64686146a8087d29.js +0 -1
- /package/out/_next/static/{rN76VAX6aeevNZTdoisFL → MdTAsVD-20JKDPs1agyRg}/_ssgManifest.js +0 -0
|
@@ -1,36 +1,52 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import { Box, Button, Text, TextLink } from "@prismicio/editor-ui";
|
|
3
|
+
|
|
1
4
|
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
2
|
-
import
|
|
3
|
-
|
|
5
|
+
import { AuthStatus } from "@src/modules/userContext/types";
|
|
6
|
+
|
|
7
|
+
export type AuthErrorPageProps = {
|
|
8
|
+
authStatus: AuthStatus.UNAUTHORIZED | AuthStatus.FORBIDDEN;
|
|
9
|
+
};
|
|
4
10
|
|
|
5
|
-
export const AuthErrorPage = () => {
|
|
11
|
+
export const AuthErrorPage: FC<AuthErrorPageProps> = (props) => {
|
|
12
|
+
const { authStatus } = props;
|
|
6
13
|
const { openLoginModal } = useSliceMachineActions();
|
|
14
|
+
|
|
7
15
|
return (
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
<Box
|
|
17
|
+
flexDirection="column"
|
|
18
|
+
height="100%"
|
|
19
|
+
alignItems="center"
|
|
20
|
+
justifyContent="center"
|
|
21
|
+
gap={8}
|
|
22
|
+
>
|
|
23
|
+
{authStatus === AuthStatus.FORBIDDEN ? (
|
|
24
|
+
<>
|
|
25
|
+
<Text variant="h3">It seems like you are logged out</Text>
|
|
26
|
+
<Text>Log in to connect to your repository.</Text>
|
|
27
|
+
</>
|
|
28
|
+
) : (
|
|
29
|
+
<>
|
|
30
|
+
<Text variant="h3">
|
|
31
|
+
It seems like you don't have access to this repository
|
|
32
|
+
</Text>
|
|
33
|
+
<Text>
|
|
34
|
+
Check that the repository name is correct, then contact your
|
|
35
|
+
repository administrator.
|
|
36
|
+
</Text>
|
|
37
|
+
</>
|
|
38
|
+
)}
|
|
39
|
+
<Text>
|
|
40
|
+
If that doesn't work, it's possible that Slice Machine is having trouble
|
|
41
|
+
accessing Prismic's servers.{" "}
|
|
42
|
+
<TextLink href="https://community.prismic.io/">
|
|
43
|
+
Contact our support team
|
|
44
|
+
</TextLink>
|
|
45
|
+
.
|
|
46
|
+
</Text>
|
|
47
|
+
{authStatus === AuthStatus.FORBIDDEN && (
|
|
48
|
+
<Button onClick={() => openLoginModal()}>Log in to Prismic</Button>
|
|
49
|
+
)}
|
|
50
|
+
</Box>
|
|
35
51
|
);
|
|
36
52
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Environment as EnvironmentType } from "@slicemachine/manager/client";
|
|
2
2
|
|
|
3
3
|
import { telemetry } from "@src/apiClient";
|
|
4
|
-
|
|
5
4
|
import { useEnvironments } from "@src/features/environments/useEnvironments";
|
|
6
5
|
import { setEnvironment } from "@src/features/environments/actions/setEnvironment";
|
|
7
6
|
import { useActiveEnvironment } from "@src/features/environments/useActiveEnvironment";
|
|
8
7
|
import { getLegacySliceMachineState } from "@src/features/legacyState/actions/getLegacySliceMachineState";
|
|
9
8
|
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
10
|
-
|
|
11
9
|
import { SideNavEnvironmentSelector } from "@src/components/SideNav";
|
|
10
|
+
import { useNetwork } from "@src/hooks/useNetwork";
|
|
12
11
|
|
|
13
12
|
export function Environment() {
|
|
14
13
|
const { environments, error: useEnvironmentsError } = useEnvironments();
|
|
15
14
|
const { activeEnvironment } = useActiveEnvironment();
|
|
16
15
|
const { refreshState, openLoginModal } = useSliceMachineActions();
|
|
16
|
+
const isOnline = useNetwork();
|
|
17
17
|
|
|
18
18
|
async function onSelect(environment: EnvironmentType) {
|
|
19
19
|
void telemetry.track({
|
|
@@ -28,6 +28,10 @@ export function Environment() {
|
|
|
28
28
|
refreshState(legacySliceMachineState);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
if (!isOnline) {
|
|
32
|
+
return <SideNavEnvironmentSelector variant="offline" />;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
if (useEnvironmentsError === undefined) {
|
|
32
36
|
return (
|
|
33
37
|
<SideNavEnvironmentSelector
|
|
@@ -47,7 +51,11 @@ export function Environment() {
|
|
|
47
51
|
) {
|
|
48
52
|
return (
|
|
49
53
|
<SideNavEnvironmentSelector
|
|
50
|
-
variant=
|
|
54
|
+
variant={
|
|
55
|
+
useEnvironmentsError.name === "UnauthenticatedError"
|
|
56
|
+
? "unauthenticated"
|
|
57
|
+
: "unauthorized"
|
|
58
|
+
}
|
|
51
59
|
onLogInClick={() => openLoginModal()}
|
|
52
60
|
/>
|
|
53
61
|
);
|
|
@@ -48,7 +48,14 @@ const Navigation: FC = () => {
|
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<SideNav>
|
|
51
|
-
<ErrorBoundary
|
|
51
|
+
<ErrorBoundary
|
|
52
|
+
onError={(error) => {
|
|
53
|
+
console.error(
|
|
54
|
+
`An error occurred while rendering the environments switch`,
|
|
55
|
+
error,
|
|
56
|
+
);
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
52
59
|
<Suspense>
|
|
53
60
|
<Environment />
|
|
54
61
|
</Suspense>
|
package/out/404.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/cf7719d67ec45489.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cf7719d67ec45489.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.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/cf7719d67ec45489.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cf7719d67ec45489.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-02e85fec42f453b0.js" defer=""></script><script src="/_next/static/chunks/pages/_error-69b4f498bafdd188.js" defer=""></script><script src="/_next/static/MdTAsVD-20JKDPs1agyRg/_buildManifest.js" defer=""></script><script src="/_next/static/MdTAsVD-20JKDPs1agyRg/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"MdTAsVD-20JKDPs1agyRg","runtimeConfig":{"sentryEnvironment":"production"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,u,l,
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,u,l,b){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[c,i,n,"static/chunks/pages/index-d8e3a2c0d712904f.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":["static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-4b8369d91d82b28b.js"],"/changes":[a,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38d08f1e885b222d.js",s,e,"static/css/78250665d395ea50.css","static/chunks/pages/changes-58e202426cfeb11f.js"],"/custom-types":[c,i,n,"static/chunks/pages/custom-types-2f5664d9492b13fb.js"],"/custom-types/[customTypeId]":[u,s,c,t,l,b,"static/chunks/pages/custom-types/[customTypeId]-3a37eb3373bb8823.js"],"/labs":["static/chunks/pages/labs-2922105ab714d32a.js"],"/page-types/[pageTypeId]":[u,s,c,t,l,b,"static/chunks/pages/page-types/[pageTypeId]-733f3890c0466a05.js"],"/slices":[a,s,e,"static/css/58a89606d9ca9093.css","static/chunks/pages/slices-93b7af2624c85b8e.js"],"/slices/[lib]/[sliceName]/[variation]":[a,s,e,t,"static/css/31841735992dea23.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-3d8beb33e88d9e35.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[a,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-5d8b6a04053638af.js","static/chunks/505-fa47e200ac3a012d.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-7b17cb59d0db03b5.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/958-7352113230cf4059.js","static/chunks/550-abf97d3008006056.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/80-72d903b2a0bd5dc3.js","static/chunks/482-2b96f646465808a7.js","static/chunks/840-6e00e3fb69984e18.js","static/css/b0be58d878c0fac3.css","static/chunks/474-9a64c602aba34ae5.js","static/chunks/904-41d6e45ae563ffc0.js","static/css/5d18ccf403d4649a.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|