Skip to content

Commit

Permalink
fix(notification): message alignment (#544)
Browse files Browse the repository at this point in the history
* fix(notification): message alignment

* fix: failed ut
  • Loading branch information
devrsi0n authored Nov 18, 2022
1 parent 9fe8b7e commit c706aa7
Show file tree
Hide file tree
Showing 21 changed files with 2,059 additions and 2,455 deletions.
16 changes: 8 additions & 8 deletions apps/comment-bootstrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
"@chirpy-dev/tsconfigs": "workspace:*",
"@chirpy-dev/utils": "workspace:*",
"@testing-library/react": "13.4.0",
"@types/jest": "29.2.2",
"@types/jest": "29.2.3",
"@types/node": "16.11.45",
"@types/react": "18.0.24",
"@types/react-dom": "18.0.8",
"dotenv": "16.0.1",
"dotenv-cli": "5.1.0",
"dotenv-expand": "8.0.3",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"dotenv": "16.0.3",
"dotenv-cli": "6.0.0",
"dotenv-expand": "9.0.0",
"eslint": "8.27.0",
"jest": "29.2.2",
"jest": "29.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.8.4",
"typescript": "4.9.3",
"vite": "2.9.14"
},
"publishConfig": {
Expand Down
8 changes: 4 additions & 4 deletions apps/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"@testing-library/cypress": "8.0.3",
"@types/node": "16.11.45",
"cypress": "10.11.0",
"dotenv": "16.0.1",
"dotenv-cli": "5.1.0",
"dotenv-expand": "8.0.3",
"dotenv": "16.0.3",
"dotenv-cli": "6.0.0",
"dotenv-expand": "9.0.0",
"eslint": "8.27.0",
"typescript": "4.8.4"
"typescript": "4.9.3"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion apps/emails/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@maizzle/framework": "4.3.0",
"autoprefixer": "10.4.13",
"glob": "8.0.3",
"postcss": "8.4.18",
"postcss": "8.4.19",
"tailwindcss": "3.2.4",
"tailwindcss-box-shadow": "2.0.0",
"tailwindcss-email-variants": "2.0.0",
Expand Down
32 changes: 16 additions & 16 deletions apps/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"html-loader": "4.2.0",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.21",
"next": "13.0.3",
"next": "13.0.4",
"next-auth": "4.16.4",
"next-axiom": "0.15.1",
"next-connect": "0.13.0",
Expand All @@ -52,7 +52,7 @@
"rehype-pretty-code": "0.4.0",
"rehype-slug": "5.1.0",
"shiki": "0.11.1",
"superjson": "1.9.1",
"superjson": "1.11.0",
"type-fest": "3.2.0",
"urql": "3.0.3",
"web-push": "3.5.0",
Expand All @@ -65,30 +65,30 @@
"@chirpy-dev/eslint-config": "workspace:*",
"@chirpy-dev/service-worker": "workspace:*",
"@chirpy-dev/tsconfigs": "workspace:*",
"@next/bundle-analyzer": "13.0.3",
"@next/bundle-analyzer": "13.0.4",
"@relative-ci/agent": "4.1.1",
"@types/cors": "2.8.12",
"@types/github-slugger": "1.3.0",
"@types/jest": "29.2.2",
"@types/jest": "29.2.3",
"@types/jsonwebtoken": "8.5.9",
"@types/lodash": "4.14.187",
"@types/lodash": "4.14.189",
"@types/node": "16.11.45",
"@types/react": "18.0.24",
"@types/react-dom": "18.0.8",
"@types/requestidlecallback": "0.3.4",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"@types/requestidlecallback": "0.3.5",
"@types/web-push": "3.3.2",
"@types/ws": "8.5.3",
"configs": "workspace:*",
"dotenv": "16.0.1",
"dotenv-cli": "5.1.0",
"dotenv-expand": "8.0.3",
"dotenv": "16.0.3",
"dotenv-cli": "6.0.0",
"dotenv-expand": "9.0.0",
"eslint": "8.27.0",
"jest": "29.2.2",
"postcss": "8.4.18",
"stellate": "1.17.0",
"jest": "29.3.1",
"postcss": "8.4.19",
"stellate": "1.17.1",
"tailwindcss": "3.2.4",
"typescript": "4.8.4",
"webpack": "5.74.0"
"typescript": "4.9.3",
"webpack": "5.75.0"
},
"engines": {
"node": "16.x"
Expand Down
14 changes: 11 additions & 3 deletions apps/main/src/server/common/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ export async function query<
): Promise<NonNullable<Data[Path]>> {
const { data, error } = await client.query(query, variables).toPromise();
if (!data || !data[path] || error) {
const message = `GQL query error, error: ${error}, data: ${data}`;
log.error(message);
const message = `GQL query error, error: ${error}, data: ${JSON.stringify(
data,
null,
2,
)}`;
log.error(message, { stack: error?.stack });
throw new Error(message);
}
return data[path] as NonNullable<Data[Path]>;
Expand All @@ -49,7 +53,11 @@ export async function mutate<
.mutation(mutation, variables)
.toPromise();
if (!data || !data[path] || error) {
const message = `GQL mutation error, error: ${error}, data: ${data}`;
const message = `GQL mutation error, error: ${error}, data: ${JSON.stringify(
data,
null,
2,
)}`;
log.error(message, { stack: error?.stack });
throw new Error(message);
}
Expand Down
8 changes: 4 additions & 4 deletions apps/service-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"devDependencies": {
"@chirpy-dev/eslint-config": "workspace:*",
"@chirpy-dev/tsconfigs": "workspace:*",
"dotenv": "16.0.1",
"dotenv-cli": "5.1.0",
"dotenv-expand": "8.0.3",
"dotenv": "16.0.3",
"dotenv-cli": "6.0.0",
"dotenv-expand": "9.0.0",
"eslint": "8.27.0",
"typescript": "4.8.4",
"typescript": "4.9.3",
"vite": "2.9.14"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@chirpy-dev/eslint-config": "workspace:*",
"@chirpy-dev/prettier-config": "workspace:*",
"eslint": "8.27.0",
"husky": "8.0.1",
"husky": "8.0.2",
"lint-staged": "13.0.3",
"next": "13.0.3",
"next": "13.0.4",
"prettier": "2.7.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"@tailwindcss/line-clamp": "0.4.2",
"@tailwindcss/typography": "0.5.8",
"color-convert": "2.0.1",
"postcss": "8.4.18",
"postcss": "8.4.19",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-preset-env": "7.8.2",
"postcss-preset-env": "7.8.3",
"tailwindcss": "3.2.4",
"typescript": "4.8.4"
"typescript": "4.9.3"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 3 additions & 2 deletions packages/docker-cli/generate-dev-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ eta.configure({
autoTrim: false,
});

const chirpyURL = 'http://localhost:3000';
const hasuraURL = 'http://localhost:8080';

(async function generateDevFiles() {
Expand All @@ -29,7 +28,9 @@ const hasuraURL = 'http://localhost:8080';
HASURA_GRAPHQL_ADMIN_SECRET: hasuraAdminSecret,
HASURA_GRAPHQL_JWT_SECRET: hasuraJwtSecret,
HASURA_EVENT_SECRET: hasuraEventSecret,
HASURA_GRAPHQL_EVENT_URL: chirpyURL,
// To let container call localhost
HASURA_GRAPHQL_EVENT_URL:
'http://host.docker.internal:3000/api/mutation-event',
})!;
// logDebug(true, `Hasura docker compose: ${hasuraDCResult}`);
const hasuraYaml = Yaml.parse(hasuraDCResult);
Expand Down
4 changes: 2 additions & 2 deletions packages/docker-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"@types/web-push": "3.3.2",
"@types/which": "2.0.1",
"@types/yargs": "17.0.13",
"dotenv": "16.0.1",
"dotenv": "16.0.3",
"eta": "1.12.3",
"ts-node": "10.9.1",
"typescript": "4.8.4",
"typescript": "4.9.3",
"web-push": "3.5.0",
"which": "2.0.2",
"yaml": "2.1.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"main": "./index.js",
"dependencies": {
"@chirpy-dev/prettier-config": "workspace:*",
"@typescript-eslint/eslint-plugin": "5.42.0",
"@typescript-eslint/parser": "5.42.0",
"eslint-config-next": "13.0.3",
"@typescript-eslint/eslint-plugin": "5.43.0",
"@typescript-eslint/parser": "5.43.0",
"eslint-config-next": "13.0.4",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "27.1.5",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-storybook": "0.6.7",
"eslint-plugin-unicorn": "44.0.2",
"next": "13.0.3",
"next": "13.0.4",
"prettier": "2.7.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.8.4"
"typescript": "4.9.3"
},
"devDependencies": {
"eslint": "8.27.0"
Expand Down
12 changes: 6 additions & 6 deletions packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
"types": "./src/index.ts",
"devDependencies": {
"@chirpy-dev/tsconfigs": "workspace:*",
"@graphql-codegen/cli": "2.13.11",
"@graphql-codegen/cli": "2.13.12",
"@graphql-codegen/introspection": "2.2.1",
"@graphql-codegen/near-operation-file-preset": "2.4.4",
"@graphql-codegen/typed-document-node": "2.3.6",
"@graphql-codegen/typescript": "2.8.1",
"@graphql-codegen/typescript-operations": "2.5.6",
"@graphql-codegen/typed-document-node": "2.3.7",
"@graphql-codegen/typescript": "2.8.2",
"@graphql-codegen/typescript-operations": "2.5.7",
"@graphql-codegen/typescript-urql": "3.7.3",
"@graphql-typed-document-node/core": "3.1.1",
"@types/node": "16.11.45",
"csstype": "3.1.0",
"csstype": "3.1.1",
"graphql": "16.6.0",
"graphql-tag": "2.12.6",
"graphqurl": "1.0.1",
"react": "18.2.0",
"typescript": "4.8.4",
"typescript": "4.9.3",
"urql": "3.0.3",
"zx": "7.0.8"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
"@tiptap/core": "2.0.0-beta.202",
"@tiptap/react": "2.0.0-beta.202",
"@types/node": "16.11.45",
"@types/react": "18.0.24",
"@types/react-dom": "18.0.8",
"csstype": "3.1.0",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"csstype": "3.1.1",
"graphql": "16.6.0",
"next": "13.0.3",
"next": "13.0.4",
"next-auth": "4.16.4",
"next-mdx-remote": "3.0.8",
"react": "18.2.0",
"react-dom": "18.2.0",
"reading-time": "1.5.0",
"typescript": "4.8.4",
"typescript": "4.9.3",
"urql": "3.0.3"
},
"publishConfig": {
Expand Down
36 changes: 18 additions & 18 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"datamaps": "0.5.9",
"dayjs": "1.11.6",
"debounce-promise": "3.1.2",
"framer-motion": "7.6.6",
"framer-motion": "7.6.7",
"graphql": "16.6.0",
"graphql-tag": "2.12.6",
"graphql-ws": "5.11.2",
"next": "13.0.3",
"next": "13.0.4",
"next-auth": "4.16.4",
"next-axiom": "0.15.1",
"next-mdx-remote": "3.0.8",
Expand All @@ -58,7 +58,7 @@
"urql": "3.0.3"
},
"devDependencies": {
"@babel/core": "7.18.13",
"@babel/core": "7.20.2",
"@chirpy-dev/eslint-config": "workspace:*",
"@chirpy-dev/graphql": "workspace:*",
"@chirpy-dev/tsconfigs": "workspace:*",
Expand All @@ -74,43 +74,43 @@
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "14.4.3",
"@types/canvas-confetti": "1.4.3",
"@types/canvas-confetti": "1.6.0",
"@types/d3": "3.5.47",
"@types/debounce-promise": "3.1.4",
"@types/jest": "29.2.2",
"@types/debounce-promise": "3.1.5",
"@types/jest": "29.2.3",
"@types/node": "16.11.45",
"@types/react": "18.0.24",
"@types/react-dom": "18.0.8",
"@types/react-flatpickr": "3.8.7",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"@types/react-flatpickr": "3.8.8",
"@urql/storybook-addon": "2.0.1",
"autoprefixer": "10.4.13",
"babel-loader": "8.2.5",
"chromatic": "6.7.0",
"chromatic": "6.11.4",
"concurrently": "7.5.0",
"configs": "workspace:*",
"css-loader": "6.7.1",
"csstype": "3.1.0",
"csstype": "3.1.1",
"downshift": "6.1.9",
"eslint": "8.27.0",
"fake-indexeddb": "4.0.0",
"html-loader": "4.2.0",
"intersection-observer": "0.12.2",
"jest": "29.2.2",
"jest-environment-jsdom": "29.2.2",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"msw": "0.47.4",
"msw-storybook-addon": "1.6.3",
"postcss": "8.4.18",
"postcss": "8.4.19",
"postcss-loader": "7.0.1",
"require-from-string": "2.0.2",
"resolve-url-loader": "5.0.0",
"sass": "1.56.0",
"sass-loader": "13.1.0",
"sass": "1.56.1",
"sass-loader": "13.2.0",
"storybook-addon-next": "1.6.10",
"style-loader": "3.3.1",
"tailwindcss": "3.2.4",
"type-fest": "3.2.0",
"typescript": "4.8.4",
"webpack": "5.74.0",
"typescript": "4.9.3",
"webpack": "5.75.0",
"whatwg-fetch": "3.6.2"
},
"modules": "./src/index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ describe('NotificationHub', () => {
it('should render the messages', async () => {
await renderDefaultNotificationHub();
expect(screen.getAllByAltText(/avatar/)).toHaveLength(3);
expect(screen.getAllByLabelText('Comment content')).toHaveLength(2);
});

it('Should mark the clicked message as read', async () => {
Expand All @@ -51,9 +50,7 @@ describe('NotificationHub', () => {
.mockReturnValue([{} as any, deleteNotificationMessage]);
await renderDefaultNotificationHub();

await userEvent.click(
screen.getAllByLabelText('Delete the notification message')[0],
);
await userEvent.click(screen.getAllByLabelText('Delete the message')[0]);
expect(deleteNotificationMessage).toHaveBeenCalledTimes(1);
});
});
Expand Down
Loading

0 comments on commit c706aa7

Please sign in to comment.