-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Deploy button had unexpected behavior since Git data (`canPush`) was not properly updated using HMR. This PR makes sure that on Studio save, updated Git data is sent to Studio. A new type of HMR message was added between studio which handles exclusively Git data, as to not pollute the current HMR message type which is purely studio data from the studio data virtual module. Streamlined the deploy button playwright test to only screenshot the deploy button at three stages: before change, after change, and after deploy. J=SLAP-2944 TEST=manual,auto
- Loading branch information
Showing
24 changed files
with
102 additions
and
36 deletions.
There are no files selected for viewing
Binary file modified
BIN
-40.6 KB
(3.5%)
e2e-tests/__screenshots__/darwin/deploy.spec.ts/can-deploy-changes-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-37.4 KB
(4.0%)
e2e-tests/__screenshots__/darwin/deploy.spec.ts/can-deploy-changes-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-41.4 KB
(3.4%)
e2e-tests/__screenshots__/darwin/deploy.spec.ts/can-deploy-changes-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-43.3 KB
e2e-tests/__screenshots__/darwin/deploy.spec.ts/can-deploy-changes-4.png
Binary file not shown.
Binary file modified
BIN
-28 KB
(3.5%)
e2e-tests/__screenshots__/win32/deploy.spec.ts/can-deploy-changes-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-25.7 KB
(3.8%)
e2e-tests/__screenshots__/win32/deploy.spec.ts/can-deploy-changes-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-26.3 KB
(3.7%)
e2e-tests/__screenshots__/win32/deploy.spec.ts/can-deploy-changes-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-27.7 KB
e2e-tests/__screenshots__/win32/deploy.spec.ts/can-deploy-changes-4.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { GitData } from "@yext/studio-plugin"; | ||
|
||
const mockGitData: GitData = { | ||
canPush: { | ||
status: true, | ||
reason: "mock reason", | ||
}, | ||
}; | ||
export default mockGitData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { default as App } from "./App"; | ||
export { default as hotReloadStore } from "./store/hotReloadStore"; | ||
export { StudioHMRUpdateID } from "@yext/studio-plugin"; | ||
export { hotReloadStudioData, hotReloadGitData } from "./store/hotReloadStore"; | ||
export { StudioHMRUpdateID, GitDataHMRUpdateID } from "@yext/studio-plugin"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...store/models/slices/StudioEnvDataSlice.ts → ...i/src/store/models/slices/EnvDataSlice.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* A slice for containing environment data. | ||
*/ | ||
export default interface StudioEnvDataSlice { | ||
export default interface EnvDataSlice { | ||
isWithinCBD: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* A slice for containing environment data. | ||
*/ | ||
export default interface GitDataSlice { | ||
canPush: { | ||
status: boolean; | ||
reason?: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import EnvDataSlice from "../models/slices/EnvDataSlice"; | ||
import { SliceCreator } from "../models/utils"; | ||
import initialStudioData from "virtual_yext-studio"; | ||
|
||
const createEnvDataSlice: SliceCreator<EnvDataSlice> = () => ({ | ||
isWithinCBD: initialStudioData.isWithinCBD, | ||
}); | ||
|
||
export default createEnvDataSlice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import GitDataSlice from "../models/slices/GitDataSlice"; | ||
import { SliceCreator } from "../models/utils"; | ||
import initialGitData from "virtual_yext-studio-git-data"; | ||
|
||
const createGitDataSlice: SliceCreator<GitDataSlice> = () => ({ | ||
canPush: initialGitData.canPush, | ||
}); | ||
|
||
export default createGitDataSlice; |
9 changes: 0 additions & 9 deletions
9
packages/studio-ui/src/store/slices/createStudioEnvDataSlice.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters