Skip to content

Commit

Permalink
fix: cypress tests (#4477)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric authored Jan 8, 2025
1 parent 592175e commit 388e12f
Show file tree
Hide file tree
Showing 72 changed files with 3,432 additions and 2,044 deletions.
16 changes: 8 additions & 8 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@editorjs/delimiter": "^1.2.0",
"@editorjs/list": "^1.6.0",
"@editorjs/quote": "^2.4.0",
"@editorjs/underline": "^1.0.0",
"@editorjs/delimiter": "^1.3.0",
"@editorjs/list": "^1.8.0",
"@editorjs/quote": "^2.5.0",
"@editorjs/underline": "^1.1.0",
"@types/react": "18.2.79",
"@webiny/app-admin": "0.0.0",
"@webiny/app-admin-users-cognito": "0.0.0",
Expand All @@ -18,12 +18,12 @@
"@webiny/plugins": "0.0.0",
"@webiny/react-properties": "0.0.0",
"@webiny/serverless-cms-aws": "0.0.0",
"core-js": "^3.0.1",
"cross-fetch": "^3.0.4",
"prop-types": "^15.7.2",
"core-js": "3.39.0",
"cross-fetch": "^3.1.5",
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"regenerator-runtime": "^0.13.5",
"regenerator-runtime": "^0.13.11",
"theme": "^1.0.0",
"tslib": "^2.8.1"
},
Expand Down
7 changes: 0 additions & 7 deletions apps/admin/src/plugins/formBuilder/richTextEditor.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
/**
* Package @editorjs/* is missing types.
*/
// @ts-expect-error
import Delimiter from "@editorjs/delimiter";
// @ts-expect-error
import Quote from "@editorjs/quote";
// @ts-expect-error
import List from "@editorjs/list";
// @ts-expect-error
import Underline from "@editorjs/underline";
import Image from "@webiny/app-admin/components/RichTextEditor/tools/image";
import TextColor from "@webiny/app-admin/components/RichTextEditor/tools/textColor";
Expand Down
7 changes: 0 additions & 7 deletions apps/admin/src/plugins/headlessCMS/richTextEditor.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
/**
* Package @editorjs/* is missing types.
*/
// @ts-expect-error
import Delimiter from "@editorjs/delimiter";
// @ts-expect-error
import Quote from "@editorjs/quote";
// @ts-expect-error
import List from "@editorjs/list";
// @ts-expect-error
import Underline from "@editorjs/underline";
import Image from "@webiny/app-admin/components/RichTextEditor/tools/image";
import TextColor from "@webiny/app-admin/components/RichTextEditor/tools/textColor";
Expand Down
7 changes: 0 additions & 7 deletions apps/admin/src/plugins/pageBuilder/richTextEditor.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
/**
* Package @editorjs/* is missing types.
*/
// @ts-expect-error
import Delimiter from "@editorjs/delimiter";
// @ts-expect-error
import Quote from "@editorjs/quote";
// @ts-expect-error
import List from "@editorjs/list";
// @ts-expect-error
import Underline from "@editorjs/underline";
import Image from "@webiny/app-admin/components/RichTextEditor/tools/image";
import TextColor from "@webiny/app-admin/components/RichTextEditor/tools/textColor";
Expand Down
6 changes: 3 additions & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"@webiny/serverless-cms-aws": "0.0.0",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"core-js": "^3.0.1",
"cross-fetch": "^3.0.4",
"core-js": "3.39.0",
"cross-fetch": "^3.1.5",
"graphql": "^15.9.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"regenerator-runtime": "^0.13.5",
"regenerator-runtime": "^0.13.11",
"theme": "^1.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions extensions/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@emotion/react": "11.10.8",
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@webiny/app-form-builder": "0.0.0",
"@webiny/app-page-builder": "0.0.0",
"@webiny/app-page-builder-elements": "0.0.0",
Expand All @@ -18,7 +18,7 @@
"@webiny/validation": "0.0.0",
"graphql": "^15.9.0",
"react": "18.2.0",
"react-hamburger-menu": "^1.1.1"
"react-hamburger-menu": "1.2.1"
},
"devDependencies": {
"@types/react-hamburger-menu": "^0.0.4"
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@types/prettier": "^2.7.3",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"adio": "^1.0.1",
"axios": "^1.7.9",
"babel-jest": "29.7.0",
Expand All @@ -76,13 +76,13 @@
"env-ci": "2.0.1",
"eslint": "^8.57.1",
"eslint-config-standard": "^16.0.3",
"eslint-import-resolver-babel-module": "^5.3.1",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.3.0",
"eslint-import-resolver-babel-module": "^5.3.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^25.7.0",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-standard": "^5.0.0",
"execa": "^5.1.1",
"folder-hash": "^4.0.4",
Expand Down Expand Up @@ -241,7 +241,6 @@
"crypto-js": "^4.2.0",
"ip": "^2.0.1",
"tar": "^6.2.1",
"express": "^4.21.2",
"ejs": "^3.1.10",
"@grpc/grpc-js": "^1.11.1",
"postcss": "^8.4.35",
Expand Down
3 changes: 2 additions & 1 deletion packages/api-headless-cms-tasks-ddb-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"license": "MIT",
"dependencies": {
"@webiny/api-headless-cms-bulk-actions": "0.0.0",
"@webiny/api-headless-cms-import-export": "0.0.0"
"@webiny/api-headless-cms-import-export": "0.0.0",
"@webiny/api-headless-cms-tasks": "0.0.0"
},
"devDependencies": {
"@webiny/cli": "0.0.0",
Expand Down
16 changes: 10 additions & 6 deletions packages/api-headless-cms-tasks-ddb-es/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
createUnpublishEntry
} from "@webiny/api-headless-cms-bulk-actions";
import { createHeadlessCmsImportExport } from "@webiny/api-headless-cms-import-export";
import { createDeleteModelTask } from "@webiny/api-headless-cms-tasks";

const createEsBulkActionEntriesTasks = () => {
return [
Expand Down Expand Up @@ -56,9 +57,12 @@ const createEsBulkActionEntriesTasks = () => {
];
};

export const createHcmsTasks = () => [
createHcmsBulkActions(),
createEsBulkActionEntriesTasks(),
createEmptyTrashBinsTask(),
createHeadlessCmsImportExport()
];
export const createHcmsTasks = () => {
return [
createHcmsBulkActions(),
createEsBulkActionEntriesTasks(),
createEmptyTrashBinsTask(),
createHeadlessCmsImportExport(),
createDeleteModelTask()
];
};
3 changes: 2 additions & 1 deletion packages/api-headless-cms-tasks-ddb-es/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"include": ["src"],
"references": [
{ "path": "../api-headless-cms-bulk-actions/tsconfig.build.json" },
{ "path": "../api-headless-cms-import-export/tsconfig.build.json" }
{ "path": "../api-headless-cms-import-export/tsconfig.build.json" },
{ "path": "../api-headless-cms-tasks/tsconfig.build.json" }
],
"compilerOptions": {
"rootDir": "./src",
Expand Down
7 changes: 5 additions & 2 deletions packages/api-headless-cms-tasks-ddb-es/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"include": ["src", "__tests__"],
"references": [
{ "path": "../api-headless-cms-bulk-actions" },
{ "path": "../api-headless-cms-import-export" }
{ "path": "../api-headless-cms-import-export" },
{ "path": "../api-headless-cms-tasks" }
],
"compilerOptions": {
"rootDirs": ["./src", "./__tests__"],
Expand All @@ -15,7 +16,9 @@
"@webiny/api-headless-cms-bulk-actions/*": ["../api-headless-cms-bulk-actions/src/*"],
"@webiny/api-headless-cms-bulk-actions": ["../api-headless-cms-bulk-actions/src"],
"@webiny/api-headless-cms-import-export/*": ["../api-headless-cms-import-export/src/*"],
"@webiny/api-headless-cms-import-export": ["../api-headless-cms-import-export/src"]
"@webiny/api-headless-cms-import-export": ["../api-headless-cms-import-export/src"],
"@webiny/api-headless-cms-tasks/*": ["../api-headless-cms-tasks/src/*"],
"@webiny/api-headless-cms-tasks": ["../api-headless-cms-tasks/src"]
},
"baseUrl": "."
}
Expand Down
2 changes: 2 additions & 0 deletions packages/api-headless-cms-tasks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
import { createHeadlessCmsImportExport } from "@webiny/api-headless-cms-import-export";
import { createDeleteModelTask } from "~/tasks/deleteModel";

export { createDeleteModelTask };

export const createHcmsTasks = () => [
createHcmsBulkActions(),
createBulkActionEntriesTasks(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ExportedTemplateData {
| "description"
| "content"
| "layout"
| "pageCategory"
| "dataBindings"
| "dataSources"
>;
Expand Down Expand Up @@ -45,6 +46,7 @@ export class PageTemplateExporter {
description: template.description,
content: template.content,
layout: template.layout,
pageCategory: template.pageCategory,
dataBindings: template.dataBindings,
dataSources: template.dataSources
},
Expand Down
2 changes: 2 additions & 0 deletions packages/api-page-builder-import-export/src/export/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export interface ExportedTemplateData {
| "description"
| "content"
| "layout"
| "pageCategory"
| "dataSources"
| "dataBindings"
>;
Expand Down Expand Up @@ -156,6 +157,7 @@ export async function exportTemplate(
description: template.description,
content: template.content,
layout: template.layout,
pageCategory: template.pageCategory,
dataSources: template.dataSources,
dataBindings: template.dataBindings
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const templatesHandler = async (
slug: template.slug,
tags: template.tags,
layout: template.layout,
pageCategory: template.pageCategory,
description: template.description,
content: template.content,
dataBindings: template.dataBindings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const createSchema = zod.object({
tags: zod.string().array(),
description: zod.string().max(100),
layout: zod.string().max(100).optional(),
pageCategory: zod.string().max(100).default("static"),
content: zod.any(),
...dynamicData
});
Expand All @@ -43,6 +44,7 @@ const updateSchema = zod.object({
tags: zod.string().array().optional(),
description: zod.string().max(100).optional(),
layout: zod.string().max(100).optional(),
pageCategory: zod.string().max(100).optional(),
content: zod.any(),
...dynamicData
});
Expand Down Expand Up @@ -378,7 +380,7 @@ export const createPageTemplatesCrud = (
if (!template) {
throw new NotFoundError(`Page template "${id || slug}" was not found!`);
}
const page = await context.pageBuilder.createPage("static", meta);
const page = await context.pageBuilder.createPage(template.pageCategory, meta);
this.copyTemplateDataToPage(template, page);

await context.pageBuilder.updatePage(page.id, {
Expand Down Expand Up @@ -423,6 +425,7 @@ export const createPageTemplatesCrud = (
description: data.description,
tags: page.settings.general?.tags || [],
layout: page.settings.general?.layout || "static",
pageCategory: page.category,
content: {
...page.content,
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const createPageTemplateGraphQL = new GraphQLSchemaPlugin<PbContext>({
savedOn: DateTime!
createdBy: PbIdentity!
layout: String
pageCategory: String
}
input PbCreatePageTemplateInput {
Expand All @@ -34,6 +35,7 @@ export const createPageTemplateGraphQL = new GraphQLSchemaPlugin<PbContext>({
slug: String!
tags: [String!]
layout: String
pageCategory: String
content: JSON
dataSources: [DataSourceInput!]
dataBindings: [DataBindingInput!]
Expand All @@ -44,6 +46,7 @@ export const createPageTemplateGraphQL = new GraphQLSchemaPlugin<PbContext>({
slug: String
description: String
layout: String
pageCategory: String
content: JSON
tags: [String!]
dataSources: [DataSourceInput!]
Expand Down
2 changes: 2 additions & 0 deletions packages/api-page-builder/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ export interface PageTemplate extends DynamicDocument {
tags: string[];
description: string;
layout?: string;
pageCategory: string;
content?: any;
createdOn: string;
savedOn: string;
Expand All @@ -940,6 +941,7 @@ export type PageTemplateInput = Pick<
| "slug"
| "tags"
| "layout"
| "pageCategory"
| "dataBindings"
| "dataSources"
| "blockVariables"
Expand Down
2 changes: 1 addition & 1 deletion packages/app-aco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@emotion/react": "11.10.8",
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@material-design-icons/svg": "^0.14.3",
"@material-symbols/svg-400": "^0.4.1",
"@minoru/react-dnd-treeview": "3.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-auth0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@auth0/auth0-react": "^2.2.4",
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@webiny/app": "0.0.0",
"@webiny/app-admin": "0.0.0",
"@webiny/app-security": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-cognito/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@aws-amplify/auth": "^5.1.9",
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@webiny/app": "0.0.0",
"@webiny/app-admin": "0.0.0",
"@webiny/app-cognito-authenticator": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-okta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "Webiny Enterprise",
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@okta/okta-auth-js": "^5.3.1",
"@okta/okta-react": "^6.1.0",
"@okta/okta-signin-widget": "^5.9.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-rmwc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Webiny Ltd.",
"license": "MIT",
"dependencies": {
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@material-design-icons/svg": "^0.14.3",
"@rmwc/base": "^14.2.2",
"@rmwc/provider": "^14.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-admin-users-cognito/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@emotion/styled": "^11.10.6",
"@emotion/styled": "11.10.6",
"@webiny/app": "0.0.0",
"@webiny/app-admin": "0.0.0",
"@webiny/app-admin-cognito": "0.0.0",
Expand Down
Loading

0 comments on commit 388e12f

Please sign in to comment.