diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 168433c21..ab79633ce 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -12,6 +12,8 @@ definitions: pnpmwebappcore: $BITBUCKET_CLONE_DIR/.pnpm-store pnpmwebappapiclient: $BITBUCKET_CLONE_DIR/.pnpm-store pnpmwebappcontentful: $BITBUCKET_CLONE_DIR/.pnpm-store + pnpmwebappcruddemo: $BITBUCKET_CLONE_DIR/.pnpm-store + pnpmwebappnotifications: $BITBUCKET_CLONE_DIR/.pnpm-store pnpmworkers: $BITBUCKET_CLONE_DIR/.pnpm-store pnpminfracore: $BITBUCKET_CLONE_DIR/.pnpm-store pnpminfrashared: $BITBUCKET_CLONE_DIR/.pnpm-store @@ -139,6 +141,46 @@ pipelines: - pnpmwebappcontentful - clis - sonar + - step: + name: 'webapp-crud-demo: Lint & test' + image: atlassian/default-image:4 + size: 2x + script: + - *initializeStep + - pnpm install + --include-workspace-root + --frozen-lockfile + --filter=webapp-crud-demo... + - node_modules/.bin/nx run webapp-crud-demo:lint + - node_modules/.bin/nx run webapp-crud-demo:test --watchAll=false --maxWorkers=20% --coverage + - pipe: sonarsource/sonarcloud-scan:1.4.0 + variables: + SONAR_TOKEN: ${SONAR_TOKEN} + EXTRA_ARGS: '-Dsonar.projectBaseDir=packages/webapp-libs/webapp-crud-demo' + caches: + - pnpmwebappcruddemo + - clis + - sonar + - step: + name: 'webapp-notifications: Lint & test' + image: atlassian/default-image:4 + size: 2x + script: + - *initializeStep + - pnpm install + --include-workspace-root + --frozen-lockfile + --filter=webapp-notifications... + - node_modules/.bin/nx run webapp-notifications:lint + - node_modules/.bin/nx run webapp-notifications:test --watchAll=false --maxWorkers=20% --coverage + - pipe: sonarsource/sonarcloud-scan:1.4.0 + variables: + SONAR_TOKEN: ${SONAR_TOKEN} + EXTRA_ARGS: '-Dsonar.projectBaseDir=packages/webapp-libs/webapp-notifications' + caches: + - pnpmwebappnotifications + - clis + - sonar - step: name: 'backend: Build image & run tests' image: atlassian/default-image:3 diff --git a/package.json b/package.json index d57bb2de0..f8a0cc76c 100644 --- a/package.json +++ b/package.json @@ -9,36 +9,67 @@ "prepare": "husky install" }, "devDependencies": { + "@babel/preset-react": "^7.14.5", "@nrwl/devkit": "15.6.3", "@nrwl/eslint-plugin-nx": "^15.6.3", + "@nrwl/jest": "15.5.3", "@nrwl/js": "15.6.3", - "@nrwl/jest": "^15.6.3", "@nrwl/linter": "15.6.3", "@nrwl/node": "^15.6.3", "@nrwl/nx-cloud": "^15.0.2", "@nrwl/nx-plugin": "^15.6.3", + "@nrwl/react": "15.5.3", + "@nrwl/web": "15.5.3", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", "@sb/core": "*", + "@svgr/webpack": "^6.1.2", "@swc-node/register": "^1.4.2", "@swc/cli": "~0.1.55", "@swc/core": "^1.2.173", "@swc/helpers": "~0.4.11", + "@testing-library/react": "13.4.0", + "@types/jest": "28.1.1", "@types/node": "16.11.7", + "@types/react": "18.0.25", + "@types/react-dom": "18.0.9", + "@types/react-is": "17.0.3", + "@types/react-router-dom": "5.3.3", + "@types/styled-components": "5.1.26", "@typescript-eslint/eslint-plugin": "^5.51.0", "@typescript-eslint/parser": "^5.51.0", + "babel-jest": "28.1.1", "babel-plugin-relay": "^14.1.0", + "babel-plugin-styled-components": "1.10.7", "env-cmd": "^10.1.0", "eslint": "^8.34.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-typescript": "^3.5.3", - "eslint-plugin-import": "npm:eslint-plugin-i@^2.26.0", + "eslint-plugin-cypress": "^2.10.3", + "eslint-plugin-import": "2.26.0", + "eslint-plugin-jsx-a11y": "6.6.1", + "eslint-plugin-react": "7.31.11", + "eslint-plugin-react-hooks": "4.6.0", "husky": "^8.0.0", + "jest": "28.1.1", + "jest-environment-jsdom": "28.1.1", "jsonc-eslint-parser": "^2.1.0", "lint-staged": "^10.5.4", "nx": "^15.4.5", "prettier": "^2.6.2", + "react-refresh": "^0.10.0", + "react-test-renderer": "18.2.0", + "ts-jest": "28.0.5", "ts-node": "10.9.1", "tsconfig-paths": "^4.1.2", "tslib": "^2.3.0", - "typescript": "~4.8.2" + "typescript": "~4.8.2", + "url-loader": "^4.1.1" + }, + "dependencies": { + "react": "18.2.0", + "react-dom": "18.2.0", + "react-is": "18.2.0", + "react-router-dom": "6.4.3", + "styled-components": "5.3.6" } } diff --git a/packages/internal/status-dashboard/src/hooks/useFetchVersions/useFetchVersions.tsx b/packages/internal/status-dashboard/src/hooks/useFetchVersions/useFetchVersions.tsx index e21320132..97bf98694 100644 --- a/packages/internal/status-dashboard/src/hooks/useFetchVersions/useFetchVersions.tsx +++ b/packages/internal/status-dashboard/src/hooks/useFetchVersions/useFetchVersions.tsx @@ -1,9 +1,30 @@ import { useEffect, useState } from 'react'; -type Version = unknown; +type VersionValue = { + label: string; + value: string; +}; + +type Version = { + envs: Array<{ + name: string; + version: string; + builtAt: string; + values: VersionValue[]; + }>; + services: Record< + string, + Array<{ + name: string; + version: string; + builtAt: string; + values: VersionValue[]; + }> + >; +}; export const useFetchVersions = () => { - const [versions, setVersions] = useState([]); + const [versions, setVersions] = useState({ envs: [], services: {} }); const [isFetching, setIsFetching] = useState(false); const [error, setError] = useState(undefined); diff --git a/packages/webapp-libs/webapp-api-client/jest.config.ts b/packages/webapp-libs/webapp-api-client/jest.config.ts index c78143042..d293cfdb5 100644 --- a/packages/webapp-libs/webapp-api-client/jest.config.ts +++ b/packages/webapp-libs/webapp-api-client/jest.config.ts @@ -6,15 +6,12 @@ export default { '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest', '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/react/babel'] }], }, - transformIgnorePatterns: ['/node_modules/(?!(@iconify-icons|react-markdown)/)'], + transformIgnorePatterns: ['/node_modules/(?!(@iconify-icons|@sb)/)'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', }, }, - moduleNameMapper: { - 'react-markdown': '/node_modules/react-markdown/react-markdown.min.js', - }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], coverageReporters: ['lcov'], coveragePathIgnorePatterns: ['/node_modules/', '.*.svg'], diff --git a/packages/webapp-libs/webapp-api-client/package.json b/packages/webapp-libs/webapp-api-client/package.json index 047dc8b15..72978ebe6 100644 --- a/packages/webapp-libs/webapp-api-client/package.json +++ b/packages/webapp-libs/webapp-api-client/package.json @@ -19,6 +19,7 @@ "@apollo/client": "^3.7.9", "react": "18.2.0", "react-dom": "18.2.0", + "react-hook-form": "^7.34.0", "graphql": "^16.6.0", "ramda": "^0.28.0", "@storybook/react": "^6.5.16", @@ -68,6 +69,7 @@ "jest-matcher-utils": "^29.4.2", "jest-watch-typeahead": "^2.2.2", "react": "18.2.0", + "react-hook-form": "^7.34.0", "ramda": "^0.28.0", "ts-jest": "28.0.5", "msw": "^1.0.0" diff --git a/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/gql.ts b/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/gql.ts index a72411800..87639c403 100644 --- a/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/gql.ts +++ b/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/gql.ts @@ -23,7 +23,6 @@ const documents = { "\n query demoItemQuery($id: String!) {\n demoItem(id: $id) {\n title\n description\n image {\n url\n title\n description\n }\n }\n }\n": types.DemoItemQueryDocument, "\n fragment demoItemListItemFragment on DemoItem {\n title\n image {\n title\n url\n }\n }\n": types.DemoItemListItemFragmentFragmentDoc, "\n query demoItemsAllQuery {\n demoItemCollection {\n items {\n sys {\n id\n }\n ...demoItemListItemFragment\n }\n }\n }\n": types.DemoItemsAllQueryDocument, - "\n mutation authConfirmUserEmailMutation($input: ConfirmEmailMutationInput!) {\n confirm(input: $input) {\n ok\n }\n }\n": types.AuthConfirmUserEmailMutationDocument, "\n mutation addCrudDemoItemMutation($input: CreateCrudDemoItemMutationInput!) {\n createCrudDemoItem(input: $input) {\n crudDemoItemEdge {\n node {\n id\n name\n }\n }\n }\n }\n": types.AddCrudDemoItemMutationDocument, "\n query crudDemoItemDetailsQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n": types.CrudDemoItemDetailsQueryDocument, "\n query crudDemoItemListQuery {\n allCrudDemoItems(first: 100) {\n edges {\n node {\n id\n ...crudDemoItemListItem\n }\n }\n }\n }\n": types.CrudDemoItemListQueryDocument, @@ -33,6 +32,13 @@ const documents = { "\n query crudDemoItemListItemDefaultStoryQuery {\n item: crudDemoItem(id: \"test-id\") {\n ...crudDemoItemListItem\n }\n }\n": types.CrudDemoItemListItemDefaultStoryQueryDocument, "\n query editCrudDemoItemQuery($id: ID!) {\n crudDemoItem(id: $id) {\n id\n name\n }\n }\n": types.EditCrudDemoItemQueryDocument, "\n mutation editCrudDemoItemContentMutation($input: UpdateCrudDemoItemMutationInput!) {\n updateCrudDemoItem(input: $input) {\n crudDemoItem {\n id\n name\n }\n }\n }\n": types.EditCrudDemoItemContentMutationDocument, + "\n mutation notificationMutation($input: UpdateNotificationMutationInput!) {\n updateNotification(input: $input) {\n hasUnreadNotifications\n notificationEdge {\n node {\n id\n readAt\n }\n }\n }\n }\n": types.NotificationMutationDocument, + "\n query notificationsListQuery($count: Int = 20, $cursor: String) {\n ...notificationsListContentFragment\n ...notificationsButtonContent\n }\n": types.NotificationsListQueryDocument, + "\n subscription notificationsListSubscription {\n notificationCreated {\n edges {\n node {\n id\n type\n createdAt\n readAt\n data\n }\n }\n }\n }\n": types.NotificationsListSubscriptionDocument, + "\n fragment notificationsButtonContent on Query {\n hasUnreadNotifications\n }\n": types.NotificationsButtonContentFragmentDoc, + "\n fragment notificationsListContentFragment on Query {\n hasUnreadNotifications\n allNotifications(first: $count, after: $cursor) {\n edges {\n node {\n id\n data\n createdAt\n readAt\n type\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n": types.NotificationsListContentFragmentFragmentDoc, + "\n mutation notificationsListMarkAsReadMutation($input: MarkReadAllNotificationsMutationInput!) {\n markReadAllNotifications(input: $input) {\n ok\n }\n }\n": types.NotificationsListMarkAsReadMutationDocument, + "\n mutation authConfirmUserEmailMutation($input: ConfirmEmailMutationInput!) {\n confirm(input: $input) {\n ok\n }\n }\n": types.AuthConfirmUserEmailMutationDocument, "\n fragment documentListItem on DocumentDemoItemType {\n id\n file {\n url\n name\n }\n createdAt\n }\n": types.DocumentListItemFragmentDoc, "\n query documentsListQuery {\n allDocumentDemoItems(first: 10) {\n edges {\n node {\n id\n ...documentListItem\n }\n }\n }\n }\n": types.DocumentsListQueryDocument, "\n mutation documentsListCreateMutation($input: CreateDocumentDemoItemMutationInput!) {\n createDocumentDemoItem(input: $input) {\n documentDemoItemEdge {\n node {\n id\n ...documentListItem\n }\n }\n }\n }\n": types.DocumentsListCreateMutationDocument, @@ -65,12 +71,6 @@ const documents = { "\n query stripeSubscriptionQuery {\n allPaymentMethods(first: 100) {\n edges {\n node {\n id\n pk\n type\n card\n billingDetails\n ...stripePaymentMethodFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n\n activeSubscription {\n ...subscriptionActiveSubscriptionFragment\n id\n __typename\n }\n }\n": types.StripeSubscriptionQueryDocument, "\n mutation stripeDeletePaymentMethodMutation($input: DeletePaymentMethodMutationInput!) {\n deletePaymentMethod(input: $input) {\n deletedIds\n activeSubscription {\n defaultPaymentMethod {\n ...stripePaymentMethodFragment\n }\n }\n }\n }\n": types.StripeDeletePaymentMethodMutationDocument, "\n mutation stripeUpdateDefaultPaymentMethodMutation($input: UpdateDefaultPaymentMethodMutationInput!) {\n updateDefaultPaymentMethod(input: $input) {\n activeSubscription {\n ...subscriptionActiveSubscriptionFragment\n id\n }\n paymentMethodEdge {\n node {\n ...stripePaymentMethodFragment\n id\n }\n }\n }\n }\n": types.StripeUpdateDefaultPaymentMethodMutationDocument, - "\n mutation notificationMutation($input: UpdateNotificationMutationInput!) {\n updateNotification(input: $input) {\n hasUnreadNotifications\n notificationEdge {\n node {\n id\n readAt\n }\n }\n }\n }\n": types.NotificationMutationDocument, - "\n query notificationsListQuery($count: Int = 20, $cursor: String) {\n ...notificationsListContentFragment\n ...notificationsButtonContent\n }\n": types.NotificationsListQueryDocument, - "\n subscription notificationsListSubscription {\n notificationCreated {\n edges {\n node {\n id\n type\n createdAt\n readAt\n data\n }\n }\n }\n }\n": types.NotificationsListSubscriptionDocument, - "\n fragment notificationsButtonContent on Query {\n hasUnreadNotifications\n }\n": types.NotificationsButtonContentFragmentDoc, - "\n fragment notificationsListContentFragment on Query {\n hasUnreadNotifications\n allNotifications(first: $count, after: $cursor) {\n edges {\n node {\n id\n data\n createdAt\n readAt\n type\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n": types.NotificationsListContentFragmentFragmentDoc, - "\n mutation notificationsListMarkAsReadMutation($input: MarkReadAllNotificationsMutationInput!) {\n markReadAllNotifications(input: $input) {\n ok\n }\n }\n": types.NotificationsListMarkAsReadMutationDocument, }; /** @@ -127,10 +127,6 @@ export function gql(source: "\n fragment demoItemListItemFragment on DemoItem { * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: "\n query demoItemsAllQuery {\n demoItemCollection {\n items {\n sys {\n id\n }\n ...demoItemListItemFragment\n }\n }\n }\n"): (typeof documents)["\n query demoItemsAllQuery {\n demoItemCollection {\n items {\n sys {\n id\n }\n ...demoItemListItemFragment\n }\n }\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n mutation authConfirmUserEmailMutation($input: ConfirmEmailMutationInput!) {\n confirm(input: $input) {\n ok\n }\n }\n"): (typeof documents)["\n mutation authConfirmUserEmailMutation($input: ConfirmEmailMutationInput!) {\n confirm(input: $input) {\n ok\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -167,6 +163,34 @@ export function gql(source: "\n query editCrudDemoItemQuery($id: ID!) {\n cr * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: "\n mutation editCrudDemoItemContentMutation($input: UpdateCrudDemoItemMutationInput!) {\n updateCrudDemoItem(input: $input) {\n crudDemoItem {\n id\n name\n }\n }\n }\n"): (typeof documents)["\n mutation editCrudDemoItemContentMutation($input: UpdateCrudDemoItemMutationInput!) {\n updateCrudDemoItem(input: $input) {\n crudDemoItem {\n id\n name\n }\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation notificationMutation($input: UpdateNotificationMutationInput!) {\n updateNotification(input: $input) {\n hasUnreadNotifications\n notificationEdge {\n node {\n id\n readAt\n }\n }\n }\n }\n"): (typeof documents)["\n mutation notificationMutation($input: UpdateNotificationMutationInput!) {\n updateNotification(input: $input) {\n hasUnreadNotifications\n notificationEdge {\n node {\n id\n readAt\n }\n }\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n query notificationsListQuery($count: Int = 20, $cursor: String) {\n ...notificationsListContentFragment\n ...notificationsButtonContent\n }\n"): (typeof documents)["\n query notificationsListQuery($count: Int = 20, $cursor: String) {\n ...notificationsListContentFragment\n ...notificationsButtonContent\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n subscription notificationsListSubscription {\n notificationCreated {\n edges {\n node {\n id\n type\n createdAt\n readAt\n data\n }\n }\n }\n }\n"): (typeof documents)["\n subscription notificationsListSubscription {\n notificationCreated {\n edges {\n node {\n id\n type\n createdAt\n readAt\n data\n }\n }\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n fragment notificationsButtonContent on Query {\n hasUnreadNotifications\n }\n"): (typeof documents)["\n fragment notificationsButtonContent on Query {\n hasUnreadNotifications\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n fragment notificationsListContentFragment on Query {\n hasUnreadNotifications\n allNotifications(first: $count, after: $cursor) {\n edges {\n node {\n id\n data\n createdAt\n readAt\n type\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n"): (typeof documents)["\n fragment notificationsListContentFragment on Query {\n hasUnreadNotifications\n allNotifications(first: $count, after: $cursor) {\n edges {\n node {\n id\n data\n createdAt\n readAt\n type\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation notificationsListMarkAsReadMutation($input: MarkReadAllNotificationsMutationInput!) {\n markReadAllNotifications(input: $input) {\n ok\n }\n }\n"): (typeof documents)["\n mutation notificationsListMarkAsReadMutation($input: MarkReadAllNotificationsMutationInput!) {\n markReadAllNotifications(input: $input) {\n ok\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation authConfirmUserEmailMutation($input: ConfirmEmailMutationInput!) {\n confirm(input: $input) {\n ok\n }\n }\n"): (typeof documents)["\n mutation authConfirmUserEmailMutation($input: ConfirmEmailMutationInput!) {\n confirm(input: $input) {\n ok\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -295,30 +319,6 @@ export function gql(source: "\n mutation stripeDeletePaymentMethodMutation($inp * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: "\n mutation stripeUpdateDefaultPaymentMethodMutation($input: UpdateDefaultPaymentMethodMutationInput!) {\n updateDefaultPaymentMethod(input: $input) {\n activeSubscription {\n ...subscriptionActiveSubscriptionFragment\n id\n }\n paymentMethodEdge {\n node {\n ...stripePaymentMethodFragment\n id\n }\n }\n }\n }\n"): (typeof documents)["\n mutation stripeUpdateDefaultPaymentMethodMutation($input: UpdateDefaultPaymentMethodMutationInput!) {\n updateDefaultPaymentMethod(input: $input) {\n activeSubscription {\n ...subscriptionActiveSubscriptionFragment\n id\n }\n paymentMethodEdge {\n node {\n ...stripePaymentMethodFragment\n id\n }\n }\n }\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n mutation notificationMutation($input: UpdateNotificationMutationInput!) {\n updateNotification(input: $input) {\n hasUnreadNotifications\n notificationEdge {\n node {\n id\n readAt\n }\n }\n }\n }\n"): (typeof documents)["\n mutation notificationMutation($input: UpdateNotificationMutationInput!) {\n updateNotification(input: $input) {\n hasUnreadNotifications\n notificationEdge {\n node {\n id\n readAt\n }\n }\n }\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n query notificationsListQuery($count: Int = 20, $cursor: String) {\n ...notificationsListContentFragment\n ...notificationsButtonContent\n }\n"): (typeof documents)["\n query notificationsListQuery($count: Int = 20, $cursor: String) {\n ...notificationsListContentFragment\n ...notificationsButtonContent\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n subscription notificationsListSubscription {\n notificationCreated {\n edges {\n node {\n id\n type\n createdAt\n readAt\n data\n }\n }\n }\n }\n"): (typeof documents)["\n subscription notificationsListSubscription {\n notificationCreated {\n edges {\n node {\n id\n type\n createdAt\n readAt\n data\n }\n }\n }\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n fragment notificationsButtonContent on Query {\n hasUnreadNotifications\n }\n"): (typeof documents)["\n fragment notificationsButtonContent on Query {\n hasUnreadNotifications\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n fragment notificationsListContentFragment on Query {\n hasUnreadNotifications\n allNotifications(first: $count, after: $cursor) {\n edges {\n node {\n id\n data\n createdAt\n readAt\n type\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n"): (typeof documents)["\n fragment notificationsListContentFragment on Query {\n hasUnreadNotifications\n allNotifications(first: $count, after: $cursor) {\n edges {\n node {\n id\n data\n createdAt\n readAt\n type\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n"]; -/** - * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function gql(source: "\n mutation notificationsListMarkAsReadMutation($input: MarkReadAllNotificationsMutationInput!) {\n markReadAllNotifications(input: $input) {\n ok\n }\n }\n"): (typeof documents)["\n mutation notificationsListMarkAsReadMutation($input: MarkReadAllNotificationsMutationInput!) {\n markReadAllNotifications(input: $input) {\n ok\n }\n }\n"]; export function gql(source: string) { return (documents as any)[source] ?? {}; diff --git a/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/graphql.ts b/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/graphql.ts index 8e41adfd2..59cfbbf11 100644 --- a/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/graphql.ts +++ b/packages/webapp-libs/webapp-api-client/src/graphql/__generated/gql/graphql.ts @@ -2611,13 +2611,6 @@ export type DemoItemsAllQueryQuery = { __typename?: 'Query', demoItemCollection? & { ' $fragmentRefs'?: { 'DemoItemListItemFragmentFragment': DemoItemListItemFragmentFragment } } ) | null> } | null }; -export type AuthConfirmUserEmailMutationMutationVariables = Exact<{ - input: ConfirmEmailMutationInput; -}>; - - -export type AuthConfirmUserEmailMutationMutation = { __typename?: 'ApiMutation', confirm?: { __typename?: 'ConfirmEmailMutationPayload', ok?: boolean | null } | null }; - export type AddCrudDemoItemMutationMutationVariables = Exact<{ input: CreateCrudDemoItemMutationInput; }>; @@ -2679,6 +2672,47 @@ export type EditCrudDemoItemContentMutationMutationVariables = Exact<{ export type EditCrudDemoItemContentMutationMutation = { __typename?: 'ApiMutation', updateCrudDemoItem?: { __typename?: 'UpdateCrudDemoItemMutationPayload', crudDemoItem?: { __typename?: 'CrudDemoItemType', id: string, name: string } | null } | null }; +export type NotificationMutationMutationVariables = Exact<{ + input: UpdateNotificationMutationInput; +}>; + + +export type NotificationMutationMutation = { __typename?: 'ApiMutation', updateNotification?: { __typename?: 'UpdateNotificationMutationPayload', hasUnreadNotifications?: boolean | null, notificationEdge?: { __typename?: 'NotificationEdge', node?: { __typename?: 'NotificationType', id: string, readAt?: any | null } | null } | null } | null }; + +export type NotificationsListQueryQueryVariables = Exact<{ + count?: InputMaybe; + cursor?: InputMaybe; +}>; + + +export type NotificationsListQueryQuery = ( + { __typename?: 'Query' } + & { ' $fragmentRefs'?: { 'NotificationsListContentFragmentFragment': NotificationsListContentFragmentFragment;'NotificationsButtonContentFragment': NotificationsButtonContentFragment } } +); + +export type NotificationsListSubscriptionSubscriptionVariables = Exact<{ [key: string]: never; }>; + + +export type NotificationsListSubscriptionSubscription = { __typename?: 'ApiSubscription', notificationCreated?: { __typename?: 'NotificationConnection', edges: Array<{ __typename?: 'NotificationEdge', node?: { __typename?: 'NotificationType', id: string, type: string, createdAt: any, readAt?: any | null, data?: any | null } | null } | null> } | null }; + +export type NotificationsButtonContentFragment = { __typename?: 'Query', hasUnreadNotifications?: boolean | null } & { ' $fragmentName'?: 'NotificationsButtonContentFragment' }; + +export type NotificationsListContentFragmentFragment = { __typename?: 'Query', hasUnreadNotifications?: boolean | null, allNotifications?: { __typename?: 'NotificationConnection', edges: Array<{ __typename?: 'NotificationEdge', node?: { __typename?: 'NotificationType', id: string, data?: any | null, createdAt: any, readAt?: any | null, type: string } | null } | null>, pageInfo: { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage: boolean } } | null } & { ' $fragmentName'?: 'NotificationsListContentFragmentFragment' }; + +export type NotificationsListMarkAsReadMutationMutationVariables = Exact<{ + input: MarkReadAllNotificationsMutationInput; +}>; + + +export type NotificationsListMarkAsReadMutationMutation = { __typename?: 'ApiMutation', markReadAllNotifications?: { __typename?: 'MarkReadAllNotificationsMutationPayload', ok?: boolean | null } | null }; + +export type AuthConfirmUserEmailMutationMutationVariables = Exact<{ + input: ConfirmEmailMutationInput; +}>; + + +export type AuthConfirmUserEmailMutationMutation = { __typename?: 'ApiMutation', confirm?: { __typename?: 'ConfirmEmailMutationPayload', ok?: boolean | null } | null }; + export type DocumentListItemFragment = { __typename?: 'DocumentDemoItemType', id: string, createdAt: any, file?: { __typename?: 'FileFieldType', url?: string | null, name?: string | null } | null } & { ' $fragmentName'?: 'DocumentListItemFragment' }; export type DocumentsListQueryQueryVariables = Exact<{ [key: string]: never; }>; @@ -2917,44 +2951,12 @@ export type StripeUpdateDefaultPaymentMethodMutationMutation = { __typename?: 'A & { ' $fragmentRefs'?: { 'StripePaymentMethodFragmentFragment': StripePaymentMethodFragmentFragment } } ) | null } | null } | null }; -export type NotificationMutationMutationVariables = Exact<{ - input: UpdateNotificationMutationInput; -}>; - - -export type NotificationMutationMutation = { __typename?: 'ApiMutation', updateNotification?: { __typename?: 'UpdateNotificationMutationPayload', hasUnreadNotifications?: boolean | null, notificationEdge?: { __typename?: 'NotificationEdge', node?: { __typename?: 'NotificationType', id: string, readAt?: any | null } | null } | null } | null }; - -export type NotificationsListQueryQueryVariables = Exact<{ - count?: InputMaybe; - cursor?: InputMaybe; -}>; - - -export type NotificationsListQueryQuery = ( - { __typename?: 'Query' } - & { ' $fragmentRefs'?: { 'NotificationsListContentFragmentFragment': NotificationsListContentFragmentFragment;'NotificationsButtonContentFragment': NotificationsButtonContentFragment } } -); - -export type NotificationsListSubscriptionSubscriptionVariables = Exact<{ [key: string]: never; }>; - - -export type NotificationsListSubscriptionSubscription = { __typename?: 'ApiSubscription', notificationCreated?: { __typename?: 'NotificationConnection', edges: Array<{ __typename?: 'NotificationEdge', node?: { __typename?: 'NotificationType', id: string, type: string, createdAt: any, readAt?: any | null, data?: any | null } | null } | null> } | null }; - -export type NotificationsButtonContentFragment = { __typename?: 'Query', hasUnreadNotifications?: boolean | null } & { ' $fragmentName'?: 'NotificationsButtonContentFragment' }; - -export type NotificationsListContentFragmentFragment = { __typename?: 'Query', hasUnreadNotifications?: boolean | null, allNotifications?: { __typename?: 'NotificationConnection', edges: Array<{ __typename?: 'NotificationEdge', node?: { __typename?: 'NotificationType', id: string, data?: any | null, createdAt: any, readAt?: any | null, type: string } | null } | null>, pageInfo: { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage: boolean } } | null } & { ' $fragmentName'?: 'NotificationsListContentFragmentFragment' }; - -export type NotificationsListMarkAsReadMutationMutationVariables = Exact<{ - input: MarkReadAllNotificationsMutationInput; -}>; - - -export type NotificationsListMarkAsReadMutationMutation = { __typename?: 'ApiMutation', markReadAllNotifications?: { __typename?: 'MarkReadAllNotificationsMutationPayload', ok?: boolean | null } | null }; - export const CommonQueryCurrentUserFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"commonQueryCurrentUserFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CurrentUserType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"roles"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"otpVerified"}},{"kind":"Field","name":{"kind":"Name","value":"otpEnabled"}}]}}]} as unknown as DocumentNode; export const UseFavoriteDemoItem_ItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"useFavoriteDemoItem_item"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ContentfulDemoItemFavoriteType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pk"}}]}}]}}]} as unknown as DocumentNode; export const DemoItemListItemFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"demoItemListItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DemoItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"image"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const CrudDemoItemListItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"crudDemoItemListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CrudDemoItemType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const NotificationsButtonContentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsButtonContent"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}}]}}]} as unknown as DocumentNode; +export const NotificationsListContentFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsListContentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"allNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"count"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}}]}}]}}]} as unknown as DocumentNode; export const DocumentListItemFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"documentListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DocumentDemoItemType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"file"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const StripeSetupIntentFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripeSetupIntentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripeSetupIntentType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"clientSecret"}}]}}]} as unknown as DocumentNode; export const StripePaymentMethodFragment_FragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment_"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}}]} as unknown as DocumentNode; @@ -2965,8 +2967,6 @@ export const StripePaymentMethodFragmentFragmentDoc = {"kind":"Document","defini export const SubscriptionPlanItemFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"subscriptionPlanItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPlanType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"product"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"amount"}}]}}]} as unknown as DocumentNode; export const StripeChargeFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripeChargeFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripeChargeType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"created"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}},{"kind":"Field","name":{"kind":"Name","value":"paymentMethod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"invoice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"subscriptionPlanItemFragment"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"subscriptionPlanItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionPlanType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"product"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"amount"}}]}}]} as unknown as DocumentNode; export const StripePaymentIntentFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentIntentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentIntentType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"clientSecret"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}}]}}]} as unknown as DocumentNode; -export const NotificationsButtonContentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsButtonContent"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}}]}}]} as unknown as DocumentNode; -export const NotificationsListContentFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsListContentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"allNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"count"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}}]}}]}}]} as unknown as DocumentNode; export const CommonQueryCurrentUserQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"commonQueryCurrentUserQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"commonQueryCurrentUserFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"commonQueryCurrentUserFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CurrentUserType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"roles"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"otpVerified"}},{"kind":"Field","name":{"kind":"Name","value":"otpEnabled"}}]}}]} as unknown as DocumentNode; export const ConfigContentfulAppConfigQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"configContentfulAppConfigQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"appConfigCollection"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"privacyPolicy"}},{"kind":"Field","name":{"kind":"Name","value":"termsAndConditions"}}]}}]}}]}}]} as unknown as DocumentNode; export const UseFavoriteDemoItemListCreateMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"useFavoriteDemoItemListCreateMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateFavoriteContentfulDemoItemMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createFavoriteContentfulDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentfulDemoItemFavoriteEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pk"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; @@ -2974,7 +2974,6 @@ export const UseFavoriteDemoItemListDeleteMutationDocument = {"kind":"Document", export const UseFavoriteDemoItemListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"useFavoriteDemoItemListQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"allContentfulDemoItemFavorites"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"useFavoriteDemoItem_item"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"useFavoriteDemoItem_item"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ContentfulDemoItemFavoriteType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pk"}}]}}]}}]} as unknown as DocumentNode; export const DemoItemQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"demoItemQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"demoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}}]}}]} as unknown as DocumentNode; export const DemoItemsAllQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"demoItemsAllQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"demoItemCollection"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sys"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"demoItemListItemFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"demoItemListItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DemoItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"image"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; -export const AuthConfirmUserEmailMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"authConfirmUserEmailMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ConfirmEmailMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"confirm"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ok"}}]}}]}}]} as unknown as DocumentNode; export const AddCrudDemoItemMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"addCrudDemoItemMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCrudDemoItemMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCrudDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"crudDemoItemEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const CrudDemoItemDetailsQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"crudDemoItemDetailsQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"crudDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const CrudDemoItemListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"crudDemoItemListQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"allCrudDemoItems"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"crudDemoItemListItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"crudDemoItemListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CrudDemoItemType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; @@ -2983,6 +2982,11 @@ export const CrudDemoItemListItemDeleteMutationDocument = {"kind":"Document","de export const CrudDemoItemListItemDefaultStoryQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"crudDemoItemListItemDefaultStoryQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"item"},"name":{"kind":"Name","value":"crudDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"StringValue","value":"test-id","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"crudDemoItemListItem"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"crudDemoItemListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CrudDemoItemType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; export const EditCrudDemoItemQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"editCrudDemoItemQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"crudDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const EditCrudDemoItemContentMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"editCrudDemoItemContentMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCrudDemoItemMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCrudDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"crudDemoItem"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]} as unknown as DocumentNode; +export const NotificationMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"notificationMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateNotificationMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateNotification"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"notificationEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const NotificationsListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"notificationsListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"count"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"20"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"notificationsListContentFragment"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"notificationsButtonContent"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsListContentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"allNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"count"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsButtonContent"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}}]}}]} as unknown as DocumentNode; +export const NotificationsListSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"notificationsListSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationCreated"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}},{"kind":"Field","name":{"kind":"Name","value":"data"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const NotificationsListMarkAsReadMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"notificationsListMarkAsReadMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MarkReadAllNotificationsMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markReadAllNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ok"}}]}}]}}]} as unknown as DocumentNode; +export const AuthConfirmUserEmailMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"authConfirmUserEmailMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ConfirmEmailMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"confirm"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ok"}}]}}]}}]} as unknown as DocumentNode; export const DocumentsListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"documentsListQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"allDocumentDemoItems"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"documentListItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"documentListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DocumentDemoItemType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"file"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const DocumentsListCreateMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"documentsListCreateMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateDocumentDemoItemMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createDocumentDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentDemoItemEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"documentListItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"documentListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DocumentDemoItemType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"file"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const DocumentsDeleteMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"documentsDeleteMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteDocumentDemoItemMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteDocumentDemoItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deletedIds"}}]}}]}}]} as unknown as DocumentNode; @@ -3006,8 +3010,4 @@ export const StripeCreatePaymentIntentMutation_Document = {"kind":"Document","de export const StripeUpdatePaymentIntentMutation_Document = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"stripeUpdatePaymentIntentMutation_"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdatePaymentIntentMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePaymentIntent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"paymentIntent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentIntentFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentIntentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentIntentType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"clientSecret"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}}]}}]} as unknown as DocumentNode; export const StripeSubscriptionQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"stripeSubscriptionQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"allPaymentMethods"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"100"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment"}},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"activeSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"subscriptionActiveSubscriptionFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment_"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"subscriptionActiveSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionScheduleType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnd"}},{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"product"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnd"}},{"kind":"Field","name":{"kind":"Name","value":"trialStart"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canActivateTrial"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPaymentMethod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment_"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const StripeDeletePaymentMethodMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"stripeDeletePaymentMethodMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeletePaymentMethodMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deletePaymentMethod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deletedIds"}},{"kind":"Field","name":{"kind":"Name","value":"activeSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"defaultPaymentMethod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}}]} as unknown as DocumentNode; -export const StripeUpdateDefaultPaymentMethodMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"stripeUpdateDefaultPaymentMethodMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateDefaultPaymentMethodMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateDefaultPaymentMethod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"subscriptionActiveSubscriptionFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"paymentMethodEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment_"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"subscriptionActiveSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionScheduleType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnd"}},{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"product"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnd"}},{"kind":"Field","name":{"kind":"Name","value":"trialStart"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canActivateTrial"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPaymentMethod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment_"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}}]} as unknown as DocumentNode; -export const NotificationMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"notificationMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateNotificationMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateNotification"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"notificationEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const NotificationsListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"notificationsListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"count"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"20"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"notificationsListContentFragment"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"notificationsButtonContent"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsListContentFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"allNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"count"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"data"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endCursor"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"notificationsButtonContent"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Query"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasUnreadNotifications"}}]}}]} as unknown as DocumentNode; -export const NotificationsListSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"notificationsListSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationCreated"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"readAt"}},{"kind":"Field","name":{"kind":"Name","value":"data"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const NotificationsListMarkAsReadMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"notificationsListMarkAsReadMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MarkReadAllNotificationsMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markReadAllNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ok"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const StripeUpdateDefaultPaymentMethodMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"stripeUpdateDefaultPaymentMethodMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateDefaultPaymentMethodMutationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateDefaultPaymentMethod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"subscriptionActiveSubscriptionFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"paymentMethodEdge"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment_"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"subscriptionActiveSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionScheduleType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnd"}},{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"product"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"trialEnd"}},{"kind":"Field","name":{"kind":"Name","value":"trialStart"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canActivateTrial"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPaymentMethod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"stripePaymentMethodFragment_"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"stripePaymentMethodFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StripePaymentMethodType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pk"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"card"}},{"kind":"Field","name":{"kind":"Name","value":"billingDetails"}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/packages/webapp-libs/webapp-api-client/src/hooks/index.ts b/packages/webapp-libs/webapp-api-client/src/hooks/index.ts new file mode 100644 index 000000000..67c3d3a73 --- /dev/null +++ b/packages/webapp-libs/webapp-api-client/src/hooks/index.ts @@ -0,0 +1 @@ +export * from './useApiForm'; diff --git a/packages/webapp/src/shared/hooks/useApiForm/__tests__/useApiForm.hook.spec.tsx b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/__tests__/useApiForm.hook.spec.tsx similarity index 98% rename from packages/webapp/src/shared/hooks/useApiForm/__tests__/useApiForm.hook.spec.tsx rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/__tests__/useApiForm.hook.spec.tsx index 53fecd412..fb8f5683f 100644 --- a/packages/webapp/src/shared/hooks/useApiForm/__tests__/useApiForm.hook.spec.tsx +++ b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/__tests__/useApiForm.hook.spec.tsx @@ -1,7 +1,7 @@ import { act } from '@testing-library/react-hooks'; import { GraphQLError } from 'graphql/error/GraphQLError'; -import { renderHook } from '../../../../tests/utils/rendering'; +import { renderHook } from '../../../tests/utils/rendering'; import { useApiForm } from '../useApiForm.hook'; import { UseApiFormArgs } from '../useApiForm.types'; diff --git a/packages/webapp/src/shared/hooks/useApiForm/index.ts b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/index.ts similarity index 100% rename from packages/webapp/src/shared/hooks/useApiForm/index.ts rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/index.ts diff --git a/packages/webapp/src/shared/hooks/useApiForm/useApiForm.hook.ts b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useApiForm.hook.ts similarity index 95% rename from packages/webapp/src/shared/hooks/useApiForm/useApiForm.hook.ts rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useApiForm.hook.ts index 60a843d11..7415e4a8c 100644 --- a/packages/webapp/src/shared/hooks/useApiForm/useApiForm.hook.ts +++ b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useApiForm.hook.ts @@ -1,10 +1,10 @@ -import { FormSubmitError } from '@sb/webapp-api-client/api/types'; +import { camelCaseKeys } from '@sb/webapp-core/utils'; import { GraphQLError } from 'graphql/error/GraphQLError'; import { isEmpty, isNil, keys } from 'ramda'; import { useCallback, useState } from 'react'; import { FieldValues, Path, useForm } from 'react-hook-form'; -import { camelCaseKeys } from '../../utils/object'; +import { FormSubmitError } from '../../api/types'; import { GraphQLValidationError, UseApiFormArgs } from './useApiForm.types'; import { useTranslatedErrors } from './useTranslatedErrors'; diff --git a/packages/webapp/src/shared/hooks/useApiForm/useApiForm.types.ts b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useApiForm.types.ts similarity index 93% rename from packages/webapp/src/shared/hooks/useApiForm/useApiForm.types.ts rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useApiForm.types.ts index 5b9439e68..8313b0729 100644 --- a/packages/webapp/src/shared/hooks/useApiForm/useApiForm.types.ts +++ b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useApiForm.types.ts @@ -1,6 +1,6 @@ -import { FormSubmitError } from '@sb/webapp-api-client/api/types'; import { DeepMap, FieldValues, UseFormProps, UseFormReturn } from 'react-hook-form'; +import { FormSubmitError } from '../../api/types'; import { useApiForm } from './useApiForm.hook'; export type FieldErrorMessages = Record; diff --git a/packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/__tests__/useTranslatedErrors.hook.spec.tsx b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/__tests__/useTranslatedErrors.hook.spec.tsx similarity index 93% rename from packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/__tests__/useTranslatedErrors.hook.spec.tsx rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/__tests__/useTranslatedErrors.hook.spec.tsx index c2b5c43a8..80e2ce381 100644 --- a/packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/__tests__/useTranslatedErrors.hook.spec.tsx +++ b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/__tests__/useTranslatedErrors.hook.spec.tsx @@ -1,4 +1,4 @@ -import { renderHook } from '../../../../../tests/utils/rendering'; +import { renderHook } from '../../../../tests/utils/rendering'; import { ErrorMessages } from '../../useApiForm.types'; import { useTranslatedErrors } from '../useTranslatedErrors.hook'; diff --git a/packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/index.ts b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/index.ts similarity index 100% rename from packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/index.ts rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/index.ts diff --git a/packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/useTranslatedErrors.hook.ts b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/useTranslatedErrors.hook.ts similarity index 93% rename from packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/useTranslatedErrors.hook.ts rename to packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/useTranslatedErrors.hook.ts index 58d5c90f0..baf9dec9e 100644 --- a/packages/webapp/src/shared/hooks/useApiForm/useTranslatedErrors/useTranslatedErrors.hook.ts +++ b/packages/webapp-libs/webapp-api-client/src/hooks/useApiForm/useTranslatedErrors/useTranslatedErrors.hook.ts @@ -1,8 +1,8 @@ -import { FieldError } from '@sb/webapp-api-client/api/types'; import { path } from 'ramda'; import { useCallback, useState } from 'react'; import { FieldValues, Path } from 'react-hook-form'; +import { FieldError } from '../../../api/types'; import { ErrorMessages, FieldErrorMessages } from '../useApiForm.types'; export const useTranslatedErrors = ( diff --git a/packages/webapp-libs/webapp-api-client/src/tests/factories/commonQuery.tsx b/packages/webapp-libs/webapp-api-client/src/tests/factories/commonQuery.ts similarity index 94% rename from packages/webapp-libs/webapp-api-client/src/tests/factories/commonQuery.tsx rename to packages/webapp-libs/webapp-api-client/src/tests/factories/commonQuery.ts index 793e07067..cff2b6b99 100644 --- a/packages/webapp-libs/webapp-api-client/src/tests/factories/commonQuery.tsx +++ b/packages/webapp-libs/webapp-api-client/src/tests/factories/commonQuery.ts @@ -1,5 +1,5 @@ import { CurrentUserType } from '../../graphql'; -import { commonQueryCurrentUserQuery } from '../../providers/commonQuery/commonQuery.graphql'; +import { commonQueryCurrentUserQuery } from '../../providers/commonQuery'; import { composeMockedQueryResult } from '../../tests/utils'; export const fillCommonQueryWithUser = (currentUser: CurrentUserType | null = null) => { diff --git a/packages/webapp-libs/webapp-api-client/src/tests/factories/index.ts b/packages/webapp-libs/webapp-api-client/src/tests/factories/index.ts index 365bdb609..9a4a1968f 100644 --- a/packages/webapp-libs/webapp-api-client/src/tests/factories/index.ts +++ b/packages/webapp-libs/webapp-api-client/src/tests/factories/index.ts @@ -1,6 +1,5 @@ export * from './auth'; export * from './document'; -export * from './notification'; export * from './stripe'; export * from './subscription'; export * from './commonQuery'; diff --git a/packages/webapp-libs/webapp-api-client/src/tests/factories/notification.ts b/packages/webapp-libs/webapp-api-client/src/tests/factories/notification.ts deleted file mode 100644 index 5b461a2f5..000000000 --- a/packages/webapp-libs/webapp-api-client/src/tests/factories/notification.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NotificationType } from '../../graphql'; -import { createFactory, makeId } from '../utils'; -import { currentUserFactory } from './auth'; - -export const notificationFactory = createFactory(() => ({ - id: makeId(32), - type: 'CRUD_ITEM_CREATED', - data: {}, - createdAt: new Date().toISOString(), - readAt: null, - user: currentUserFactory(), -})); diff --git a/packages/webapp-libs/webapp-api-client/src/tests/utils/rendering.tsx b/packages/webapp-libs/webapp-api-client/src/tests/utils/rendering.tsx index 2391a63e9..3bda99cf6 100644 --- a/packages/webapp-libs/webapp-api-client/src/tests/utils/rendering.tsx +++ b/packages/webapp-libs/webapp-api-client/src/tests/utils/rendering.tsx @@ -1,5 +1,6 @@ import { MockedProvider as MockedApolloProvider, MockedProviderProps, MockedResponse } from '@apollo/client/testing'; import * as coreUtils from '@sb/webapp-core/tests/utils/rendering'; +import { CoreTestProviders, CoreTestProvidersProps } from '@sb/webapp-core/tests/utils/rendering'; import { StoryContext } from '@storybook/react'; import { RenderOptions, render, renderHook, waitFor } from '@testing-library/react'; import { ComponentClass, ComponentType, FC, PropsWithChildren, ReactElement } from 'react'; @@ -7,18 +8,12 @@ import { ComponentClass, ComponentType, FC, PropsWithChildren, ReactElement } fr import { CommonQuery } from '../../providers'; import { fillCommonQueryWithUser } from '../factories'; -export type DefaultTestProvidersProps = PropsWithChildren< - { - apolloMocks?: ReadonlyArray; - apolloProviderProps: MockedProviderProps; - } & coreUtils.DefaultTestProvidersProps ->; - -export function DefaultTestProviders({ - children, - apolloMocks = [], - apolloProviderProps = {}, -}: DefaultTestProvidersProps) { +export type ApiTestProvidersProps = PropsWithChildren<{ + apolloMocks?: ReadonlyArray; + apolloProviderProps?: MockedProviderProps; +}>; + +export function ApiTestProviders({ children, apolloMocks = [], apolloProviderProps = {} }: ApiTestProvidersProps) { return ( {children} @@ -26,23 +21,21 @@ export function DefaultTestProviders({ ); } -export type WrapperProps

= Partial< - Omit -> & { +export type WrapperProps = Partial> & { apolloMocks?: | ReadonlyArray | ((mocks: ReadonlyArray, storyContext?: StoryContext) => ReadonlyArray); }; -export function getWrapper

( - WrapperComponent: ComponentClass

| FC

, - wrapperProps: WrapperProps

, +export function getWrapper( + WrapperComponent: ComponentClass | FC, + wrapperProps: WrapperProps, storyContext?: StoryContext ): { - wrapper: ComponentType

; + wrapper: ComponentType; waitForApolloMocks: (mockIndex?: number) => Promise; } { - const { wrapper: CoreWrapper } = coreUtils.getWrapper(coreUtils.DefaultTestProviders, wrapperProps); + const { wrapper: CoreWrapper } = coreUtils.getWrapper(CoreTestProviders, wrapperProps); const apolloMocks = (() => { const defaultApolloMocks = [fillCommonQueryWithUser()]; @@ -65,7 +58,7 @@ export function getWrapper

expect(apolloMocks[mockIndex].result).toHaveBeenCalled()); }; - const wrapper = (props: P) => { + const wrapper = (props: WrapperProps) => { return ( @@ -79,14 +72,10 @@ export function getWrapper

= RenderOptions & - WrapperProps

; +export type CustomRenderOptions = RenderOptions & WrapperProps; -function customRender

( - ui: ReactElement, - options: CustomRenderOptions

= {} -) { - const { wrapper, waitForApolloMocks } = getWrapper(DefaultTestProviders, options); +function customRender(ui: ReactElement, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(ApiTestProviders, options); return { ...render(ui, { @@ -97,11 +86,8 @@ function customRender

( - hook: (initialProps: Props) => Result, - options: CustomRenderOptions

= {} -) { - const { wrapper, waitForApolloMocks } = getWrapper(DefaultTestProviders, options); +function customRenderHook(hook: (initialProps: Props) => Result, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(ApiTestProviders, options); return { ...renderHook(hook, { diff --git a/packages/webapp-libs/webapp-api-client/tsconfig.lib.json b/packages/webapp-libs/webapp-api-client/tsconfig.lib.json index 1b5eb94a6..977345bb3 100644 --- a/packages/webapp-libs/webapp-api-client/tsconfig.lib.json +++ b/packages/webapp-libs/webapp-api-client/tsconfig.lib.json @@ -20,6 +20,14 @@ "forceConsistentCasingInFileNames": true, "jsx": "react-jsx" }, - "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": [ + "jest.config.ts", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] } diff --git a/packages/webapp-libs/webapp-api-client/tsconfig.spec.json b/packages/webapp-libs/webapp-api-client/tsconfig.spec.json index 3cfd2a83a..27777e4d7 100644 --- a/packages/webapp-libs/webapp-api-client/tsconfig.spec.json +++ b/packages/webapp-libs/webapp-api-client/tsconfig.spec.json @@ -4,7 +4,17 @@ "outDir": "../../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"], - "esModuleInterop": true + "esModuleInterop": true, + "jsx": "react-jsx" }, - "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.d.ts", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] } diff --git a/packages/webapp-libs/webapp-contentful/src/config/routes.ts b/packages/webapp-libs/webapp-contentful/src/config/routes.ts index a1e681d75..b9cb2a84f 100644 --- a/packages/webapp-libs/webapp-contentful/src/config/routes.ts +++ b/packages/webapp-libs/webapp-contentful/src/config/routes.ts @@ -1,4 +1,6 @@ export const RoutesConfig = { + privacyPolicy: 'privacy-policy', + termsAndConditions: 'terms-and-conditions', demoItems: 'demo-items', demoItem: 'demo-items/:id', }; diff --git a/packages/webapp-libs/webapp-contentful/src/tests/utils/rendering.tsx b/packages/webapp-libs/webapp-contentful/src/tests/utils/rendering.tsx index 1dba2f6d5..8b0586101 100644 --- a/packages/webapp-libs/webapp-contentful/src/tests/utils/rendering.tsx +++ b/packages/webapp-libs/webapp-contentful/src/tests/utils/rendering.tsx @@ -1,93 +1,25 @@ -import { MockedProvider as MockedApolloProvider, MockedProviderProps, MockedResponse } from '@apollo/client/testing'; -import { CommonQuery } from '@sb/webapp-api-client/providers'; -import { fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; -import * as coreUtils from '@sb/webapp-core/tests/utils/rendering'; +import * as apiUtils from '@sb/webapp-api-client/tests/utils/rendering'; import * as corePath from '@sb/webapp-core/utils/path'; -import { StoryContext } from '@storybook/react'; -import { RenderOptions, render, renderHook, waitFor } from '@testing-library/react'; -import { ComponentClass, ComponentType, FC, PropsWithChildren, ReactElement } from 'react'; +import { RenderOptions, render, renderHook } from '@testing-library/react'; +import { ComponentClass, ComponentType, FC, ReactElement } from 'react'; import { MemoryRouterProps, generatePath } from 'react-router'; -export type DefaultTestProvidersProps = PropsWithChildren< - { - apolloMocks?: ReadonlyArray; - apolloProviderProps: MockedProviderProps; - } & coreUtils.DefaultTestProvidersProps ->; +export type WrapperProps = apiUtils.WrapperProps; -export function DefaultTestProviders({ - children, - apolloMocks = [], - apolloProviderProps = {}, -}: DefaultTestProvidersProps) { - return ( - - {children} - - ); -} - -export type WrapperProps

= Partial< - Omit -> & { - apolloMocks?: - | ReadonlyArray - | ((mocks: ReadonlyArray, storyContext?: StoryContext) => ReadonlyArray); -}; - -export function getWrapper

( - WrapperComponent: ComponentClass

| FC

, - wrapperProps: WrapperProps

, - storyContext?: StoryContext +export function getWrapper( + WrapperComponent: ComponentClass | FC, + wrapperProps: WrapperProps ): { - wrapper: ComponentType

; + wrapper: ComponentType; waitForApolloMocks: (mockIndex?: number) => Promise; } { - const { wrapper: CoreWrapper } = coreUtils.getWrapper(coreUtils.DefaultTestProviders, wrapperProps); - const apolloMocks = (() => { - const defaultApolloMocks = [fillCommonQueryWithUser()]; - - if (typeof wrapperProps.apolloMocks === 'function') { - return wrapperProps.apolloMocks(defaultApolloMocks, storyContext); - } - - if (wrapperProps.apolloMocks !== undefined) { - return wrapperProps.apolloMocks; - } - - return defaultApolloMocks; - })(); - - const waitForApolloMocks = async (mockIndex: number = apolloMocks.length - 1) => { - if (!apolloMocks.length) { - return Promise.resolve(); - } - - await waitFor(() => expect(apolloMocks[mockIndex].result).toHaveBeenCalled()); - }; - - const wrapper = (props: P) => { - return ( - - - - ); - }; - - return { - wrapper, - waitForApolloMocks, - }; + return apiUtils.getWrapper(apiUtils.ApiTestProviders, wrapperProps); } -export type CustomRenderOptions

= RenderOptions & - WrapperProps

; +export type CustomRenderOptions = RenderOptions & WrapperProps; -function customRender

( - ui: ReactElement, - options: CustomRenderOptions

= {} -) { - const { wrapper, waitForApolloMocks } = getWrapper(DefaultTestProviders, options); +function customRender(ui: ReactElement, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); return { ...render(ui, { @@ -98,11 +30,8 @@ function customRender

( - hook: (initialProps: Props) => Result, - options: CustomRenderOptions

= {} -) { - const { wrapper, waitForApolloMocks } = getWrapper(DefaultTestProviders, options); +function customRenderHook(hook: (initialProps: Props) => Result, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); return { ...renderHook(hook, { @@ -115,10 +44,7 @@ function customRenderHook, - params?: Record -): MemoryRouterProps => { +export const createMockRouterProps = (pathName: string, params?: Record): MemoryRouterProps => { return { initialEntries: [ generatePath(corePath.getLocalePath(pathName), { diff --git a/packages/webapp-libs/webapp-contentful/src/utils/storybook.tsx b/packages/webapp-libs/webapp-contentful/src/utils/storybook.tsx index 7f54943ba..f631dd1b3 100644 --- a/packages/webapp-libs/webapp-contentful/src/utils/storybook.tsx +++ b/packages/webapp-libs/webapp-contentful/src/utils/storybook.tsx @@ -1,19 +1,14 @@ +import { ApiTestProviders } from '@sb/webapp-api-client/tests/utils/rendering'; import { Story } from '@storybook/react'; -import { DefaultTestProviders, DefaultTestProvidersProps, WrapperProps, getWrapper } from '../tests/utils/rendering'; +import { WrapperProps, getWrapper } from '../tests/utils/rendering'; -export function withProviders

( - wrapperProps: WrapperProps

= {} -) { +export function withProviders(wrapperProps: WrapperProps = {}) { return (StoryComponent: Story) => { - const { wrapper: WrapperComponent } = getWrapper(DefaultTestProviders, wrapperProps); + const { wrapper: WrapperComponent } = getWrapper(ApiTestProviders, wrapperProps); return ( - + ); diff --git a/packages/webapp-libs/webapp-contentful/tsconfig.lib.json b/packages/webapp-libs/webapp-contentful/tsconfig.lib.json index 1b5eb94a6..977345bb3 100644 --- a/packages/webapp-libs/webapp-contentful/tsconfig.lib.json +++ b/packages/webapp-libs/webapp-contentful/tsconfig.lib.json @@ -20,6 +20,14 @@ "forceConsistentCasingInFileNames": true, "jsx": "react-jsx" }, - "include": ["src/**/*.ts"], - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": [ + "jest.config.ts", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] } diff --git a/packages/webapp-libs/webapp-contentful/tsconfig.spec.json b/packages/webapp-libs/webapp-contentful/tsconfig.spec.json index 3cfd2a83a..3bc25e0a4 100644 --- a/packages/webapp-libs/webapp-contentful/tsconfig.spec.json +++ b/packages/webapp-libs/webapp-contentful/tsconfig.spec.json @@ -4,7 +4,15 @@ "outDir": "../../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"], - "esModuleInterop": true + "esModuleInterop": true, + "jsx": "react-jsx" }, - "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] } diff --git a/packages/webapp-libs/webapp-core/package.json b/packages/webapp-libs/webapp-core/package.json index 04b5bf2ac..c057fee23 100644 --- a/packages/webapp-libs/webapp-core/package.json +++ b/packages/webapp-libs/webapp-core/package.json @@ -18,16 +18,6 @@ "peerDependencies": { "@iconify-icons/ion": "^1.2.4", "@iconify/react": "^4.0.0", - "@storybook/react": "^6.5.16", - "@testing-library/dom": "^8.19.0", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^13.4.0", - "@testing-library/react-hooks": "^8.0.1", - "@testing-library/user-event": "^14.4.3", - "babel-jest": "28.1.3", - "jest": "28.1.3", - "jest-environment-jsdom": "28.1.3", - "msw": "^1.0.0", "react-markdown": "^8.0.3", "react-dom": "18.2.0", "react-router": "^6.7.0", @@ -52,6 +42,7 @@ "@storybook/client-api": "^6.5.16", "@storybook/client-logger": "^6.5.16", "@storybook/react": "^6.5.16", + "@supercharge/strings": "^2.0.0", "@testing-library/dom": "^8.19.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/packages/webapp/src/shared/components/emptyState/__tests__/emptyState.component.spec.tsx b/packages/webapp-libs/webapp-core/src/components/emptyState/__tests__/emptyState.component.spec.tsx similarity index 93% rename from packages/webapp/src/shared/components/emptyState/__tests__/emptyState.component.spec.tsx rename to packages/webapp-libs/webapp-core/src/components/emptyState/__tests__/emptyState.component.spec.tsx index 76f396680..7fe34657b 100644 --- a/packages/webapp/src/shared/components/emptyState/__tests__/emptyState.component.spec.tsx +++ b/packages/webapp-libs/webapp-core/src/components/emptyState/__tests__/emptyState.component.spec.tsx @@ -1,6 +1,6 @@ import { screen } from '@testing-library/react'; -import { PLACEHOLDER_CONTENT, PLACEHOLDER_TEST_ID, render } from '../../../../tests/utils/rendering'; +import { PLACEHOLDER_CONTENT, PLACEHOLDER_TEST_ID, render } from '../../../tests/utils/rendering'; import { EmptyState, EmptyStateProps } from '../emptyState.component'; describe('EmptyState: Component', () => { diff --git a/packages/webapp/src/shared/components/emptyState/emptyState.component.tsx b/packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.component.tsx similarity index 100% rename from packages/webapp/src/shared/components/emptyState/emptyState.component.tsx rename to packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.component.tsx diff --git a/packages/webapp/src/shared/components/emptyState/emptyState.stories.tsx b/packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.stories.tsx similarity index 100% rename from packages/webapp/src/shared/components/emptyState/emptyState.stories.tsx rename to packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.stories.tsx diff --git a/packages/webapp/src/shared/components/emptyState/emptyState.styles.ts b/packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.styles.ts similarity index 83% rename from packages/webapp/src/shared/components/emptyState/emptyState.styles.ts rename to packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.styles.ts index 3fd9be82e..3a271e232 100644 --- a/packages/webapp/src/shared/components/emptyState/emptyState.styles.ts +++ b/packages/webapp-libs/webapp-core/src/components/emptyState/emptyState.styles.ts @@ -1,6 +1,7 @@ -import { color, size, typography } from '@sb/webapp-core/theme'; import styled from 'styled-components'; +import { color, size, typography } from '../../theme'; + export const Container = styled.span` display: flex; justify-content: center; diff --git a/packages/webapp/src/shared/components/emptyState/index.ts b/packages/webapp-libs/webapp-core/src/components/emptyState/index.ts similarity index 100% rename from packages/webapp/src/shared/components/emptyState/index.ts rename to packages/webapp-libs/webapp-core/src/components/emptyState/index.ts diff --git a/packages/webapp-libs/webapp-core/src/hooks/index.ts b/packages/webapp-libs/webapp-core/src/hooks/index.ts index ba4aa3ba1..35beb1ee9 100644 --- a/packages/webapp-libs/webapp-core/src/hooks/index.ts +++ b/packages/webapp-libs/webapp-core/src/hooks/index.ts @@ -4,3 +4,4 @@ export * from './useLocale'; export * from './useWindowListener'; export * from './useMappedConnection'; export * from './useMediaQuery'; +export * from './useOpenState'; diff --git a/packages/webapp/src/shared/hooks/useOpenState/__tests__/useOpenState.hook.spec.ts b/packages/webapp-libs/webapp-core/src/hooks/useOpenState/__tests__/useOpenState.hook.spec.ts similarity index 100% rename from packages/webapp/src/shared/hooks/useOpenState/__tests__/useOpenState.hook.spec.ts rename to packages/webapp-libs/webapp-core/src/hooks/useOpenState/__tests__/useOpenState.hook.spec.ts diff --git a/packages/webapp/src/shared/hooks/useOpenState/index.ts b/packages/webapp-libs/webapp-core/src/hooks/useOpenState/index.ts similarity index 100% rename from packages/webapp/src/shared/hooks/useOpenState/index.ts rename to packages/webapp-libs/webapp-core/src/hooks/useOpenState/index.ts diff --git a/packages/webapp/src/shared/hooks/useOpenState/useOpenState.hook.ts b/packages/webapp-libs/webapp-core/src/hooks/useOpenState/useOpenState.hook.ts similarity index 100% rename from packages/webapp/src/shared/hooks/useOpenState/useOpenState.hook.ts rename to packages/webapp-libs/webapp-core/src/hooks/useOpenState/useOpenState.hook.ts diff --git a/packages/webapp-libs/webapp-core/src/tests/utils/rendering.tsx b/packages/webapp-libs/webapp-core/src/tests/utils/rendering.tsx index 8145ed60f..1cd061dc3 100644 --- a/packages/webapp-libs/webapp-core/src/tests/utils/rendering.tsx +++ b/packages/webapp-libs/webapp-core/src/tests/utils/rendering.tsx @@ -24,13 +24,13 @@ export const SnackbarMessages = styled.div` `} `; -export type DefaultTestProvidersProps = PropsWithChildren<{ +export type CoreTestProvidersProps = PropsWithChildren<{ routerProps: MemoryRouterProps; intlLocale: Locale; intlMessages: TranslationMessages; }>; -export function DefaultTestProviders({ children, routerProps, intlMessages, intlLocale }: DefaultTestProvidersProps) { +export function CoreTestProviders({ children, routerProps, intlMessages, intlLocale }: CoreTestProvidersProps) { return ( @@ -53,17 +53,17 @@ export function DefaultTestProviders({ children, routerProps, intlMessages, intl ); } -export type WrapperProps

