Skip to content

Commit f4a5d0c

Browse files
committed
Merge branch 'dev' into feature/2132-workflow-status
2 parents 6acaa93 + ec07673 commit f4a5d0c

File tree

46 files changed

+2387
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2387
-1101
lines changed

cypress/e2e/settings/actions.spec.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ describe("Settings Actions", () => {
2222
cy.get("[data-cy=SubApp] .MuiSelect-select").first().click();
2323
cy.get(".MuiList-root li[aria-selected=false]").last().click();
2424
cy.get("#SaveSettings").click();
25-
cy.contains(SAVED_MESSAGE).should("exist");
25+
cy.get('[data-cy="ConfirmSaveSettings"]').should("exist");
26+
cy.get('[data-cy="ConfirmSaveSettings"]').click();
27+
cy.contains(SAVED_MESSAGE, { matchCase: false, timeout: 15_000 }).should(
28+
"exist"
29+
);
2630
});
2731

2832
// skipping flakey test in preparation for CI

cypress/e2e/settings/instance.spec.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ describe("Instance", () => {
1010
it("General", () => {
1111
cy.get("[data-cy=SubApp] textarea").first().clear().type("example");
1212

13-
cy.get("#saveSettings").click();
13+
cy.get("#SaveSettings").click();
14+
cy.get('[data-cy="ConfirmSaveSettings"]').should("exist");
15+
cy.get('[data-cy="ConfirmSaveSettings"]').click();
1416

1517
cy.contains(SAVED_MESSAGE).should("exist");
1618
});
@@ -26,9 +28,10 @@ describe("Instance", () => {
2628
.type("test test test")
2729
.clear();
2830

29-
cy.get("#saveSettings").click({ force: true });
30-
31-
cy.get("#saveSettings").click({ force: true });
31+
cy.get("#SaveSettings").should("exist");
32+
cy.get("#SaveSettings").click();
33+
cy.get('[data-cy="ConfirmSaveSettings"]').should("exist");
34+
cy.get('[data-cy="ConfirmSaveSettings"]').click();
3235
cy.contains(SAVED_MESSAGE).should("exist");
3336
});
3437

@@ -40,7 +43,9 @@ describe("Instance", () => {
4043
.click();
4144
cy.get("[data-cy=SubApp] input").last().type("[email protected]");
4245

43-
cy.get("#saveSettings").click();
46+
cy.get("#SaveSettings").click();
47+
cy.get('[data-cy="ConfirmSaveSettings"]').should("exist");
48+
cy.get('[data-cy="ConfirmSaveSettings"]').click();
4449
cy.contains(SAVED_MESSAGE).should("exist");
4550
});
4651

src/apps/blocks/views/AllBlocks.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export const AllBlocks = () => {
220220
{showCreateModelDialogue && (
221221
<CreateModelDialogue
222222
modelType="block"
223+
typeIsSet={true}
223224
onClose={() => setShowCreateModelDialogue(false)}
224225
/>
225226
)}

src/apps/code-editor/src/app/components/BottomDrawer/FileCard.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const FileCard: React.FC<FileCardProps> = ({
3131
sx={{
3232
boxSizing: "border-box",
3333
// Temporary: will be updated once the design is final
34-
bgcolor: "#2f2f2f",
34+
bgcolor: "#0D1116",
3535
color: "grey.400",
3636
width: "100%",
3737
px: 2,
@@ -68,6 +68,7 @@ const FileCard: React.FC<FileCardProps> = ({
6868
flexGrow={0}
6969
width="100%"
7070
boxSizing="border-box"
71+
overflow="hidden"
7172
>
7273
<Box
7374
component={Icon}
@@ -76,9 +77,11 @@ const FileCard: React.FC<FileCardProps> = ({
7677
<Typography
7778
variant="h6"
7879
color="grey.300"
80+
width="100%"
7981
sx={{
8082
pl: "35px",
8183
boxSizing: "border-box",
84+
wordWrap: "break-word",
8285
}}
8386
>
8487
{title}

src/apps/code-editor/src/app/components/BottomDrawer/FileStatus.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import FlashOnIcon from "@mui/icons-material/FlashOn";
66
import { FileCard, FileCardListItem } from "./FileCard";
77
import { List, Divider } from "@mui/material";
88
import { Link as RouterLink } from "react-router-dom";
9-
import { NavCodeTypes } from "../SideBar/constants";
109
import Typography from "@mui/material/Typography";
1110
import Link from "@mui/material/Link";
11+
import { NavCodeTypes } from "../constants";
1212
interface ItemWeb {
1313
path: string;
1414
}

src/apps/code-editor/src/app/components/BottomDrawer/LinkedContent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import EditIcon from "@mui/icons-material/Edit";
33
import { FileCard, FileCardListItem } from "./FileCard";
44
import { NavLink } from "react-router-dom";
55
import VisibilityIcon from "@mui/icons-material/Visibility";
6-
import { NavCodeTypes } from "../SideBar/constants";
76
import LaunchIcon from "@mui/icons-material/Launch";
7+
import { NavCodeTypes } from "../constants";
88

99
interface Meta {
1010
ZUID: string;

src/apps/code-editor/src/app/components/BottomDrawer/LinkedSchema.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import StorageIcon from "@mui/icons-material/Storage";
21
import Link from "@mui/material/Link";
32
import { List, Typography, Divider } from "@mui/material";
43
import { FileCardListItem, FileCard } from "./FileCard";
5-
import { NavCodeTypes } from "../SideBar/constants";
64
import { Database } from "@zesty-io/material";
5+
import { NavCodeTypes } from "../constants";
76

87
interface Field {
98
ZUID: string;

src/apps/code-editor/src/app/components/BottomDrawer/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { fetchFields } from "../../../../../../shell/store/fields";
1414
import { fetchAuditTrail } from "../../../store/auditTrail";
1515
import { useMetaKey } from "../../../../../../shell/hooks/useMetaKey";
1616
import { fetchItems } from "../../../../../../shell/store/content";
17-
import { NavCodeTypes } from "../SideBar/constants";
17+
import { NavCodeTypes } from "../constants";
1818

1919
interface Field {
2020
ZUID: string;
@@ -157,7 +157,7 @@ const BottomDrawer = memo(function BottomDrawer({ file }: BottomDrawerProps) {
157157
bgcolor="background.editor"
158158
color="grey.300"
159159
height="40vh"
160-
sx={{ overflowY: "auto", bgcolor: "background.editor" }}
160+
sx={{ overflowY: "auto" }}
161161
>
162162
<WithLoader
163163
condition={!loading}

src/apps/code-editor/src/app/components/SideBar/CreateFile.tsx renamed to src/apps/code-editor/src/app/components/CreateFile.tsx

+6-16
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import {
1515
} from "@mui/material";
1616
import LoadingButton from "@mui/lab/LoadingButton";
1717
import CloseIcon from "@mui/icons-material/Close";
18-
import { createFile, fetchFiles } from "../../../store/files";
19-
import { notify } from "../../../../../../shell/store/notifications";
18+
2019
import { fileTypeOptions, scripts, stylesheets } from "./constants";
20+
import { notify } from "../../../../../shell/store/notifications";
21+
import { createFile, fetchFiles } from "../../store/files";
2122

2223
export type CreateFileProps = {
2324
open: boolean;
@@ -75,25 +76,14 @@ const CreateFile = memo(function CreateFile({
7576
}
7677

7778
setLoading(true);
78-
79-
dispatch(createFile(name, type) as any)
79+
let redirectPage = "";
80+
Promise.resolve(dispatch(createFile(name, type)))
8081
.then((res: any) => {
81-
if (res.status === 201) {
82+
if (!res?.error) {
8283
history.push(`/code/file/${res.pathPart}/${res.data.ZUID}`);
83-
84-
const fileType = scripts.includes(type)
85-
? "scripts"
86-
: stylesheets?.includes(type)
87-
? "stylesheets"
88-
: "views";
89-
90-
dispatch(fetchFiles(fileType));
9184
handleClearForm();
9285
}
9386
})
94-
.catch((err: any) => {
95-
console.error(err);
96-
})
9787
.finally(() => {
9888
setLoading(false);
9989
onClose();

src/apps/code-editor/src/app/components/Differ/Differ.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const Differ = memo(
3939
isLoading={loading}
4040
synced={props?.synced}
4141
code={props?.currentCode}
42+
icon={props.icon}
4243
isDiffer={true}
4344
/>
4445
<Box

src/apps/code-editor/src/app/components/Editor/Editor.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const Editor = memo(function Editor(props) {
2727
updatedBy={props.updatedBy}
2828
publishedAt={props.publishedAt}
2929
publishedBy={props.publishedBy}
30+
icon={props.icon}
3031
isDiffer={false}
3132
/>
3233

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
import { Box, Paper, Typography, Avatar } from "@mui/material";
2+
import Link from "@mui/material/Link";
3+
4+
type ExternalLinkProps = {
5+
href: string;
6+
text: string;
7+
target?: string;
8+
};
9+
10+
const ExternalLink = ({ href, text, target = "_blank" }: ExternalLinkProps) => {
11+
return (
12+
<Typography
13+
component={Link}
14+
href={href}
15+
target={target}
16+
variant="body3"
17+
color="info.main"
18+
>
19+
{text}
20+
</Typography>
21+
);
22+
};
23+
24+
export const DevResources = () => {
25+
return (
26+
<Box>
27+
<Typography variant="h5" mb="20px" color="common.white">
28+
Developer Resources
29+
</Typography>
30+
<Paper
31+
variant="outlined"
32+
elevation={0}
33+
sx={{
34+
p: "20px",
35+
display: "flex",
36+
flexDirection: "column",
37+
gap: "20px",
38+
backgroundColor: "transparent",
39+
color: "grey.400",
40+
borderColor: "grey.700",
41+
borderRadius: "8px",
42+
}}
43+
>
44+
<Typography variant="h6" color="common.white">
45+
Build Faster, Build Smarter with Parsley! 🚀
46+
</Typography>
47+
48+
<Typography variant="body3" color="grey.400">
49+
Get started building dynamic websites and applications with&nbsp;
50+
<ExternalLink
51+
href="https://docs.zesty.io/docs/parsley"
52+
text="Parsley"
53+
/>
54+
, Zesty.io's templating language. Explore our interactive&nbsp;
55+
<ExternalLink href="https://parsley.zesty.io/" text="REPL" />
56+
&nbsp;for a quick hands-on introduction, or learn more through our
57+
in-depth&nbsp;
58+
<ExternalLink
59+
href="https://docs.zesty.io/docs/parsley-index"
60+
text="documentation"
61+
/>
62+
.
63+
</Typography>
64+
65+
<Typography variant="h6" color="common.white">
66+
Simplify Your Workflow: Preprocessing Inside! 💻
67+
</Typography>
68+
69+
<Typography variant="body3" color="grey.400">
70+
Discover our streamlined workflows and boost your development
71+
efficiency. See how this works with our&nbsp;
72+
<ExternalLink
73+
href="https://docs.zesty.io/docs/css-js-processing-flow"
74+
text="CSS & JavaScript preprocessing"
75+
/>
76+
.
77+
</Typography>
78+
79+
<Box display="flex" flexDirection="column">
80+
<Typography variant="h6" color="common.white" mb="8px">
81+
API Docs
82+
</Typography>
83+
<Box
84+
component={Link}
85+
href="https://docs.zesty.io/reference/instances-api-reference"
86+
target="_blank"
87+
display="flex"
88+
flexDirection="row"
89+
alignItems="center"
90+
columnGap="12px"
91+
py="4px"
92+
height="36px"
93+
borderBottom="1px solid"
94+
borderColor="grey.700"
95+
sx={{
96+
textDecoration: "none!important",
97+
}}
98+
>
99+
<Avatar
100+
src="/images/postmanIcon.svg"
101+
sx={{ width: 24, height: 24 }}
102+
/>
103+
<Typography variant="body2" color="common.white">
104+
Instance API Docs
105+
</Typography>
106+
</Box>
107+
<Box
108+
component={Link}
109+
href="https://docs.zesty.io/docs/graphql#GraphQL"
110+
target="_blank"
111+
display="flex"
112+
flexDirection="row"
113+
alignItems="center"
114+
columnGap="12px"
115+
py="4px"
116+
height="36px"
117+
borderBottom="1px solid"
118+
borderColor="grey.700"
119+
sx={{
120+
textDecoration: "none!important",
121+
}}
122+
>
123+
<Avatar
124+
src="/images/graphQLIcon.svg"
125+
sx={{ width: 24, height: 24 }}
126+
/>
127+
<Typography variant="body2" color="common.white">
128+
GraphQL Docs
129+
</Typography>
130+
</Box>
131+
<Box
132+
component={Link}
133+
href="https://docs.zesty.io/docs/parsley"
134+
target="_blank"
135+
display="flex"
136+
flexDirection="row"
137+
alignItems="center"
138+
columnGap="12px"
139+
py="4px"
140+
height="36px"
141+
borderBottom="1px solid"
142+
borderColor="grey.700"
143+
sx={{
144+
textDecoration: "none!important",
145+
}}
146+
>
147+
<Avatar
148+
src="/images/parsleyIcon.svg"
149+
sx={{ width: 24, height: 24 }}
150+
/>
151+
<Typography variant="body2" color="common.white">
152+
Parsley Docs
153+
</Typography>
154+
</Box>
155+
</Box>
156+
</Paper>
157+
</Box>
158+
);
159+
};

0 commit comments

Comments
 (0)