slice-machine-ui 2.18.1-beta.7 → 2.18.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/out/404.html +1 -1
- package/out/_next/static/{Zy4opMpDS8I-mxQ1kA3m2 → JnNsFjiOtQSOKhLcOb3-p}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/{248-43faecb386a16518.js → 248-a9c33f7fbe2da2f1.js} +1 -1
- package/out/_next/static/chunks/34-50c64778da33cff6.js +1 -0
- package/out/_next/static/chunks/429-aab52070cad2884b.js +3 -0
- package/out/_next/static/chunks/{489-234ed5471aa694b3.js → 489-a046ae0fa4f74435.js} +1 -1
- package/out/_next/static/chunks/{630-bb6e3db525588f16.js → 630-eae75e90b30f201a.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-64feff311539f17b.js → _app-1b4541325b4a29ab.js} +40 -40
- package/out/_next/static/chunks/pages/{changelog-ba55ed247c20dc21.js → changelog-3901f2fc937d9648.js} +1 -1
- package/out/_next/static/chunks/pages/changes-c58a60af39167147.js +1 -0
- package/out/_next/static/chunks/pages/{labs-78ac01d97ab02cd7.js → labs-dd04033db23a58f3.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-b127d948a17968d3.js → simulator-f237aaa755dc9a99.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-da423aa0da7bc11e.js → [variation]-c8c3e7ffb898261c.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-59b857edc9f72d5f.js → slices-0aaae79dcc7b8c55.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 -5
- package/src/features/auth/LogoutButton.tsx +42 -36
- package/src/features/builder/fields/contentRelationship/ContentRelationshipFieldPicker.tsx +3 -3
- package/src/features/changes/StatusBadge.tsx +1 -9
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +3 -3
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +3 -3
- package/src/features/environments/actions/useSetEnvironment.ts +22 -0
- package/src/features/environments/useActiveEnvironment.ts +17 -9
- package/src/features/environments/useEnvironments.ts +11 -8
- package/src/features/errorBoundaries/AppStateErrorBoundary.tsx +108 -0
- package/src/{ErrorBoundary.tsx → features/errorBoundaries/DefaultErrorBoundary.tsx} +2 -2
- package/src/features/errorBoundaries/index.ts +2 -0
- package/src/features/labs/labsList/LabsPage.tsx +3 -3
- package/src/features/navigation/Navigation.tsx +7 -8
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -3
- package/src/features/sync/AutoSyncProvider.tsx +2 -2
- package/src/features/sync/getUnSyncChanges.ts +1 -3
- package/src/legacy/components/AppLayout/index.tsx +10 -85
- package/src/legacy/components/ChangesEmptyState/UnauthenticatedView.tsx +31 -0
- package/src/legacy/components/ChangesEmptyState/index.ts +1 -1
- package/src/legacy/components/ChangesItems/ChangesItems.tsx +3 -3
- package/src/legacy/components/LoginModal/index.tsx +14 -6
- package/src/legacy/components/Navigation/ChangesItem.tsx +2 -6
- package/src/legacy/components/Navigation/Environment.tsx +2 -7
- package/src/legacy/components/Navigation/SideNavEnvironmentSelector/SideNavEnvironmentSelector.tsx +3 -8
- package/src/legacy/components/Simulator/index.tsx +3 -3
- package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -3
- package/src/modules/userContext/index.ts +5 -5
- package/src/modules/userContext/types.ts +2 -3
- package/src/pages/_app.tsx +93 -95
- package/src/pages/changes.tsx +4 -5
- package/src/queryClient.tsx +24 -0
- package/test/__testutils__/index.tsx +13 -10
- package/out/_next/static/chunks/157-fa8b348c960c8283.js +0 -3
- package/out/_next/static/chunks/34-8d9d9b2944824750.js +0 -1
- package/out/_next/static/chunks/pages/changes-4c23263cdc8e59c6.js +0 -1
- package/src/features/environments/actions/setEnvironment.ts +0 -18
- package/src/legacy/components/ChangesEmptyState/AuthErrorPage.tsx +0 -44
- /package/out/_next/static/{Zy4opMpDS8I-mxQ1kA3m2 → JnNsFjiOtQSOKhLcOb3-p}/_ssgManifest.js +0 -0
package/src/pages/changes.tsx
CHANGED
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
AppLayoutHeader,
|
|
26
26
|
} from "@/legacy/components/AppLayout";
|
|
27
27
|
import {
|
|
28
|
-
AuthErrorPage,
|
|
29
28
|
OfflinePage,
|
|
29
|
+
UnauthenticatedView,
|
|
30
30
|
} from "@/legacy/components/ChangesEmptyState";
|
|
31
31
|
import { ChangesItems } from "@/legacy/components/ChangesItems";
|
|
32
32
|
import {
|
|
@@ -114,8 +114,8 @@ const Changes: React.FunctionComponent = () => {
|
|
|
114
114
|
if (!isOnline) {
|
|
115
115
|
return <OfflinePage />;
|
|
116
116
|
}
|
|
117
|
-
if (authStatus === AuthStatus.
|
|
118
|
-
return <
|
|
117
|
+
if (authStatus === AuthStatus.UNAUTHENTICATED) {
|
|
118
|
+
return <UnauthenticatedView />;
|
|
119
119
|
}
|
|
120
120
|
if (numberOfChanges === 0) {
|
|
121
121
|
return (
|
|
@@ -160,8 +160,7 @@ const Changes: React.FunctionComponent = () => {
|
|
|
160
160
|
disabled={
|
|
161
161
|
numberOfChanges === 0 ||
|
|
162
162
|
!isOnline ||
|
|
163
|
-
authStatus
|
|
164
|
-
authStatus === AuthStatus.FORBIDDEN ||
|
|
163
|
+
authStatus !== AuthStatus.AUTHENTICATED ||
|
|
165
164
|
isSyncing
|
|
166
165
|
}
|
|
167
166
|
loading={isSyncing}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
QueryClient,
|
|
3
|
+
QueryClientProvider as RCQueryClientProvider,
|
|
4
|
+
} from "@tanstack/react-query";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
export const queryClient = new QueryClient({
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
queries: {
|
|
10
|
+
staleTime: 5 * 60 * 1000,
|
|
11
|
+
gcTime: 10 * 60 * 1000,
|
|
12
|
+
retry: false,
|
|
13
|
+
refetchOnWindowFocus: "always",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export function QueryClientProvider(props: { children: ReactNode }) {
|
|
19
|
+
return (
|
|
20
|
+
<RCQueryClientProvider client={queryClient}>
|
|
21
|
+
{props.children}
|
|
22
|
+
</RCQueryClientProvider>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -5,7 +5,8 @@ import { Provider } from "react-redux";
|
|
|
5
5
|
import { AnyAction, Store } from "redux";
|
|
6
6
|
import { BaseStyles, ThemeProvider as ThemeUIThemeProvider } from "theme-ui";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { DefaultErrorBoundary } from "@/features/errorBoundaries";
|
|
9
|
+
import { QueryClientProvider } from "@/queryClient";
|
|
9
10
|
|
|
10
11
|
import configureStore from "../../src/redux/store";
|
|
11
12
|
import type { SliceMachineStoreType } from "../../src/redux/type";
|
|
@@ -44,15 +45,17 @@ function render(
|
|
|
44
45
|
children: any;
|
|
45
46
|
}) {
|
|
46
47
|
return (
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
<QueryClientProvider>
|
|
49
|
+
<ThemeUIThemeProvider theme={theme}>
|
|
50
|
+
<TooltipProvider>
|
|
51
|
+
<BaseStyles>
|
|
52
|
+
<Provider store={store}>
|
|
53
|
+
<DefaultErrorBoundary>{children}</DefaultErrorBoundary>
|
|
54
|
+
</Provider>
|
|
55
|
+
</BaseStyles>
|
|
56
|
+
</TooltipProvider>
|
|
57
|
+
</ThemeUIThemeProvider>
|
|
58
|
+
</QueryClientProvider>
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
return {
|