= Partial

; +export type WrapperProps = Partial; -export function getWrapper

( - WrapperComponent: ComponentClass

| FC

, - wrapperProps: WrapperProps

+export function getWrapper( + WrapperComponent: ComponentClass | FC, + wrapperProps: WrapperProps ): { - wrapper: ComponentType

; + wrapper: ComponentType; } { const defaultRouterProps: MemoryRouterProps = { initialEntries: ['/'] }; - const wrapper = (props: P) => { + const wrapper = (props: PropsWithChildren) => { return ( = RenderOptions & - WrapperProps

; +export type CustomRenderOptions = RenderOptions & WrapperProps; -function customRender

( - ui: ReactElement, - options: CustomRenderOptions

= {} -) { - const { wrapper } = getWrapper(DefaultTestProviders, options); +function customRender(ui: ReactElement, options: CustomRenderOptions = {}) { + const { wrapper } = getWrapper(CoreTestProviders, options); return { ...render(ui, { @@ -97,11 +93,8 @@ function customRender

( - hook: (initialProps: Props) => Result, - options: CustomRenderOptions

= {} -) { - const { wrapper } = getWrapper(DefaultTestProviders, options); +function customRenderHook(hook: (initialProps: Props) => Result, options: CustomRenderOptions = {}) { + const { wrapper } = getWrapper(CoreTestProviders, options); return { ...renderHook(hook, { @@ -112,3 +105,6 @@ function customRenderHookcontent; diff --git a/packages/webapp-libs/webapp-core/src/utils/index.ts b/packages/webapp-libs/webapp-core/src/utils/index.ts index 8bb93e3b3..f20fea828 100644 --- a/packages/webapp-libs/webapp-core/src/utils/index.ts +++ b/packages/webapp-libs/webapp-core/src/utils/index.ts @@ -1,2 +1,3 @@ export * from './assertUnreachable'; export * from './path'; +export * from './object'; diff --git a/packages/webapp/src/shared/utils/object.ts b/packages/webapp-libs/webapp-core/src/utils/object.ts similarity index 100% rename from packages/webapp/src/shared/utils/object.ts rename to packages/webapp-libs/webapp-core/src/utils/object.ts diff --git a/packages/webapp-libs/webapp-core/src/utils/storybook.tsx b/packages/webapp-libs/webapp-core/src/utils/storybook.tsx index 336397f39..00b1b37f7 100644 --- a/packages/webapp-libs/webapp-core/src/utils/storybook.tsx +++ b/packages/webapp-libs/webapp-core/src/utils/storybook.tsx @@ -1,26 +1,13 @@ import { Story } from '@storybook/react'; -import { - DefaultTestProviders, - DefaultTestProvidersProps, - WrapperProps, - getWrapper, -} from '../tests/utils/rendering'; -export function withProviders< - P extends DefaultTestProvidersProps = DefaultTestProvidersProps ->(wrapperProps: WrapperProps

= {}) { +import { CoreTestProviders, WrapperProps, getWrapper } from '../tests/utils/rendering'; + +export function withProviders(wrapperProps: WrapperProps = {}) { return (StoryComponent: Story) => { - const { wrapper: WrapperComponent } = getWrapper( - DefaultTestProviders, - wrapperProps - ); + const { wrapper: WrapperComponent } = getWrapper(CoreTestProviders, wrapperProps); return ( - + ); diff --git a/packages/webapp-libs/webapp-crud-demo/.eslintrc.json b/packages/webapp-libs/webapp-crud-demo/.eslintrc.json new file mode 100644 index 000000000..9562b9edd --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/.eslintrc.json @@ -0,0 +1,38 @@ +{ + "extends": ["plugin:@nrwl/nx/react", "../../../.eslintrc.json"], + "ignorePatterns": ["!**/*", "node_modules/**/*"], + "plugins": ["react-hooks", "formatjs", "testing-library"], + "rules": { + "import/order": ["error"], + "formatjs/no-offset": "error", + "react/jsx-curly-brace-presence": "error" + }, + "overrides": [ + { + "files": "*.stories.tsx", + "rules": { + "import/no-anonymous-default-export": "off" + } + }, + { + "files": "*.{ts,tsx}", + "rules": { + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "import/no-anonymous-default-export": "off", + "@typescript-eslint/no-explicit-any": "off", + "no-empty": "off", + "react/jsx-no-useless-fragment": "off" + } + }, + { + "files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"], + "extends": ["plugin:testing-library/react"], + "rules": { + "testing-library/render-result-naming-convention": "off", + "testing-library/no-node-access": "off" + } + } + ] +} diff --git a/packages/webapp-libs/webapp-crud-demo/.prettierrc b/packages/webapp-libs/webapp-crud-demo/.prettierrc new file mode 100644 index 000000000..af20e9802 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/.prettierrc @@ -0,0 +1,14 @@ +{ + "plugins": ["@trivago/prettier-plugin-sort-imports"], + "printWidth": 120, + "singleQuote": true, + "trailingComma": "es5", + "importOrder": [ + "^(path|dns|fs)/?", + "", + "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", + "^[./]" + ], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true +} diff --git a/packages/webapp-libs/webapp-crud-demo/graphql/codegen.ts b/packages/webapp-libs/webapp-crud-demo/graphql/codegen.ts new file mode 100644 index 000000000..e50d10dd0 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/graphql/codegen.ts @@ -0,0 +1,13 @@ +import { CodegenConfig } from '@graphql-codegen/cli'; + +const config: Partial = { + generates: { + 'src/graphql/__generated/gql/': { + documents: ['../webapp-crud-demo/src/**/*.ts', '../webapp-crud-demo/src/**/*.tsx'], + + plugins: [], + }, + }, +}; + +export default config; diff --git a/packages/webapp-libs/webapp-crud-demo/jest.config.ts b/packages/webapp-libs/webapp-crud-demo/jest.config.ts new file mode 100644 index 000000000..663ac4db5 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'webapp-crud-demo', + preset: '../../../jest.preset.js', + transform: { + '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest', + '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/react/babel'] }], + }, + transformIgnorePatterns: ['/node_modules/(?!(@iconify-icons|react-markdown)/)'], + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + moduleNameMapper: { + 'react-markdown': '/node_modules/react-markdown/react-markdown.min.js', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageReporters: ['lcov'], + coveragePathIgnorePatterns: ['/node_modules/', '.*.svg'], + setupFilesAfterEnv: ['./src/tests/setupTests.ts'], + watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], +}; diff --git a/packages/webapp-libs/webapp-crud-demo/package.json b/packages/webapp-libs/webapp-crud-demo/package.json new file mode 100644 index 000000000..99b40f4a9 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/package.json @@ -0,0 +1,88 @@ +{ + "name": "@sb/webapp-crud-demo", + "version": "0.0.1", + "type": "commonjs", + "scripts": { + "test": "jest", + "test:watch": "jest --watch", + "lint": "eslint ." + }, + "dependencies": { + "@sb/webapp-core": "*", + "@sb/webapp-api-client": "*", + "@sb/webapp-notifications": "*", + "graphql": "^16.6.0", + "react-click-away-listener": "^2.2.2" + }, + "peerDependencies": { + "@iconify-icons/ion": "^1.2.4", + "@iconify/react": "^4.0.0", + "@apollo/client": "^3.7.9", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-router": "^6.7.0", + "react-router-dom": "^6.7.0", + "ramda": "^0.28.0", + "react-markdown": "^8.0.3", + "react-intl": "^6.2.1", + "@storybook/react": "^6.5.16", + "@testing-library/dom": "^8.19.0", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^13.4.0", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^14.4.3", + "babel-jest": "28.1.3", + "jest": "28.1.3", + "jest-environment-jsdom": "28.1.3", + "msw": "^1.0.0", + "styled-components": "5.3.6" + }, + "devDependencies": { + "@nrwl/react": "^15.8.6", + "@nrwl/jest": "^15.8.6", + "@iconify-icons/ion": "^1.2.4", + "@iconify/react": "^4.0.0", + "@apollo/client": "^3.7.9", + "@apollo/rover": "^0.12.2", + "@graphql-codegen/cli": "^2.13.11", + "@storybook/addon-actions": "^6.5.16", + "@storybook/addon-backgrounds": "^6.5.16", + "@storybook/addon-docs": "^6.5.16", + "@storybook/addon-essentials": "^6.5.16", + "@storybook/addon-measure": "^6.5.16", + "@storybook/addon-outline": "^6.5.16", + "@storybook/builder-vite": "^0.4.0", + "@storybook/client-api": "^6.5.16", + "@storybook/client-logger": "^6.5.16", + "@storybook/react": "^6.5.16", + "@testing-library/dom": "^8.19.0", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^13.4.0", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^14.4.3", + "@types/jest": "28.1.3", + "@types/testing-library__jest-dom": "^5.14.5", + "@types/ramda": "^0.28.23", + "@types/react": "^18.0.24", + "@types/styled-components": "^5.1.26", + "eslint-plugin-formatjs": "^4.3.4", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-react": "^7.21.5", + "eslint-plugin-react-hooks": "^4.0.0", + "eslint-plugin-testing-library": "^5.9.1", + "babel-jest": "28.1.3", + "jest": "28.1.3", + "jest-environment-jsdom": "28.1.3", + "jest-matcher-utils": "^29.4.2", + "jest-watch-typeahead": "^2.2.2", + "ts-jest": "28.0.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-router": "^6.7.0", + "react-router-dom": "^6.7.0", + "ramda": "^0.28.0", + "react-markdown": "^8.0.3", + "react-intl": "^6.2.1", + "styled-components": "5.3.6" + } +} diff --git a/packages/webapp-libs/webapp-crud-demo/project.json b/packages/webapp-libs/webapp-crud-demo/project.json new file mode 100644 index 000000000..446ebf73b --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/project.json @@ -0,0 +1,31 @@ +{ + "name": "webapp-crud-demo", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/webapp-libs/webapp-crud-demo/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/webapp-libs/webapp-crud-demo", + "main": "packages/webapp-libs/webapp-crud-demo/src/index.ts", + "tsConfig": "packages/webapp-libs/webapp-crud-demo/tsconfig.lib.json", + "assets": ["packages/webapp-libs/webapp-crud-demo/*.md"] + } + }, + "graphql": { + "executor": "nx:run-commands", + "options": { + "cwd": "packages/webapp-libs/webapp-crud-demo", + "color": true + }, + "configurations": { + "download-schema": { + "commands": ["/bin/sh ./scripts/download-graphql-schema.sh"] + } + } + } + }, + "tags": [] +} diff --git a/packages/webapp-libs/webapp-crud-demo/sonar-project.properties b/packages/webapp-libs/webapp-crud-demo/sonar-project.properties new file mode 100644 index 000000000..1f9ffe484 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.organization=apptension +sonar.projectKey=saas_boilerplate_webapp_crud_demo +sonar.javascript.lcov.reportPaths=coverage/lcov.info + +# Define the same root directory for sources and tests +sonar.sources = src/ +sonar.tests = src/ + +# Include test subdirectories in test scope +sonar.test.inclusions = src/**/*.spec.* + +# Exclude test and generated subdirectories from source scope +sonar.exclusions = src/**/*.spec.* +sonar.coverage.exclusions = src/**/*.stories.*, diff --git a/packages/webapp-libs/webapp-crud-demo/src/config/routes.ts b/packages/webapp-libs/webapp-crud-demo/src/config/routes.ts new file mode 100644 index 000000000..189f68ad2 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/config/routes.ts @@ -0,0 +1,10 @@ +import { nestedPath } from '@sb/webapp-core/utils'; + +export const RoutesConfig = { + crudDemoItem: nestedPath('crud-demo-item', { + list: '', + details: ':id', + edit: ':id/edit', + add: 'add', + }), +}; diff --git a/packages/webapp/src/shared/components/notifications/templates/crudItemCreated/crudItemCreated.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/crudItemCreated.component.tsx similarity index 84% rename from packages/webapp/src/shared/components/notifications/templates/crudItemCreated/crudItemCreated.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/crudItemCreated.component.tsx index 8ee8be6fc..2f5d4ec47 100644 --- a/packages/webapp/src/shared/components/notifications/templates/crudItemCreated/crudItemCreated.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/crudItemCreated.component.tsx @@ -1,10 +1,9 @@ import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; +import { Notification, NotificationType } from '@sb/webapp-notifications'; import { FormattedMessage } from 'react-intl'; import { useNavigate } from 'react-router-dom'; -import { RoutesConfig } from '../../../../../app/config/routes'; -import { Notification } from '../../notification'; -import { NotificationType } from '../../notifications.types'; +import { RoutesConfig } from '../../config/routes'; export type CrudItemCreatedProps = NotificationType<{ id: string; diff --git a/packages/webapp/src/shared/components/notifications/templates/crudItemCreated/crudItemCreated.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/crudItemCreated.stories.tsx similarity index 85% rename from packages/webapp/src/shared/components/notifications/templates/crudItemCreated/crudItemCreated.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/crudItemCreated.stories.tsx index 33fd6cdb2..501d72150 100644 --- a/packages/webapp/src/shared/components/notifications/templates/crudItemCreated/crudItemCreated.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/crudItemCreated.stories.tsx @@ -1,7 +1,7 @@ +import { NotificationTypes } from '@sb/webapp-notifications'; import { Story } from '@storybook/react'; -import { withProviders } from '../../../../utils/storybook'; -import { NotificationTypes } from '../../notifications.types'; +import { withProviders } from '../../utils/storybook'; import { CrudItemCreated, CrudItemCreatedProps } from './crudItemCreated.component'; const Template: Story = (args: CrudItemCreatedProps) => { diff --git a/packages/webapp/src/shared/components/notifications/templates/crudItemCreated/index.ts b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/templates/crudItemCreated/index.ts rename to packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemCreated/index.ts diff --git a/packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/crudItemUpdated.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/crudItemUpdated.component.tsx similarity index 84% rename from packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/crudItemUpdated.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/crudItemUpdated.component.tsx index 8a9cc8e42..4d0c8ccda 100644 --- a/packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/crudItemUpdated.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/crudItemUpdated.component.tsx @@ -1,10 +1,9 @@ import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; +import { Notification, NotificationType } from '@sb/webapp-notifications'; import { FormattedMessage } from 'react-intl'; import { useNavigate } from 'react-router-dom'; -import { RoutesConfig } from '../../../../../app/config/routes'; -import { Notification } from '../../notification'; -import { NotificationType } from '../../notifications.types'; +import { RoutesConfig } from '../../config/routes'; export type CrudItemUpdatedProps = NotificationType<{ id: string; diff --git a/packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/crudItemUpdated.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/crudItemUpdated.stories.tsx similarity index 85% rename from packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/crudItemUpdated.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/crudItemUpdated.stories.tsx index 951c721e1..a40fb2bcb 100644 --- a/packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/crudItemUpdated.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/crudItemUpdated.stories.tsx @@ -1,7 +1,7 @@ +import { NotificationTypes } from '@sb/webapp-notifications'; import { Story } from '@storybook/react'; -import { withProviders } from '../../../../utils/storybook'; -import { NotificationTypes } from '../../notifications.types'; +import { withProviders } from '../../utils/storybook'; import { CrudItemUpdated, CrudItemUpdatedProps } from './crudItemUpdated.component'; const Template: Story = (args: CrudItemUpdatedProps) => { diff --git a/packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/index.ts b/packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/templates/crudItemUpdated/index.ts rename to packages/webapp-libs/webapp-crud-demo/src/notifications/crudItemUpdated/index.ts diff --git a/packages/webapp-libs/webapp-crud-demo/src/notifications/index.ts b/packages/webapp-libs/webapp-crud-demo/src/notifications/index.ts new file mode 100644 index 000000000..437793668 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/notifications/index.ts @@ -0,0 +1,2 @@ +export * from './crudItemCreated'; +export * from './crudItemUpdated'; diff --git a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/__tests__/addCrudDemoItem.component.spec.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/__tests__/addCrudDemoItem.component.spec.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/__tests__/addCrudDemoItem.component.spec.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/__tests__/addCrudDemoItem.component.spec.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.component.tsx similarity index 97% rename from packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.component.tsx index dad4fbfb8..24cdec306 100644 --- a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.component.tsx @@ -6,7 +6,7 @@ import { useSnackbar } from '@sb/webapp-core/snackbar'; import { FormattedMessage, useIntl } from 'react-intl'; import { useNavigate } from 'react-router'; -import { RoutesConfig } from '../../../app/config/routes'; +import { RoutesConfig } from '../../../config/routes'; import { CrudDemoItemForm } from '../crudDemoItemForm'; import { CrudDemoItemFormFields } from '../crudDemoItemForm/crudDemoItemForm.component'; import { crudDemoItemListItemFragment } from '../crudDemoItemList/crudDemoItemListItem'; diff --git a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.stories.tsx similarity index 84% rename from packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.stories.tsx index 1969bcca3..ac53c3c40 100644 --- a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.stories.tsx @@ -1,6 +1,6 @@ import { Story } from '@storybook/react'; -import { withProviders } from '../../../shared/utils/storybook'; +import { withProviders } from '../../../utils/storybook'; import { AddCrudDemoItem } from './addCrudDemoItem.component'; const Template: Story = () => { diff --git a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.styles.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.styles.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.styles.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/addCrudDemoItem.styles.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/index.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/index.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/addCrudDemoItem/index.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/addCrudDemoItem/index.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItem.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItem.component.tsx similarity index 55% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItem.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItem.component.tsx index 34e0faa85..d6a17583b 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItem.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItem.component.tsx @@ -1,20 +1,29 @@ -import { Route, Routes } from 'react-router-dom'; +import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; +import { FC } from 'react'; +import { Navigate, Route, Routes } from 'react-router-dom'; -import { NotFound } from '../../app/asyncComponents'; -import { RoutesConfig } from '../../app/config/routes'; +import { RoutesConfig } from '../../config/routes'; import { AddCrudDemoItem } from './addCrudDemoItem'; import { CrudDemoItemDetails } from './crudDemoItemDetails'; import { CrudDemoItemList } from './crudDemoItemList'; import { EditCrudDemoItem } from './editCrudDemoItem'; -export const CrudDemoItem = () => { +type CrudDemoItemProps = { + routesConfig: { + notFound: string; + }; +}; + +export const CrudDemoItem: FC = ({ routesConfig }) => { + const generateLocalePath = useGenerateLocalePath(); + return ( } /> } /> } /> } /> - } /> + } /> ); }; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/__tests__/crudDemoItemDetails.component.spec.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/__tests__/crudDemoItemDetails.component.spec.tsx similarity index 76% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/__tests__/crudDemoItemDetails.component.spec.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/__tests__/crudDemoItemDetails.component.spec.tsx index 9fe13c512..3385a2be2 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/__tests__/crudDemoItemDetails.component.spec.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/__tests__/crudDemoItemDetails.component.spec.tsx @@ -1,24 +1,24 @@ import { fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; +import { getLocalePath } from '@sb/webapp-core/utils'; import { screen } from '@testing-library/react'; import { Route, Routes } from 'react-router'; -import { RoutesConfig } from '../../../../app/config/routes'; +import { RoutesConfig } from '../../../../config/routes'; import { fillCrudDemoItemDetailsQuery } from '../../../../tests/factories'; import { createMockRouterProps, render } from '../../../../tests/utils/rendering'; import { CrudDemoItemDetails } from '../crudDemoItemDetails.component'; describe('CrudDemoItemDetails: Component', () => { - const routePath = ['crudDemoItem', 'details']; const defaultItemId = 'test-id'; const Component = () => ( - } /> + } /> ); it('should render item details', async () => { - const routerProps = createMockRouterProps(routePath, { id: defaultItemId }); + const routerProps = createMockRouterProps(RoutesConfig.crudDemoItem.details, { id: defaultItemId }); const variables = { id: defaultItemId }; const data = { id: defaultItemId, name: 'demo item name' }; const mockRequest = fillCrudDemoItemDetailsQuery(data, variables); diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.component.tsx similarity index 95% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.component.tsx index 59efb999f..072b01aee 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.component.tsx @@ -5,7 +5,7 @@ import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; import { FormattedMessage } from 'react-intl'; import { useParams } from 'react-router'; -import { RoutesConfig } from '../../../app/config/routes'; +import { RoutesConfig } from '../../../config/routes'; import { Container, Header } from './crudDemoItemDetails.styles'; export const crudDemoItemDetailsQuery = gql(/* GraphQL */ ` diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.stories.tsx similarity index 69% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.stories.tsx index ea9486fd1..4484bd131 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.stories.tsx @@ -1,20 +1,20 @@ +import { getLocalePath } from '@sb/webapp-core/utils'; import { Story } from '@storybook/react'; import { append } from 'ramda'; import { Route, Routes } from 'react-router'; -import { RoutesConfig } from '../../../app/config/routes'; +import { RoutesConfig } from '../../../config/routes'; import { fillCrudDemoItemDetailsQuery } from '../../../tests/factories'; -import { withProviders } from '../../../shared/utils/storybook'; import { createMockRouterProps } from '../../../tests/utils/rendering'; +import { withProviders } from '../../../utils/storybook'; import { CrudDemoItemDetails } from './crudDemoItemDetails.component'; -const routePath = ['crudDemoItem', 'details']; const defaultItemId = 'test-id'; const Template: Story = () => { return ( - } /> + } /> ); }; @@ -31,7 +31,7 @@ const data = { }; Default.decorators = [ withProviders({ - routerProps: createMockRouterProps(routePath, variables), + routerProps: createMockRouterProps(RoutesConfig.crudDemoItem.details, variables), apolloMocks: append(fillCrudDemoItemDetailsQuery(data, variables)), }), ]; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.styles.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.styles.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.styles.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/crudDemoItemDetails.styles.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/index.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/index.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemDetails/index.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemDetails/index.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/__tests__/crudDemoItemForm.component.spec.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/__tests__/crudDemoItemForm.component.spec.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/__tests__/crudDemoItemForm.component.spec.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/__tests__/crudDemoItemForm.component.spec.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.component.tsx similarity index 97% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.component.tsx index 7c4cecdb3..2e6003b96 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.component.tsx @@ -4,7 +4,7 @@ import { Input } from '@sb/webapp-core/components/forms'; import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; import { FormattedMessage, useIntl } from 'react-intl'; -import { RoutesConfig } from '../../../app/config/routes'; +import { RoutesConfig } from '../../../config/routes'; import { useCrudDemoItemForm } from './crudDemoItemForm.hook'; import { Buttons, Container, ErrorMessage, Fields, Form } from './crudDemoItemForm.styles'; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.hook.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.hook.ts similarity index 92% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.hook.ts rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.hook.ts index 606dc03f1..dc0f2cf32 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.hook.ts +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.hook.ts @@ -1,6 +1,6 @@ +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useEffect } from 'react'; -import { useApiForm } from '../../../shared/hooks'; import { CrudDemoItemFormFields, CrudDemoItemFormProps } from './crudDemoItemForm.component'; type UseCrudDemoItemFormProps = Omit; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.stories.tsx similarity index 90% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.stories.tsx index 6afbe833f..e73e8e2d2 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.stories.tsx @@ -1,6 +1,6 @@ import { Story } from '@storybook/react'; -import { withProviders } from '../../../shared/utils/storybook'; +import { withProviders } from '../../../utils/storybook'; import { CrudDemoItemForm, CrudDemoItemFormProps } from './crudDemoItemForm.component'; const Template: Story = (args: CrudDemoItemFormProps) => { diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.styles.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.styles.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.styles.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/crudDemoItemForm.styles.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/index.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/index.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemForm/index.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemForm/index.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/__tests__/crudDemoItemList.component.spec.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/__tests__/crudDemoItemList.component.spec.tsx similarity index 73% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/__tests__/crudDemoItemList.component.spec.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/__tests__/crudDemoItemList.component.spec.tsx index 2de910653..780aa498a 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/__tests__/crudDemoItemList.component.spec.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/__tests__/crudDemoItemList.component.spec.tsx @@ -1,26 +1,24 @@ import { fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; +import { getLocalePath } from '@sb/webapp-core/utils'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Route, Routes } from 'react-router-dom'; -import { RoutesConfig } from '../../../../app/config/routes'; +import { RoutesConfig } from '../../../../config/routes'; import { fillCrudDemoItemListQuery } from '../../../../tests/factories'; import { createMockRouterProps, render } from '../../../../tests/utils/rendering'; import { CrudDemoItemList } from '../crudDemoItemList.component'; describe('CrudDemoItemList: Component', () => { - const routePath = ['crudDemoItem', 'list']; - const addRoutePath = ['crudDemoItem', 'add']; - const Component = () => ( - } /> - CrudDemoItem add page mock} /> + } /> + CrudDemoItem add page mock} /> ); it('should render all items', async () => { - const routerProps = createMockRouterProps(routePath); + const routerProps = createMockRouterProps(RoutesConfig.crudDemoItem.list); const apolloMocks = [fillCommonQueryWithUser(), fillCrudDemoItemListQuery()]; render(, { routerProps, apolloMocks }); @@ -31,7 +29,7 @@ describe('CrudDemoItemList: Component', () => { }); it('should render link to add new item form', async () => { - const routerProps = createMockRouterProps(routePath); + const routerProps = createMockRouterProps(RoutesConfig.crudDemoItem.list); const apolloMocks = [fillCommonQueryWithUser(), fillCrudDemoItemListQuery()]; render(, { routerProps, apolloMocks }); diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.component.tsx similarity index 96% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.component.tsx index c382291c0..d7d1b65d1 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.component.tsx @@ -5,7 +5,7 @@ import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; import { mapConnection } from '@sb/webapp-core/utils/graphql'; import { FormattedMessage } from 'react-intl'; -import { RoutesConfig } from '../../../app/config/routes'; +import { RoutesConfig } from '../../../config/routes'; import { AddNewLink, Container, Header, List } from './crudDemoItemList.styles'; import { CrudDemoItemListItem } from './crudDemoItemListItem'; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.stories.tsx similarity index 85% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.stories.tsx index 0caa39892..8625ed4b6 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.stories.tsx @@ -1,8 +1,8 @@ import { Story } from '@storybook/react'; import { append } from 'ramda'; -import { fillCrudDemoItemListQuery } from '../../../tests/factories/crudDemoItem'; -import { withProviders } from '../../../shared/utils/storybook'; +import { fillCrudDemoItemListQuery } from '../../../tests/factories'; +import { withProviders } from '../../../utils/storybook'; import { CrudDemoItemList } from './crudDemoItemList.component'; const Template: Story = () => { diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.styles.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.styles.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.styles.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemList.styles.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/__tests__/crudDemoItemListItem.component.spec.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/__tests__/crudDemoItemListItem.component.spec.tsx similarity index 87% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/__tests__/crudDemoItemListItem.component.spec.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/__tests__/crudDemoItemListItem.component.spec.tsx index c7deb0223..2e1e8141c 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/__tests__/crudDemoItemListItem.component.spec.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/__tests__/crudDemoItemListItem.component.spec.tsx @@ -1,12 +1,13 @@ import { useQuery } from '@apollo/client'; -import { gql } from '@sb/webapp-api-client/graphql'; +import { gql } from '@sb/webapp-api-client'; import { fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; import { composeMockedQueryResult } from '@sb/webapp-api-client/tests/utils'; +import { getLocalePath } from '@sb/webapp-core/utils'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Route, Routes, useParams } from 'react-router'; -import { RoutesConfig } from '../../../../../app/config/routes'; +import { RoutesConfig } from '../../../../../config/routes'; import { render } from '../../../../../tests/utils/rendering'; import { CrudDemoItemListItem } from '../crudDemoItemListItem.component'; @@ -39,8 +40,8 @@ describe('CrudDemoItemListItem: Component', () => { return ( } /> - } /> - } /> + } /> + } /> ); }; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.component.tsx similarity index 98% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.component.tsx index fd384102d..49bd48f4a 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.component.tsx @@ -9,7 +9,7 @@ import { media } from '@sb/webapp-core/theme'; import { MouseEvent } from 'react'; import { FormattedMessage } from 'react-intl'; -import { RoutesConfig } from '../../../../app/config/routes'; +import { RoutesConfig } from '../../../../config/routes'; import { crudDemoItemListItemDeleteMutation, crudDemoItemListItemFragment } from './crudDemoItemListItem.graphql'; import { Container, DropdownMenu, InlineButtons, LinkContainer, Text } from './crudDemoItemListItem.styles'; diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.graphql.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.graphql.ts similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.graphql.ts rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.graphql.ts diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.stories.tsx similarity index 95% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.stories.tsx index ea04ae1a3..a23afc9f7 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.stories.tsx @@ -4,7 +4,7 @@ import { composeMockedQueryResult } from '@sb/webapp-api-client/tests/utils/fixt import { Story } from '@storybook/react'; import { append } from 'ramda'; -import { withProviders } from '../../../../shared/utils/storybook'; +import { withProviders } from '../../../../utils/storybook'; import { CrudDemoItemListItem, CrudDemoItemListItemProps } from './crudDemoItemListItem.component'; export default { diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.styles.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.styles.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.styles.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDemoItemListItem.styles.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.component.tsx similarity index 97% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.component.tsx index 75cd94881..5b243c4e7 100644 --- a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.component.tsx @@ -7,7 +7,7 @@ import { MouseEvent, useState } from 'react'; import ClickAwayListener from 'react-click-away-listener'; import { FormattedMessage, useIntl } from 'react-intl'; -import { RoutesConfig } from '../../../../../app/config/routes'; +import { RoutesConfig } from '../../../../../config/routes'; import { Container, Menu, ToggleButton, ToggleButtonCircle } from './crudDropdownMenu.styles'; export type CrudDropdownMenuProps = { diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.styles.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.styles.ts similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.styles.ts rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/crudDropdownMenu.styles.ts diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/index.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/index.ts similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/index.ts rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/crudDropdownMenu/index.ts diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/index.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/index.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/index.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/crudDemoItemListItem/index.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/crudDemoItemList/index.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/index.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/crudDemoItemList/index.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/crudDemoItemList/index.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/__tests__/editCrudDemoItem.component.spec.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/__tests__/editCrudDemoItem.component.spec.tsx similarity index 86% rename from packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/__tests__/editCrudDemoItem.component.spec.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/__tests__/editCrudDemoItem.component.spec.tsx index a372fc205..890b9873b 100644 --- a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/__tests__/editCrudDemoItem.component.spec.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/__tests__/editCrudDemoItem.component.spec.tsx @@ -1,10 +1,11 @@ -import { composeMockedQueryResult } from '@sb/webapp-api-client/tests/utils/fixtures'; +import { composeMockedQueryResult } from '@sb/webapp-api-client/tests/utils'; +import { getLocalePath } from '@sb/webapp-core/utils'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Route, Routes } from 'react-router'; -import { RoutesConfig } from '../../../../app/config/routes'; -import { fillEditCrudDemoItemQuery } from '../../../../tests/factories/crudDemoItem'; +import { RoutesConfig } from '../../../../config/routes'; +import { fillEditCrudDemoItemQuery } from '../../../../tests/factories'; import { createMockRouterProps, render } from '../../../../tests/utils/rendering'; import { EditCrudDemoItem } from '../editCrudDemoItem.component'; import { editCrudDemoItemMutation } from '../editCrudDemoItem.graphql'; @@ -13,7 +14,7 @@ describe('EditCrudDemoItem: Component', () => { const defaultItemId = 'test-id'; const oldName = 'old item'; const newName = 'new item'; - const routePath = RoutesConfig.getLocalePath(['crudDemoItem', 'edit']); + const routePath = getLocalePath(RoutesConfig.crudDemoItem.edit); const queryData = { id: defaultItemId, @@ -33,7 +34,7 @@ describe('EditCrudDemoItem: Component', () => { ); it('should display prefilled form', async () => { - const routerProps = createMockRouterProps(['crudDemoItem', 'edit'], { id: defaultItemId }); + const routerProps = createMockRouterProps(RoutesConfig.crudDemoItem.edit, { id: defaultItemId }); const queryMock = fillEditCrudDemoItemQuery(queryData, queryVariables); render(, { @@ -46,7 +47,7 @@ describe('EditCrudDemoItem: Component', () => { describe('action completes successfully', () => { it('should commit mutation', async () => { - const routerProps = createMockRouterProps(['crudDemoItem', 'edit'], { id: defaultItemId }); + const routerProps = createMockRouterProps(RoutesConfig.crudDemoItem.edit, { id: defaultItemId }); const queryMock = fillEditCrudDemoItemQuery(queryData, queryVariables); const requestMock = composeMockedQueryResult(editCrudDemoItemMutation, { @@ -72,7 +73,7 @@ describe('EditCrudDemoItem: Component', () => { }); it('should show success message', async () => { - const routerProps = createMockRouterProps(['crudDemoItem', 'edit'], { id: defaultItemId }); + const routerProps = createMockRouterProps(RoutesConfig.crudDemoItem.edit, { id: defaultItemId }); const queryMock = fillEditCrudDemoItemQuery(queryData, queryVariables); const requestMock = composeMockedQueryResult(editCrudDemoItemMutation, { variables: mutationVariables, diff --git a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.component.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.component.tsx similarity index 97% rename from packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.component.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.component.tsx index 20386f8be..cd4bf85d8 100644 --- a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.component.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.component.tsx @@ -5,7 +5,7 @@ import { useSnackbar } from '@sb/webapp-core/snackbar'; import { FormattedMessage, useIntl } from 'react-intl'; import { Navigate, useParams } from 'react-router'; -import { RoutesConfig } from '../../../app/config/routes'; +import { RoutesConfig } from '../../../config/routes'; import { CrudDemoItemForm } from '../crudDemoItemForm'; import { CrudDemoItemFormFields } from '../crudDemoItemForm/crudDemoItemForm.component'; import { editCrudDemoItemMutation, editCrudDemoItemQuery } from './editCrudDemoItem.graphql'; diff --git a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.graphql.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.graphql.ts similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.graphql.ts rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.graphql.ts diff --git a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.stories.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.stories.tsx similarity index 67% rename from packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.stories.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.stories.tsx index 425c280d5..fb133459a 100644 --- a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.stories.tsx +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.stories.tsx @@ -1,20 +1,20 @@ +import { getLocalePath } from '@sb/webapp-core/utils'; import { Story } from '@storybook/react'; import { append } from 'ramda'; import { Route, Routes } from 'react-router'; -import { RoutesConfig } from '../../../app/config/routes'; -import { fillEditCrudDemoItemQuery } from '../../../tests/factories/crudDemoItem'; -import { withProviders } from '../../../shared/utils/storybook'; +import { RoutesConfig } from '../../../config/routes'; +import { fillEditCrudDemoItemQuery } from '../../../tests/factories'; import { createMockRouterProps } from '../../../tests/utils/rendering'; +import { withProviders } from '../../../utils/storybook'; import { EditCrudDemoItem } from './editCrudDemoItem.component'; -const routePath = ['crudDemoItem', 'edit']; const defaultItemId = 'test-id'; const Template: Story = () => { return ( - } /> + } /> ); }; @@ -35,6 +35,6 @@ Default.decorators = [ { id: defaultItemId } ) ), - routerProps: createMockRouterProps(routePath, { id: defaultItemId }), + routerProps: createMockRouterProps(RoutesConfig.crudDemoItem.edit, { id: defaultItemId }), }), ]; diff --git a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.styles.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.styles.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.styles.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/editCrudDemoItem.styles.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/index.tsx b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/index.tsx similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/editCrudDemoItem/index.tsx rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/editCrudDemoItem/index.tsx diff --git a/packages/webapp/src/routes/crudDemoItem/index.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/index.ts similarity index 100% rename from packages/webapp/src/routes/crudDemoItem/index.ts rename to packages/webapp-libs/webapp-crud-demo/src/routes/crudDemoItem/index.ts diff --git a/packages/webapp-libs/webapp-crud-demo/src/routes/index.ts b/packages/webapp-libs/webapp-crud-demo/src/routes/index.ts new file mode 100644 index 000000000..2cf3aebb2 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/routes/index.ts @@ -0,0 +1,3 @@ +import { asyncComponent } from '@sb/webapp-core/utils/asyncComponent'; + +export const CrudDemoItem = asyncComponent(() => import('./crudDemoItem')); diff --git a/packages/webapp/src/tests/factories/crudDemoItem.ts b/packages/webapp-libs/webapp-crud-demo/src/tests/factories/crudDemoItem.ts similarity index 100% rename from packages/webapp/src/tests/factories/crudDemoItem.ts rename to packages/webapp-libs/webapp-crud-demo/src/tests/factories/crudDemoItem.ts diff --git a/packages/webapp-libs/webapp-crud-demo/src/tests/factories/index.ts b/packages/webapp-libs/webapp-crud-demo/src/tests/factories/index.ts new file mode 100644 index 000000000..f2bd7acd2 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/tests/factories/index.ts @@ -0,0 +1 @@ +export * from './crudDemoItem'; diff --git a/packages/webapp-libs/webapp-crud-demo/src/tests/setupTests.ts b/packages/webapp-libs/webapp-crud-demo/src/tests/setupTests.ts new file mode 100644 index 000000000..170487a8f --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/tests/setupTests.ts @@ -0,0 +1,2 @@ +import '@sb/webapp-api-client/tests/setupTests'; +import '@sb/webapp-core/tests/setupTests'; diff --git a/packages/webapp-libs/webapp-crud-demo/src/tests/utils/rendering.tsx b/packages/webapp-libs/webapp-crud-demo/src/tests/utils/rendering.tsx new file mode 100644 index 000000000..a1de56bd5 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/tests/utils/rendering.tsx @@ -0,0 +1,56 @@ +import * as apiUtils from '@sb/webapp-api-client/tests/utils/rendering'; +import * as corePath from '@sb/webapp-core/utils/path'; +import { RenderOptions, render, renderHook } from '@testing-library/react'; +import { ComponentClass, ComponentType, FC, ReactElement } from 'react'; +import { MemoryRouterProps, generatePath } from 'react-router'; + +export type WrapperProps = apiUtils.WrapperProps; + +export function getWrapper( + WrapperComponent: ComponentClass | FC, + wrapperProps: WrapperProps +): { + wrapper: ComponentType; + waitForApolloMocks: (mockIndex?: number) => Promise; +} { + return apiUtils.getWrapper(apiUtils.ApiTestProviders, wrapperProps); +} + +export type CustomRenderOptions = RenderOptions & WrapperProps; + +function customRender(ui: ReactElement, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); + + return { + ...render(ui, { + ...options, + wrapper, + }), + waitForApolloMocks, + }; +} + +function customRenderHook(hook: (initialProps: Props) => Result, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); + + return { + ...renderHook(hook, { + ...options, + wrapper, + }), + waitForApolloMocks, + }; +} + +export { customRender as render, customRenderHook as renderHook }; + +export const createMockRouterProps = (pathName: string, params?: Record): MemoryRouterProps => { + return { + initialEntries: [ + generatePath(corePath.getLocalePath(pathName), { + lang: 'en', + ...(params ?? {}), + }), + ], + }; +}; diff --git a/packages/webapp-libs/webapp-crud-demo/src/utils/storybook.tsx b/packages/webapp-libs/webapp-crud-demo/src/utils/storybook.tsx new file mode 100644 index 000000000..f631dd1b3 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/src/utils/storybook.tsx @@ -0,0 +1,16 @@ +import { ApiTestProviders } from '@sb/webapp-api-client/tests/utils/rendering'; +import { Story } from '@storybook/react'; + +import { WrapperProps, getWrapper } from '../tests/utils/rendering'; + +export function withProviders(wrapperProps: WrapperProps = {}) { + return (StoryComponent: Story) => { + const { wrapper: WrapperComponent } = getWrapper(ApiTestProviders, wrapperProps); + + return ( + + + + ); + }; +} diff --git a/packages/webapp-libs/webapp-crud-demo/tsconfig.json b/packages/webapp-libs/webapp-crud-demo/tsconfig.json new file mode 100644 index 000000000..8122543a9 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/webapp-libs/webapp-crud-demo/tsconfig.lib.json b/packages/webapp-libs/webapp-crud-demo/tsconfig.lib.json new file mode 100644 index 000000000..977345bb3 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/tsconfig.lib.json @@ -0,0 +1,33 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "strict": true, + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "types": ["vite/client"], + "noEmit": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "esModuleInterop": true, + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react-jsx" + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": [ + "jest.config.ts", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] +} diff --git a/packages/webapp-libs/webapp-crud-demo/tsconfig.spec.json b/packages/webapp-libs/webapp-crud-demo/tsconfig.spec.json new file mode 100644 index 000000000..27777e4d7 --- /dev/null +++ b/packages/webapp-libs/webapp-crud-demo/tsconfig.spec.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"], + "esModuleInterop": true, + "jsx": "react-jsx" + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.d.ts", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] +} diff --git a/packages/webapp-libs/webapp-notifications/.eslintrc.json b/packages/webapp-libs/webapp-notifications/.eslintrc.json new file mode 100644 index 000000000..9562b9edd --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/.eslintrc.json @@ -0,0 +1,38 @@ +{ + "extends": ["plugin:@nrwl/nx/react", "../../../.eslintrc.json"], + "ignorePatterns": ["!**/*", "node_modules/**/*"], + "plugins": ["react-hooks", "formatjs", "testing-library"], + "rules": { + "import/order": ["error"], + "formatjs/no-offset": "error", + "react/jsx-curly-brace-presence": "error" + }, + "overrides": [ + { + "files": "*.stories.tsx", + "rules": { + "import/no-anonymous-default-export": "off" + } + }, + { + "files": "*.{ts,tsx}", + "rules": { + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "import/no-anonymous-default-export": "off", + "@typescript-eslint/no-explicit-any": "off", + "no-empty": "off", + "react/jsx-no-useless-fragment": "off" + } + }, + { + "files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"], + "extends": ["plugin:testing-library/react"], + "rules": { + "testing-library/render-result-naming-convention": "off", + "testing-library/no-node-access": "off" + } + } + ] +} diff --git a/packages/webapp-libs/webapp-notifications/.prettierrc b/packages/webapp-libs/webapp-notifications/.prettierrc new file mode 100644 index 000000000..af20e9802 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/.prettierrc @@ -0,0 +1,14 @@ +{ + "plugins": ["@trivago/prettier-plugin-sort-imports"], + "printWidth": 120, + "singleQuote": true, + "trailingComma": "es5", + "importOrder": [ + "^(path|dns|fs)/?", + "", + "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", + "^[./]" + ], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true +} diff --git a/packages/webapp-libs/webapp-notifications/graphql/codegen.ts b/packages/webapp-libs/webapp-notifications/graphql/codegen.ts new file mode 100644 index 000000000..6076443c7 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/graphql/codegen.ts @@ -0,0 +1,13 @@ +import { CodegenConfig } from '@graphql-codegen/cli'; + +const config: Partial = { + generates: { + 'src/graphql/__generated/gql/': { + documents: ['../webapp-notifications/src/**/*.ts', '../webapp-notifications/src/**/*.tsx'], + + plugins: [], + }, + }, +}; + +export default config; diff --git a/packages/webapp-libs/webapp-notifications/jest.config.ts b/packages/webapp-libs/webapp-notifications/jest.config.ts new file mode 100644 index 000000000..c4e014ea3 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/jest.config.ts @@ -0,0 +1,23 @@ +/* eslint-disable */ +export default { + displayName: 'webapp-notifications', + preset: '../../../jest.preset.js', + transform: { + '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest', + '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/react/babel'] }], + }, + transformIgnorePatterns: ['/node_modules/(?!(@iconify-icons|react-markdown)/)'], + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + }, + }, + moduleNameMapper: { + 'react-markdown': '/node_modules/react-markdown/react-markdown.min.js', + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageReporters: ['lcov'], + coveragePathIgnorePatterns: ['/node_modules/', '.*.svg'], + setupFilesAfterEnv: ['./src/tests/setupTests.ts'], + watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], +}; diff --git a/packages/webapp-libs/webapp-notifications/package.json b/packages/webapp-libs/webapp-notifications/package.json new file mode 100644 index 000000000..da27875a5 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/package.json @@ -0,0 +1,80 @@ +{ + "name": "@sb/webapp-notifications", + "version": "0.0.1", + "type": "commonjs", + "scripts": { + "test": "jest", + "test:watch": "jest --watch", + "lint": "eslint ." + }, + "dependencies": { + "@sb/webapp-core": "*", + "@sb/webapp-api-client": "*", + "graphql": "^16.6.0", + "react-click-away-listener": "^2.2.2", + "react-infinite-scroll-hook": "^4.0.4" + }, + "peerDependencies": { + "@iconify-icons/ion": "^1.2.4", + "@iconify/react": "^4.0.0", + "@apollo/client": "^3.7.9", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-router": "^6.7.0", + "react-router-dom": "^6.7.0", + "react-loading-skeleton": "^3.1.0", + "ramda": "^0.28.0", + "react-markdown": "^8.0.3", + "react-intl": "^6.2.1", + "styled-components": "5.3.6" + }, + "devDependencies": { + "@nrwl/react": "^15.8.6", + "@nrwl/jest": "^15.8.6", + "@iconify-icons/ion": "^1.2.4", + "@iconify/react": "^4.0.0", + "@apollo/client": "^3.7.9", + "@apollo/rover": "^0.12.2", + "@graphql-codegen/cli": "^2.13.11", + "@storybook/addon-actions": "^6.5.16", + "@storybook/addon-backgrounds": "^6.5.16", + "@storybook/addon-docs": "^6.5.16", + "@storybook/addon-essentials": "^6.5.16", + "@storybook/addon-measure": "^6.5.16", + "@storybook/addon-outline": "^6.5.16", + "@storybook/builder-vite": "^0.4.0", + "@storybook/client-api": "^6.5.16", + "@storybook/client-logger": "^6.5.16", + "@storybook/react": "^6.5.16", + "@testing-library/dom": "^8.19.0", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^13.4.0", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^14.4.3", + "@types/jest": "28.1.3", + "@types/testing-library__jest-dom": "^5.14.5", + "@types/ramda": "^0.28.23", + "@types/react": "^18.0.24", + "@types/styled-components": "^5.1.26", + "eslint-plugin-formatjs": "^4.3.4", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-react": "^7.21.5", + "eslint-plugin-react-hooks": "^4.0.0", + "eslint-plugin-testing-library": "^5.9.1", + "babel-jest": "28.1.3", + "jest": "28.1.3", + "jest-environment-jsdom": "28.1.3", + "jest-matcher-utils": "^29.4.2", + "jest-watch-typeahead": "^2.2.2", + "ts-jest": "28.0.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-router": "^6.7.0", + "react-router-dom": "^6.7.0", + "ramda": "^0.28.0", + "react-markdown": "^8.0.3", + "react-intl": "^6.2.1", + "react-loading-skeleton": "^3.1.0", + "styled-components": "5.3.6" + } +} diff --git a/packages/webapp-libs/webapp-notifications/project.json b/packages/webapp-libs/webapp-notifications/project.json new file mode 100644 index 000000000..2e52114f0 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/project.json @@ -0,0 +1,31 @@ +{ + "name": "webapp-notifications", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/webapp-libs/webapp-notifications/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/webapp-libs/webapp-notifications", + "main": "packages/webapp-libs/webapp-notifications/src/index.ts", + "tsConfig": "packages/webapp-libs/webapp-notifications/tsconfig.lib.json", + "assets": ["packages/webapp-libs/webapp-notifications/*.md"] + } + }, + "graphql": { + "executor": "nx:run-commands", + "options": { + "cwd": "packages/webapp-libs/webapp-notifications", + "color": true + }, + "configurations": { + "download-schema": { + "commands": ["/bin/sh ./scripts/download-graphql-schema.sh"] + } + } + } + }, + "tags": [] +} diff --git a/packages/webapp-libs/webapp-notifications/sonar-project.properties b/packages/webapp-libs/webapp-notifications/sonar-project.properties new file mode 100644 index 000000000..201db1958 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.organization=apptension +sonar.projectKey=saas_boilerplate_webapp_notifications +sonar.javascript.lcov.reportPaths=coverage/lcov.info + +# Define the same root directory for sources and tests +sonar.sources = src/ +sonar.tests = src/ + +# Include test subdirectories in test scope +sonar.test.inclusions = src/**/*.spec.* + +# Exclude test and generated subdirectories from source scope +sonar.exclusions = src/**/*.spec.* +sonar.coverage.exclusions = src/**/*.stories.*, diff --git a/packages/webapp-libs/webapp-notifications/src/index.ts b/packages/webapp-libs/webapp-notifications/src/index.ts new file mode 100644 index 000000000..766cc9eb9 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/src/index.ts @@ -0,0 +1,3 @@ +export * from './notifications.component'; +export * from './notification'; +export * from './notifications.types'; diff --git a/packages/webapp/src/shared/components/notifications/notification/__tests__/notification.component.spec.tsx b/packages/webapp-libs/webapp-notifications/src/notification/__tests__/notification.component.spec.tsx similarity index 96% rename from packages/webapp/src/shared/components/notifications/notification/__tests__/notification.component.spec.tsx rename to packages/webapp-libs/webapp-notifications/src/notification/__tests__/notification.component.spec.tsx index b5c8d63af..c1b308739 100644 --- a/packages/webapp/src/shared/components/notifications/notification/__tests__/notification.component.spec.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notification/__tests__/notification.component.spec.tsx @@ -1,6 +1,6 @@ import { fireEvent, screen } from '@testing-library/react'; -import { PLACEHOLDER_CONTENT, PLACEHOLDER_TEST_ID, render } from '../../../../../tests/utils/rendering'; +import { PLACEHOLDER_CONTENT, PLACEHOLDER_TEST_ID, render } from '../../tests/utils/rendering'; import { Notification, NotificationProps } from '../notification.component'; import { mockedNotificationProps } from '../notification.fixtures'; diff --git a/packages/webapp/src/shared/components/notifications/notification/button/button.component.tsx b/packages/webapp-libs/webapp-notifications/src/notification/button/button.component.tsx similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/button/button.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notification/button/button.component.tsx diff --git a/packages/webapp/src/shared/components/notifications/notification/button/index.ts b/packages/webapp-libs/webapp-notifications/src/notification/button/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/button/index.ts rename to packages/webapp-libs/webapp-notifications/src/notification/button/index.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/index.ts b/packages/webapp-libs/webapp-notifications/src/notification/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/index.ts rename to packages/webapp-libs/webapp-notifications/src/notification/index.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.component.tsx b/packages/webapp-libs/webapp-notifications/src/notification/notification.component.tsx similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/notification.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notification/notification.component.tsx diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.fixtures.ts b/packages/webapp-libs/webapp-notifications/src/notification/notification.fixtures.ts similarity index 81% rename from packages/webapp/src/shared/components/notifications/notification/notification.fixtures.ts rename to packages/webapp-libs/webapp-notifications/src/notification/notification.fixtures.ts index 52e44a071..f29abd60e 100644 --- a/packages/webapp/src/shared/components/notifications/notification/notification.fixtures.ts +++ b/packages/webapp-libs/webapp-notifications/src/notification/notification.fixtures.ts @@ -1,6 +1,6 @@ -import { notificationFactory } from '@sb/webapp-api-client/tests/factories'; import { pick } from 'ramda'; +import { notificationFactory } from '../tests/factories'; import { NotificationProps } from './notification.component'; export const mockedNotificationProps: NotificationProps = { diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.graphql.ts b/packages/webapp-libs/webapp-notifications/src/notification/notification.graphql.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/notification.graphql.ts rename to packages/webapp-libs/webapp-notifications/src/notification/notification.graphql.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.hooks.ts b/packages/webapp-libs/webapp-notifications/src/notification/notification.hooks.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/notification.hooks.ts rename to packages/webapp-libs/webapp-notifications/src/notification/notification.hooks.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.stories.tsx b/packages/webapp-libs/webapp-notifications/src/notification/notification.stories.tsx similarity index 94% rename from packages/webapp/src/shared/components/notifications/notification/notification.stories.tsx rename to packages/webapp-libs/webapp-notifications/src/notification/notification.stories.tsx index dcdbeb807..c028a8c65 100644 --- a/packages/webapp/src/shared/components/notifications/notification/notification.stories.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notification/notification.stories.tsx @@ -2,10 +2,10 @@ import { action } from '@storybook/addon-actions'; import { Story } from '@storybook/react'; import styled from 'styled-components'; -import { withProviders } from '../../../utils/storybook'; +import { withProviders } from '../utils/storybook'; +import { Button as NotificationButton } from './button'; import { Notification, NotificationProps } from './notification.component'; import { mockedNotificationProps } from './notification.fixtures'; -import { NotificationButton } from './index'; const Container = styled.div` max-width: 320px; diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.styles.ts b/packages/webapp-libs/webapp-notifications/src/notification/notification.styles.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/notification.styles.ts rename to packages/webapp-libs/webapp-notifications/src/notification/notification.styles.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/notification.types.ts b/packages/webapp-libs/webapp-notifications/src/notification/notification.types.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/notification.types.ts rename to packages/webapp-libs/webapp-notifications/src/notification/notification.types.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/skeleton/index.ts b/packages/webapp-libs/webapp-notifications/src/notification/skeleton/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/skeleton/index.ts rename to packages/webapp-libs/webapp-notifications/src/notification/skeleton/index.ts diff --git a/packages/webapp/src/shared/components/notifications/notification/skeleton/skeleton.component.tsx b/packages/webapp-libs/webapp-notifications/src/notification/skeleton/skeleton.component.tsx similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/skeleton/skeleton.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notification/skeleton/skeleton.component.tsx diff --git a/packages/webapp/src/shared/components/notifications/notification/skeleton/skeleton.stories.tsx b/packages/webapp-libs/webapp-notifications/src/notification/skeleton/skeleton.stories.tsx similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/skeleton/skeleton.stories.tsx rename to packages/webapp-libs/webapp-notifications/src/notification/skeleton/skeleton.stories.tsx diff --git a/packages/webapp/src/shared/components/notifications/notification/skeleton/skeleton.styles.ts b/packages/webapp-libs/webapp-notifications/src/notification/skeleton/skeleton.styles.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notification/skeleton/skeleton.styles.ts rename to packages/webapp-libs/webapp-notifications/src/notification/skeleton/skeleton.styles.ts diff --git a/packages/webapp/src/shared/components/notifications/notifications.component.tsx b/packages/webapp-libs/webapp-notifications/src/notifications.component.tsx similarity index 83% rename from packages/webapp/src/shared/components/notifications/notifications.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notifications.component.tsx index 7cc89a358..20e9d5038 100644 --- a/packages/webapp/src/shared/components/notifications/notifications.component.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notifications.component.tsx @@ -1,14 +1,18 @@ import { NetworkStatus, useQuery } from '@apollo/client'; -import { useEffect } from 'react'; +import { useOpenState } from '@sb/webapp-core/hooks'; +import { ElementType, FC, useEffect } from 'react'; import ClickAwayListener from 'react-click-away-listener'; -import { useOpenState } from '../../hooks'; import { notificationsListQuery, notificationsListSubscription } from './notifications.graphql'; +import { NotificationTypes } from './notifications.types'; import { NotificationsButton } from './notificationsButton'; import { NotificationsList } from './notificationsList'; import { NOTIFICATIONS_PER_PAGE } from './notificationsList/notificationsList.constants'; -export const Notifications = () => { +type NotificationsProps = { + templates: Record; +}; +export const Notifications: FC = ({ templates }) => { const notifications = useOpenState(false); const { loading, data, fetchMore, networkStatus, subscribeToMore } = useQuery(notificationsListQuery); @@ -50,6 +54,7 @@ export const Notifications = () => { <> = Omit & { - type: NotificationTypes; - data: T; -}; - export enum NotificationTypes { CRUD_ITEM_CREATED = 'CRUD_ITEM_CREATED', CRUD_ITEM_UPDATED = 'CRUD_ITEM_UPDATED', - //<-- INJECT NOTIFICATION TYPE --> } + +export type NotificationType = Omit & { + type: NotificationTypes; + data: T; +}; diff --git a/packages/webapp/src/shared/components/notifications/notificationsButton/__tests__/notificationsButton.component.spec.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsButton/__tests__/notificationsButton.component.spec.tsx similarity index 87% rename from packages/webapp/src/shared/components/notifications/notificationsButton/__tests__/notificationsButton.component.spec.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsButton/__tests__/notificationsButton.component.spec.tsx index f52c51d27..33c4ba67f 100644 --- a/packages/webapp/src/shared/components/notifications/notificationsButton/__tests__/notificationsButton.component.spec.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notificationsButton/__tests__/notificationsButton.component.spec.tsx @@ -2,9 +2,9 @@ import { useQuery } from '@apollo/client'; import { screen } from '@testing-library/react'; import { append } from 'ramda'; -import { fillNotificationsListQuery } from '../../../../../tests/factories'; -import { render } from '../../../../../tests/utils/rendering'; import { notificationsListQuery } from '../../notifications.graphql'; +import { fillNotificationsListQuery } from '../../tests/factories'; +import { render } from '../../tests/utils/rendering'; import { NotificationsButton, NotificationsButtonProps } from '../notificationsButton.component'; describe('NotificationsButton: Component', () => { diff --git a/packages/webapp/src/shared/components/notifications/notificationsButton/index.ts b/packages/webapp-libs/webapp-notifications/src/notificationsButton/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsButton/index.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsButton/index.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.component.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.component.tsx similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.component.tsx diff --git a/packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.stories.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.stories.tsx similarity index 83% rename from packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.stories.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.stories.tsx index 3895fa9cc..37492958f 100644 --- a/packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.stories.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.stories.tsx @@ -2,8 +2,8 @@ import { action } from '@storybook/addon-actions'; import { Story } from '@storybook/react'; import { append } from 'ramda'; -import { fillNotificationsListQuery } from '../../../../tests/factories'; -import { withProviders } from '../../../utils/storybook'; +import { fillNotificationsListQuery } from '../tests/factories'; +import { withProviders } from '../utils/storybook'; import { NotificationsButton, NotificationsButtonProps } from './notificationsButton.component'; const Template: Story = (args: NotificationsButtonProps) => { diff --git a/packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.styles.ts b/packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.styles.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsButton/notificationsButton.styles.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsButton/notificationsButton.styles.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/__tests__/notificationsList.component.spec.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsList/__tests__/notificationsList.component.spec.tsx similarity index 66% rename from packages/webapp/src/shared/components/notifications/notificationsList/__tests__/notificationsList.component.spec.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsList/__tests__/notificationsList.component.spec.tsx index 8caf02f07..abb8a0489 100644 --- a/packages/webapp/src/shared/components/notifications/notificationsList/__tests__/notificationsList.component.spec.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notificationsList/__tests__/notificationsList.component.spec.tsx @@ -1,18 +1,35 @@ import { useQuery } from '@apollo/client'; -import { NotificationType } from '@sb/webapp-api-client/graphql'; -import { fillCommonQueryWithUser, notificationFactory } from '@sb/webapp-api-client/tests/factories'; +import { NotificationType } from '@sb/webapp-api-client'; +import { fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; import { screen } from '@testing-library/react'; import { times } from 'ramda'; -import { fillNotificationsListQuery } from '../../../../../tests/factories'; -import { render } from '../../../../../tests/utils/rendering'; +import { NotificationTypes } from '../../'; import { notificationsListQuery } from '../../notifications.graphql'; +import { fillNotificationsListQuery, notificationFactory } from '../../tests/factories'; +import { render } from '../../tests/utils/rendering'; import { NotificationsList, NotificationsListProps } from '../notificationsList.component'; +const NotificationMock = ({ type }: NotificationType) => { + return notification-mock: {type}; +}; + describe('NotificationsList: Component', () => { const Component = (props: Partial) => { const { loading, data } = useQuery(notificationsListQuery); - return null} loading={loading} queryResult={data} {...props} />; + return ( + null} + loading={loading} + queryResult={data} + {...props} + /> + ); }; const renderWithNotifications = ( @@ -33,7 +50,7 @@ describe('NotificationsList: Component', () => { expect(screen.getAllByLabelText('Loading notification')).toHaveLength(2); expect(await screen.findByText('Mark all as read')).toBeInTheDocument(); expect(await screen.findByText('No notifications')).toBeInTheDocument(); - expect(screen.queryByRole('link')).not.toBeInTheDocument(); + expect(screen.queryAllByText(/notification-mock/i)).toHaveLength(0); }); it('should not render non registered notifications', async () => { @@ -43,7 +60,7 @@ describe('NotificationsList: Component', () => { }), ]); - expect(screen.queryByRole('link')).not.toBeInTheDocument(); + expect(screen.queryAllByText(/notification-mock/i)).toHaveLength(0); }); it('should render correct notifications', async () => { @@ -54,7 +71,7 @@ describe('NotificationsList: Component', () => { expect(screen.getAllByLabelText('Loading notification')).toHaveLength(2); expect(await screen.findByText('Mark all as read')).toBeInTheDocument(); - expect(await screen.findAllByRole('link')).toHaveLength(notifications.length); + expect(await screen.findAllByText(/notification-mock/i)).toHaveLength(notifications.length); }); it('should not render wrong notifications', async () => { @@ -64,6 +81,6 @@ describe('NotificationsList: Component', () => { }); renderWithNotifications([...correctNotifications, malformedNotification], { hasUnreadNotifications: false }); - expect(await screen.findAllByRole('link')).toHaveLength(correctNotifications.length); + expect(await screen.findAllByText(/notification-mock/i)).toHaveLength(correctNotifications.length); }); }); diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/index.ts b/packages/webapp-libs/webapp-notifications/src/notificationsList/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsList/index.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsList/index.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationErrorBoundary/index.ts b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationErrorBoundary/index.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationErrorBoundary/index.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationErrorBoundary/index.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationErrorBoundary/notificationErrorBoundary.component.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationErrorBoundary/notificationErrorBoundary.component.tsx similarity index 91% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationErrorBoundary/notificationErrorBoundary.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationErrorBoundary/notificationErrorBoundary.component.tsx index 65df2da8b..d1aa561e0 100644 --- a/packages/webapp/src/shared/components/notifications/notificationsList/notificationErrorBoundary/notificationErrorBoundary.component.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationErrorBoundary/notificationErrorBoundary.component.tsx @@ -21,11 +21,11 @@ export class NotificationErrorBoundary extends React.Component< return { hasError: true }; } - componentDidCatch() { + override componentDidCatch() { this.setState({ hasError: true }); } - render() { + override render() { return this.state.hasError ? null : this.props.children; } } diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.component.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.component.tsx similarity index 87% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.component.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.component.tsx index f8e7c6bfb..74f0094b2 100644 --- a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.component.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.component.tsx @@ -1,13 +1,12 @@ import { FragmentType } from '@sb/webapp-api-client/graphql'; import { ButtonVariant } from '@sb/webapp-core/components/buttons'; +import { EmptyState } from '@sb/webapp-core/components/emptyState'; import { isEmpty } from 'ramda'; import { ElementType } from 'react'; import useInfiniteScroll from 'react-infinite-scroll-hook'; import { FormattedMessage, useIntl } from 'react-intl'; -import { EmptyState } from '../../emptyState'; import { NotificationSkeleton } from '../notification'; -import { NOTIFICATIONS_STRATEGY } from '../notifications.constants'; import { NotificationTypes } from '../notifications.types'; import { NotificationErrorBoundary } from './notificationErrorBoundary'; import { NOTIFICATIONS_PER_PAGE } from './notificationsList.constants'; @@ -16,6 +15,7 @@ import { useMarkAllAsRead, useNotificationsListContent } from './notificationsLi import { Container, List, MarkAllAsReadButton, Title } from './notificationsList.styles'; export type NotificationsListProps = { + templates: Record; isOpen: boolean; queryResult?: FragmentType; loading: boolean; @@ -57,9 +57,9 @@ export const NotificationsList = ({ isOpen, ...props }: NotificationsListProps) ); }; -type ContentProps = Pick; +type ContentProps = Pick; -const Content = ({ queryResult, loading, onLoadMore }: ContentProps) => { +const Content = ({ templates, queryResult, loading, onLoadMore }: ContentProps) => { const { allNotifications, hasNext, endCursor } = useNotificationsListContent(queryResult); const [scrollSensorRef] = useInfiniteScroll({ @@ -84,9 +84,7 @@ const Content = ({ queryResult, loading, onLoadMore }: ContentProps) => { return ( <> {allNotifications.map((notification) => { - const NotificationComponent = NOTIFICATIONS_STRATEGY[notification.type as NotificationTypes] as - | ElementType - | undefined; + const NotificationComponent = templates[notification.type as NotificationTypes] as ElementType | undefined; if (!notification.data || !NotificationComponent) { return null; } diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.constants.ts b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.constants.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.constants.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.constants.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.graphql.ts b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.graphql.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.graphql.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.graphql.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.hooks.ts b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.hooks.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.hooks.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.hooks.ts diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.stories.tsx b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.stories.tsx similarity index 86% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.stories.tsx rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.stories.tsx index 3e89300e1..20b94b290 100644 --- a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.stories.tsx +++ b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.stories.tsx @@ -1,10 +1,9 @@ -import { notificationFactory } from '@sb/webapp-api-client/tests/factories'; import { Story } from '@storybook/react'; import { append } from 'ramda'; -import { fillNotificationsListQuery } from '../../../../tests/factories'; -import { withProviders } from '../../../utils/storybook'; import { NotificationTypes } from '../notifications.types'; +import { fillNotificationsListQuery, notificationFactory } from '../tests/factories'; +import { withProviders } from '../utils/storybook'; import { NotificationsList, NotificationsListProps } from './notificationsList.component'; const Template: Story = (args: NotificationsListProps) => { diff --git a/packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.styles.ts b/packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.styles.ts similarity index 100% rename from packages/webapp/src/shared/components/notifications/notificationsList/notificationsList.styles.ts rename to packages/webapp-libs/webapp-notifications/src/notificationsList/notificationsList.styles.ts diff --git a/packages/webapp-libs/webapp-notifications/src/tests/factories/index.ts b/packages/webapp-libs/webapp-notifications/src/tests/factories/index.ts new file mode 100644 index 000000000..3f0d15b4e --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/src/tests/factories/index.ts @@ -0,0 +1 @@ +export * from './notification'; \ No newline at end of file diff --git a/packages/webapp/src/tests/factories/notification.ts b/packages/webapp-libs/webapp-notifications/src/tests/factories/notification.ts similarity index 63% rename from packages/webapp/src/tests/factories/notification.ts rename to packages/webapp-libs/webapp-notifications/src/tests/factories/notification.ts index 2f8ad9805..1bbd48b94 100644 --- a/packages/webapp/src/tests/factories/notification.ts +++ b/packages/webapp-libs/webapp-notifications/src/tests/factories/notification.ts @@ -1,10 +1,17 @@ import { NotificationType } from '@sb/webapp-api-client'; -import { composeMockedPaginatedListQueryResult } from '@sb/webapp-api-client/tests/utils'; +import { currentUserFactory } from '@sb/webapp-api-client/tests/factories'; +import { composeMockedPaginatedListQueryResult, createFactory, makeId } from '@sb/webapp-api-client/tests/utils'; -import { - notificationsListQuery, - notificationsListSubscription, -} from '../../shared/components/notifications/notifications.graphql'; +import { notificationsListQuery, notificationsListSubscription } from '../../notifications.graphql'; + +export const notificationFactory = createFactory(() => ({ + id: makeId(32), + type: 'CRUD_ITEM_CREATED', + data: {}, + createdAt: new Date().toISOString(), + readAt: null, + user: currentUserFactory(), +})); export const fillNotificationsListQuery = ( notifications: Array> = [], diff --git a/packages/webapp-libs/webapp-notifications/src/tests/setupTests.ts b/packages/webapp-libs/webapp-notifications/src/tests/setupTests.ts new file mode 100644 index 000000000..170487a8f --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/src/tests/setupTests.ts @@ -0,0 +1,2 @@ +import '@sb/webapp-api-client/tests/setupTests'; +import '@sb/webapp-core/tests/setupTests'; diff --git a/packages/webapp-libs/webapp-notifications/src/tests/utils/rendering.tsx b/packages/webapp-libs/webapp-notifications/src/tests/utils/rendering.tsx new file mode 100644 index 000000000..c1b83a7ee --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/src/tests/utils/rendering.tsx @@ -0,0 +1,59 @@ +import * as apiUtils from '@sb/webapp-api-client/tests/utils/rendering'; +import * as corePath from '@sb/webapp-core/utils/path'; +import { RenderOptions, render, renderHook } from '@testing-library/react'; +import { ComponentClass, ComponentType, FC, ReactElement } from 'react'; +import { MemoryRouterProps, generatePath } from 'react-router'; + +export type WrapperProps = apiUtils.ApiTestProvidersProps; + +export function getWrapper( + WrapperComponent: ComponentClass | FC, + wrapperProps: apiUtils.WrapperProps +): { + wrapper: ComponentType; + waitForApolloMocks: (mockIndex?: number) => Promise; +} { + return apiUtils.getWrapper(apiUtils.ApiTestProviders, wrapperProps); +} + +export type CustomRenderOptions = RenderOptions & WrapperProps; + +function customRender(ui: ReactElement, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); + + return { + ...render(ui, { + ...options, + wrapper, + }), + waitForApolloMocks, + }; +} + +function customRenderHook(hook: (initialProps: Props) => Result, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); + + return { + ...renderHook(hook, { + ...options, + wrapper, + }), + waitForApolloMocks, + }; +} + +export { customRender as render, customRenderHook as renderHook }; + +export const createMockRouterProps = (pathName: string, params?: Record): MemoryRouterProps => { + return { + initialEntries: [ + generatePath(corePath.getLocalePath(pathName), { + lang: 'en', + ...(params ?? {}), + }), + ], + }; +}; + +export const PLACEHOLDER_TEST_ID = 'content'; +export const PLACEHOLDER_CONTENT = content; diff --git a/packages/webapp-libs/webapp-notifications/src/utils/storybook.tsx b/packages/webapp-libs/webapp-notifications/src/utils/storybook.tsx new file mode 100644 index 000000000..f631dd1b3 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/src/utils/storybook.tsx @@ -0,0 +1,16 @@ +import { ApiTestProviders } from '@sb/webapp-api-client/tests/utils/rendering'; +import { Story } from '@storybook/react'; + +import { WrapperProps, getWrapper } from '../tests/utils/rendering'; + +export function withProviders(wrapperProps: WrapperProps = {}) { + return (StoryComponent: Story) => { + const { wrapper: WrapperComponent } = getWrapper(ApiTestProviders, wrapperProps); + + return ( + + + + ); + }; +} diff --git a/packages/webapp-libs/webapp-notifications/tsconfig.json b/packages/webapp-libs/webapp-notifications/tsconfig.json new file mode 100644 index 000000000..8122543a9 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/webapp-libs/webapp-notifications/tsconfig.lib.json b/packages/webapp-libs/webapp-notifications/tsconfig.lib.json new file mode 100644 index 000000000..f806fc0f0 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/tsconfig.lib.json @@ -0,0 +1,32 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "strict": true, + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "esModuleInterop": true, + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react-jsx" + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": [ + "jest.config.ts", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] +} diff --git a/packages/webapp-libs/webapp-notifications/tsconfig.spec.json b/packages/webapp-libs/webapp-notifications/tsconfig.spec.json new file mode 100644 index 000000000..27777e4d7 --- /dev/null +++ b/packages/webapp-libs/webapp-notifications/tsconfig.spec.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"], + "esModuleInterop": true, + "jsx": "react-jsx" + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/**/*.spec.ts", + "src/**/*.spec.tsx", + "src/**/*.d.ts", + "src/tests/**/*.ts", + "src/tests/**/*.tsx" + ] +} diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 7ef139080..15908ff81 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -50,7 +50,6 @@ "react-dom": "18.2.0", "react-helmet-async": "^1.3.0", "react-hook-form": "^7.34.0", - "react-infinite-scroll-hook": "^4.0.4", "react-intl": "^6.2.1", "react-is": "18.2.0", "react-loading-skeleton": "^3.1.0", @@ -79,6 +78,8 @@ "@sb/webapp-core": "*", "@sb/webapp-api-client": "*", "@sb/webapp-contentful": "*", + "@sb/webapp-crud-demo": "*", + "@sb/webapp-notifications": "*", "@storybook/addon-actions": "^6.5.16", "@storybook/addon-backgrounds": "^6.5.16", "@storybook/addon-docs": "^6.5.16", diff --git a/packages/webapp/src/app/app.component.tsx b/packages/webapp/src/app/app.component.tsx index 617351fc6..3bf27a5da 100644 --- a/packages/webapp/src/app/app.component.tsx +++ b/packages/webapp/src/app/app.component.tsx @@ -1,6 +1,7 @@ import { DemoItem, DemoItems, PrivacyPolicy, TermsAndConditions } from '@sb/webapp-contentful/routes'; import { DEFAULT_LOCALE, translationMessages } from '@sb/webapp-core/config/i18n'; import { typography } from '@sb/webapp-core/theme'; +import { CrudDemoItem } from '@sb/webapp-crud-demo/routes'; import { FormattedMessage, IntlProvider } from 'react-intl'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; @@ -13,7 +14,6 @@ import { AuthRoute } from '../shared/components/routes/authRoute'; import { CancelSubscription, ConfirmEmail, - CrudDemoItem, Documents, EditPaymentMethod, EditSubscription, @@ -50,7 +50,7 @@ export const App = () => { } /> } /> } /> - } /> + } /> }> } /> } /> diff --git a/packages/webapp/src/app/asyncComponents.ts b/packages/webapp/src/app/asyncComponents.ts index 1b1ec4d7c..7676e6797 100644 --- a/packages/webapp/src/app/asyncComponents.ts +++ b/packages/webapp/src/app/asyncComponents.ts @@ -7,7 +7,6 @@ export const Login = asyncComponent(() => import('../routes/auth/login')); export const Logout = asyncComponent(() => import('../routes/auth/logout')); export const Profile = asyncComponent(() => import('../routes/profile')); export const ConfirmEmail = asyncComponent(() => import('../routes/auth/confirmEmail')); -export const CrudDemoItem = asyncComponent(() => import('../routes/crudDemoItem')); export const FinancesPaymentConfirm = asyncComponent(() => import('../routes/finances/paymentConfirm')); export const Subscriptions = asyncComponent(() => import('../routes/finances/subscriptions')); export const EditSubscription = asyncComponent(() => import('../routes/finances/editSubscription')); diff --git a/packages/webapp/src/app/config/routes.ts b/packages/webapp/src/app/config/routes.ts index 703862978..0a16b2a7a 100644 --- a/packages/webapp/src/app/config/routes.ts +++ b/packages/webapp/src/app/config/routes.ts @@ -1,4 +1,5 @@ import { RoutesConfig as ContentfulRoutesConfig } from '@sb/webapp-contentful/config/routes'; +import { RoutesConfig as CrudDemoRoutesConfig } from '@sb/webapp-crud-demo/config/routes'; import { getLocalePath, nestedPath } from '@sb/webapp-core/utils/path'; import { Path, path } from 'ramda'; @@ -13,18 +14,10 @@ const routes = { notFound: '404', profile: 'profile', admin: 'admin', - privacyPolicy: 'privacy-policy', - termsAndConditions: 'terms-and-conditions', confirmEmail: 'auth/confirm/:user/:token', passwordReset: nestedPath('auth/reset-password', { confirm: 'confirm/:user/:token', }), - crudDemoItem: nestedPath('crud-demo-item', { - list: '', - details: ':id', - edit: ':id/edit', - add: 'add', - }), finances: nestedPath('finances', { paymentConfirm: 'payment-confirm', history: 'history', @@ -37,8 +30,10 @@ const routes = { }), documents: 'documents', ...ContentfulRoutesConfig, + ...CrudDemoRoutesConfig, //<-- INJECT ROUTE DEFINITION --> }; + export const RoutesConfig = { ...routes, getLocalePath: (routeKey: Path) => { diff --git a/packages/webapp/src/emails/index.tsx b/packages/webapp/src/emails/index.tsx index d7e233696..a7f8dd68b 100644 --- a/packages/webapp/src/emails/index.tsx +++ b/packages/webapp/src/emails/index.tsx @@ -1,9 +1,9 @@ +import { camelCaseKeys } from '@sb/webapp-core/utils/object'; import { UnknownObject } from '@sb/webapp-core/utils/types'; import juice from 'juice'; import { renderToString } from 'react-dom/server'; import { ServerStyleSheet, StyleSheetManager } from 'styled-components'; -import { camelCaseKeys } from '../shared/utils/object'; import { buildEmail } from './email'; import { EmailComponentProps, EmailTemplateType } from './types'; diff --git a/packages/webapp/src/routes/documents/documents.component.tsx b/packages/webapp/src/routes/documents/documents.component.tsx index 3332d94e3..cb3326274 100644 --- a/packages/webapp/src/routes/documents/documents.component.tsx +++ b/packages/webapp/src/routes/documents/documents.component.tsx @@ -1,11 +1,11 @@ import { useQuery } from '@apollo/client'; import { DocumentsListQueryQuery } from '@sb/webapp-api-client/graphql'; +import { EmptyState } from '@sb/webapp-core/components/emptyState'; import { Dropzone } from '@sb/webapp-core/components/forms'; import { useMappedConnection } from '@sb/webapp-core/hooks'; import { isEmpty } from 'ramda'; import { FormattedMessage } from 'react-intl'; -import { EmptyState } from '../../shared/components/emptyState'; import { Document, DocumentSkeleton } from './document'; import { MAX_FILES, MAX_FILE_SIZE } from './documents.constants'; import { documentsListQuery } from './documents.graphql'; diff --git a/packages/webapp/src/routes/finances/editPaymentMethod/editPaymentMethodForm/editPaymentMethodForm.component.tsx b/packages/webapp/src/routes/finances/editPaymentMethod/editPaymentMethodForm/editPaymentMethodForm.component.tsx index a993bb7ec..2122af07f 100644 --- a/packages/webapp/src/routes/finances/editPaymentMethod/editPaymentMethodForm/editPaymentMethodForm.component.tsx +++ b/packages/webapp/src/routes/finances/editPaymentMethod/editPaymentMethodForm/editPaymentMethodForm.component.tsx @@ -1,4 +1,5 @@ import { StripeSetupIntentFragmentFragment, useFragment } from '@sb/webapp-api-client/graphql'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { FormattedMessage } from 'react-intl'; import { StripePaymentMethodSelector, useStripePaymentMethods } from '../../../../shared/components/finances/stripe'; @@ -6,7 +7,6 @@ import { PaymentFormFields, StripePaymentMethodSelectionType, } from '../../../../shared/components/finances/stripe/stripePaymentMethodSelector/stripePaymentMethodSelector.types'; -import { useApiForm } from '../../../../shared/hooks'; import { useActiveSubscriptionDetails } from '../../activeSubscriptionContext/activeSubscriptionContext.hooks'; import { subscriptionActiveFragment } from '../../hooks/useSubscriptionPlanDetails/useSubscriptionPlanDetails.graphql'; import { useStripeCardSetup, useStripeSetupIntent } from './editPaymentMethodForm.hooks'; diff --git a/packages/webapp/src/shared/components/auth/addTwoFactorAuth/addTwoFactorAuth.component.tsx b/packages/webapp/src/shared/components/auth/addTwoFactorAuth/addTwoFactorAuth.component.tsx index b3d0299c7..fd5501ea2 100644 --- a/packages/webapp/src/shared/components/auth/addTwoFactorAuth/addTwoFactorAuth.component.tsx +++ b/packages/webapp/src/shared/components/auth/addTwoFactorAuth/addTwoFactorAuth.component.tsx @@ -1,4 +1,5 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useCommonQuery } from '@sb/webapp-api-client/providers'; import { ButtonSize, ButtonVariant } from '@sb/webapp-core/components/buttons'; import { useSnackbar } from '@sb/webapp-core/snackbar'; @@ -6,7 +7,6 @@ import * as QRCode from 'qrcode'; import React, { useEffect, useState } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { useApiForm } from '../../../hooks'; import { generateOtpMutation, verifyOtpMutation } from '../twoFactorAuthForm/twoFactorAuthForm.graphql'; import { Body, diff --git a/packages/webapp/src/shared/components/auth/avatarForm/avatarForm.hooks.ts b/packages/webapp/src/shared/components/auth/avatarForm/avatarForm.hooks.ts index 66ae03694..f2f9bc4bf 100644 --- a/packages/webapp/src/shared/components/auth/avatarForm/avatarForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/avatarForm/avatarForm.hooks.ts @@ -1,9 +1,9 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useFormatFileSize } from '@sb/webapp-core/components/fileSize'; import { useSnackbar } from '@sb/webapp-core/snackbar'; import { useIntl } from 'react-intl'; -import { useApiForm } from '../../../hooks'; import { authUpdateUserProfileMutation } from '../editProfileForm/editProfileForm.graphql'; import { MAX_AVATAR_SIZE } from './avatarForm.constants'; import { UpdateAvatarFormFields } from './avatarForm.types'; diff --git a/packages/webapp/src/shared/components/auth/changePasswordForm/changePasswordForm.hooks.ts b/packages/webapp/src/shared/components/auth/changePasswordForm/changePasswordForm.hooks.ts index 7a174b474..065d1a098 100644 --- a/packages/webapp/src/shared/components/auth/changePasswordForm/changePasswordForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/changePasswordForm/changePasswordForm.hooks.ts @@ -1,8 +1,8 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useSnackbar } from '@sb/webapp-core/snackbar'; import { useIntl } from 'react-intl'; -import { useApiForm } from '../../../hooks'; import { authChangePasswordMutation } from './changePasswordForm.graphql'; import { ChangePasswordFormFields } from './changePasswordForm.types'; diff --git a/packages/webapp/src/shared/components/auth/editProfileForm/editProfileForm.hooks.ts b/packages/webapp/src/shared/components/auth/editProfileForm/editProfileForm.hooks.ts index 650040a99..c79a5de57 100644 --- a/packages/webapp/src/shared/components/auth/editProfileForm/editProfileForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/editProfileForm/editProfileForm.hooks.ts @@ -1,8 +1,9 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useSnackbar } from '@sb/webapp-core/snackbar'; import { useIntl } from 'react-intl'; -import { useApiForm, useAuth } from '../../../hooks'; +import { useAuth } from '../../../hooks'; import { authUpdateUserProfileMutation } from './editProfileForm.graphql'; import { UpdateProfileFormFields } from './editProfileForm.types'; diff --git a/packages/webapp/src/shared/components/auth/loginForm/loginForm.hooks.ts b/packages/webapp/src/shared/components/auth/loginForm/loginForm.hooks.ts index 1ce66481f..8adc15202 100644 --- a/packages/webapp/src/shared/components/auth/loginForm/loginForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/loginForm/loginForm.hooks.ts @@ -1,11 +1,11 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useCommonQuery } from '@sb/webapp-api-client/providers'; import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; import { useIntl } from 'react-intl'; import { useNavigate } from 'react-router-dom'; import { RoutesConfig } from '../../../../app/config/routes'; -import { useApiForm } from '../../../hooks'; import { authSinginMutation } from './loginForm.graphql'; import { LoginFormFields } from './loginForm.types'; diff --git a/packages/webapp/src/shared/components/auth/passwordResetConfirmForm/passwordResetConfirmForm.hooks.ts b/packages/webapp/src/shared/components/auth/passwordResetConfirmForm/passwordResetConfirmForm.hooks.ts index 7813708c9..7f0361555 100644 --- a/packages/webapp/src/shared/components/auth/passwordResetConfirmForm/passwordResetConfirmForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/passwordResetConfirmForm/passwordResetConfirmForm.hooks.ts @@ -1,11 +1,11 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; import { useSnackbar } from '@sb/webapp-core/snackbar'; import { useIntl } from 'react-intl'; import { useNavigate } from 'react-router'; import { RoutesConfig } from '../../../../app/config/routes'; -import { useApiForm } from '../../../hooks'; import { authRequestPasswordResetConfirmMutation } from './passwordResetConfirmForm.graphql'; import { ResetPasswordFormFields } from './passwordResetConfirmForm.types'; diff --git a/packages/webapp/src/shared/components/auth/passwordResetRequestForm/passwordResetRequestForm.hooks.ts b/packages/webapp/src/shared/components/auth/passwordResetRequestForm/passwordResetRequestForm.hooks.ts index 609148d5b..361b0f345 100644 --- a/packages/webapp/src/shared/components/auth/passwordResetRequestForm/passwordResetRequestForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/passwordResetRequestForm/passwordResetRequestForm.hooks.ts @@ -1,7 +1,7 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useState } from 'react'; -import { useApiForm } from '../../../hooks'; import { authRequestPasswordResetMutation } from './passwordResetRequestForm.graphql'; import { ResetPasswordFormFields } from './passwordResetRequestForm.types'; diff --git a/packages/webapp/src/shared/components/auth/signupForm/signupForm.hooks.ts b/packages/webapp/src/shared/components/auth/signupForm/signupForm.hooks.ts index 3ae8f3cf8..aff90b55a 100644 --- a/packages/webapp/src/shared/components/auth/signupForm/signupForm.hooks.ts +++ b/packages/webapp/src/shared/components/auth/signupForm/signupForm.hooks.ts @@ -1,11 +1,11 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useCommonQuery } from '@sb/webapp-api-client/providers'; import { useGenerateLocalePath } from '@sb/webapp-core/hooks'; import { useIntl } from 'react-intl'; import { useNavigate } from 'react-router-dom'; import { RoutesConfig } from '../../../../app/config/routes'; -import { useApiForm } from '../../../hooks'; import { authSingupMutation } from './signUpForm.graphql'; import { SignupFormFields } from './signupForm.types'; diff --git a/packages/webapp/src/shared/components/auth/twoFactorAuthForm/twoFactorAuthForm.component.tsx b/packages/webapp/src/shared/components/auth/twoFactorAuthForm/twoFactorAuthForm.component.tsx index 5d7acf999..dad995ab6 100644 --- a/packages/webapp/src/shared/components/auth/twoFactorAuthForm/twoFactorAuthForm.component.tsx +++ b/packages/webapp/src/shared/components/auth/twoFactorAuthForm/twoFactorAuthForm.component.tsx @@ -1,11 +1,11 @@ import { useMutation } from '@apollo/client'; import { useCommonQuery } from '@sb/webapp-api-client/providers'; import { Modal } from '@sb/webapp-core/components/modal'; +import { useOpenState } from '@sb/webapp-core/hooks'; import { useSnackbar } from '@sb/webapp-core/snackbar'; import { H5 } from '@sb/webapp-core/theme/typography'; import { FormattedMessage, useIntl } from 'react-intl'; -import { useOpenState } from '../../../hooks'; import { AddTwoFactorAuth } from '../addTwoFactorAuth'; import { disableOtpMutation } from './twoFactorAuthForm.graphql'; import { Container, CtaButton, ModalHeader, Row } from './twoFactorAuthForm.styles'; diff --git a/packages/webapp/src/shared/components/auth/validateOtpForm/validateOtpForm.component.tsx b/packages/webapp/src/shared/components/auth/validateOtpForm/validateOtpForm.component.tsx index 1492916c2..fb9e8b765 100644 --- a/packages/webapp/src/shared/components/auth/validateOtpForm/validateOtpForm.component.tsx +++ b/packages/webapp/src/shared/components/auth/validateOtpForm/validateOtpForm.component.tsx @@ -1,4 +1,5 @@ import { useMutation } from '@apollo/client'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useCommonQuery } from '@sb/webapp-api-client/providers'; import { ButtonSize } from '@sb/webapp-core/components/buttons'; import { Input } from '@sb/webapp-core/components/forms'; @@ -7,7 +8,6 @@ import { FormattedMessage, useIntl } from 'react-intl'; import { useNavigate } from 'react-router-dom'; import { RoutesConfig } from '../../../../app/config/routes'; -import { useApiForm } from '../../../hooks'; import { validateOtpMutation } from '../twoFactorAuthForm/twoFactorAuthForm.graphql'; import { Container, ErrorMessage, Header, SubmitButton } from './validateOtpForm.styles'; diff --git a/packages/webapp/src/shared/components/finances/stripe/stripePayment.hooks.ts b/packages/webapp/src/shared/components/finances/stripe/stripePayment.hooks.ts index 51f73aff8..150578613 100644 --- a/packages/webapp/src/shared/components/finances/stripe/stripePayment.hooks.ts +++ b/packages/webapp/src/shared/components/finances/stripe/stripePayment.hooks.ts @@ -1,9 +1,9 @@ import { useMutation } from '@apollo/client'; import { StripePaymentIntentType } from '@sb/webapp-api-client/graphql'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { useState } from 'react'; import { TestProduct } from '../../../../modules/stripe/stripe.types'; -import { useApiForm } from '../../../hooks'; import { useStripePayment } from './stripePayment.stripe.hook'; import { stripeCreatePaymentIntentMutation, diff --git a/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/__tests__/stripePaymentMethodSelector.component.spec.tsx b/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/__tests__/stripePaymentMethodSelector.component.spec.tsx index eced29447..b1357e9cf 100644 --- a/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/__tests__/stripePaymentMethodSelector.component.spec.tsx +++ b/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/__tests__/stripePaymentMethodSelector.component.spec.tsx @@ -1,3 +1,4 @@ +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { paymentMethodFactory, subscriptionPhaseFactory } from '@sb/webapp-api-client/tests/factories'; import { Elements } from '@stripe/react-stripe-js'; import { screen } from '@testing-library/react'; @@ -6,7 +7,6 @@ import { append } from 'ramda'; import { fillSubscriptionScheduleQueryWithPhases } from '../../../../../../tests/factories'; import { matchTextContent } from '../../../../../../tests/utils/match'; import { render } from '../../../../../../tests/utils/rendering'; -import { useApiForm } from '../../../../../hooks'; import { StripePaymentMethodSelector } from '../stripePaymentMethodSelector.component'; import { PaymentFormFields } from '../stripePaymentMethodSelector.types'; diff --git a/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/stripePaymentMethodSelector.stories.tsx b/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/stripePaymentMethodSelector.stories.tsx index 28884f5c0..cccde3041 100644 --- a/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/stripePaymentMethodSelector.stories.tsx +++ b/packages/webapp/src/shared/components/finances/stripe/stripePaymentMethodSelector/stripePaymentMethodSelector.stories.tsx @@ -1,4 +1,5 @@ import { SubscriptionPlanName } from '@sb/webapp-api-client/api/subscription'; +import { useApiForm } from '@sb/webapp-api-client/hooks'; import { paymentMethodFactory, subscriptionPhaseFactory, @@ -9,7 +10,6 @@ import { Elements } from '@stripe/react-stripe-js'; import { append, times } from 'ramda'; import { fillSubscriptionScheduleQueryWithPhases } from '../../../../../tests/factories'; -import { useApiForm } from '../../../../hooks'; import { stripePromise } from '../../../../services/stripe'; import { withActiveSubscriptionContext, withProviders } from '../../../../utils/storybook'; import { StripePaymentMethodSelector, StripePaymentMethodSelectorProps } from './stripePaymentMethodSelector.component'; diff --git a/packages/webapp/src/shared/components/layout/__tests__/layout.component.spec.tsx b/packages/webapp/src/shared/components/layout/__tests__/layout.component.spec.tsx index e8e3f14db..ed63ee6f5 100644 --- a/packages/webapp/src/shared/components/layout/__tests__/layout.component.spec.tsx +++ b/packages/webapp/src/shared/components/layout/__tests__/layout.component.spec.tsx @@ -1,9 +1,10 @@ +import { currentUserFactory, fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; +import { media } from '@sb/webapp-core/theme'; import { - currentUserFactory, - fillCommonQueryWithUser, + fillNotificationsListQuery, + fillNotificationsSubscriptionQuery, notificationFactory, -} from '@sb/webapp-api-client/tests/factories'; -import { media } from '@sb/webapp-core/theme'; +} from '@sb/webapp-notifications/tests/factories'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { append } from 'ramda'; @@ -11,7 +12,6 @@ import { Route, Routes } from 'react-router-dom'; import { RoutesConfig } from '../../../../app/config/routes'; import { Role } from '../../../../modules/auth/auth.types'; -import { fillNotificationsListQuery, fillNotificationsSubscriptionQuery } from '../../../../tests/factories'; import { createMockRouterProps, render } from '../../../../tests/utils/rendering'; import { Layout } from '../layout.component'; diff --git a/packages/webapp/src/shared/components/layout/header/__tests__/header.component.spec.tsx b/packages/webapp/src/shared/components/layout/header/__tests__/header.component.spec.tsx index 3286b36ed..0751f7fd4 100644 --- a/packages/webapp/src/shared/components/layout/header/__tests__/header.component.spec.tsx +++ b/packages/webapp/src/shared/components/layout/header/__tests__/header.component.spec.tsx @@ -1,14 +1,14 @@ +import { currentUserFactory, fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; import { - currentUserFactory, - fillCommonQueryWithUser, + fillNotificationsListQuery, + fillNotificationsSubscriptionQuery, notificationFactory, -} from '@sb/webapp-api-client/tests/factories'; +} from '@sb/webapp-notifications/tests/factories'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Route, Routes } from 'react-router-dom'; import { RoutesConfig } from '../../../../../app/config/routes'; -import { fillNotificationsListQuery, fillNotificationsSubscriptionQuery } from '../../../../../tests/factories'; import { render } from '../../../../../tests/utils/rendering'; import { Header } from '../header.component'; diff --git a/packages/webapp/src/shared/components/layout/header/header.component.tsx b/packages/webapp/src/shared/components/layout/header/header.component.tsx index 66c3c4c81..f36785d80 100644 --- a/packages/webapp/src/shared/components/layout/header/header.component.tsx +++ b/packages/webapp/src/shared/components/layout/header/header.component.tsx @@ -1,15 +1,16 @@ import { Link as ButtonLink, ButtonVariant } from '@sb/webapp-core/components/buttons'; -import { useGenerateLocalePath, useMediaQuery } from '@sb/webapp-core/hooks'; +import { useGenerateLocalePath, useMediaQuery, useOpenState } from '@sb/webapp-core/hooks'; import { Snackbar } from '@sb/webapp-core/snackbar'; import { media } from '@sb/webapp-core/theme'; +import { Notifications } from '@sb/webapp-notifications'; import { HTMLAttributes, useContext } from 'react'; import ClickAwayListener from 'react-click-away-listener'; import { FormattedMessage, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; import { RoutesConfig } from '../../../../app/config/routes'; -import { useAuth, useOpenState } from '../../../hooks'; -import { Notifications } from '../../notifications'; +import notificationTemplates from '../../../constants/notificationTemplates'; +import { useAuth } from '../../../hooks'; import { LayoutContext } from '../layout.context'; import { Avatar, @@ -70,7 +71,7 @@ export const Header = (props: HeaderProps) => { {isLoggedIn && ( <> - + -} from './templates'; - -export const NOTIFICATIONS_STRATEGY: Record = { - [NotificationTypes.CRUD_ITEM_CREATED]: CrudItemCreated, - [NotificationTypes.CRUD_ITEM_UPDATED]: CrudItemUpdated, - //<-- INJECT NOTIFICATION STRATEGY --> -}; diff --git a/packages/webapp/src/shared/components/notifications/templates/index.ts b/packages/webapp/src/shared/components/notifications/templates/index.ts deleted file mode 100644 index 2bd1d3501..000000000 --- a/packages/webapp/src/shared/components/notifications/templates/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { CrudItemCreated } from './crudItemCreated'; -export { CrudItemUpdated } from './crudItemUpdated'; -//<-- INJECT NOTIFICATION EXPORT --> diff --git a/packages/webapp/src/shared/constants/notificationTemplates.ts b/packages/webapp/src/shared/constants/notificationTemplates.ts new file mode 100644 index 000000000..f5375b885 --- /dev/null +++ b/packages/webapp/src/shared/constants/notificationTemplates.ts @@ -0,0 +1,9 @@ +import { CrudItemCreated, CrudItemUpdated } from '@sb/webapp-crud-demo/notifications'; +import { NotificationTypes } from '@sb/webapp-notifications'; +import { ElementType } from 'react'; + +const templates: Record = { + [NotificationTypes.CRUD_ITEM_CREATED]: CrudItemCreated, + [NotificationTypes.CRUD_ITEM_UPDATED]: CrudItemUpdated, +}; +export default templates; diff --git a/packages/webapp/src/shared/hooks/index.ts b/packages/webapp/src/shared/hooks/index.ts index 81a5eb2ac..0a3e24e66 100644 --- a/packages/webapp/src/shared/hooks/index.ts +++ b/packages/webapp/src/shared/hooks/index.ts @@ -1,7 +1,4 @@ -export type { ApiFormReturnType } from './useApiForm'; -export { useApiForm } from './useApiForm'; export { useAuth } from './useAuth/useAuth'; -export { useOpenState } from './useOpenState'; export { useRoleAccessCheck } from './useRoleAccessCheck'; export { useRouterScrollToTop } from './useRouterScrollToTop'; export { useGenerateAbsoluteLocalePath } from './useGenerateAbsoluteLocalePath'; diff --git a/packages/webapp/src/shared/utils/storybook.tsx b/packages/webapp/src/shared/utils/storybook.tsx index 00561bce8..41b0810dd 100644 --- a/packages/webapp/src/shared/utils/storybook.tsx +++ b/packages/webapp/src/shared/utils/storybook.tsx @@ -1,9 +1,10 @@ +import { ApiTestProviders } from '@sb/webapp-api-client/tests/utils/rendering'; import { Story } from '@storybook/react'; import { Elements } from '@stripe/react-stripe-js'; import { Route, Routes } from 'react-router-dom'; import { ActiveSubscriptionContext } from '../../routes/finances/activeSubscriptionContext/activeSubscriptionContext.component'; -import { DefaultTestProviders, DefaultTestProvidersProps, WrapperProps, getWrapper } from '../../tests/utils/rendering'; +import { WrapperProps, getWrapper } from '../../tests/utils/rendering'; import { stripePromise } from '../services/stripe'; export const withActiveSubscriptionContext = (StoryComponent: Story) => { @@ -23,14 +24,12 @@ export const withActiveSubscriptionContext = (StoryComponent: Story) => { ); }; -export function withProviders

( - wrapperProps: WrapperProps

= {} -) { - return (StoryComponent: Story, storyContext: any) => { - const { wrapper: WrapperComponent } = getWrapper(DefaultTestProviders, wrapperProps, storyContext) as any; +export function withProviders(wrapperProps: WrapperProps = {}) { + return (StoryComponent: Story) => { + const { wrapper: WrapperComponent } = getWrapper(ApiTestProviders, wrapperProps) as any; return ( - + ); diff --git a/packages/webapp/src/tests/factories/index.ts b/packages/webapp/src/tests/factories/index.ts index 61f98aebc..4b00b47e0 100644 --- a/packages/webapp/src/tests/factories/index.ts +++ b/packages/webapp/src/tests/factories/index.ts @@ -1,6 +1,4 @@ export * from './stripe'; export * from './subscription'; -export * from './notification'; export * from './document'; -export * from './crudDemoItem'; //<-- INJECT FACTORY --> diff --git a/packages/webapp/src/tests/utils/rendering.tsx b/packages/webapp/src/tests/utils/rendering.tsx index 727c0df6d..a95ac8394 100644 --- a/packages/webapp/src/tests/utils/rendering.tsx +++ b/packages/webapp/src/tests/utils/rendering.tsx @@ -1,99 +1,26 @@ -import { MockedProvider as MockedApolloProvider, MockedProviderProps, MockedResponse } from '@apollo/client/testing'; -import { CommonQuery } from '@sb/webapp-api-client/providers'; -import { fillCommonQueryWithUser } from '@sb/webapp-api-client/tests/factories'; -import * as coreUtils from '@sb/webapp-core/tests/utils/rendering'; -import { StoryContext } from '@storybook/react'; -import { RenderOptions, render, renderHook, waitFor } from '@testing-library/react'; -import { ComponentClass, ComponentType, FC, PropsWithChildren, ReactElement } from 'react'; -import { generatePath } from 'react-router'; -import { MemoryRouterProps } from 'react-router-dom'; +import * as apiUtils from '@sb/webapp-api-client/tests/utils/rendering'; +import { RenderOptions, render, renderHook } from '@testing-library/react'; +import { ComponentClass, ComponentType, FC, ReactElement } from 'react'; +import { MemoryRouterProps, generatePath } from 'react-router'; import { RoutesConfig } from '../../app/config/routes'; -export const PLACEHOLDER_TEST_ID = 'content'; -export const PLACEHOLDER_CONTENT = content; - -export type DefaultTestProvidersProps = PropsWithChildren< - { - apolloMocks?: ReadonlyArray; - apolloProviderProps: MockedProviderProps; - } & coreUtils.DefaultTestProvidersProps ->; +export type WrapperProps = apiUtils.WrapperProps; -export function DefaultTestProviders({ - children, - apolloMocks = [], - apolloProviderProps = {}, -}: DefaultTestProvidersProps) { - return ( - - {children} - - ); -} - -export type WrapperProps

= Partial< - Omit -> & { - apolloMocks?: - | ReadonlyArray - | ((mocks: ReadonlyArray, storyContext?: StoryContext) => ReadonlyArray); -}; - -export function getWrapper

( - WrapperComponent: ComponentClass

| FC

, - wrapperProps: WrapperProps

, - storyContext?: StoryContext +export function getWrapper( + WrapperComponent: ComponentClass | FC, + wrapperProps: WrapperProps ): { - wrapper: ComponentType

; + wrapper: ComponentType; waitForApolloMocks: (mockIndex?: number) => Promise; } { - const { wrapper: CoreWrapper } = coreUtils.getWrapper(coreUtils.DefaultTestProviders, wrapperProps); - const apolloMocks = (() => { - const defaultApolloMocks = [fillCommonQueryWithUser()]; - - if (typeof wrapperProps.apolloMocks === 'function') { - return wrapperProps.apolloMocks(defaultApolloMocks, storyContext); - } - - if (wrapperProps.apolloMocks !== undefined) { - return wrapperProps.apolloMocks; - } - - return defaultApolloMocks; - })(); - - const waitForApolloMocks = async (mockIndex: number = apolloMocks.length - 1) => { - if (!apolloMocks.length) { - return Promise.resolve(); - } - - // @ts-ignore - await waitFor(() => expect(apolloMocks[mockIndex].result).toHaveBeenCalled()); - }; - - const wrapper = (props: P) => { - return ( - - - - ); - }; - - return { - wrapper, - waitForApolloMocks, - }; + return apiUtils.getWrapper(apiUtils.ApiTestProviders, wrapperProps); } -export type CustomRenderOptions

= RenderOptions & - WrapperProps

; +export type CustomRenderOptions = RenderOptions & WrapperProps; -function customRender

( - ui: ReactElement, - options: CustomRenderOptions

= {} -) { - const { wrapper, waitForApolloMocks } = getWrapper(DefaultTestProviders, options); +function customRender(ui: ReactElement, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); return { ...render(ui, { @@ -104,11 +31,8 @@ function customRender

( - hook: (initialProps: Props) => Result, - options: CustomRenderOptions

= {} -) { - const { wrapper, waitForApolloMocks } = getWrapper(DefaultTestProviders, options); +function customRenderHook(hook: (initialProps: Props) => Result, options: CustomRenderOptions = {}) { + const { wrapper, waitForApolloMocks } = getWrapper(apiUtils.ApiTestProviders, options); return { ...renderHook(hook, { @@ -134,3 +58,6 @@ export const createMockRouterProps = ( ], }; }; + +export const PLACEHOLDER_TEST_ID = 'content'; +export const PLACEHOLDER_CONTENT = content; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f5d2e5cb..c497f7ca2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,69 +4,128 @@ importers: .: specifiers: + '@babel/preset-react': ^7.14.5 '@nrwl/devkit': 15.6.3 '@nrwl/eslint-plugin-nx': ^15.6.3 - '@nrwl/jest': ^15.6.3 + '@nrwl/jest': 15.5.3 '@nrwl/js': 15.6.3 '@nrwl/linter': 15.6.3 '@nrwl/node': ^15.6.3 '@nrwl/nx-cloud': ^15.0.2 '@nrwl/nx-plugin': ^15.6.3 + '@nrwl/react': 15.5.3 + '@nrwl/web': 15.5.3 + '@pmmmwh/react-refresh-webpack-plugin': ^0.5.7 '@sb/core': '*' + '@svgr/webpack': ^6.1.2 '@swc-node/register': ^1.4.2 '@swc/cli': ~0.1.55 '@swc/core': ^1.2.173 '@swc/helpers': ~0.4.11 + '@testing-library/react': 13.4.0 + '@types/jest': 28.1.1 '@types/node': 16.11.7 + '@types/react': 18.0.25 + '@types/react-dom': 18.0.9 + '@types/react-is': 17.0.3 + '@types/react-router-dom': 5.3.3 + '@types/styled-components': 5.1.26 '@typescript-eslint/eslint-plugin': ^5.51.0 '@typescript-eslint/parser': ^5.51.0 + babel-jest: 28.1.1 babel-plugin-relay: ^14.1.0 + babel-plugin-styled-components: 1.10.7 env-cmd: ^10.1.0 eslint: ^8.34.0 eslint-config-prettier: ^8.5.0 eslint-import-resolver-typescript: ^3.5.3 - eslint-plugin-import: npm:eslint-plugin-i@^2.26.0 + eslint-plugin-cypress: ^2.10.3 + eslint-plugin-import: 2.26.0 + eslint-plugin-jsx-a11y: 6.6.1 + eslint-plugin-react: 7.31.11 + eslint-plugin-react-hooks: 4.6.0 husky: ^8.0.0 + jest: 28.1.1 + jest-environment-jsdom: 28.1.1 jsonc-eslint-parser: ^2.1.0 lint-staged: ^10.5.4 nx: ^15.4.5 prettier: ^2.6.2 + react: 18.2.0 + react-dom: 18.2.0 + react-is: 18.2.0 + react-refresh: ^0.10.0 + react-router-dom: 6.4.3 + react-test-renderer: 18.2.0 + styled-components: 5.3.6 + ts-jest: 28.0.5 ts-node: 10.9.1 tsconfig-paths: ^4.1.2 tslib: ^2.3.0 typescript: ~4.8.2 + url-loader: ^4.1.1 + dependencies: + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-is: 18.2.0 + react-router-dom: 6.4.3_biqbaboplfbrettd7655fr4n2y + styled-components: 5.3.6_7i5myeigehqah43i5u7wbekgba devDependencies: + '@babel/preset-react': 7.18.6 '@nrwl/devkit': 15.6.3_nx@15.5.3+typescript@4.8.4 '@nrwl/eslint-plugin-nx': 15.6.3_zqeseekv33b4aue5js4hxijdpe - '@nrwl/jest': 15.6.3_hnvut7mdfhqf2wtqnzwlbw5agu + '@nrwl/jest': 15.5.3_hnvut7mdfhqf2wtqnzwlbw5agu '@nrwl/js': 15.6.3_tuejytaz3socmkola73m5zhv6a '@nrwl/linter': 15.6.3_ihnn6okre4k4xzbx2em7pmleii '@nrwl/node': 15.6.3_llxn6cb7nqbhgmm2wxatjnw3rq '@nrwl/nx-cloud': 15.0.2 '@nrwl/nx-plugin': 15.6.3_llxn6cb7nqbhgmm2wxatjnw3rq + '@nrwl/react': 15.5.3_tuejytaz3socmkola73m5zhv6a + '@nrwl/web': 15.5.3_llxn6cb7nqbhgmm2wxatjnw3rq + '@pmmmwh/react-refresh-webpack-plugin': 0.5.10_react-refresh@0.10.0 '@sb/core': link:packages/internal/core + '@svgr/webpack': 6.5.1 '@swc-node/register': 1.5.5_sj45ejzagl3ytkpurcqhbu2wya '@swc/cli': 0.1.59_@swc+core@1.3.27 '@swc/core': 1.3.27 '@swc/helpers': 0.4.14 + '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y + '@types/jest': 28.1.1 '@types/node': 16.11.7 + '@types/react': 18.0.25 + '@types/react-dom': 18.0.9 + '@types/react-is': 17.0.3 + '@types/react-router-dom': 5.3.3 + '@types/styled-components': 5.1.26 '@typescript-eslint/eslint-plugin': 5.51.0_tyhfwyxxzt5pesoilawie2sdoa '@typescript-eslint/parser': 5.51.0_vvbfoh7ci2jjuy6alapehrh2ri + babel-jest: 28.1.1 babel-plugin-relay: 14.1.0 + babel-plugin-styled-components: 1.10.7_styled-components@5.3.6 env-cmd: 10.1.0 eslint: 8.34.0 eslint-config-prettier: 8.6.0_eslint@8.34.0 - eslint-import-resolver-typescript: 3.5.3_bfxbel4ck22mojfyurwsgb3ygm - eslint-plugin-import: /eslint-plugin-i/2.26.0_inmo4nrctlhmfx73hzu6aogupa + eslint-import-resolver-typescript: 3.5.3_w7dy265x2bmlgtc6kmsfumkjde + eslint-plugin-cypress: 2.12.1_eslint@8.34.0 + eslint-plugin-import: 2.26.0_inmo4nrctlhmfx73hzu6aogupa + eslint-plugin-jsx-a11y: 6.6.1_eslint@8.34.0 + eslint-plugin-react: 7.31.11_eslint@8.34.0 + eslint-plugin-react-hooks: 4.6.0_eslint@8.34.0 husky: 8.0.3 + jest: 28.1.1_6m7kcbkkzjz4ln6z66tlzx44we + jest-environment-jsdom: 28.1.1 jsonc-eslint-parser: 2.1.0 lint-staged: 10.5.4 nx: 15.5.3_pys4s3dn6tgpk2ashdi5msvbey prettier: 2.8.3 + react-refresh: 0.10.0 + react-test-renderer: 18.2.0_react@18.2.0 + ts-jest: 28.0.5_c57pmzltpvrsqbtqxiqe3cr3ra ts-node: 10.9.1_2frzvjkzow2fwipuxdbwjegfle tsconfig-paths: 4.1.2 tslib: 2.4.1 typescript: 4.8.4 + url-loader: 4.1.1 packages/backend: specifiers: @@ -357,6 +416,8 @@ importers: '@sb/webapp-api-client': '*' '@sb/webapp-contentful': '*' '@sb/webapp-core': '*' + '@sb/webapp-crud-demo': '*' + '@sb/webapp-notifications': '*' '@sentry/react': ^7.17.4 '@storybook/addon-actions': ^6.5.16 '@storybook/addon-backgrounds': ^6.5.16 @@ -443,7 +504,6 @@ importers: react-dom: 18.2.0 react-helmet-async: ^1.3.0 react-hook-form: ^7.34.0 - react-infinite-scroll-hook: ^4.0.4 react-intl: ^6.2.1 react-is: 18.2.0 react-loading-skeleton: ^3.1.0 @@ -504,7 +564,6 @@ importers: react-dom: 18.2.0_react@18.2.0 react-helmet-async: 1.3.0_biqbaboplfbrettd7655fr4n2y react-hook-form: 7.42.1_react@18.2.0 - react-infinite-scroll-hook: 4.0.4_react@18.2.0 react-intl: 6.2.5_react@18.2.0 react-is: 18.2.0 react-loading-skeleton: 3.1.0_react@18.2.0 @@ -532,6 +591,8 @@ importers: '@sb/webapp-api-client': link:../webapp-libs/webapp-api-client '@sb/webapp-contentful': link:../webapp-libs/webapp-contentful '@sb/webapp-core': link:../webapp-libs/webapp-core + '@sb/webapp-crud-demo': link:../webapp-libs/webapp-crud-demo + '@sb/webapp-notifications': link:../webapp-libs/webapp-notifications '@storybook/addon-actions': 6.5.16_biqbaboplfbrettd7655fr4n2y '@storybook/addon-backgrounds': 6.5.16_biqbaboplfbrettd7655fr4n2y '@storybook/addon-docs': 6.5.16_biqbaboplfbrettd7655fr4n2y @@ -653,6 +714,7 @@ importers: msw: ^1.0.0 ramda: ^0.28.0 react: 18.2.0 + react-hook-form: ^7.34.0 ts-jest: 28.0.5 dependencies: '@sb/webapp-core': link:../webapp-core @@ -698,6 +760,7 @@ importers: msw: 1.0.0 ramda: 0.28.0 react: 18.2.0 + react-hook-form: 7.42.1_react@18.2.0 ts-jest: 28.0.5_gcleckb5zcuhbbyyhlubvkkx2y packages/webapp-libs/webapp-contentful: @@ -832,6 +895,7 @@ importers: '@storybook/client-api': ^6.5.16 '@storybook/client-logger': ^6.5.16 '@storybook/react': ^6.5.16 + '@supercharge/strings': ^2.0.0 '@testing-library/dom': ^8.19.0 '@testing-library/jest-dom': ^5.16.5 '@testing-library/react': ^13.4.0 @@ -902,6 +966,7 @@ importers: '@storybook/client-api': 6.5.16_biqbaboplfbrettd7655fr4n2y '@storybook/client-logger': 6.5.16 '@storybook/react': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@supercharge/strings': 2.0.0 '@testing-library/dom': 8.20.0 '@testing-library/jest-dom': 5.16.5 '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y @@ -944,6 +1009,222 @@ importers: styled-theming: 2.2.0 ts-jest: 28.0.5_gcleckb5zcuhbbyyhlubvkkx2y + packages/webapp-libs/webapp-crud-demo: + specifiers: + '@apollo/client': ^3.7.9 + '@apollo/rover': ^0.12.2 + '@graphql-codegen/cli': ^2.13.11 + '@iconify-icons/ion': ^1.2.4 + '@iconify/react': ^4.0.0 + '@nrwl/jest': ^15.8.6 + '@nrwl/react': ^15.8.6 + '@sb/webapp-api-client': '*' + '@sb/webapp-core': '*' + '@sb/webapp-notifications': '*' + '@storybook/addon-actions': ^6.5.16 + '@storybook/addon-backgrounds': ^6.5.16 + '@storybook/addon-docs': ^6.5.16 + '@storybook/addon-essentials': ^6.5.16 + '@storybook/addon-measure': ^6.5.16 + '@storybook/addon-outline': ^6.5.16 + '@storybook/builder-vite': ^0.4.0 + '@storybook/client-api': ^6.5.16 + '@storybook/client-logger': ^6.5.16 + '@storybook/react': ^6.5.16 + '@testing-library/dom': ^8.19.0 + '@testing-library/jest-dom': ^5.16.5 + '@testing-library/react': ^13.4.0 + '@testing-library/react-hooks': ^8.0.1 + '@testing-library/user-event': ^14.4.3 + '@types/jest': 28.1.3 + '@types/ramda': ^0.28.23 + '@types/react': ^18.0.24 + '@types/styled-components': ^5.1.26 + '@types/testing-library__jest-dom': ^5.14.5 + babel-jest: 28.1.3 + eslint-plugin-formatjs: ^4.3.4 + eslint-plugin-jsx-a11y: ^6.4.1 + eslint-plugin-react: ^7.21.5 + eslint-plugin-react-hooks: ^4.0.0 + eslint-plugin-testing-library: ^5.9.1 + graphql: ^16.6.0 + jest: 28.1.3 + jest-environment-jsdom: 28.1.3 + jest-matcher-utils: ^29.4.2 + jest-watch-typeahead: ^2.2.2 + ramda: ^0.28.0 + react: 18.2.0 + react-click-away-listener: ^2.2.2 + react-dom: 18.2.0 + react-intl: ^6.2.1 + react-markdown: ^8.0.3 + react-router: ^6.7.0 + react-router-dom: ^6.7.0 + styled-components: 5.3.6 + ts-jest: 28.0.5 + dependencies: + '@sb/webapp-api-client': link:../webapp-api-client + '@sb/webapp-core': link:../webapp-core + '@sb/webapp-notifications': link:../webapp-notifications + graphql: 16.6.0 + react-click-away-listener: 2.2.2_biqbaboplfbrettd7655fr4n2y + devDependencies: + '@apollo/client': 3.7.9_gdcq4dv6opitr3wbfwyjmanyra + '@apollo/rover': 0.12.2 + '@graphql-codegen/cli': 2.16.4_graphql@16.6.0 + '@iconify-icons/ion': 1.2.7 + '@iconify/react': 4.0.1_react@18.2.0 + '@nrwl/jest': 15.8.6 + '@nrwl/react': 15.8.6 + '@storybook/addon-actions': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-backgrounds': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-docs': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-essentials': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-measure': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-outline': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/builder-vite': 0.4.0_biqbaboplfbrettd7655fr4n2y + '@storybook/client-api': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/client-logger': 6.5.16 + '@storybook/react': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@testing-library/dom': 8.20.0 + '@testing-library/jest-dom': 5.16.5 + '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y + '@testing-library/react-hooks': 8.0.1_5ndqzdd6t4rivxsukjv3i3ak2q + '@testing-library/user-event': 14.4.3_yxlyej73nftwmh2fiao7paxmlm + '@types/jest': 28.1.3 + '@types/ramda': 0.28.23 + '@types/react': 18.0.27 + '@types/styled-components': 5.1.26 + '@types/testing-library__jest-dom': 5.14.5 + babel-jest: 28.1.3 + eslint-plugin-formatjs: 4.3.9_ts-jest@28.0.5 + eslint-plugin-jsx-a11y: 6.7.1 + eslint-plugin-react: 7.32.1 + eslint-plugin-react-hooks: 4.6.0 + eslint-plugin-testing-library: 5.9.1 + jest: 28.1.3 + jest-environment-jsdom: 28.1.3 + jest-matcher-utils: 29.4.2 + jest-watch-typeahead: 2.2.2_jest@28.1.3 + ramda: 0.28.0 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-intl: 6.2.5_react@18.2.0 + react-markdown: 8.0.5_3stiutgnnbnfnf3uowm5cip22i + react-router: 6.7.0_react@18.2.0 + react-router-dom: 6.7.0_biqbaboplfbrettd7655fr4n2y + styled-components: 5.3.6_biqbaboplfbrettd7655fr4n2y + ts-jest: 28.0.5_gcleckb5zcuhbbyyhlubvkkx2y + + packages/webapp-libs/webapp-notifications: + specifiers: + '@apollo/client': ^3.7.9 + '@apollo/rover': ^0.12.2 + '@graphql-codegen/cli': ^2.13.11 + '@iconify-icons/ion': ^1.2.4 + '@iconify/react': ^4.0.0 + '@nrwl/jest': ^15.8.6 + '@nrwl/react': ^15.8.6 + '@sb/webapp-api-client': '*' + '@sb/webapp-core': '*' + '@storybook/addon-actions': ^6.5.16 + '@storybook/addon-backgrounds': ^6.5.16 + '@storybook/addon-docs': ^6.5.16 + '@storybook/addon-essentials': ^6.5.16 + '@storybook/addon-measure': ^6.5.16 + '@storybook/addon-outline': ^6.5.16 + '@storybook/builder-vite': ^0.4.0 + '@storybook/client-api': ^6.5.16 + '@storybook/client-logger': ^6.5.16 + '@storybook/react': ^6.5.16 + '@testing-library/dom': ^8.19.0 + '@testing-library/jest-dom': ^5.16.5 + '@testing-library/react': ^13.4.0 + '@testing-library/react-hooks': ^8.0.1 + '@testing-library/user-event': ^14.4.3 + '@types/jest': 28.1.3 + '@types/ramda': ^0.28.23 + '@types/react': ^18.0.24 + '@types/styled-components': ^5.1.26 + '@types/testing-library__jest-dom': ^5.14.5 + babel-jest: 28.1.3 + eslint-plugin-formatjs: ^4.3.4 + eslint-plugin-jsx-a11y: ^6.4.1 + eslint-plugin-react: ^7.21.5 + eslint-plugin-react-hooks: ^4.0.0 + eslint-plugin-testing-library: ^5.9.1 + graphql: ^16.6.0 + jest: 28.1.3 + jest-environment-jsdom: 28.1.3 + jest-matcher-utils: ^29.4.2 + jest-watch-typeahead: ^2.2.2 + ramda: ^0.28.0 + react: 18.2.0 + react-click-away-listener: ^2.2.2 + react-dom: 18.2.0 + react-infinite-scroll-hook: ^4.0.4 + react-intl: ^6.2.1 + react-loading-skeleton: ^3.1.0 + react-markdown: ^8.0.3 + react-router: ^6.7.0 + react-router-dom: ^6.7.0 + styled-components: 5.3.6 + ts-jest: 28.0.5 + dependencies: + '@sb/webapp-api-client': link:../webapp-api-client + '@sb/webapp-core': link:../webapp-core + graphql: 16.6.0 + react-click-away-listener: 2.2.2_biqbaboplfbrettd7655fr4n2y + react-infinite-scroll-hook: 4.0.4_react@18.2.0 + devDependencies: + '@apollo/client': 3.7.9_gdcq4dv6opitr3wbfwyjmanyra + '@apollo/rover': 0.12.2 + '@graphql-codegen/cli': 2.16.4_graphql@16.6.0 + '@iconify-icons/ion': 1.2.7 + '@iconify/react': 4.0.1_react@18.2.0 + '@nrwl/jest': 15.8.6 + '@nrwl/react': 15.8.6 + '@storybook/addon-actions': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-backgrounds': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-docs': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-essentials': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-measure': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/addon-outline': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/builder-vite': 0.4.0_biqbaboplfbrettd7655fr4n2y + '@storybook/client-api': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@storybook/client-logger': 6.5.16 + '@storybook/react': 6.5.16_biqbaboplfbrettd7655fr4n2y + '@testing-library/dom': 8.20.0 + '@testing-library/jest-dom': 5.16.5 + '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y + '@testing-library/react-hooks': 8.0.1_2zx2umvpluuhvlq44va5bta2da + '@testing-library/user-event': 14.4.3_yxlyej73nftwmh2fiao7paxmlm + '@types/jest': 28.1.3 + '@types/ramda': 0.28.23 + '@types/react': 18.0.25 + '@types/styled-components': 5.1.26 + '@types/testing-library__jest-dom': 5.14.5 + babel-jest: 28.1.3 + eslint-plugin-formatjs: 4.3.9_ts-jest@28.0.5 + eslint-plugin-jsx-a11y: 6.6.1 + eslint-plugin-react: 7.31.11 + eslint-plugin-react-hooks: 4.6.0 + eslint-plugin-testing-library: 5.9.1 + jest: 28.1.3 + jest-environment-jsdom: 28.1.3 + jest-matcher-utils: 29.4.2 + jest-watch-typeahead: 2.2.2_jest@28.1.3 + ramda: 0.28.0 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-intl: 6.2.5_react@18.2.0 + react-loading-skeleton: 3.1.0_react@18.2.0 + react-markdown: 8.0.5_fan5qbzahqtxlm5dzefqlqx5ia + react-router: 6.7.0_react@18.2.0 + react-router-dom: 6.7.0_biqbaboplfbrettd7655fr4n2y + styled-components: 5.3.6_biqbaboplfbrettd7655fr4n2y + ts-jest: 28.0.5_gcleckb5zcuhbbyyhlubvkkx2y + packages/workers: specifiers: '@aws-sdk/client-ses': ^3.272.0 @@ -1176,7 +1457,6 @@ packages: ts-invariant: 0.10.3 tslib: 2.5.0 zen-observable-ts: 1.2.5 - dev: false /@apollo/client/3.7.9_o7paodxqbevdia6ixjcodtofcm: resolution: {integrity: sha512-YnJvrJOVWrp4y/zdNvUaM8q4GuSHCEIecsRDTJhK/veT33P/B7lfqGJ24NeLdKMj8tDEuXYF7V0t+th4+rgC+Q==} @@ -5480,7 +5760,7 @@ packages: '@docusaurus/react-loadable': 5.5.2_react@16.14.0 '@docusaurus/types': 2.2.0_wcqkhtmu7mswc6yz4uyexck3ty '@types/history': 4.7.11 - '@types/react': 18.0.27 + '@types/react': 18.0.25 '@types/react-router-config': 5.0.6 '@types/react-router-dom': 5.3.3 react: 16.14.0 @@ -5795,7 +6075,7 @@ packages: peerDependencies: react: '*' dependencies: - '@types/react': 18.0.27 + '@types/react': 18.0.25 prop-types: 15.8.1 react: 16.14.0 dev: false @@ -5866,7 +6146,7 @@ packages: '@docusaurus/plugin-content-pages': 2.2.0_wcqkhtmu7mswc6yz4uyexck3ty '@docusaurus/utils': 2.2.0_@docusaurus+types@2.2.0 '@types/history': 4.7.11 - '@types/react': 18.0.27 + '@types/react': 18.0.25 '@types/react-router-config': 5.0.6 clsx: 1.2.1 parse-numeric-range: 1.3.0 @@ -5955,7 +6235,7 @@ packages: react-dom: ^16.8.4 || ^17.0.0 dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.27 + '@types/react': 18.0.25 commander: 5.1.0 joi: 17.7.0 react: 16.14.0 @@ -6625,6 +6905,60 @@ packages: - utf-8-validate dev: true + /@graphql-codegen/cli/2.16.4_graphql@16.6.0: + resolution: {integrity: sha512-MBbdzIIaNZ8BTlFXG00toxU5rIV7Ltf2myaze88HpI5YPVfVJKlfccE6l0/Gv+nLv88CIM/PZrnFLdVtlBmrZw==} + hasBin: true + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + ts-node: '>=10' + dependencies: + '@babel/generator': 7.20.7 + '@babel/template': 7.20.7 + '@babel/types': 7.20.7 + '@graphql-codegen/core': 2.6.8_graphql@16.6.0 + '@graphql-codegen/plugin-helpers': 3.1.2_graphql@16.6.0 + '@graphql-tools/apollo-engine-loader': 7.3.22_graphql@16.6.0 + '@graphql-tools/code-file-loader': 7.3.16_graphql@16.6.0 + '@graphql-tools/git-loader': 7.2.16_graphql@16.6.0 + '@graphql-tools/github-loader': 7.3.23_graphql@16.6.0 + '@graphql-tools/graphql-file-loader': 7.5.14_graphql@16.6.0 + '@graphql-tools/json-file-loader': 7.4.15_graphql@16.6.0 + '@graphql-tools/load': 7.8.0_graphql@16.6.0 + '@graphql-tools/prisma-loader': 7.2.54_graphql@16.6.0 + '@graphql-tools/url-loader': 7.17.3_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + '@whatwg-node/fetch': 0.6.2 + chalk: 4.1.2 + chokidar: 3.5.3 + cosmiconfig: 7.1.0 + cosmiconfig-typescript-loader: 4.3.0_cosmiconfig@7.1.0 + debounce: 1.2.1 + detect-indent: 6.1.0 + graphql: 16.6.0 + graphql-config: 4.4.0_ul246jct24iapssnbw5f5pr2vu + inquirer: 8.2.5 + is-glob: 4.0.3 + json-to-pretty-yaml: 1.2.2 + listr2: 4.0.5 + log-symbols: 4.1.0 + shell-quote: 1.7.4 + string-env-interpolation: 1.0.1 + ts-log: 2.2.5 + tslib: 2.5.0 + yaml: 1.10.2 + yargs: 17.6.2 + transitivePeerDependencies: + - '@babel/core' + - '@types/node' + - bufferutil + - cosmiconfig-toml-loader + - encoding + - enquirer + - supports-color + - typescript + - utf-8-validate + dev: true + /@graphql-codegen/cli/3.2.2_graphql@16.6.0: resolution: {integrity: sha512-u+dm/SW1heLnUL4Tyf5Uv0AxOFhTCmUPHKwRLq2yE8MPhv7+Ti4vxxUP/XGoaMNRuHlN37wLI7tpFLV1Hhm22Q==} hasBin: true @@ -6735,6 +7069,18 @@ packages: tslib: 2.4.1 dev: true + /@graphql-codegen/core/2.6.8_graphql@16.6.0: + resolution: {integrity: sha512-JKllNIipPrheRgl+/Hm/xuWMw9++xNQ12XJR/OHHgFopOg4zmN3TdlRSyYcv/K90hCFkkIwhlHFUQTfKrm8rxQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + dependencies: + '@graphql-codegen/plugin-helpers': 3.1.2_graphql@16.6.0 + '@graphql-tools/schema': 9.0.13_graphql@16.6.0 + '@graphql-tools/utils': 9.2.1_graphql@16.6.0 + graphql: 16.6.0 + tslib: 2.4.1 + dev: true + /@graphql-codegen/core/3.1.0_graphql@16.6.0: resolution: {integrity: sha512-DH1/yaR7oJE6/B+c6ZF2Tbdh7LixF1K8L+8BoSubjNyQ8pNwR4a70mvc1sv6H7qgp6y1bPQ9tKE+aazRRshysw==} peerDependencies: @@ -7181,6 +7527,22 @@ packages: - supports-color dev: true + /@graphql-tools/code-file-loader/7.3.16_graphql@16.6.0: + resolution: {integrity: sha512-109UFvQjZEntHwjPaHpWvgUudHenGngbXvSImabPc2fdrtgja5KC0h7thCg379Yw6IORHGrF2XbJwS1hAGPPWw==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + dependencies: + '@graphql-tools/graphql-tag-pluck': 7.4.3_graphql@16.6.0 + '@graphql-tools/utils': 9.1.4_graphql@16.6.0 + globby: 11.1.0 + graphql: 16.6.0 + tslib: 2.5.0 + unixify: 1.0.0 + transitivePeerDependencies: + - '@babel/core' + - supports-color + dev: true + /@graphql-tools/code-file-loader/7.3.21_graphql@16.6.0: resolution: {integrity: sha512-dj+OLnz1b8SYkXcuiy0CUQ25DWnOEyandDlOcdBqU3WVwh5EEVbn0oXUYm90fDlq2/uut00OrtC5Wpyhi3tAvA==} peerDependencies: @@ -8404,6 +8766,49 @@ packages: - ts-node dev: true + /@jest/core/28.1.3_ts-node@10.9.1: + resolution: {integrity: sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 28.1.3 + '@jest/reporters': 28.1.3 + '@jest/test-result': 28.1.3 + '@jest/transform': 28.1.3 + '@jest/types': 28.1.3 + '@types/node': 16.11.7 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.7.1 + exit: 0.1.2 + graceful-fs: 4.2.10 + jest-changed-files: 28.1.3 + jest-config: 28.1.3_6m7kcbkkzjz4ln6z66tlzx44we + jest-haste-map: 28.1.3 + jest-message-util: 28.1.3 + jest-regex-util: 28.0.2 + jest-resolve: 28.1.3 + jest-resolve-dependencies: 28.1.3 + jest-runner: 28.1.3 + jest-runtime: 28.1.3 + jest-snapshot: 28.1.3 + jest-util: 28.1.3 + jest-validate: 28.1.3 + jest-watcher: 28.1.3 + micromatch: 4.0.5 + pretty-format: 28.1.3 + rimraf: 3.0.2 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /@jest/environment/28.1.3: resolution: {integrity: sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -8899,7 +9304,11 @@ packages: /@nrwl/cli/15.5.3: resolution: {integrity: sha512-NWf9CWswvdYM6YzXuweaZPAZ2erMtQrrHZdgFbUGeojZBZ+b4TCGzLWNodZj4yQOa/eTwlyPMYO2LEw9CoapDQ==} dependencies: - nx: 15.5.3_pys4s3dn6tgpk2ashdi5msvbey + nx: 15.5.3 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - debug dev: true /@nrwl/cli/15.5.3_pys4s3dn6tgpk2ashdi5msvbey: @@ -8965,6 +9374,30 @@ packages: - typescript dev: true + /@nrwl/cypress/15.5.3_tuejytaz3socmkola73m5zhv6a: + resolution: {integrity: sha512-qOp0MfD8ot+QGkkBV8tWM3x2repSFmoo6Jn4wSKuQ3Md6UeoCdchKrm5oT8+FRjdaKLydFgA3wZcbDU+m6mQlA==} + peerDependencies: + cypress: '>= 3 < 13' + peerDependenciesMeta: + cypress: + optional: true + dependencies: + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@nrwl/linter': 15.5.3_ihnn6okre4k4xzbx2em7pmleii + '@nrwl/workspace': 15.5.3_a33fmxuvh5yshls4mufkezcq3y + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.8.4 + dotenv: 10.0.0 + semver: 7.3.4 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - debug + - eslint + - nx + - prettier + - typescript + dev: true + /@nrwl/devkit/15.5.3: resolution: {integrity: sha512-GGNLLGXDGWflrpaLimnE6hChfZfq3+XWZ0LJWL0IuCnchngPbNzuyh8S8KPgNKKgq4Nv0hglWefIwMg2UhHysA==} peerDependencies: @@ -8994,6 +9427,21 @@ packages: - typescript dev: true + /@nrwl/devkit/15.5.3_nx@15.5.3+typescript@4.8.4: + resolution: {integrity: sha512-GGNLLGXDGWflrpaLimnE6hChfZfq3+XWZ0LJWL0IuCnchngPbNzuyh8S8KPgNKKgq4Nv0hglWefIwMg2UhHysA==} + peerDependencies: + nx: '>= 14 <= 16' + dependencies: + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.8.4 + ejs: 3.1.8 + ignore: 5.2.4 + nx: 15.5.3_pys4s3dn6tgpk2ashdi5msvbey + semver: 7.3.4 + tslib: 2.5.0 + transitivePeerDependencies: + - typescript + dev: true + /@nrwl/devkit/15.6.3: resolution: {integrity: sha512-/JDvdzNxUM+C1PCZPCrvmFx+OfywqZdOq1GS9QR8C0VctTLG4D/SGSFD88O1SAdcbH/f1mMiBGfEYZYd23fghQ==} peerDependencies: @@ -9129,6 +9577,30 @@ packages: - typescript dev: true + /@nrwl/jest/15.5.3_hnvut7mdfhqf2wtqnzwlbw5agu: + resolution: {integrity: sha512-BSs4ZQJtRjQ+OAPHdfeemoAiYsGL3Zuq2Ezj8XwGp50SkgVLUBZdXg2Ld1ARjTh/d3pMg+Mf+yKfjoYqFzKx+A==} + dependencies: + '@jest/reporters': 28.1.1 + '@jest/test-result': 28.1.1 + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.8.4 + chalk: 4.1.2 + dotenv: 10.0.0 + identity-obj-proxy: 3.0.0 + jest-config: 28.1.1_6m7kcbkkzjz4ln6z66tlzx44we + jest-resolve: 28.1.1 + jest-util: 28.1.1 + resolve.exports: 1.1.0 + tslib: 2.5.0 + transitivePeerDependencies: + - '@types/node' + - node-notifier + - nx + - supports-color + - ts-node + - typescript + dev: true + /@nrwl/jest/15.6.3: resolution: {integrity: sha512-pG8ESEJFkgyBGOOVZ6bFohklkDXn7JrDPSjmnoKvcOzprluPS7Nx4Ce5bw7wk2Ul3fqJcpAcH5LAZvb+HtA85w==} dependencies: @@ -9231,6 +9703,31 @@ packages: - typescript dev: true + /@nrwl/js/15.5.3_tuejytaz3socmkola73m5zhv6a: + resolution: {integrity: sha512-wOkupYzuCzzYOacDL4fJyi6yS9x56SNLPKzMIOtVgWNu7K5WFxwhQ3Pkbc2VgdjIpif5pU7cxYLfyZLNYaZSbw==} + dependencies: + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@nrwl/linter': 15.5.3_ihnn6okre4k4xzbx2em7pmleii + '@nrwl/workspace': 15.5.3_a33fmxuvh5yshls4mufkezcq3y + chalk: 4.1.2 + fast-glob: 3.2.7 + fs-extra: 11.1.0 + ignore: 5.2.4 + js-tokens: 4.0.0 + minimatch: 3.0.5 + source-map-support: 0.5.19 + tree-kill: 1.2.2 + tslib: 2.5.0 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - debug + - eslint + - nx + - prettier + - typescript + dev: true + /@nrwl/js/15.6.3: resolution: {integrity: sha512-OkjpbNAL6732jGPR7Lz/6K6AScqjxMGuZCHmMqmlK0NpSRcOtYJpGsn4XZzPRsWteqXCvY/l3efceiL6eNPmRg==} dependencies: @@ -9386,6 +9883,24 @@ packages: - typescript dev: true + /@nrwl/linter/15.5.3_ihnn6okre4k4xzbx2em7pmleii: + resolution: {integrity: sha512-ZeUtLOT0olORBL4FpEXmJoaiSKq4VIffW/vmCbosRIuHZqL4Cye5uHyQ6/KJXjD44Z+P6QCkyfr0etcy3lhSkg==} + peerDependencies: + eslint: ^8.0.0 + peerDependenciesMeta: + eslint: + optional: true + dependencies: + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.8.4 + eslint: 8.34.0 + tmp: 0.2.1 + tslib: 2.5.0 + transitivePeerDependencies: + - nx + - typescript + dev: true + /@nrwl/linter/15.5.3_nx@15.5.3: resolution: {integrity: sha512-ZeUtLOT0olORBL4FpEXmJoaiSKq4VIffW/vmCbosRIuHZqL4Cye5uHyQ6/KJXjD44Z+P6QCkyfr0etcy3lhSkg==} peerDependencies: @@ -9693,6 +10208,26 @@ packages: - typescript dev: true + /@nrwl/react/15.5.3_tuejytaz3socmkola73m5zhv6a: + resolution: {integrity: sha512-BK4wa1fljdaCM4rNLCKyUcnkLdwrRDZli3elo75IEBk78Qo/95yCvosAaowcTZnTjugiXyTOvTeVXTvFV/9vzg==} + dependencies: + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@nrwl/linter': 15.5.3_ihnn6okre4k4xzbx2em7pmleii + '@nrwl/workspace': 15.5.3_a33fmxuvh5yshls4mufkezcq3y + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.8.4 + chalk: 4.1.2 + minimatch: 3.0.5 + semver: 7.3.4 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - debug + - eslint + - nx + - prettier + - typescript + dev: true + /@nrwl/react/15.6.3: resolution: {integrity: sha512-WpINxLNsX4Wq9O/stsJIXDGE8GdatyyeeKI0Y9GjVdMPfdPq3qTifnCsUrb97D0WjTEceyPGUzGsx0GmhPB3Dg==} dependencies: @@ -9769,6 +10304,43 @@ packages: - typescript dev: true + /@nrwl/rollup/15.5.3_c3busieyqrq62rwyzz3y44bugq: + resolution: {integrity: sha512-fARI4ecPQkfwOS3nYa9F1ybmIr4zwig32OBOdBUgtNP7pi3jD17mRiRveJ7aiBFZhRwhZWxl8wku1OH9qhu84w==} + dependencies: + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@nrwl/js': 15.5.3_tuejytaz3socmkola73m5zhv6a + '@nrwl/workspace': 15.5.3_a33fmxuvh5yshls4mufkezcq3y + '@rollup/plugin-babel': 5.3.1_3dsfpkpoyvuuxyfgdbpn4j4uzm + '@rollup/plugin-commonjs': 20.0.0_rollup@2.79.1 + '@rollup/plugin-image': 2.1.1_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + autoprefixer: 10.4.13_postcss@8.4.21 + babel-plugin-transform-async-to-promises: 0.8.18 + chalk: 4.1.2 + dotenv: 10.0.0 + fs-extra: 11.1.0 + postcss: 8.4.21 + rollup: 2.79.1 + rollup-plugin-copy: 3.4.0 + rollup-plugin-peer-deps-external: 2.2.4_rollup@2.79.1 + rollup-plugin-postcss: 4.0.2_aesdjsunmf4wiehhujt67my7tu + rollup-plugin-typescript2: 0.34.1_gypgyaqhine6mwjfvh7icfhviq + rxjs: 6.6.7 + tslib: 2.5.0 + transitivePeerDependencies: + - '@babel/core' + - '@swc-node/register' + - '@swc/core' + - '@types/babel__core' + - debug + - eslint + - nx + - prettier + - ts-node + - typescript + dev: true + /@nrwl/tao/15.5.3: resolution: {integrity: sha512-vgPLIW9IoBfQ4IkHRT5RC4LqNwFBK5jmHYmFIRgbIeFRudFBbnpmOaKRME0OwN7qJ6964PVVbzahAPvYVD02xw==} hasBin: true @@ -9847,7 +10419,48 @@ packages: chokidar: 3.5.3 http-server: 14.1.1 ignore: 5.2.4 - tslib: 2.4.1 + tslib: 2.5.0 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - '@types/babel__core' + - '@types/node' + - cypress + - debug + - eslint + - node-notifier + - nx + - prettier + - supports-color + - ts-node + - typescript + dev: true + + /@nrwl/web/15.5.3_llxn6cb7nqbhgmm2wxatjnw3rq: + resolution: {integrity: sha512-puZRZL5wEVsxWqnEo0LTC1mDQZU/XIm98qferhP4n0XVU3bghjOj/4w0Pea2E7yge/DQ1JviydKX6+jGoAP+Dg==} + dependencies: + '@babel/core': 7.20.12 + '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.20.12 + '@babel/plugin-proposal-decorators': 7.20.13_@babel+core@7.20.12 + '@babel/plugin-transform-runtime': 7.19.6_@babel+core@7.20.12 + '@babel/preset-env': 7.20.2_@babel+core@7.20.12 + '@babel/preset-typescript': 7.18.6_@babel+core@7.20.12 + '@babel/runtime': 7.20.13 + '@nrwl/cypress': 15.5.3_tuejytaz3socmkola73m5zhv6a + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@nrwl/jest': 15.5.3_hnvut7mdfhqf2wtqnzwlbw5agu + '@nrwl/js': 15.5.3_tuejytaz3socmkola73m5zhv6a + '@nrwl/linter': 15.5.3_ihnn6okre4k4xzbx2em7pmleii + '@nrwl/rollup': 15.5.3_c3busieyqrq62rwyzz3y44bugq + '@nrwl/workspace': 15.5.3_a33fmxuvh5yshls4mufkezcq3y + babel-plugin-const-enum: 1.2.0_@babel+core@7.20.12 + babel-plugin-macros: 2.8.0 + babel-plugin-transform-typescript-metadata: 0.3.2 + chalk: 4.1.2 + chokidar: 3.5.3 + http-server: 14.1.1 + ignore: 5.2.4 + tslib: 2.5.0 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' @@ -10051,6 +10664,48 @@ packages: - typescript dev: true + /@nrwl/workspace/15.5.3_a33fmxuvh5yshls4mufkezcq3y: + resolution: {integrity: sha512-/Udv+dF4Z/9GZ4QmdCu/6e4QUJYx7zGTcoCOZi+Pt+OPRqOULkBbfKmB+xtiG/D32WnFePsxcssaZGux/aysUQ==} + peerDependencies: + prettier: ^2.6.2 + peerDependenciesMeta: + prettier: + optional: true + dependencies: + '@nrwl/devkit': 15.5.3_nx@15.5.3+typescript@4.8.4 + '@nrwl/linter': 15.5.3_ihnn6okre4k4xzbx2em7pmleii + '@parcel/watcher': 2.0.4 + chalk: 4.1.2 + chokidar: 3.5.3 + cli-cursor: 3.1.0 + cli-spinners: 2.6.1 + dotenv: 10.0.0 + enquirer: 2.3.6 + figures: 3.2.0 + flat: 5.0.2 + fs-extra: 11.1.0 + glob: 7.1.4 + ignore: 5.2.4 + jsonc-parser: 3.2.0 + minimatch: 3.0.5 + npm-run-path: 4.0.1 + nx: 15.5.3_pys4s3dn6tgpk2ashdi5msvbey + open: 8.4.0 + prettier: 2.8.3 + rxjs: 6.6.7 + semver: 7.3.4 + tmp: 0.2.1 + tslib: 2.5.0 + yargs: 17.6.2 + yargs-parser: 21.1.1 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - debug + - eslint + - typescript + dev: true + /@nrwl/workspace/15.6.3: resolution: {integrity: sha512-RkCmDvcMXCVanR0RS8CZ14D7OMojSyvAal+b37P521MpizDkiN+zdRKewKvyOonzDeTAmZODtYccQ/uM5DjRfQ==} peerDependencies: @@ -10294,9 +10949,52 @@ packages: webpack: 5.75.0 dev: true + /@pmmmwh/react-refresh-webpack-plugin/0.5.10_react-refresh@0.10.0: + resolution: {integrity: sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==} + engines: {node: '>= 10.13'} + peerDependencies: + '@types/webpack': 4.x || 5.x + react-refresh: '>=0.10.0 <1.0.0' + sockjs-client: ^1.4.0 + type-fest: '>=0.17.0 <4.0.0' + webpack: '>=4.43.0 <6.0.0' + webpack-dev-server: 3.x || 4.x + webpack-hot-middleware: 2.x + webpack-plugin-serve: 0.x || 1.x + peerDependenciesMeta: + '@types/webpack': + optional: true + sockjs-client: + optional: true + type-fest: + optional: true + webpack-dev-server: + optional: true + webpack-hot-middleware: + optional: true + webpack-plugin-serve: + optional: true + dependencies: + ansi-html-community: 0.0.8 + common-path-prefix: 3.0.0 + core-js-pure: 3.27.2 + error-stack-parser: 2.1.4 + find-up: 5.0.0 + html-entities: 2.3.3 + loader-utils: 2.0.4 + react-refresh: 0.10.0 + schema-utils: 3.1.1 + source-map: 0.7.4 + dev: true + /@polka/url/1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} + /@remix-run/router/1.0.3: + resolution: {integrity: sha512-ceuyTSs7PZ/tQqi19YZNBc5X7kj1f8p+4DIyrcIYFY9h+hd1OKm4RqtiWldR9eGEvIiJfsqwM4BsuCtRIuEw6Q==} + engines: {node: '>=14'} + dev: false + /@remix-run/router/1.3.0: resolution: {integrity: sha512-nwQoYb3m4DDpHTeOwpJEuDt8lWVcujhYYSFGLluC+9es2PyLjm+jjq3IeRBQbwBtPLJE/lkuHuGHr8uQLgmJRA==} engines: {node: '>=14'} @@ -13072,6 +13770,29 @@ packages: redent: 3.0.0 dev: true + /@testing-library/react-hooks/8.0.1_2zx2umvpluuhvlq44va5bta2da: + resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} + engines: {node: '>=12'} + peerDependencies: + '@types/react': ^16.9.0 || ^17.0.0 + react: ^16.9.0 || ^17.0.0 + react-dom: ^16.9.0 || ^17.0.0 + react-test-renderer: ^16.9.0 || ^17.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + react-dom: + optional: true + react-test-renderer: + optional: true + dependencies: + '@babel/runtime': 7.20.13 + '@types/react': 18.0.25 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-error-boundary: 3.1.4_react@18.2.0 + dev: true + /@testing-library/react-hooks/8.0.1_3stiutgnnbnfnf3uowm5cip22i: resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} engines: {node: '>=12'} @@ -13150,7 +13871,7 @@ packages: dependencies: '@babel/runtime': 7.20.13 '@testing-library/dom': 8.20.0 - '@types/react-dom': 18.0.10 + '@types/react-dom': 18.0.9 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: true @@ -13164,7 +13885,7 @@ packages: dependencies: '@babel/runtime': 7.20.13 '@testing-library/dom': 8.20.0 - '@types/react-dom': 18.0.10 + '@types/react-dom': 18.0.9 react: 18.2.0 dev: true @@ -13436,7 +14157,7 @@ packages: /@types/hoist-non-react-statics/3.3.1: resolution: {integrity: sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==} dependencies: - '@types/react': 18.0.27 + '@types/react': 18.0.25 hoist-non-react-statics: 3.3.2 /@types/html-minifier-terser/5.1.2: @@ -13502,6 +14223,13 @@ packages: dependencies: '@types/istanbul-lib-report': 3.0.0 + /@types/jest/28.1.1: + resolution: {integrity: sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA==} + dependencies: + jest-matcher-utils: 27.5.1 + pretty-format: 27.5.1 + dev: true + /@types/jest/28.1.3: resolution: {integrity: sha512-Tsbjk8Y2hkBaY/gJsataeb4q9Mubw9EOz7+4RjPkzD5KjTvHHs7cpws22InaoXxAVAhF5HfFbzJjo6oKWqSZLw==} dependencies: @@ -13569,7 +14297,7 @@ packages: /@types/loadable__component/5.13.4: resolution: {integrity: sha512-YhoCCxyuvP2XeZNbHbi8Wb9EMaUJuA2VGHxJffcQYrJKIKSkymJrhbzsf9y4zpTmr5pExAAEh5hbF628PAZ8Dg==} dependencies: - '@types/react': 18.0.27 + '@types/react': 18.0.25 dev: true /@types/lodash.throttle/4.1.7: @@ -13718,14 +14446,26 @@ packages: /@types/react-dom/18.0.10: resolution: {integrity: sha512-E42GW/JA4Qv15wQdqJq8DL4JhNpB3prJgjgapN3qJT9K2zO5IIAQh4VXvCEDupoqAwnz0cY4RlXeC/ajX5SFHg==} dependencies: - '@types/react': 18.0.27 + '@types/react': 18.0.25 + dev: true + + /@types/react-dom/18.0.9: + resolution: {integrity: sha512-qnVvHxASt/H7i+XG1U1xMiY5t+IHcPGUK7TDMDzom08xa7e86eCeKOiLZezwCKVxJn6NEiiy2ekgX8aQssjIKg==} + dependencies: + '@types/react': 18.0.25 + dev: true + + /@types/react-is/17.0.3: + resolution: {integrity: sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==} + dependencies: + '@types/react': 18.0.25 dev: true /@types/react-router-config/5.0.6: resolution: {integrity: sha512-db1mx37a1EJDf1XeX8jJN7R3PZABmJQXR8r28yUjVMFSjkmnQo6X6pOEEmNl+Tp2gYQOGPdYbFIipBtdElZ3Yg==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.27 + '@types/react': 18.0.25 '@types/react-router': 5.1.20 dev: false @@ -13733,21 +14473,28 @@ packages: resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.27 + '@types/react': 18.0.25 '@types/react-router': 5.1.20 /@types/react-router/5.1.20: resolution: {integrity: sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.27 + '@types/react': 18.0.25 /@types/react-test-renderer/18.0.0: resolution: {integrity: sha512-C7/5FBJ3g3sqUahguGi03O79b8afNeSD6T8/GU50oQrJCU0bVCCGQHaGKUbg2Ce8VQEEqTw8/HiS6lXHHdgkdQ==} dependencies: - '@types/react': 18.0.27 + '@types/react': 18.0.25 dev: true + /@types/react/18.0.25: + resolution: {integrity: sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.1 + /@types/react/18.0.27: resolution: {integrity: sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA==} dependencies: @@ -13834,7 +14581,7 @@ packages: resolution: {integrity: sha512-KuKJ9Z6xb93uJiIyxo/+ksS7yLjS1KzG6iv5i78dhVg/X3u5t1H7juRWqVmodIdz6wGVaIApo1u01kmFRdJHVw==} dependencies: '@types/hoist-non-react-statics': 3.3.1 - '@types/react': 18.0.27 + '@types/react': 18.0.25 csstype: 3.1.1 dev: true @@ -13871,7 +14618,7 @@ packages: /@types/testing-library__react/9.1.3: resolution: {integrity: sha512-iCdNPKU3IsYwRK9JieSYAiX0+aYDXOGAmrC/3/M7AqqSDKnWWVv07X+Zk1uFSL7cMTUYzv4lQRfohucEocn5/w==} dependencies: - '@types/react-dom': 18.0.10 + '@types/react-dom': 18.0.9 '@types/testing-library__dom': 7.5.0 pretty-format: 25.5.0 dev: true @@ -15525,12 +16272,33 @@ packages: transitivePeerDependencies: - debug + /axobject-query/2.2.0: + resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} + dev: true + /axobject-query/3.1.1: resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} dependencies: deep-equal: 2.2.0 dev: true + /babel-jest/28.1.1: + resolution: {integrity: sha512-MEt0263viUdAkTq5D7upHPNxvt4n9uLUGa6pPz3WviNBMtOmStb1lIXS3QobnoqM+qnH+vr4EKlvhe8QcmxIYw==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@jest/transform': 28.1.3 + '@types/babel__core': 7.20.0 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 28.1.3 + chalk: 4.1.2 + graceful-fs: 4.2.10 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /babel-jest/28.1.3: resolution: {integrity: sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -15789,6 +16557,18 @@ packages: graphql: 15.3.0 dev: true + /babel-plugin-styled-components/1.10.7_styled-components@5.3.6: + resolution: {integrity: sha512-MBMHGcIA22996n9hZRf/UJLVVgkEOITuR2SvjHLb5dSTUyR4ZRGn+ngITapes36FI3WLxZHfRhkA1ffHxihOrg==} + peerDependencies: + styled-components: '>= 2' + dependencies: + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-module-imports': 7.18.6 + babel-plugin-syntax-jsx: 6.18.0 + lodash: 4.17.21 + styled-components: 5.3.6_7i5myeigehqah43i5u7wbekgba + dev: true + /babel-plugin-styled-components/2.0.7_styled-components@5.3.6: resolution: {integrity: sha512-i7YhvPgVqRKfoQ66toiZ06jPNA3p6ierpfUuEWxNF+fV27Uv5gxBkf8KZLHUCc1nFA9j6+80pYoIpqCeyW3/bA==} peerDependencies: @@ -18999,6 +19779,11 @@ packages: engines: {node: '>= 6'} dev: true + /diff-sequences/27.5.1: + resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dev: true + /diff-sequences/28.1.1: resolution: {integrity: sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -19919,7 +20704,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript/3.5.3_bfxbel4ck22mojfyurwsgb3ygm: + /eslint-import-resolver-typescript/3.5.3_w7dy265x2bmlgtc6kmsfumkjde: resolution: {integrity: sha512-njRcKYBc3isE42LaTcJNVANR3R99H9bAxBDMNDr2W7yq5gYPxbU3MkdhsQukxZ/Xg9C2vcyLlDsbKfRDg0QvCQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -19929,7 +20714,7 @@ packages: debug: 4.3.4 enhanced-resolve: 5.12.0 eslint: 8.34.0 - eslint-plugin-import: /eslint-plugin-i/2.26.0_inmo4nrctlhmfx73hzu6aogupa + eslint-plugin-import: 2.26.0_inmo4nrctlhmfx73hzu6aogupa get-tsconfig: 4.4.0 globby: 13.1.3 is-core-module: 2.11.0 @@ -19964,7 +20749,7 @@ packages: debug: 3.2.7 eslint: 8.34.0 eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.3_bfxbel4ck22mojfyurwsgb3ygm + eslint-import-resolver-typescript: 3.5.3_w7dy265x2bmlgtc6kmsfumkjde transitivePeerDependencies: - supports-color dev: true @@ -20006,6 +20791,15 @@ packages: globals: 11.12.0 dev: true + /eslint-plugin-cypress/2.12.1_eslint@8.34.0: + resolution: {integrity: sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==} + peerDependencies: + eslint: '>= 3.2.1' + dependencies: + eslint: 8.34.0 + globals: 11.12.0 + dev: true + /eslint-plugin-formatjs/4.3.9_ts-jest@28.0.5: resolution: {integrity: sha512-+8kGoTUaNe0qS55eg5XbPDY+eQmeZxnrC8MugQTGUXlqbCyLyG7y4mDsMhAgactVyUMST6Ln1HEm1Tk0KNuIKQ==} peerDependencies: @@ -20025,12 +20819,17 @@ packages: - ts-jest dev: true - /eslint-plugin-i/2.26.0_inmo4nrctlhmfx73hzu6aogupa: - resolution: {integrity: sha512-d1o6wLEslujT20ObVE/sAfpgsMBlU58P0rU+sudTHCuWDpVhFAuDz1cYzeM70RJ++XCUsCYBID4a3m51TOPT+g==} + /eslint-plugin-import/2.26.0_inmo4nrctlhmfx73hzu6aogupa: + resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: + '@typescript-eslint/parser': '*' eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true dependencies: + '@typescript-eslint/parser': 5.51.0_vvbfoh7ci2jjuy6alapehrh2ri array-includes: 3.1.6 array.prototype.flat: 1.3.1 debug: 2.6.9 @@ -20038,17 +20837,14 @@ packages: eslint: 8.34.0 eslint-import-resolver-node: 0.3.7 eslint-module-utils: 2.7.4_7d5otxxipfjcaqho6psg7iyp4e - get-own-property-symbols: 0.9.5 - get-tsconfig: 4.4.0 has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 minimatch: 3.1.2 - object.getownpropertydescriptors: 2.1.5 object.values: 1.1.6 resolve: 1.22.1 + tsconfig-paths: 3.14.1 transitivePeerDependencies: - - '@typescript-eslint/parser' - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color @@ -20086,6 +20882,49 @@ packages: - supports-color dev: true + /eslint-plugin-jsx-a11y/6.6.1: + resolution: {integrity: sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + '@babel/runtime': 7.20.13 + aria-query: 4.2.2 + array-includes: 3.1.6 + ast-types-flow: 0.0.7 + axe-core: 4.6.2 + axobject-query: 2.2.0 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + has: 1.0.3 + jsx-ast-utils: 3.3.3 + language-tags: 1.0.5 + minimatch: 3.1.2 + semver: 6.3.0 + dev: true + + /eslint-plugin-jsx-a11y/6.6.1_eslint@8.34.0: + resolution: {integrity: sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + '@babel/runtime': 7.20.13 + aria-query: 4.2.2 + array-includes: 3.1.6 + ast-types-flow: 0.0.7 + axe-core: 4.6.2 + axobject-query: 2.2.0 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + eslint: 8.34.0 + has: 1.0.3 + jsx-ast-utils: 3.3.3 + language-tags: 1.0.5 + minimatch: 3.1.2 + semver: 6.3.0 + dev: true + /eslint-plugin-jsx-a11y/6.7.1: resolution: {integrity: sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==} engines: {node: '>=4.0'} @@ -20168,6 +21007,62 @@ packages: eslint: 7.32.0 dev: true + /eslint-plugin-react-hooks/4.6.0_eslint@8.34.0: + resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + dependencies: + eslint: 8.34.0 + dev: true + + /eslint-plugin-react/7.31.11: + resolution: {integrity: sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + array-includes: 3.1.6 + array.prototype.flatmap: 1.3.1 + array.prototype.tosorted: 1.1.1 + doctrine: 2.1.0 + estraverse: 5.3.0 + jsx-ast-utils: 3.3.3 + minimatch: 3.1.2 + object.entries: 1.1.6 + object.fromentries: 2.0.6 + object.hasown: 1.1.2 + object.values: 1.1.6 + prop-types: 15.8.1 + resolve: 2.0.0-next.4 + semver: 6.3.0 + string.prototype.matchall: 4.0.8 + dev: true + + /eslint-plugin-react/7.31.11_eslint@8.34.0: + resolution: {integrity: sha512-TTvq5JsT5v56wPa9OYHzsrOlHzKZKjV+aLgS+55NJP/cuzdiQPC7PfYoUjMoxlffKtvijpk7vA/jmuqRb9nohw==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + array-includes: 3.1.6 + array.prototype.flatmap: 1.3.1 + array.prototype.tosorted: 1.1.1 + doctrine: 2.1.0 + eslint: 8.34.0 + estraverse: 5.3.0 + jsx-ast-utils: 3.3.3 + minimatch: 3.1.2 + object.entries: 1.1.6 + object.fromentries: 2.0.6 + object.hasown: 1.1.2 + object.values: 1.1.6 + prop-types: 15.8.1 + resolve: 2.0.0-next.4 + semver: 6.3.0 + string.prototype.matchall: 4.0.8 + dev: true + /eslint-plugin-react/7.32.1: resolution: {integrity: sha512-vOjdgyd0ZHBXNsmvU+785xY8Bfe57EFbTYYk8XrROzWpr9QBvpjITvAXt9xqcE6+8cjR/g1+mfumPToxsl1www==} engines: {node: '>=4'} @@ -21874,10 +22769,6 @@ packages: /get-own-enumerable-property-symbols/3.0.2: resolution: {integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==} - /get-own-property-symbols/0.9.5: - resolution: {integrity: sha512-ZvAIlmbmRE39iErqrw45vIkUUi0TQ78AWi5RtesI8rP13kECtm56WwgaWXn8valvJ6bOhQhBrn+PoNqnDu132w==} - dev: true - /get-package-type/0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} @@ -22398,6 +23289,33 @@ packages: - utf-8-validate dev: true + /graphql-config/4.4.0_ul246jct24iapssnbw5f5pr2vu: + resolution: {integrity: sha512-QUrX7R4htnTBTi83a0IlIilWVfiLEG8ANFlHRcxoZiTvOXTbgan67SUdGe1OlopbDuyNgtcy4ladl3Gvk4C36A==} + engines: {node: '>= 10.0.0'} + peerDependencies: + cosmiconfig-toml-loader: ^1.0.0 + cosmiconfig-typescript-loader: ^4.0.0 + graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + dependencies: + '@graphql-tools/graphql-file-loader': 7.5.14_graphql@16.6.0 + '@graphql-tools/json-file-loader': 7.4.15_graphql@16.6.0 + '@graphql-tools/load': 7.8.0_graphql@16.6.0 + '@graphql-tools/merge': 8.3.15_graphql@16.6.0 + '@graphql-tools/url-loader': 7.17.3_graphql@16.6.0 + '@graphql-tools/utils': 9.2.1_graphql@16.6.0 + cosmiconfig: 8.0.0 + cosmiconfig-typescript-loader: 4.3.0_cosmiconfig@7.1.0 + graphql: 16.6.0 + minimatch: 4.2.1 + string-env-interpolation: 1.0.1 + tslib: 2.5.0 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - encoding + - utf-8-validate + dev: true + /graphql-config/4.4.0_yisfhryqznvqit6c3u5nab2tty: resolution: {integrity: sha512-QUrX7R4htnTBTi83a0IlIilWVfiLEG8ANFlHRcxoZiTvOXTbgan67SUdGe1OlopbDuyNgtcy4ladl3Gvk4C36A==} engines: {node: '>= 10.0.0'} @@ -24447,6 +25365,34 @@ packages: - ts-node dev: true + /jest-cli/28.1.3_6m7kcbkkzjz4ln6z66tlzx44we: + resolution: {integrity: sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 28.1.3_ts-node@10.9.1 + '@jest/test-result': 28.1.3 + '@jest/types': 28.1.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.10 + import-local: 3.1.0 + jest-config: 28.1.3_6m7kcbkkzjz4ln6z66tlzx44we + jest-util: 28.1.3 + jest-validate: 28.1.3 + prompts: 2.4.2 + yargs: 17.6.2 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jest-config/28.1.1: resolution: {integrity: sha512-tASynMhS+jVV85zKvjfbJ8nUyJS/jUSYZ5KQxLUN2ZCvcQc/OmhQl2j6VEL3ezQkNofxn5pQ3SPYWPHb0unTZA==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -24562,6 +25508,46 @@ packages: - supports-color dev: true + /jest-config/28.1.3_6m7kcbkkzjz4ln6z66tlzx44we: + resolution: {integrity: sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.20.12 + '@jest/test-sequencer': 28.1.3 + '@jest/types': 28.1.3 + '@types/node': 16.11.7 + babel-jest: 28.1.3_@babel+core@7.20.12 + chalk: 4.1.2 + ci-info: 3.7.1 + deepmerge: 4.2.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-circus: 28.1.3 + jest-environment-node: 28.1.3 + jest-get-type: 28.0.2 + jest-regex-util: 28.0.2 + jest-resolve: 28.1.3 + jest-runner: 28.1.3 + jest-util: 28.1.3 + jest-validate: 28.1.3 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 28.1.3 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1_2frzvjkzow2fwipuxdbwjegfle + transitivePeerDependencies: + - supports-color + dev: true + /jest-config/28.1.3_@types+node@16.11.7: resolution: {integrity: sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -24611,6 +25597,16 @@ packages: pretty-format: 24.9.0 dev: true + /jest-diff/27.5.1: + resolution: {integrity: sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 27.5.1 + jest-get-type: 27.5.1 + pretty-format: 27.5.1 + dev: true + /jest-diff/28.1.3: resolution: {integrity: sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -24646,6 +25642,25 @@ packages: jest-util: 28.1.3 pretty-format: 28.1.3 + /jest-environment-jsdom/28.1.1: + resolution: {integrity: sha512-41ZvgSoPNcKG5q3LuuOcAczdBxRq9DbZkPe24okN6ZCmiZdAfFtPg3z+lOtsT1fM6OAERApKT+3m0MRDQH2zIA==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + dependencies: + '@jest/environment': 28.1.3 + '@jest/fake-timers': 28.1.3 + '@jest/types': 28.1.3 + '@types/jsdom': 16.2.15 + '@types/node': 16.11.7 + jest-mock: 28.1.3 + jest-util: 28.1.3 + jsdom: 19.0.0 + transitivePeerDependencies: + - bufferutil + - canvas + - supports-color + - utf-8-validate + dev: true + /jest-environment-jsdom/28.1.3: resolution: {integrity: sha512-HnlGUmZRdxfCByd3GM2F100DgQOajUBzEitjGqIREcb45kGjZvRrKUdlaF6escXBdcXNl0OBh+1ZrfeZT3GnAg==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -24681,6 +25696,11 @@ packages: engines: {node: '>= 6'} dev: true + /jest-get-type/27.5.1: + resolution: {integrity: sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dev: true + /jest-get-type/28.0.2: resolution: {integrity: sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -24748,6 +25768,16 @@ packages: pretty-format: 24.9.0 dev: true + /jest-matcher-utils/27.5.1: + resolution: {integrity: sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 27.5.1 + jest-get-type: 27.5.1 + pretty-format: 27.5.1 + dev: true + /jest-matcher-utils/28.1.3: resolution: {integrity: sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -25106,6 +26136,26 @@ packages: supports-color: 8.1.1 dev: false + /jest/28.1.1_6m7kcbkkzjz4ln6z66tlzx44we: + resolution: {integrity: sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 28.1.3_ts-node@10.9.1 + '@jest/types': 28.1.3 + import-local: 3.1.0 + jest-cli: 28.1.3_6m7kcbkkzjz4ln6z66tlzx44we + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jest/28.1.3: resolution: {integrity: sha512-N4GT5on8UkZgH0O5LUavMRV1EDEhNTL0KEfRmDIeZHSV7p2XgLoY9t9VDUgL6o+yfdgYHVxuz81G8oB9VG5uyA==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -29188,6 +30238,24 @@ packages: resolve: 1.22.1 dev: true + /postcss-load-config/3.1.4_aesdjsunmf4wiehhujt67my7tu: + resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} + engines: {node: '>= 10'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 2.0.6 + postcss: 8.4.21 + ts-node: 10.9.1_2frzvjkzow2fwipuxdbwjegfle + yaml: 1.10.2 + dev: true + /postcss-load-config/3.1.4_postcss@8.4.21: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} @@ -30345,7 +31413,6 @@ packages: react: ^16.8.0 || ^17 || ^18 dependencies: react: 18.2.0 - dev: false /react-infinite-scroll-hook/4.0.4_react@18.2.0: resolution: {integrity: sha512-fCjG9xwCfnV9GcAHVz9rXGnLqO55fcYsbeshSxgEH2biF8fVFHmfzZrfX4iTzoOWO1Rrz5hxrK4bBcqL5fAy9Q==} @@ -30390,7 +31457,7 @@ packages: '@formatjs/intl-displaynames': 6.2.3 '@formatjs/intl-listformat': 7.1.7 '@types/hoist-non-react-statics': 3.3.1 - '@types/react': 18.0.27 + '@types/react': 18.0.25 hoist-non-react-statics: 3.3.2 intl-messageformat: 10.2.5 react: 18.2.0 @@ -30445,7 +31512,6 @@ packages: react: '>=16.8.0' dependencies: react: 18.2.0 - dev: false /react-markdown/8.0.5_3stiutgnnbnfnf3uowm5cip22i: resolution: {integrity: sha512-jGJolWWmOWAvzf+xMdB9zwStViODyyFQhNB/bwCerbBKmrTmgmA599CGiOlP58OId1IMoIRsA8UdI1Lod4zb5A==} @@ -30473,6 +31539,38 @@ packages: transitivePeerDependencies: - supports-color + /react-markdown/8.0.5_fan5qbzahqtxlm5dzefqlqx5ia: + resolution: {integrity: sha512-jGJolWWmOWAvzf+xMdB9zwStViODyyFQhNB/bwCerbBKmrTmgmA599CGiOlP58OId1IMoIRsA8UdI1Lod4zb5A==} + peerDependencies: + '@types/react': '>=16' + react: '>=16' + dependencies: + '@types/hast': 2.3.4 + '@types/prop-types': 15.7.5 + '@types/react': 18.0.25 + '@types/unist': 2.0.6 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 2.0.1 + prop-types: 15.8.1 + property-information: 6.2.0 + react: 18.2.0 + react-is: 18.2.0 + remark-parse: 10.0.1 + remark-rehype: 10.1.0 + space-separated-tokens: 2.0.2 + style-to-object: 0.4.1 + unified: 10.1.2 + unist-util-visit: 4.1.1 + vfile: 5.3.6 + transitivePeerDependencies: + - supports-color + dev: true + + /react-refresh/0.10.0: + resolution: {integrity: sha512-PgidR3wST3dDYKr6b4pJoqQFpPGNKDSCDx4cZoshjXipw3LzO7mG1My2pwEzz2JVkF+inx3xRpDeQLFQGH/hsQ==} + engines: {node: '>=0.10.0'} + dev: true + /react-refresh/0.11.0: resolution: {integrity: sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==} engines: {node: '>=0.10.0'} @@ -30509,6 +31607,19 @@ packages: tiny-warning: 1.0.3 dev: false + /react-router-dom/6.4.3_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-MiaYQU8CwVCaOfJdYvt84KQNjT78VF0TJrA17SIQgNHRvLnXDJO6qsFqq8F/zzB1BWZjCFIrQpu4QxcshitziQ==} + engines: {node: '>=14'} + peerDependencies: + react: '>=16.8' + react-dom: '>=16.8' + dependencies: + '@remix-run/router': 1.0.3 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-router: 6.4.3_react@18.2.0 + dev: false + /react-router-dom/6.7.0_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-jQtXUJyhso3kFw430+0SPCbmCmY1/kJv8iRffGHwHy3CkoomGxeYzMkmeSPYo6Egzh3FKJZRAL22yg5p2tXtfg==} engines: {node: '>=14'} @@ -30538,6 +31649,16 @@ packages: tiny-warning: 1.0.3 dev: false + /react-router/6.4.3_react@18.2.0: + resolution: {integrity: sha512-BT6DoGn6aV1FVP5yfODMOiieakp3z46P1Fk0RNzJMACzE7C339sFuHebfvWtnB4pzBvXXkHP2vscJzWRuUjTtA==} + engines: {node: '>=14'} + peerDependencies: + react: '>=16.8' + dependencies: + '@remix-run/router': 1.0.3 + react: 18.2.0 + dev: false + /react-router/6.7.0_react@18.2.0: resolution: {integrity: sha512-KNWlG622ddq29MAM159uUsNMdbX8USruoKnwMMQcs/QWZgFUayICSn2oB7reHce1zPj6CG18kfkZIunSSRyGHg==} engines: {node: '>=14'} @@ -31259,6 +32380,30 @@ packages: '@rollup/plugin-inject': 5.0.3 dev: true + /rollup-plugin-postcss/4.0.2_aesdjsunmf4wiehhujt67my7tu: + resolution: {integrity: sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w==} + engines: {node: '>=10'} + peerDependencies: + postcss: 8.x + dependencies: + chalk: 4.1.2 + concat-with-sourcemaps: 1.1.0 + cssnano: 5.1.14_postcss@8.4.21 + import-cwd: 3.0.0 + p-queue: 6.6.2 + pify: 5.0.0 + postcss: 8.4.21 + postcss-load-config: 3.1.4_aesdjsunmf4wiehhujt67my7tu + postcss-modules: 4.3.1_postcss@8.4.21 + promise.series: 0.2.0 + resolve: 1.22.1 + rollup-pluginutils: 2.8.2 + safe-identifier: 0.4.2 + style-inject: 0.3.0 + transitivePeerDependencies: + - ts-node + dev: true + /rollup-plugin-postcss/4.0.2_postcss@8.4.21: resolution: {integrity: sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w==} engines: {node: '>=10'} @@ -31283,6 +32428,21 @@ packages: - ts-node dev: true + /rollup-plugin-typescript2/0.34.1_gypgyaqhine6mwjfvh7icfhviq: + resolution: {integrity: sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==} + peerDependencies: + rollup: '>=1.26.3' + typescript: '>=2.4.0' + dependencies: + '@rollup/pluginutils': 4.2.1 + find-cache-dir: 3.3.2 + fs-extra: 10.1.0 + rollup: 2.79.1 + semver: 7.3.8 + tslib: 2.5.0 + typescript: 4.8.4 + dev: true + /rollup-plugin-typescript2/0.34.1_rollup@2.79.1: resolution: {integrity: sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==} peerDependencies: @@ -32899,7 +34059,6 @@ packages: react-is: 18.2.0 shallowequal: 1.1.0 supports-color: 5.5.0 - dev: false /styled-components/5.3.6_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-hGTZquGAaTqhGWldX7hhfzjnIYBZ0IXQXkCYdvF1Sq3DsUaLx6+NTHC5Jj1ooM2F68sBiVz3lvhfwQs/S3l6qg==} @@ -33788,6 +34947,37 @@ packages: tslib: 1.14.1 dev: true + /ts-jest/28.0.5_c57pmzltpvrsqbtqxiqe3cr3ra: + resolution: {integrity: sha512-Sx9FyP9pCY7pUzQpy4FgRZf2bhHY3za576HMKJFs+OnQ9jS96Du5vNsDKkyedQkik+sEabbKAnCliv9BEsHZgQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + babel-jest: ^28.0.0 + esbuild: '*' + jest: ^28.0.0 + typescript: '>=4.3' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + babel-jest: 28.1.1 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 28.1.1_6m7kcbkkzjz4ln6z66tlzx44we + jest-util: 28.1.3 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 4.8.4 + yargs-parser: 21.1.1 + dev: true + /ts-jest/28.0.5_gcleckb5zcuhbbyyhlubvkkx2y: resolution: {integrity: sha512-Sx9FyP9pCY7pUzQpy4FgRZf2bhHY3za576HMKJFs+OnQ9jS96Du5vNsDKkyedQkik+sEabbKAnCliv9BEsHZgQ==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} diff --git a/tsconfig.base.json b/tsconfig.base.json index 8e9a120a7..ee43fe5c0 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -23,8 +23,6 @@ "@sb/infra-core": ["packages/infra/infra-core/src/index.ts"], "@sb/infra-shared": ["packages/infra/infra-shared/src/index.ts"], "@sb/tools": ["packages/internal/tools/src/index.ts"], - "@sb/webapp-core": ["packages/webapp-libs/webapp-core/src/index.ts"], - "@sb/webapp-core/*": ["packages/webapp-libs/webapp-core/src/*"], "@sb/webapp-api-client": [ "packages/webapp-libs/webapp-api-client/src/index.ts" ], @@ -36,6 +34,18 @@ ], "@sb/webapp-contentful/*": [ "packages/webapp-libs/webapp-contentful/src/*" + ], + "@sb/webapp-core": ["packages/webapp-libs/webapp-core/src/index.ts"], + "@sb/webapp-core/*": ["packages/webapp-libs/webapp-core/src/*"], + "@sb/webapp-crud-demo": [ + "packages/webapp-libs/webapp-crud-demo/src/index.ts" + ], + "@sb/webapp-crud-demo/*": ["packages/webapp-libs/webapp-crud-demo/src/*"], + "@sb/webapp-notifications": [ + "packages/webapp-libs/webapp-notifications/src/index.ts" + ], + "@sb/webapp-notifications/*": [ + "packages/webapp-libs/webapp-notifications/src/*" ] } },