slice-machine-ui 1.23.2-beta.8 → 1.24.0
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/.depcheckrc +3 -0
- package/components/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/components/ChangesItems/ChangesItems.tsx +6 -2
- package/components/CustomTypeTable/changesPage.tsx +12 -7
- package/components/DeleteSliceModal/index.tsx +3 -0
- package/components/DeleteVariationModal/index.tsx +1 -0
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +4 -0
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -1
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +6 -1
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +3 -0
- package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +0 -1
- package/components/LoginModal/index.tsx +40 -2
- package/components/ModalFormCard/index.tsx +0 -1
- package/components/Navigation/ChangesItem.tsx +117 -0
- package/components/Navigation/Environment.tsx +51 -4
- package/components/Navigation/index.css.ts +1 -2
- package/components/Navigation/index.test.tsx +5 -85
- package/components/Navigation/index.tsx +32 -20
- package/components/ReviewModal/ReviewForm.tsx +0 -1
- package/lib/builders/SliceBuilder/index.tsx +3 -3
- package/lib/builders/common/EditModal/Form.jsx +0 -1
- package/lib/builders/common/Zone/Card/components/NewField.tsx +0 -1
- package/lib/models/common/ModelStatus/index.ts +25 -0
- package/out/404.html +1 -1
- package/out/_next/static/chunks/18539003-5f78714a35fde4a1.js +97 -0
- package/out/_next/static/chunks/25-3aa4d4b24167d340.js +1 -0
- package/out/_next/static/chunks/318-19dbcae10cdb6408.js +1 -0
- package/out/_next/static/chunks/727-de03055e40815a3a.js +1 -0
- package/out/_next/static/chunks/777-8c5507e3b119b5dc.js +8 -0
- package/out/_next/static/chunks/799-0af1215eb2b3c17e.js +1 -0
- package/out/_next/static/chunks/904-40686b0426716111.js +1 -0
- package/out/_next/static/chunks/pages/_app-bca191df4ac7078e.js +434 -0
- package/out/_next/static/chunks/pages/{changelog-afd18276fe018b24.js → changelog-cb1df3a70b20f1b8.js} +1 -1
- package/out/_next/static/chunks/pages/changes-ccfd715c2bdc4f83.js +1 -0
- package/out/_next/static/chunks/pages/{labs-ee206005948f8e87.js → labs-2adfb5127f9c4081.js} +1 -1
- package/out/_next/static/chunks/pages/settings-94bcd7422e8b237d.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-52c3e1f9d14160b8.js → simulator-aaf65fbec8f5839c.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-90bb2ea76d2abf42.js +1 -0
- package/out/_next/static/chunks/pages/slices-e0ce615c38e8338d.js +1 -0
- package/out/_next/static/css/39e089aad1742a3a.css +1 -0
- package/out/_next/static/css/{37153180c3b0dd66.css → 838fd8bb5a7c32b0.css} +1 -1
- package/out/_next/static/css/ca32882a5d2d8d88.css +1 -0
- package/out/_next/static/eNujlD43QIdmra7ggcNtK/_buildManifest.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/settings.html +1 -0
- 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 +10 -8
- package/pages/_app.tsx +34 -32
- package/pages/changes.tsx +27 -41
- package/pages/settings.tsx +1 -0
- package/postcss.config.js +10 -0
- package/src/components/FieldSet/FieldSet.stories.tsx +20 -11
- package/src/components/RelativeTime/RelativeTime.stories.tsx +25 -0
- package/src/components/RelativeTime/RelativeTime.tsx +40 -0
- package/src/components/RelativeTime/index.ts +1 -0
- package/src/components/SideNav/SideNav.css.ts +1 -1
- package/src/components/SideNav/SideNav.tsx +9 -5
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +31 -11
- package/src/domain/__tests__/customType.test.ts +26 -19
- package/src/domain/customType.ts +22 -5
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +4 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +11 -10
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +3 -3
- package/src/features/environments/actions/setEnvironment.ts +4 -4
- package/src/features/settings/SettingsPage.tsx +47 -0
- package/src/features/settings/git/ConnectGitRepository.tsx +126 -0
- package/src/features/settings/git/ConnectGitRepositoryBlankSlate.tsx +33 -0
- package/src/features/settings/git/GitOwnerSelect.tsx +71 -0
- package/src/features/settings/git/GitProvider.ts +40 -0
- package/src/features/settings/git/GitProviderConnectButtons.tsx +63 -0
- package/src/features/settings/git/GitRepositoriesList.tsx +76 -0
- package/src/features/settings/git/GitRepositoriesSearch.tsx +69 -0
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +85 -0
- package/src/features/settings/git/GitRepositoryDisconnectDialog.tsx +60 -0
- package/src/features/settings/git/useGitIntegrationExperiment.ts +8 -0
- package/src/features/settings/git/useGitOwners.ts +12 -0
- package/src/features/settings/git/useGitRepos.ts +24 -0
- package/src/features/settings/git/useLinkedGitRepos.ts +41 -0
- package/src/features/settings/git/useWriteAPIToken.ts +23 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +0 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +0 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +0 -1
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +12 -10
- package/src/features/sync/AutoSyncProvider.tsx +252 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css +17 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css.d.ts +5 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +58 -0
- package/src/features/sync/fetchUnSyncChanges.ts +40 -0
- package/src/features/sync/getUnSyncChanges.ts +144 -0
- package/src/features/sync/useUnSyncChanges.ts +32 -0
- package/src/hooks/useActionQueue.tsx +177 -0
- package/src/hooks/useAuthStatus.ts +12 -0
- package/src/hooks/useUser.ts +14 -0
- package/src/icons/SettingsIcon.tsx +19 -0
- package/src/icons/SyncFailed.tsx +30 -0
- package/src/icons/Synced.tsx +19 -0
- package/src/icons/Syncing.tsx +23 -0
- package/test/__testutils__/index.tsx +8 -5
- package/test/src/modules/__fixtures__/serverState.ts +1 -2
- package/components/Navigation/ChangesListItem.tsx +0 -74
- package/components/Navigation/ChangesRightElement.tsx +0 -33
- package/out/_next/static/chunks/18539003-5cc559566b738915.js +0 -97
- package/out/_next/static/chunks/25-01f422cea8066349.js +0 -1
- package/out/_next/static/chunks/318-387e3f23d717c53d.js +0 -1
- package/out/_next/static/chunks/376-7e784d6069e01654.js +0 -8
- package/out/_next/static/chunks/727-358d7fae68a880b3.js +0 -1
- package/out/_next/static/chunks/799-d95a93e965557aeb.js +0 -1
- package/out/_next/static/chunks/904-1ff7519adece2b55.js +0 -1
- package/out/_next/static/chunks/pages/_app-e31adcf75e9176d3.js +0 -432
- package/out/_next/static/chunks/pages/changes-92c84f6cac0285fd.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-608d206d10a719e3.js +0 -1
- package/out/_next/static/chunks/pages/slices-b0b58192a87df822.js +0 -1
- package/out/_next/static/css/200244e3e0463c39.css +0 -1
- package/out/_next/static/vxOhh_oqUIQ5PTSKUKgMR/_buildManifest.js +0 -1
- package/src/features/autoSave/useAutoSave.tsx +0 -177
- package/src/features/legacyState/actions/getLegacySliceMachineState.ts +0 -53
- package/src/features/legacyState/useLegacySliceMachineState.ts +0 -7
- package/src/hooks/useModelStatus.ts +0 -78
- package/src/hooks/useUnSyncChanges.ts +0 -88
- package/test/components/LoginModal.test.tsx +0 -67
- package/test/src/hooks/useModelStatus.test.ts +0 -115
- /package/out/_next/static/{vxOhh_oqUIQ5PTSKUKgMR → eNujlD43QIdmra7ggcNtK}/_ssgManifest.js +0 -0
- /package/src/features/{changes → sync}/actions/pushChanges.ts +0 -0
- /package/src/features/{changes → sync}/actions/trackPushChangesSuccess.ts +0 -0
|
@@ -8,9 +8,9 @@ import { telemetry } from "@src/apiClient";
|
|
|
8
8
|
import VideoItem from "@components/Navigation/VideoItem";
|
|
9
9
|
import { LightningIcon } from "@src/icons/Lightning";
|
|
10
10
|
import { MathPlusIcon } from "@src/icons/MathPlusIcon";
|
|
11
|
+
import { SettingsIcon } from "@src/icons/SettingsIcon";
|
|
11
12
|
import { CUSTOM_TYPES_CONFIG } from "@src/features/customTypes/customTypesConfig";
|
|
12
13
|
import {
|
|
13
|
-
SideNavSeparator,
|
|
14
14
|
SideNavLink,
|
|
15
15
|
SideNavListItem,
|
|
16
16
|
SideNavList,
|
|
@@ -26,9 +26,10 @@ import { SliceMachineStoreType } from "@src/redux/type";
|
|
|
26
26
|
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
27
27
|
import { getChangelog } from "@src/modules/environment";
|
|
28
28
|
import { CUSTOM_TYPES_MESSAGES } from "@src/features/customTypes/customTypesMessages";
|
|
29
|
+
import { useGitIntegrationExperiment } from "@src/features/settings/git/useGitIntegrationExperiment";
|
|
29
30
|
import { useRepositoryInformation } from "@src/hooks/useRepositoryInformation";
|
|
30
31
|
|
|
31
|
-
import {
|
|
32
|
+
import { ChangesItem } from "./ChangesItem";
|
|
32
33
|
import { Environment } from "./Environment";
|
|
33
34
|
|
|
34
35
|
import * as styles from "./index.css";
|
|
@@ -45,6 +46,7 @@ const Navigation: FC = () => {
|
|
|
45
46
|
useSliceMachineActions();
|
|
46
47
|
const { repositoryName, repositoryDomain, repositoryUrl } =
|
|
47
48
|
useRepositoryInformation();
|
|
49
|
+
const gitIntegrationExperiment = useGitIntegrationExperiment();
|
|
48
50
|
|
|
49
51
|
return (
|
|
50
52
|
<SideNav>
|
|
@@ -73,6 +75,8 @@ const Navigation: FC = () => {
|
|
|
73
75
|
href={repositoryUrl}
|
|
74
76
|
/>
|
|
75
77
|
|
|
78
|
+
<ChangesItem />
|
|
79
|
+
|
|
76
80
|
<SideNavList>
|
|
77
81
|
<SideNavListItem>
|
|
78
82
|
<SideNavLink
|
|
@@ -104,12 +108,6 @@ const Navigation: FC = () => {
|
|
|
104
108
|
/>
|
|
105
109
|
</SideNavListItem>
|
|
106
110
|
|
|
107
|
-
<SideNavSeparator />
|
|
108
|
-
|
|
109
|
-
<ChangesListItem />
|
|
110
|
-
|
|
111
|
-
<SideNavSeparator />
|
|
112
|
-
|
|
113
111
|
<SideNavListItem>
|
|
114
112
|
<SideNavLink
|
|
115
113
|
title="Slices"
|
|
@@ -141,17 +139,19 @@ const Navigation: FC = () => {
|
|
|
141
139
|
)}
|
|
142
140
|
|
|
143
141
|
<SideNavList position="bottom">
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
142
|
+
<SideNavListItem>
|
|
143
|
+
<SideNavLink
|
|
144
|
+
title="Invite team"
|
|
145
|
+
href={`${repositoryUrl}/settings/users`}
|
|
146
|
+
Icon={MathPlusIcon}
|
|
147
|
+
onClick={() => {
|
|
148
|
+
void telemetry.track({
|
|
149
|
+
event: "users-invite-button-clicked",
|
|
150
|
+
});
|
|
151
|
+
}}
|
|
152
|
+
target="_blank"
|
|
153
|
+
/>
|
|
154
|
+
</SideNavListItem>
|
|
155
155
|
|
|
156
156
|
<ErrorBoundary>
|
|
157
157
|
<Suspense>
|
|
@@ -162,11 +162,23 @@ const Navigation: FC = () => {
|
|
|
162
162
|
</Suspense>
|
|
163
163
|
</ErrorBoundary>
|
|
164
164
|
|
|
165
|
+
{gitIntegrationExperiment.eligible ? (
|
|
166
|
+
<SideNavListItem>
|
|
167
|
+
<SideNavLink
|
|
168
|
+
title="Settings"
|
|
169
|
+
href="/settings"
|
|
170
|
+
Icon={SettingsIcon}
|
|
171
|
+
active={router.asPath.startsWith("/settings")}
|
|
172
|
+
component={Link}
|
|
173
|
+
/>
|
|
174
|
+
</SideNavListItem>
|
|
175
|
+
) : undefined}
|
|
176
|
+
|
|
165
177
|
<SideNavListItem>
|
|
166
178
|
<SideNavLink
|
|
167
179
|
title="Changelog"
|
|
168
180
|
href="/changelog"
|
|
169
|
-
Icon={
|
|
181
|
+
Icon={LightningIcon}
|
|
170
182
|
active={router.asPath.startsWith("/changelog")}
|
|
171
183
|
component={Link}
|
|
172
184
|
RightElement={
|
|
@@ -21,7 +21,7 @@ import { useSliceState } from "@src/features/slices/sliceBuilder/SliceBuilderPro
|
|
|
21
21
|
import { AutoSaveStatusIndicator } from "@src/features/autoSave/AutoSaveStatusIndicator";
|
|
22
22
|
|
|
23
23
|
export const SliceBuilder: FC = () => {
|
|
24
|
-
const { slice,
|
|
24
|
+
const { slice, actionQueueStatus } = useSliceState();
|
|
25
25
|
|
|
26
26
|
const isSimulatorAvailableForFramework = useSelector(
|
|
27
27
|
selectIsSimulatorAvailableForFramework,
|
|
@@ -33,10 +33,10 @@ export const SliceBuilder: FC = () => {
|
|
|
33
33
|
<AppLayoutBackButton url="/slices" />
|
|
34
34
|
<AppLayoutBreadcrumb folder="Slices" page={slice.model.name} />
|
|
35
35
|
<AppLayoutActions>
|
|
36
|
-
<AutoSaveStatusIndicator status={
|
|
36
|
+
<AutoSaveStatusIndicator status={actionQueueStatus} />
|
|
37
37
|
<SimulatorButton
|
|
38
38
|
isSimulatorAvailableForFramework={isSimulatorAvailableForFramework}
|
|
39
|
-
disabled={
|
|
39
|
+
disabled={actionQueueStatus !== "done"}
|
|
40
40
|
/>
|
|
41
41
|
</AppLayoutActions>
|
|
42
42
|
</AppLayoutHeader>
|
|
@@ -13,7 +13,6 @@ const WidgetForm = ({
|
|
|
13
13
|
return (
|
|
14
14
|
<Box>
|
|
15
15
|
<Formik
|
|
16
|
-
validateOnChange
|
|
17
16
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
18
17
|
initialValues={initialValues}
|
|
19
18
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-assignment
|
|
@@ -117,3 +117,28 @@ export function computeModelStatus(
|
|
|
117
117
|
: compareCustomTypeLocalToRemote(model);
|
|
118
118
|
return { status, model };
|
|
119
119
|
}
|
|
120
|
+
|
|
121
|
+
export function computeStatuses(
|
|
122
|
+
models: LocalOrRemoteCustomType[],
|
|
123
|
+
userHasAccessToModels: boolean,
|
|
124
|
+
): { [sliceId: string]: ModelStatus };
|
|
125
|
+
export function computeStatuses(
|
|
126
|
+
models: LocalOrRemoteSlice[],
|
|
127
|
+
userHasAccessToModels: boolean,
|
|
128
|
+
): { [sliceId: string]: ModelStatus };
|
|
129
|
+
export function computeStatuses(
|
|
130
|
+
models: LocalOrRemoteModel[],
|
|
131
|
+
userHasAccessToModels: boolean,
|
|
132
|
+
) {
|
|
133
|
+
return models.reduce<{ [id: string]: ModelStatus }>(
|
|
134
|
+
(acc, model) => {
|
|
135
|
+
const { status } = computeModelStatus(model, userHasAccessToModels);
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
...acc,
|
|
139
|
+
[hasLocal(model) ? model.local.id : model.remote.id]: status,
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
{} as { [sliceId: string]: ModelStatus },
|
|
143
|
+
);
|
|
144
|
+
}
|
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/
|
|
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/39e089aad1742a3a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/39e089aad1742a3a.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-bca191df4ac7078e.js" defer=""></script><script src="/_next/static/chunks/pages/_error-69b4f498bafdd188.js" defer=""></script><script src="/_next/static/eNujlD43QIdmra7ggcNtK/_buildManifest.js" defer=""></script><script src="/_next/static/eNujlD43QIdmra7ggcNtK/_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":"eNujlD43QIdmra7ggcNtK","runtimeConfig":{"sentryEnvironment":"production"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|