Compare commits

..

1109 Commits

Author SHA1 Message Date
Szilárd Dóró
43705b992d Merge pull request #1509 from nhost/changeset-release/main
chore: update versions
2023-01-12 12:41:41 +01:00
github-actions[bot]
2e999e8715 chore: update versions 2023-01-12 10:14:41 +00:00
Pilou
0370696d5c Merge pull request #1511 from nhost/chore/unlink-packages
chore(changeset): stop linking packages
2023-01-12 11:12:44 +01:00
Pierre-Louis Mercereau
f62131d55a chore(changeset): stop linking packages 2023-01-12 10:59:57 +01:00
Szilárd Dóró
86d077ac00 Merge pull request #1508 from nhost/renovate-changesets
chore: create changesest from Renovate bumps
2023-01-12 10:10:35 +01:00
szilarddoro
200e9f774c chore(deps): update dependency @types/react-dom to v18.0.10 2023-01-12 08:49:58 +00:00
Szilárd Dóró
bc1235de3b Merge pull request #1433 from nhost/renovate/react-dom-18.x
chore(deps): update dependency @types/react-dom to v18.0.10
2023-01-12 09:48:10 +01:00
Szilárd Dóró
fce58ebaea remove changeset, CI generates it 2023-01-12 09:47:53 +01:00
Szilárd Dóró
452e281120 chore(dashboard): add changeset 2023-01-12 09:47:04 +01:00
Szilárd Dóró
9a338e54c9 Merge pull request #1492 from nhost/renovate/vitest-monorepo
chore(deps): update vitest monorepo to ^0.27.0
2023-01-12 09:45:14 +01:00
Szilárd Dóró
baeebf980d Merge pull request #1507 from nhost/changeset-release/main
chore: update versions
2023-01-12 09:27:25 +01:00
github-actions[bot]
ac92c6ee61 chore: update versions 2023-01-12 01:38:20 +00:00
Guido Curcio
1ddaf680c0 Merge pull request #1471 from nhost/fix(dashboard)/workspace-creation-redirection-delete 2023-01-11 22:36:50 -03:00
Guido Curcio
c6e6194d8e mutating -> updating for signaling changes in course. 2023-01-11 09:05:43 -03:00
Pilou
83deea8b45 Merge pull request #1501 from nhost/chore/exclude-functions-from-workspace
chore: exclude functions from workspace
2023-01-11 11:42:07 +01:00
Pierre-Louis Mercereau
acbaabcf85 chore: update lockfile 2023-01-11 10:44:36 +01:00
Pierre-Louis Mercereau
3534501f37 chore: force using turborepo v1 2023-01-11 10:31:10 +01:00
Pierre-Louis Mercereau
27bc23cbbc chore: exclude functions from workspace 2023-01-11 10:15:47 +01:00
Szilárd Dóró
6450223558 Merge pull request #1498 from nhost/changeset-release/main
chore: update versions
2023-01-11 08:48:36 +01:00
Guido Curcio
a62a85a777 add comments to effects and router changes. 2023-01-11 02:07:15 -03:00
Guido Curcio
ae24f83953 fix changing application name redirect to 404, fix 404 flash when changing workspace name. 2023-01-11 01:33:28 -03:00
Guido Curcio
fc60d7a782 2023-01-10 19:14:00 -03:00
Guido Curcio
6be8a998df 2023-01-10 19:13:09 -03:00
Guido Curcio
ea091f6251 2023-01-10 19:11:02 -03:00
Guido Curcio
8175c052f7 2023-01-10 18:50:45 -03:00
github-actions[bot]
e6605a6ed0 chore: update versions 2023-01-10 16:43:20 +00:00
Szilárd Dóró
1cba0e6492 Merge pull request #1497 from nhost/fix/database-ui-hasura-metadata
fix(dashboard): don't break the table creation process
2023-01-10 17:41:38 +01:00
Szilárd Dóró
179c90fcdb fix(dashboard): update inline snapshot 2023-01-10 17:13:29 +01:00
Szilárd Dóró
85f0f943a1 chore(dashboard): add changeset 2023-01-10 16:04:15 +01:00
Szilárd Dóró
c4c23fde31 fix(dashboard): don't break table creation
don't break table creation when referencing a table that is not in the `public` schema
2023-01-10 15:39:05 +01:00
Szilárd Dóró
e0b94c3e90 Merge pull request #1493 from nhost/changeset-release/main
chore: update versions
2023-01-10 09:33:58 +01:00
github-actions[bot]
113d638532 chore: update versions 2023-01-09 17:20:13 +00:00
Pilou
d87448916f Merge pull request #1486 from nhost/chore/bump-start-server-and-test
chore(deps): bump start-server-and-test
2023-01-09 18:17:47 +01:00
Pilou
af4292658c Merge pull request #1495 from nhost/fix/export-types
Export commonly used types
2023-01-09 18:17:01 +01:00
Pilou
f735bcd2ea Merge pull request #1485 from nhost/fix/explicit-types
fix: 🐛 add explicit types to React hooks and Vue composables
2023-01-09 18:00:48 +01:00
Pierre-Louis Mercereau
66fb74af86 Merge branch 'main' into fix/explicit-types 2023-01-09 16:30:20 +01:00
Pierre-Louis Mercereau
791eac30bb Merge branch 'main' into chore/bump-start-server-and-test 2023-01-09 16:29:57 +01:00
Pierre-Louis Mercereau
da4ad889d7 Merge branch 'main' into fix/export-types 2023-01-09 16:27:31 +01:00
Pilou
9ef111760c Merge pull request #1490 from nhost/test/correct-forgot-password
test: correct forgot-password test
2023-01-09 16:26:57 +01:00
Pierre-Louis Mercereau
c2706c7d97 chore: export commonly used types 2023-01-09 16:26:01 +01:00
Pilou
683b8768c4 Merge pull request #1482 from nhost/chore/access-token-cookie
chore: store the session in a cookie to avoid refetching the jwt on every ssr call
2023-01-09 16:11:39 +01:00
renovate[bot]
6d9df237a8 chore(deps): update vitest monorepo to ^0.27.0 2023-01-09 13:34:33 +00:00
Szilárd Dóró
220ae37aa7 Merge pull request #1491 from nhost/changeset-release/main
chore: update versions
2023-01-09 14:26:56 +01:00
Pierre-Louis Mercereau
d0d94d9239 chore: use email+password sign-up 2023-01-09 13:27:28 +01:00
Pierre-Louis Mercereau
aed3d1f147 chore: wrap 2023-01-09 11:59:49 +01:00
github-actions[bot]
d07bf08e45 chore: update versions 2023-01-09 10:46:27 +00:00
Szilárd Dóró
f2183250d2 Merge pull request #1470 from nhost/fix(dashboard)/sign-out
fix(dashboard): Resetting the cache when signing out.
2023-01-09 11:44:48 +01:00
Pierre-Louis Mercereau
d2bb5ecfae refactor: unnest code blocks 2023-01-09 11:39:33 +01:00
Pierre-Louis Mercereau
02d0db0cf0 revert: remove line 2023-01-09 11:20:28 +01:00
Pierre-Louis Mercereau
441005d5c3 chore: another attempt 2023-01-09 10:59:38 +01:00
Pierre-Louis Mercereau
eea8708549 chore: visit 2023-01-09 10:31:44 +01:00
Szilárd Dóró
5f3f9390aa chore(dashboard): updated changeset 2023-01-09 09:42:36 +01:00
Pierre-Louis Mercereau
1c5b0560ed chore: 10 attempts 2023-01-09 09:38:19 +01:00
Pierre-Louis Mercereau
1bfdf21b99 test: correct forgot-password test 2023-01-09 09:33:40 +01:00
Pierre-Louis Mercereau
efd522a38a chore: update changesets 2023-01-06 16:53:21 +01:00
Pierre-Louis Mercereau
55c35fa9c5 chore(deps): bump start-server-and-test 2023-01-06 16:45:06 +01:00
Pierre-Louis Mercereau
d42c27ae99 fix: 🐛 add explicit types to React hooks and Vue composables 2023-01-06 13:56:19 +01:00
Pierre-Louis Mercereau
927be4a2c9 chore: store the session in a cookie 2023-01-06 10:47:09 +01:00
Guido Curcio
e44352abbd typo in CreateWorkspaceFormProps Save -> Create 2023-01-05 23:48:35 -03:00
Guido Curcio
f9289f3c32 Merge branch 'fix(dashboard)/workspace-creation-redirection-delete' of https://github.com/nhost/nhost into fix(dashboard)/workspace-creation-redirection-delete 2023-01-05 23:47:01 -03:00
Guido Curcio
8ff06e5637 disable create workspace button if error on input. 2023-01-05 23:45:32 -03:00
Guido Curcio
49e4633bca handle when workspace name is already taken. 2023-01-05 23:41:23 -03:00
Guido Curcio
7ae7a7206c Update dashboard/src/components/home/CreateWorkspaceForm/CreateWorkspaceForm.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-01-05 23:31:02 -03:00
Guido Curcio
43d7e7babf Update dashboard/src/components/workspace/WorkspaceSection.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-01-05 23:30:54 -03:00
Guido Curcio
463a51ce7c Update dashboard/src/components/home/CreateWorkspaceForm/CreateWorkspaceForm.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-01-05 23:30:47 -03:00
Guido Curcio
86e9d9d47f Update dashboard/src/components/home/CreateWorkspaceForm/CreateWorkspaceForm.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-01-05 23:30:42 -03:00
Guido Curcio
f99b72cd7c useUserData instead of nhost.auth.getUser() 2023-01-05 23:29:42 -03:00
Guido Curcio
0dc2f3ff29 remove unused file 2023-01-05 23:24:11 -03:00
Guido Curcio
d0f8081101 new changeset 2023-01-05 23:16:09 -03:00
Guido Curcio
84ebfb79d0 reorder calls when signing out 2023-01-05 23:14:35 -03:00
Pilou
3c78d0ef46 Merge pull request #1476 from nhost/test/reset-password
test: add forgot password test
2023-01-05 17:07:47 +01:00
Szilárd Dóró
e9a26fc995 Merge pull request #1477 from nhost/fix/versions
fix(deps): revert major bumps
2023-01-05 13:46:39 +01:00
Szilárd Dóró
b0794507f5 fix(deps): revert major bumps 2023-01-05 13:43:00 +01:00
Szilárd Dóró
824e222e9d Merge pull request #1472 from nhost/changeset-release/main
chore: update versions
2023-01-05 13:39:35 +01:00
github-actions[bot]
16a99d7d0f chore: update versions 2023-01-05 11:58:13 +00:00
Johan Eliasson
cda5c3d274 Merge pull request #1475 from nhost/dashboard-ib8ga98sid
fix(dashboard): create new user
2023-01-05 12:56:53 +01:00
Johan Eliasson
3d3791286d changeset 2023-01-05 12:08:34 +01:00
Pierre-Louis Mercereau
ad28bf2166 test: add forgot password test 2023-01-05 10:59:52 +01:00
Szilárd Dóró
17bfa83204 Merge pull request #1414 from nhost/feat/permission-editor
feat(dashboard): Permission Editor
2023-01-05 10:38:09 +01:00
Johan Eliasson
6cd64e76ff Merge pull request #1450 from nhost/chatgpt-iyv8asd
[chatgpt] added tests
2023-01-05 10:26:16 +01:00
Pilou
a4bf50cf23 Merge pull request #1461 from nhost/feat/image-transformation
feat: image transformation parameters
2023-01-05 09:47:19 +01:00
Pierre-Louis Mercereau
113baafd84 Merge branch 'main' into feat/image-transformation 2023-01-05 09:10:56 +01:00
Johan Eliasson
87c2b31821 fix 2023-01-05 08:50:12 +01:00
Johan Eliasson
8a6bc3625c fix 2023-01-05 08:42:42 +01:00
Pilou
bdfda8aced Merge pull request #1444 from nhost/fix/non-iso-8859-1-names
Fix: convert non ISO-8859-1 file names
2023-01-05 08:24:52 +01:00
Szilárd Dóró
ca090436af Merge pull request #1469 from nhost/changeset-release/main 2023-01-04 22:51:49 +01:00
Johan Eliasson
55f85a04ea fix 2023-01-04 22:10:41 +01:00
Johan Eliasson
73f95cfa3b jsdom tests 2023-01-04 22:07:47 +01:00
Guido Curcio
dbd3ded515 add patch changeset for dashboard. 2023-01-04 17:41:20 -03:00
Guido Curcio
5399fac211 remove AddWorkspace.tsx file and imports. 2023-01-04 17:39:01 -03:00
Guido Curcio
52e3127a34 fix(dashboard): workspaces creation, new form, correct redirects. 2023-01-04 17:34:35 -03:00
github-actions[bot]
3fb12c189b chore: update versions 2023-01-04 19:22:01 +00:00
Guido Curcio
c4d5366b22 Merge pull request #1468 from nhost/fix/twitter 2023-01-04 14:20:19 -05:00
Szilárd Dóró
bd68e916cf chore(dashboard): cleanup unused GQL file 2023-01-04 20:04:52 +01:00
Szilárd Dóró
7cadd9447b fix(dashboard): display Twitter provider settings 2023-01-04 19:52:21 +01:00
Szilárd Dóró
b649f178e0 Merge pull request #1454 from nhost/changeset-release/main
chore: update versions
2023-01-04 14:43:52 +01:00
Szilárd Dóró
7432c6477c fix(dashboard): change truncation type 2023-01-04 10:33:13 +01:00
Szilárd Dóró
c3aa6126fe chore(dashboard): improve autocomplete equality check 2023-01-04 09:34:58 +01:00
Szilárd Dóró
0f3cf887c1 fix(dashboard): improve boolean transformation 2023-01-04 09:31:55 +01:00
Szilárd Dóró
5cd311b69a feat(dashboard): add support for manual relationships 2023-01-04 09:25:30 +01:00
Szilárd Dóró
057fda178f fix(dashboard): get rid of MUI warning, add preview label 2023-01-03 20:56:10 +01:00
Szilárd Dóró
241b14a004 feat(dashboard): add read-only permissions support 2023-01-03 20:52:04 +01:00
github-actions[bot]
1f5e1e3d42 chore: update versions 2023-01-03 18:20:01 +00:00
Nuno Pato
5727b0b0fe Merge pull request #1426 from nhost/feat/add-functions-to-logs-dashboard
feat(dashboard): add functions to logs
2023-01-03 17:18:24 -01:00
Szilárd Dóró
10b56089fa feat(dashboard): initial read-only mode implementation 2023-01-03 16:35:57 +01:00
Szilárd Dóró
973df1ed5a Merge remote-tracking branch 'origin/main' into feat/permission-editor 2023-01-03 16:09:26 +01:00
Pierre-Louis Mercereau
8f681b83e8 chore: re-enable quality, as it is implemented 2023-01-03 13:50:29 +01:00
Pilou
2f38ed56f5 Merge pull request #1459 from nhost/fix/reuse-file-upload
fix: 🐛 allow useFileUpload to be reused
2023-01-03 13:41:20 +01:00
Pierre-Louis Mercereau
21501624e6 chore: update changeset 2023-01-03 13:31:16 +01:00
Pierre-Louis Mercereau
464530dacb chore: deactivate unavailable image transformation parameters 2023-01-03 13:28:24 +01:00
Pierre-Louis Mercereau
0f2fc3dfec docs: image transformation parameters 2023-01-03 13:18:18 +01:00
Pierre-Louis Mercereau
5cb71f1dc8 chore: correct changeset 2023-01-03 13:14:32 +01:00
Pierre-Louis Mercereau
83e0a4d33e feat: image transformation parameters 2023-01-03 13:11:04 +01:00
Guido Curcio
16502ea175 Merge pull request #1382 from nhost/feat/auth-management 2023-01-03 06:16:57 -05:00
Guido Curcio
beee0407df Merge branch 'main' into feat/auth-management 2023-01-03 05:13:46 -05:00
Guido Curcio
3990b1ffbb Update dashboard/src/components/users/CreateUserForm/CreateUserForm.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-01-03 06:12:22 -03:00
Guido Curcio
1fb03708e3 Update dashboard/src/components/users/EditUserPasswordForm/EditUserPasswordForm.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-01-03 06:12:15 -03:00
Szilárd Dóró
e9ef254c6d Merge branch 'main' into feat/permission-editor 2023-01-03 09:45:44 +01:00
Szilárd Dóró
d42719ee65 Merge pull request #1453 from nhost/feat/custom-jwt-secret
feat(dashboard): add JWT secret editor modal
2023-01-03 09:30:09 +01:00
Guido Curcio
72ff489ea8 fix inconsistent padding in modals. 2023-01-03 03:43:11 -03:00
Pilou
c9bf2dde0e Merge pull request #1458 from nhost/refactor/do-not-over-export
Only export what is required by the user or `@nhost/nextjs`
2023-01-02 22:04:52 +01:00
Pierre-Louis Mercereau
613533d377 chore: do not cache documentation build 2023-01-02 21:22:54 +01:00
Pierre-Louis Mercereau
8568354718 fix: 🐛 allow useFileUpload to be reused 2023-01-02 21:03:58 +01:00
Pierre-Louis Mercereau
1be6d32455 Only export what is required by the user or @nhost/nextjs 2023-01-02 16:19:00 +01:00
Pilou
812a6e5005 Merge pull request #1452 from nhost/fix/improve-missing-react-provider-error
fix: improve missing React provider error
2023-01-02 15:54:48 +01:00
Szilárd Dóró
34cc230b61 fix(dashboard): improve responsive layout 2023-01-02 15:29:02 +01:00
Szilárd Dóró
898a7c835f chore(dashboard): improve JWT secret validation 2023-01-02 14:41:28 +01:00
Szilárd Dóró
7766624bc5 feat(dashboard): add JWT secret editor modal 2023-01-02 14:34:36 +01:00
Pierre-Louis Mercereau
2e8f73df38 chore: changeset 2023-01-02 14:25:29 +01:00
Pierre-Louis Mercereau
6a419e060e fix: improve missing React provider error 2023-01-02 14:23:49 +01:00
Guido Curcio
43480ca735 spacing on action buttons 2023-01-02 09:07:21 -03:00
Guido Curcio
efc42d77fd fix loading state on EditUserForm (drawer) 2023-01-02 08:42:45 -03:00
Guido Curcio
31e2523eca spacing on create user modal 2023-01-02 08:19:54 -03:00
Guido Curcio
fbf4f40ab7 Merge branch 'feat/auth-management' of https://github.com/nhost/nhost into feat/auth-management 2023-01-02 08:15:31 -03:00
Guido Curcio
cbe203e720 fix alt props and spacing on users table 2023-01-02 08:14:49 -03:00
Szilárd Dóró
09af118452 fix(dashboard): use booleans when operator is _is_null 2023-01-02 12:01:31 +01:00
Szilárd Dóró
20d0c3d09b fix(dashboard): select appearance in rule group editor 2023-01-02 11:47:35 +01:00
Szilárd Dóró
378a6684b0 Merge pull request #1451 from nhost/changeset-release/main
chore: update versions
2023-01-02 11:33:20 +01:00
Szilárd Dóró
d92891b223 chore(dashboard): add changeset 2023-01-02 10:48:25 +01:00
github-actions[bot]
1999ae09e6 chore: update versions 2023-01-02 09:47:28 +00:00
Szilárd Dóró
aef86dc822 Merge remote-tracking branch 'origin/main' into feat/permission-editor 2023-01-02 10:46:25 +01:00
Szilárd Dóró
0fe48a0833 Merge pull request #1425 from nhost/fix/refresh-after-provisioning
fix(dashboard): provisioning status polling
2023-01-02 10:46:12 +01:00
Szilárd Dóró
7bbf6dbf1c Merge pull request #1387 from nhost/changeset-release/main
chore: update versions
2023-01-02 10:43:56 +01:00
Szilárd Dóró
a3499c4628 fix(dashboard): improve rule group editor scrollability 2023-01-02 10:43:47 +01:00
Szilárd Dóró
689dc873b3 Update integrations/react-apollo/CHANGELOG.md
Co-authored-by: Pilou <24897252+plmercereau@users.noreply.github.com>
2023-01-02 10:07:28 +01:00
Szilárd Dóró
a0747d02e0 Update integrations/react-urql/CHANGELOG.md
Co-authored-by: Pilou <24897252+plmercereau@users.noreply.github.com>
2023-01-02 10:07:23 +01:00
Szilárd Dóró
be5bd1e446 Update integrations/apollo/CHANGELOG.md
Co-authored-by: Pilou <24897252+plmercereau@users.noreply.github.com>
2023-01-02 10:07:18 +01:00
Szilárd Dóró
52ccfdec89 Merge branch 'main' into fix/refresh-after-provisioning 2023-01-02 10:05:46 +01:00
Szilárd Dóró
2c60591580 fix(deps): revert major bumps 2023-01-02 10:02:12 +01:00
Szilárd Dóró
3cac6f69bd fix(dashboard): improve warning message 2023-01-02 09:43:19 +01:00
Szilárd Dóró
71ff71ccd2 Merge branch 'main' into feat/permission-editor 2023-01-02 09:36:43 +01:00
Szilárd Dóró
da575ca262 feat(dashboard): add unsupported rules to request 2023-01-02 09:36:27 +01:00
Johan Eliasson
5020566725 update 2022-12-31 19:32:18 +01:00
Johan Eliasson
eb5915aa03 revert code 2022-12-31 19:17:20 +01:00
Johan Eliasson
458ee7fe6c remove jsdom 2022-12-31 14:40:10 +01:00
Johan Eliasson
ea7eb18f36 test update 2022-12-31 14:39:37 +01:00
Johan Eliasson
18f5414411 missing imports 2022-12-31 14:04:52 +01:00
Johan Eliasson
a7ce6d85f4 missing imports 2022-12-31 12:56:04 +01:00
Johan Eliasson
2f348c660a tests and refactoring 2022-12-31 12:36:57 +01:00
github-actions[bot]
6140bc5b3b chore: update versions 2022-12-27 13:49:10 +00:00
Pilou
9f7780ec91 Merge pull request #1438 from nhost/ci/renovate
ci: improve renovate configuration
2022-12-27 14:47:35 +01:00
Pierre-Louis Mercereau
7c07d09ea4 test: add test from user 2022-12-27 14:35:17 +01:00
Pierre-Louis Mercereau
13876ed523 fix: Allow uploading files with non ISO 8859-1 names 2022-12-27 14:11:08 +01:00
Pilou
abc7d0c7a5 Merge pull request #1442 from nhost/chore/docgen-vite
chore: build docgen with vite
2022-12-27 09:44:03 +01:00
Pilou
074a36ea48 Merge pull request #1432 from nhost/fix/remove-accept-encoding-header
Fix/allow override of the accept-encoding header
2022-12-27 09:43:39 +01:00
Pierre-Louis Mercereau
64e806dc27 chore: build docgen with vite 2022-12-26 21:16:02 +01:00
Pilou
bd0e9748b6 Merge pull request #1440 from nhost/renovate-changesets
chore: create changesest from Renovate bumps
2022-12-26 21:04:45 +01:00
plmercereau
b21222b378 chore(deps): update dependency @types/node to v16 2022-12-26 20:01:13 +00:00
Pilou
7e217db128 Merge pull request #1294 from nhost/renovate/node-18.x
chore(deps): update dependency @types/node to v16
2022-12-26 20:59:25 +01:00
Pierre-Louis Mercereau
56c716d9fa Merge branch 'main' into renovate/node-18.x 2022-12-26 20:23:00 +01:00
Pilou
14ecbd1fb9 Merge pull request #1439 from nhost/renovate-changesets
chore: create changesest from Renovate bumps
2022-12-26 20:19:58 +01:00
plmercereau
a0242c4d6f chore(deps): update dependency tsup to v6 2022-12-26 19:13:36 +00:00
Pilou
4800b4a756 Merge pull request #1306 from nhost/renovate/tsup-6.x
chore(deps): update dependency tsup to v6
2022-12-26 20:12:14 +01:00
Pierre-Louis Mercereau
5b318d17d4 Merge branch 'main' into renovate/node-18.x 2022-12-26 20:08:46 +01:00
Pierre-Louis Mercereau
2f9be4f760 fix: @types/node v16 2022-12-26 20:06:00 +01:00
Pierre-Louis Mercereau
64777b6f30 ci: improve renovate configuration 2022-12-26 19:59:48 +01:00
Pilou
7e1489353e Merge pull request #1437 from nhost/ci/renovate-changeset-pr
ci: create renovate changeset pr
2022-12-26 19:44:20 +01:00
Pierre-Louis Mercereau
c53306a497 ci: correct PAT secret 2022-12-26 19:43:55 +01:00
Pierre-Louis Mercereau
83345579d0 ci: create renovate changeset pr 2022-12-26 19:41:08 +01:00
Pilou
2b4b9e0385 Merge pull request #1304 from nhost/renovate/graphql-16.x
chore(deps): update dependency graphql to v16
2022-12-26 19:08:25 +01:00
renovate[bot]
922349f550 chore(deps): update dependency graphql to v16 2022-12-26 17:47:32 +00:00
Pilou
d613f3fd04 Merge pull request #1434 from nhost/renovate/jsonwebtoken-9.x
ci: correct gh action
2022-12-26 18:41:24 +01:00
Pierre-Louis Mercereau
4d8a47777e ci: correct gh action 2022-12-26 18:40:44 +01:00
Pilou
229a7ab1f7 Merge pull request #1417 from nhost/renovate/jsonwebtoken-9.x
fix(deps): update dependency jsonwebtoken to v9
2022-12-26 18:38:09 +01:00
Pierre-Louis Mercereau
3dabb7b53a ci: adapt renovate action 2022-12-26 18:37:49 +01:00
renovate[bot]
abc3d6ce60 chore(deps): update dependency tsup to v6 2022-12-26 17:33:02 +00:00
renovate[bot]
a529b654bc chore(deps): update dependency @types/react-dom to v18.0.10 2022-12-26 17:31:33 +00:00
Pilou
08d49bd1fd Merge pull request #1408 from nhost/renovate/vitest-monorepo
chore(deps): update dependency vitest to ^0.26.0
2022-12-26 18:24:07 +01:00
Pierre-Louis Mercereau
03435a2c66 chore: bump vitest to latest version 2022-12-26 14:55:39 +01:00
Pierre-Louis Mercereau
66208d6840 chore: allow custom values for Accept-Encoding 2022-12-26 13:15:04 +01:00
Pierre-Louis Mercereau
5be9abb0fa chore: changeset 2022-12-26 12:59:23 +01:00
Pierre-Louis Mercereau
8e504b5328 Merge branch 'main' into fix/remove-accept-encoding-header 2022-12-26 12:55:58 +01:00
renovate[bot]
0e3eb7204a fix(deps): update dependency jsonwebtoken to v9 2022-12-23 23:51:28 +00:00
Szilárd Dóró
b112ba0af4 feat(dashboard): extend "unsupported" functionality 2022-12-23 17:24:23 +01:00
Guido Curcio
70cfeb1fcf Update dashboard/src/components/users/UsersBody/UsersBody.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-12-23 12:38:12 -03:00
Szilárd Dóró
e6d990faa7 chore(dashboard): unsupported objects in permissions 2022-12-23 16:28:14 +01:00
Szilárd Dóró
b45da7e360 fix(dashboard): correct _is_null negation 2022-12-23 16:14:27 +01:00
Guido Curcio
3116562b58 fix service urls; pagination props 2022-12-23 11:31:43 -03:00
Guido Curcio
693e40d385 Merge branch 'main' into feat/auth-management 2022-12-23 11:28:53 -03:00
Szilárd Dóró
ff186a8d09 feat(dashboard): add support for the _not operator 2022-12-23 14:48:03 +01:00
Szilárd Dóró
3061771908 fix(dashboard): improve validation 2022-12-23 14:14:58 +01:00
Szilárd Dóró
c681cc9bef chore(dashboard): remove code blocking submission 2022-12-23 11:22:15 +01:00
Szilárd Dóró
3a80504427 feat(dashboard): add form validation to permission editor 2022-12-23 11:21:53 +01:00
Nuno Pato
9a1aa7bb2e changeset 2022-12-22 20:08:28 -01:00
Nuno Pato
98345f2e78 dashboard: add functions to the logs dashboard 2022-12-22 20:05:39 -01:00
Guido Curcio
f29abe6238 add changeset 2022-12-22 16:51:19 -03:00
Szilárd Dóró
8956d47bce fix(dashboard): start polling manually
reference issue: https://github.com/apollographql/apollo-client/issues/9819
2022-12-22 18:22:00 +01:00
Szilárd Dóró
dd0738d5f7 chore(dashboard): add changeset 2022-12-22 17:57:36 +01:00
Szilárd Dóró
11d77d6011 fix(dashboard): provisioning status polling 2022-12-22 17:53:07 +01:00
renovate[bot]
a78cd2f18f chore(deps): update dependency vitest to ^0.26.0 2022-12-22 16:01:51 +00:00
Szilárd Dóró
e025c5857f chore(dashboard): simplify section components 2022-12-22 16:54:23 +01:00
Pilou
6ef340daad Merge pull request #1424 from nhost/ci/retry-cli-install
ci: retry the Nhost CLI installation
2022-12-22 16:31:46 +01:00
Pierre-Louis Mercereau
a96e3c9163 ci: retry the Nhost CLI installation 2022-12-22 16:21:36 +01:00
Szilárd Dóró
c3c95053dc fix(dashboard): improve permission editor UX 2022-12-22 15:30:12 +01:00
Szilárd Dóró
b27e94c712 chore(dashboard): add subtitle to column presets 2022-12-22 15:04:30 +01:00
Szilárd Dóró
279cf78aa5 fix(dashboard): clear dirty state when cancelling 2022-12-22 14:20:35 +01:00
Szilárd Dóró
8817adddf6 Merge remote-tracking branch 'origin/main' into feat/permission-editor 2022-12-22 14:12:03 +01:00
Guido Curcio
229c47cf16 set up redirect from /users/<userId> -> users?userId=<userId> 2022-12-22 10:04:56 -03:00
Szilárd Dóró
1388f11508 feat(dashboard): backend only permissions
- improved the conversion from Nhost's data structure to Hasura's
2022-12-22 13:58:53 +01:00
Guido Curcio
e5e705350d fix: style inconsistencies in users page 2022-12-22 09:56:37 -03:00
Guido Curcio
4f81b0695d add responsive breakpoints to users's table, user's drawer 2022-12-22 09:51:47 -03:00
Szilárd Dóró
c2bfed6e1f feat(dashboard): add support for local migrations 2022-12-22 13:38:59 +01:00
Szilárd Dóró
97dc261fcd feat(dashboard): persist permissions 2022-12-22 13:04:28 +01:00
Szilárd Dóró
4ca93c2773 feat(dashboard): delete permissions 2022-12-22 12:27:14 +01:00
Szilárd Dóró
9c5b6532d3 Merge pull request #1422 from nhost/fix/persistent-drawer
fix(dashboard): close modals when navigating
2022-12-22 11:02:40 +01:00
Szilárd Dóró
f8b32584b4 Merge branch 'main' into feat/permission-editor 2022-12-22 10:55:09 +01:00
Szilárd Dóró
889df8ca4d fix(dashboard): don't break unit tests 2022-12-22 10:54:02 +01:00
Pilou
b998e09e10 Merge pull request #1421 from nhost/chore/integrations-labeler
ci: label integrations
2022-12-22 10:48:33 +01:00
Szilárd Dóró
9e0486a362 chore(dashboard): add changeset 2022-12-22 10:01:12 +01:00
Szilárd Dóró
74037cec68 fix(dashboard): close modals when navigating 2022-12-22 10:00:21 +01:00
Guido Curcio
800db1b300 remove page query param from url if currentPage is equal to 1. 2022-12-22 03:02:53 -03:00
Guido Curcio
a40baa8c63 show up to 3 providers in users table, render a chip with remainder length 2022-12-22 02:23:17 -03:00
Guido Curcio
5cc06609c2 fix(EditUserForm): copy button. 2022-12-22 01:51:17 -03:00
Pierre-Louis Mercereau
819e68b501 ci: label integrations 2022-12-21 19:36:05 +01:00
Guido Curcio
efa68aab83 fix(roles): only show alert when editing role. 2022-12-21 14:15:48 -03:00
Guido Curcio
3a696d366a clicking on auth button of sidebar goes to page 1 2022-12-21 13:55:15 -03:00
Guido Curcio
e3e21b6164 upper bound on number of pages 2022-12-21 13:44:50 -03:00
Guido Curcio
9259663c76 missing key prop on providers 2022-12-21 13:43:28 -03:00
Guido Curcio
26dd7faf05 retrigger effect when nr of pages changes 2022-12-21 13:31:30 -03:00
Pilou
10cc213933 Merge pull request #1418 from nhost/renovate/mermaid-9.x
fix(deps): update dependency mermaid to v9
2022-12-21 16:50:53 +01:00
Guido Curcio
1b5cb93761 include alert when editing roles 2022-12-21 12:18:51 -03:00
Pilou
4157c012fd Merge pull request #1406 from nhost/chore/deprecate-axios
chore: deprecate axios
2022-12-21 16:02:26 +01:00
Szilárd Dóró
8de1be4910 feat(dashboard); add custom claims to column presets 2022-12-21 15:42:46 +01:00
Pilou
9515096349 Update .changeset/kind-cycles-explain.md
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-21 15:38:33 +01:00
Pilou
4dd5617855 Update .changeset/kind-cycles-explain.md
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-21 15:37:29 +01:00
Szilárd Dóró
d0f9ffba73 feat(dashboard): initial column preset section 2022-12-21 14:56:55 +01:00
renovate[bot]
01dc358842 fix(deps): update dependency mermaid to v9 2022-12-21 13:22:15 +00:00
Pilou
925a1808e6 Merge pull request #1413 from nhost/renovate/vite-4.x
chore(deps): update dependency vite to v4
2022-12-21 14:10:23 +01:00
Pilou
ac80f88727 Merge pull request #1410 from nhost/chore/remove-query-string
chore: remove unused query-string dependency
2022-12-21 13:12:23 +01:00
Pilou
3078247629 Merge pull request #1412 from nhost/test/docker-compose
test(docker-compose): more retries
2022-12-21 13:12:05 +01:00
Pierre-Louis Mercereau
144c0084d2 chore: add Nhost prefix to client types 2022-12-21 12:27:19 +01:00
Pierre-Louis Mercereau
bbdfb77a07 refactor: types 2022-12-21 12:22:27 +01:00
Guido Curcio
b6df9e2e8c fix: correct onPageChange prop comments. 2022-12-21 08:21:39 -03:00
Guido Curcio
48f15eb849 remove unhelpful comments 2022-12-21 08:16:19 -03:00
Guido Curcio
141642d40d show only two providers in users table 2022-12-21 08:07:23 -03:00
Guido Curcio
def4a3a2ea fix: password change error handling, refetch, and closing dialog; createdAt in users body; use internal ban state for unbanning user; implement error handling for odd pages from URL & side-effect for user id queries; add comments to side-effects. 2022-12-21 08:02:50 -03:00
Szilárd Dóró
fcb4d167e7 feat(dashboard): added aggregation queries and root field customization 2022-12-21 10:45:44 +01:00
Pilou
b5a9c1be47 Update packages/nhost-js/src/clients/functions.ts
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-20 18:45:36 +01:00
Szilárd Dóró
c5137c6c45 fix(dashboard): fix async initialization 2022-12-20 16:26:57 +01:00
Szilárd Dóró
297c2a965d fix(dashboard): fix async initialization issues 2022-12-20 16:06:28 +01:00
Pierre-Louis Mercereau
5b5e7d9640 chore: update vite-related libraries 2022-12-20 15:38:28 +01:00
Guido Curcio
b876a4ada1 handle pagination between pages (parse & mutate url) 2022-12-20 11:02:35 -03:00
Pierre-Louis Mercereau
c02e0c63f2 refactor: simplify 2022-12-20 14:48:47 +01:00
Guido Curcio
7e064355ba show banned users on users table 2022-12-20 10:47:27 -03:00
renovate[bot]
788482fab2 chore(deps): update dependency vite to v4 2022-12-20 13:40:30 +00:00
Pilou
16d94821b8 Merge pull request #1411 from nhost/renovate/tj-actions-changed-files-35.x
chore(deps): update tj-actions/changed-files action to v35
2022-12-20 14:30:16 +01:00
Guido Curcio
0f6ece6b8c remove pagination when there are no users from filter. 2022-12-20 10:28:46 -03:00
Pierre-Louis Mercereau
5c4ab54c90 test(docker-compose): more retries 2022-12-20 14:28:05 +01:00
Guido Curcio
793e7392da error handling for creating users 2022-12-20 10:24:53 -03:00
renovate[bot]
5941568bbb chore(deps): update tj-actions/changed-files action to v35 2022-12-20 13:15:40 +00:00
Pierre-Louis Mercereau
1a9e1fde1d chore: remove unused query-string dependency 2022-12-20 14:12:29 +01:00
Guido Curcio
a9bbd1303e close drawer after deleting user; track disabled state of an user. 2022-12-20 09:30:41 -03:00
Guido Curcio
b0ed2b6f14 button instead of IconButton for password change 2022-12-20 09:03:33 -03:00
Szilárd Dóró
9194be4816 feat(dashboard): fetch table permissions 2022-12-20 12:55:47 +01:00
Guido Curcio
3e951eab4f fix: don't hide the OAuth methods section; remove the active chip. 2022-12-20 08:42:13 -03:00
Guido Curcio
cd7a198715 fix: fix showing minutes instead of month; correct format. 2022-12-20 08:36:36 -03:00
Guido Curcio
7c4d05a25e fix: loading states, remove sign-in methods, fix default role, move handlers to specific component. 2022-12-20 07:15:43 -03:00
Szilárd Dóró
199fd0d491 fix(dashboard): correct relationship discovery 2022-12-20 10:36:48 +01:00
Pierre-Louis Mercereau
32c0632526 docs: correct changeset 2022-12-20 10:28:09 +01:00
Pierre-Louis Mercereau
19cca7f45d chore: changeset 2022-12-20 10:22:00 +01:00
Szilárd Dóró
cd4b58674a feat(dashboard): integrate RuleGroupEditor 2022-12-20 10:15:14 +01:00
Pierre-Louis Mercereau
191580a819 Merge branch 'main' into chore/deprecate-axios 2022-12-20 10:12:29 +01:00
Pilou
4a57861354 Merge pull request #1396 from nhost/integrations-iaubsd98hasd
Integrations and README updates
2022-12-20 10:11:48 +01:00
Pierre-Louis Mercereau
d96b817476 refactor: simplify 2022-12-20 10:04:19 +01:00
renovate[bot]
db6db8d860 chore(deps): update dependency @types/node to v18 2022-12-20 08:35:37 +00:00
Pierre-Louis Mercereau
fe405ba123 fix: docgen and tsconfig 2022-12-20 09:33:53 +01:00
Pilou
972a5f652f Merge pull request #1281 from nhost/renovate/typescript-4.x
chore(deps): update dependency typescript to v4.9.4
2022-12-20 09:32:34 +01:00
Pierre-Louis Mercereau
7a2c140524 Merge branch 'main' into chore/deprecate-axios 2022-12-20 09:26:41 +01:00
Pierre-Louis Mercereau
3d717d68a9 Merge branch 'main' into integrations-iaubsd98hasd 2022-12-20 09:22:29 +01:00
Pierre-Louis Mercereau
13b6a47bef fix: ignore duplicate type 2022-12-20 09:13:50 +01:00
Pierre-Louis Mercereau
2a6caa47bd chore: deprecate axios 2022-12-20 09:00:59 +01:00
Szilárd Dóró
4f20d8640d feat(dashboard): added Radio and RadioGroup 2022-12-19 17:04:57 +01:00
Szilárd Dóró
5e8ae336a2 feat(dashboard): added form for role editing 2022-12-19 15:54:35 +01:00
Szilárd Dóró
1ff73f4f00 chore(dashboard): improved table appearance 2022-12-19 14:29:41 +01:00
Szilárd Dóró
7ce44ae1b1 feat(dashboard): improve table customizability 2022-12-19 14:16:51 +01:00
Szilárd Dóró
1b847617b6 feat(dashboard): added default role table 2022-12-19 13:59:58 +01:00
Szilárd Dóró
df53ec2954 feat(dashboard): started working on permissions layout 2022-12-19 12:49:31 +01:00
Szilárd Dóró
7b4c32816e feat(dashboard): started working on permission editor 2022-12-19 11:54:12 +01:00
Szilárd Dóró
dbbfaef451 Merge pull request #1373 from nhost/feat/rule-group-editor
feat(dashboard): Rule Group Editor
2022-12-19 11:52:16 +01:00
Szilárd Dóró
b4c07f1723 Merge branch 'main' into feat/rule-group-editor 2022-12-19 11:51:18 +01:00
Szilárd Dóró
e983eb53d9 chore(dashboard): remove "is" prefix 2022-12-19 11:09:18 +01:00
Szilárd Dóró
49867fdcf7 fix(dashboard): add missing inputValue for freeSolo input 2022-12-19 11:07:50 +01:00
Szilárd Dóró
cc428d73ee fix(dashboard): async initialization 2022-12-19 11:02:16 +01:00
Pilou
940a1db0fc Merge branch 'main' into integrations-iaubsd98hasd 2022-12-19 11:00:35 +01:00
Pilou
d70f29a408 Merge pull request #1400 from nhost/contributors-readme-action-PL6rn2c5lN
docs(contributor): contributors readme action update
2022-12-19 10:58:17 +01:00
Pilou
52cb055520 Merge pull request #1402 from nhost/contributors-readme-action-IrWb62uoZo
docs(contributor): contributors readme action update
2022-12-19 10:57:46 +01:00
github-actions[bot]
8c406237a2 docs(contributor): contrib-readme-action has updated readme 2022-12-19 09:57:07 +00:00
Pilou
d036e282e5 Merge pull request #1395 from nhost/fix-asu9hda0sd
revert code to previously working
2022-12-19 10:56:53 +01:00
Szilárd Dóró
39530cd8e8 feat(dashboard): support Hasura array operators 2022-12-19 10:16:36 +01:00
github-actions[bot]
8b58627608 docs(contributor): contrib-readme-action has updated readme 2022-12-19 08:06:33 +00:00
Calvin Lang
c4e2d87e5c Removed accept headers * in axios requests 2022-12-19 16:06:26 +08:00
Johan Eliasson
66b0378d38 Merge pull request #1397 from muttenzer/docs/event-trigger-env-var
Replace deprecated "NHOST_BACKEND_URL" in event trigger example
2022-12-19 09:06:09 +01:00
Timo M
22d7a36247 update hasura event trigger video using the correct env var 2022-12-17 17:48:36 +01:00
Timo M
7d2eb2de66 update webhook url format image 2022-12-17 17:45:09 +01:00
Timo M
4bba002c30 replace NHOST_BACKEND_URL with NHOST_FUNCTIONS_URL env var 2022-12-17 17:43:42 +01:00
Johan Eliasson
881a3344d4 update lock file 2022-12-17 11:00:45 +01:00
Johan Eliasson
d1562d33fb update 2022-12-17 10:57:06 +01:00
Johan Eliasson
21ced66f22 moved apollo and react-apollo to integrations/ folder 2022-12-17 10:50:13 +01:00
Johan Eliasson
2a2d86904d revert to previously working 2022-12-17 10:46:12 +01:00
Johan Eliasson
82d46f716b Merge pull request #1381 from nhost/docs-ui8asud9
docs update
2022-12-17 10:42:33 +01:00
Johan Eliasson
5e26810868 using authentication everywhere 2022-12-17 10:36:39 +01:00
Johan Eliasson
d590258371 correct query 2022-12-17 10:34:06 +01:00
Johan Eliasson
697ef57cb8 Update docs/docs/authentication/users.mdx
Co-authored-by: Guido Curcio <guidomaurocurcio@gmail.com>
2022-12-17 10:29:28 +01:00
Johan Eliasson
93002dc8c3 Update docs/docs/authentication/users.mdx
Co-authored-by: Guido Curcio <guidomaurocurcio@gmail.com>
2022-12-17 10:29:09 +01:00
Guido Curcio
357e0933ff pass roles with payload; handle adding and removing roles from user 2022-12-17 03:18:53 -03:00
Johan Eliasson
baa1937d06 Merge pull request #1228 from nhost/react-urql
urql
2022-12-16 22:11:29 +01:00
Johan Eliasson
03e5662df9 Merge branch 'main' into react-urql 2022-12-16 22:10:54 +01:00
Pilou
e0711bdfc8 Merge pull request #1372 from kematzy/docs-update-vue-quickstart
Update of Vue Quickstart documentation
2022-12-16 22:05:55 +01:00
Johan Eliasson
caca27fde3 Merge branch 'main' into docs-ui8asud9 2022-12-16 21:55:55 +01:00
Johan Eliasson
b0d51033c6 typo fix 2022-12-16 21:43:02 +01:00
Johan Eliasson
088f9394fc Update docs/docs/graphql/permissions.mdx
Co-authored-by: Siarhei Lipchyk <contact@siarhei.dev>
2022-12-16 21:42:07 +01:00
Szilárd Dóró
a91361f971 feat(dashboard): add support for Hasura permission object converter 2022-12-16 21:10:04 +01:00
Pilou
a4f5be6ab9 Merge pull request #1390 from nhost/fix/strict-mode
fix: React 18 strict mode and other improvements
2022-12-16 19:09:55 +01:00
Szilárd Dóró
dbbccbf1cd fix(dashboard): mobile responsive design 2022-12-16 13:50:22 +01:00
Guido Curcio
7d8f82b99d user.lastSeen fix 2022-12-16 09:36:22 -03:00
Szilárd Dóró
a70dc7b352 chore(dashboard): improve rule group editor design 2022-12-16 12:57:03 +01:00
Pierre-Louis Mercereau
54df0df42b fix: 🐛 React 18 strict mode and other improvements 2022-12-16 12:08:04 +01:00
Szilárd Dóró
0bbb2598fd feat(dashboard): finalize Hasura permission converter 2022-12-16 11:01:25 +01:00
Guido Curcio
e10480b761 missing refetch when deleting user. 2022-12-15 15:02:05 -03:00
Guido Curcio
1343abbe50 comments & types 2022-12-15 12:33:04 -03:00
Szilárd Dóró
4ba34cc827 feat(dashboard): working on Hasura converters 2022-12-15 16:00:11 +01:00
Guido Curcio
fa37546139 handle banning users 2022-12-15 11:22:55 -03:00
Szilárd Dóró
42ece48ce3 feat(dashboard): added support for text truncation 2022-12-15 15:05:24 +01:00
Guido Curcio
112526a984 render email & password only if email and no social oauth. 2022-12-15 11:04:40 -03:00
Szilárd Dóró
f97ab31f69 feat(dashboard): added support for _c* operators 2022-12-15 10:21:09 +01:00
Johan Eliasson
21dc1ecd6b image didn't exist 2022-12-15 10:01:24 +01:00
Szilárd Dóró
c11adbe3e2 chore(dashboard): improve initialization 2022-12-15 09:58:27 +01:00
Johan Eliasson
6078e9c207 new sys env vars 2022-12-15 09:22:00 +01:00
Johan Eliasson
450582dc43 update 2022-12-15 09:12:11 +01:00
Johan Eliasson
ddec0e1be1 update 2022-12-15 09:09:31 +01:00
Johan Eliasson
698154b24b permissions updated 2022-12-15 09:05:42 +01:00
Johan Eliasson
9c87b0f67b updates 2022-12-14 20:48:43 +01:00
Pilou
85afe3d216 Merge pull request #1368 from nhost/refactor/less-peer-dependencies
refactor: less peer dependencies
2022-12-14 19:19:09 +01:00
Pierre-Louis Mercereau
0773e5215f Merge branch 'main' into refactor/less-peer-dependencies 2022-12-14 19:01:31 +01:00
Pierre-Louis Mercereau
10f25fcc4e chore: remove needless paths 2022-12-14 18:59:57 +01:00
Johan Eliasson
2ee90d6ea3 removed unused files 2022-12-14 18:16:33 +01:00
Johan Eliasson
5db5323a1d updates 2022-12-14 18:14:40 +01:00
Guido Curcio
0c74806245 fix showing limit in pagination rather than total users. 2022-12-14 13:31:47 -03:00
Guido Curcio
5df84d7f50 fix remoteAppUser type 2022-12-14 13:08:39 -03:00
Guido Curcio
d58de8fcf8 join totalUsers query with main users query 2022-12-14 12:55:49 -03:00
Szilárd Dóró
ed93d4b583 feat(dashboard): add onInitialized to autocomplete 2022-12-14 16:15:40 +01:00
Szilárd Dóró
1ec1953eaa chore(dashboard): improve default value error tolerance 2022-12-14 15:41:17 +01:00
Szilárd Dóró
63e9c3933e chore(dashboard): improved column autocomplete value management 2022-12-14 15:33:29 +01:00
Guido Curcio
85674c4d90 handle users providers other than email (e.g. github); handle removed providers from a user. 2022-12-14 11:32:28 -03:00
Guido Curcio
5a1d3b9bfc handle anonymous users 2022-12-14 11:06:35 -03:00
Guido Curcio
942570ed29 show table header on not found search strings 2022-12-14 10:33:29 -03:00
Szilárd Dóró
1b1620f633 chore(dashboard): cleaned up default value functionality 2022-12-14 14:24:41 +01:00
Johan Eliasson
e8e8d661e1 small exchange refactor 2022-12-14 13:50:44 +01:00
Johan Eliasson
ba08ec7f5c comments 2022-12-14 13:44:39 +01:00
Johan Eliasson
fb0c98c21d moved react-urql to integrations 2022-12-14 13:37:20 +01:00
Johan Eliasson
c9f575c40c database settings update 2022-12-14 13:24:25 +01:00
Johan Eliasson
6c8bed7ecc Update packages/react-urql/src/provider.tsx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-12-14 13:23:37 +01:00
Guido Curcio
3058eee48f 25 limit, loading screen 2022-12-14 09:21:14 -03:00
Szilárd Dóró
d5a712f7ef feat(dashboard): add support for default values 2022-12-14 13:07:11 +01:00
Johan Eliasson
83422f5ee6 updated README 2022-12-14 09:42:01 +01:00
Johan Eliasson
51909a6a8f remove 2022-12-14 09:34:05 +01:00
Johan Eliasson
2f30797556 update 2022-12-14 09:28:35 +01:00
Johan Eliasson
0b8f7d1661 Merge branch 'main' into react-urql 2022-12-14 09:27:54 +01:00
Johan Eliasson
52ee9d84b6 demo img 2022-12-14 09:11:17 +01:00
Szilárd Dóró
d9612b28b0 chore(dashboard): update pnpm-lock.yaml 2022-12-14 09:07:56 +01:00
Szilárd Dóró
0034791493 Merge remote-tracking branch 'origin/main' into feat/rule-group-editor 2022-12-14 09:06:15 +01:00
Johan Eliasson
80fed14a6b updated 2022-12-14 09:03:30 +01:00
Szilárd Dóró
d457ada435 Merge pull request #1380 from nhost/changeset-release/main
chore: update versions
2022-12-14 08:57:35 +01:00
github-actions[bot]
b41e5a9df5 chore: update versions 2022-12-14 07:46:43 +00:00
Szilárd Dóró
0c8ace1bd4 Merge pull request #1379 from nhost/fix/dashboard-urls
fix(dashboard): use correct service URLs
2022-12-14 08:45:12 +01:00
Johan Eliasson
3f800a068b update 2022-12-13 22:31:42 +01:00
Szilárd Dóró
7d490fe569 fix(dashboard): use correct GraphQL slug and admin secret 2022-12-13 21:34:11 +01:00
Szilárd Dóró
d6527122db fix(dashboard): use correct service URLs 2022-12-13 21:21:12 +01:00
Johan Eliasson
3211140dec remove changeset for now 2022-12-13 21:10:41 +01:00
Johan Eliasson
469352cd81 merge 2022-12-13 21:09:44 +01:00
Szilárd Dóró
88400f6b7c chore(dashboard): add delay to queries 2022-12-13 17:41:16 +01:00
Szilárd Dóró
f8c8a06d71 feat(dashboard): permission variable queries 2022-12-13 17:24:14 +01:00
Szilárd Dóró
ebc1730fce Merge pull request #1375 from nhost/changeset-release/main
chore: update versions
2022-12-13 16:55:15 +01:00
Pierre-Louis Mercereau
c1cd1e813c docs: update changelog 2022-12-13 16:34:41 +01:00
Pierre-Louis Mercereau
e08a074474 chore: un-bump major versions 2022-12-13 16:33:30 +01:00
Szilárd Dóró
2f819865bc chore(dashboard): move handlers to mocks folder 2022-12-13 16:32:01 +01:00
Szilárd Dóró
3888f3041f chore(dashboard): improve operator selectors 2022-12-13 16:15:01 +01:00
Guido Curcio
bacb1b9720 fix number of pages going to 0 on nextPageClick 2022-12-13 11:53:42 -03:00
Guido Curcio
e119e4fc18 styles on userBody 2022-12-13 11:19:23 -03:00
Pierre-Louis Mercereau
569c4004f6 Merge branch 'main' into refactor/less-peer-dependencies 2022-12-13 14:10:31 +01:00
github-actions[bot]
95932fa3f2 chore: update versions 2022-12-13 13:06:10 +00:00
Pilou
99402b77d1 Merge pull request #1376 from nhost/chore/docgen
chore: remove generated documentation from the repository
2022-12-13 14:04:48 +01:00
Szilárd Dóró
f6fb2cd8e6 Merge pull request #1377 from nhost/fix/local-development-region
fix(dashboard): don't break the UI when project is not loaded yet
2022-12-13 13:49:38 +01:00
Szilárd Dóró
5c2cf59b41 chore(dashboard): update CHANGELOG.md 2022-12-13 13:11:50 +01:00
Szilárd Dóró
a6d31dc260 fix(dashboard): don't break the UI when project is not loaded yet 2022-12-13 13:10:54 +01:00
Guido Curcio
b1fe2be963 users body loader, pagination elemnts; input fix for pages > 9 2022-12-13 09:07:36 -03:00
Szilárd Dóró
872e50b635 chore(dashboard): improve Chip in autocomplete 2022-12-13 13:01:44 +01:00
Pierre-Louis Mercereau
bd73557a47 Merge branch 'main' into chore/docgen 2022-12-13 12:01:04 +01:00
Guido Curcio
9b6e8ab3bc slotProps for pagination component 2022-12-13 07:50:43 -03:00
Pilou
c95bab70c2 Merge pull request #1366 from nhost/refactor/merge-core
refactor: decommission `@nhost/core`
2022-12-13 10:50:36 +01:00
Szilárd Dóró
52d4b5de45 Merge pull request #1347 from nhost/changeset-release/main
chore: update versions
2022-12-13 10:29:25 +01:00
Szilárd Dóró
fe0742e278 chore(dashboard): update pnpm-lock.yaml 2022-12-13 10:15:29 +01:00
Szilárd Dóró
ded57d3b24 Merge remote-tracking branch 'origin/main' into feat/rule-group-editor 2022-12-13 10:13:03 +01:00
Szilárd Dóró
c30abaea22 chore(dashboard): add reference to storybook to the README 2022-12-13 10:11:31 +01:00
Szilárd Dóró
6b4ab50f74 fix(packages): nextjs and react-apollo versions 2022-12-13 09:50:42 +01:00
github-actions[bot]
ceba605d0b chore: update versions 2022-12-13 08:47:12 +00:00
Szilárd Dóró
9249a85ee5 Merge pull request #1371 from nhost/fix/aws-name-null-reference
fix(dashboard): don't break UI when region is nullish
2022-12-13 09:45:32 +01:00
Guido Curcio
d2c4b7cad1 custom styles for pagination in users tab 2022-12-13 02:26:32 -03:00
Guido Curcio
59d737696a onChangePage handler for Pagination 2022-12-13 02:13:57 -03:00
Kematzy
22de3214f1 Minor typo & formatting changes to standardise 2022-12-13 11:52:08 +08:00
Kematzy
cf880f992f Update Vue Quickstart docs 2022-12-13 11:50:51 +08:00
Szilárd Dóró
f4d70f88e9 chore(dashboard): add changeset 2022-12-12 22:43:06 +01:00
Szilárd Dóró
0d09b80b12 fix(dashboard): fix nullish region in local mode 2022-12-12 22:42:09 +01:00
Pierre-Louis Mercereau
195adfb04a chore: remove generated documentation from the repository 2022-12-12 21:26:21 +01:00
Pilou
aee4cdcb72 Update .changeset/modern-days-eat.md
Co-authored-by: Johan Eliasson <johan@nhost.io>
2022-12-12 20:20:03 +01:00
Pilou
b09930c8a4 Merge pull request #1369 from nhost/contributors-readme-action-TvJAKaD1lO
docs(contributor): contributors readme action update
2022-12-12 19:06:31 +01:00
github-actions[bot]
687951281e docs(contributor): contrib-readme-action has updated readme 2022-12-12 18:05:20 +00:00
Pilou
c0f05acd9b Merge pull request #1365 from badgifter/patch-windowslive-url
Windows Live Provider displayed link updated to match backend url
2022-12-12 19:05:01 +01:00
Szilárd Dóró
87af60cc03 feat(dashboard): add experimental multiselect autocomplete 2022-12-12 17:30:09 +01:00
Pierre-Louis Mercereau
3d8dd39995 fix: dashboard tests 2022-12-12 17:00:41 +01:00
Pierre-Louis Mercereau
65687beecc chore: rewrite the pr so it fits with Nuno's mind 2022-12-12 16:41:16 +01:00
Szilárd Dóró
62aa859737 feat(dashboard): support for boolean input field 2022-12-12 15:53:50 +01:00
Pierre-Louis Mercereau
d8c2d369aa chore: changeset 2022-12-12 15:43:55 +01:00
Pierre-Louis Mercereau
a4e4926aeb Merge branch 'main' into refactor/merge-core 2022-12-12 15:28:26 +01:00
Guido Curcio
35cd76e562 UsersBodyProps types 2022-12-12 11:16:56 -03:00
Guido Curcio
266bbe837d type users, add comments UsersBodyProps, memo limit & offset. 2022-12-12 11:15:31 -03:00
Guido Curcio
caf785a938 feat: Pagination common component. 2022-12-12 10:48:06 -03:00
Szilárd Dóró
9bc3e755df feat(dashboard): add dynamic rule group editor input type 2022-12-12 14:43:22 +01:00
Pilou
4a9471cc16 Create rude-singers-carry.md 2022-12-12 14:42:55 +01:00
Szilárd Dóró
638a7ac11d feat(dashboard): finalize relationship discovery 2022-12-12 14:19:02 +01:00
Bad Gifter
567e370bdc microsoft changed to windowslive 2022-12-12 14:04:35 +03:00
Bad Gifter
a91f2db0e2 Windows Live Provider displayed link updated to match backend url 2022-12-12 13:49:08 +03:00
Szilárd Dóró
4e49c8db50 fix(dashboard): correct column autocomplete input value 2022-12-12 11:28:49 +01:00
Szilárd Dóró
210f65b4db feat(dashboard): added column autocomplete to rule group editor 2022-12-12 10:50:15 +01:00
Szilárd Dóró
1b6482126f feat(dashboard): add relationship discovery 2022-12-12 10:10:39 +01:00
Guido Curcio
96f9c1a55d handle pagination when searching for users 2022-12-12 06:08:35 -03:00
Guido Curcio
731460b20d handle pagination in users' table 2022-12-12 06:05:22 -03:00
Guido Curcio
1537d46b1d handle states of search: case insensitive query, preserve search query. 2022-12-12 04:29:12 -03:00
Guido Curcio
632def158d render activated providers from users. 2022-12-12 02:38:53 -03:00
Guido Curcio
39271a67e2 render all available roles from the app, check roles form user. 2022-12-12 02:11:43 -03:00
Guido Curcio
9e25c4f386 render verified checkbox as helpertext except when errors; disable prop on phoneNumberVerified when no phoneNumber. 2022-12-12 01:26:48 -03:00
Guido Curcio
dd58a4ac7f handle mutation of displayName, email, and avatarUrl; render avatar url if not default=blank. 2022-12-12 01:14:04 -03:00
Guido Curcio
b9c3567baa update gql query with locale, lastSeen, emailVerified, and phoneNumberVerified 2022-12-12 00:56:00 -03:00
Guido Curcio
108937789a EditUserForm: roles & sign-in methods styles. 2022-12-12 00:20:59 -03:00
Guido Curcio
e651745a7e no users found; default & allowed roles 2022-12-11 23:15:29 -03:00
Szilárd Dóró
699debb2b8 fix(dashboard): correct group rendering 2022-12-09 16:12:05 +01:00
Szilárd Dóró
3e08dc7f8c feat(dashboard): improve navigation in popover 2022-12-09 14:26:46 +01:00
Szilárd Dóró
6928b48781 fix(dashboard): custom autocomplete props 2022-12-09 14:14:58 +01:00
Szilárd Dóró
02886350ff chore(dashboard): use custom autocomplete for column selector 2022-12-09 14:11:32 +01:00
Szilárd Dóró
b3672f8246 feat(dashboard): column selector metadata support 2022-12-09 12:09:43 +01:00
Guido Curcio
6091b4a8e8 handle delete users & refetch main users query 2022-12-09 06:46:01 -03:00
Szilárd Dóró
aea99ad2c8 Merge pull request #1361 from nhost/fix/apple-sign-in-mutation
fix(dashboard): do not show error when submitting Apple provider settings
2022-12-09 09:45:33 +01:00
Szilárd Dóró
594488e435 chore(dashboard): add changeset 2022-12-09 09:29:32 +01:00
Szilárd Dóró
bb83b0f81a fix(dashboard): do not show error when submitting Apple provider settings 2022-12-09 09:18:46 +01:00
Guido Curcio
82ddcbd180 handle search strings, static UsersBodyHeader, nullish render on no users 2022-12-09 03:48:34 -03:00
Guido Curcio
8aa7aafa3b add form footer to EditUserForm 2022-12-09 03:10:23 -03:00
Guido Curcio
183cb4b26a EditUserPasswordForm: handle change password edits, remote gql client, toast on edit. 2022-12-09 03:00:20 -03:00
Guido Curcio
3a7377c6e2 EditUserForm: add avatar with letters, change password button & modal. 2022-12-08 23:15:05 -03:00
Guido Curcio
1529f58c33 fetch remote project users on page load 2022-12-08 23:00:26 -03:00
Guido Curcio
95af5421d1 UsersBody: render first two letters of displayname if no avatar 2022-12-08 22:51:11 -03:00
Guido Curcio
feb39404db first section of user's drawer 2022-12-08 22:26:54 -03:00
Pilou
0384d7c7c4 Merge pull request #1360 from nhost/contributors-readme-action-cDMbyYcNKN
docs(contributor): contributors readme action update
2022-12-08 19:40:40 +01:00
Pilou
7e356a9604 Merge pull request #1357 from nhost/contributors-readme-action-sNfze0TcKw
docs(contributor): contributors readme action update
2022-12-08 19:29:19 +01:00
github-actions[bot]
013e55a307 docs(contributor): contrib-readme-action has updated readme 2022-12-08 18:28:57 +00:00
Pilou
2a71257cde Merge pull request #1358 from nhost/fix/workspace-packages
fix: use workspace to resolve internal dependencies
2022-12-08 19:28:41 +01:00
Pierre-Louis Mercereau
583a4401d0 docs: add explanation to the CI workflow 2022-12-08 18:50:01 +01:00
Pierre-Louis Mercereau
914e91a0b0 ci: correct test 2022-12-08 18:40:49 +01:00
Pierre-Louis Mercereau
98698213e2 ci: run all e2e tests when lockfile changed 2022-12-08 18:29:54 +01:00
Pierre-Louis Mercereau
756daa97cd fix: use workspace to resolve internal dependencies 2022-12-08 16:58:47 +01:00
github-actions[bot]
ab5a2b119c docs(contributor): contrib-readme-action has updated readme 2022-12-08 15:18:12 +00:00
Johan Eliasson
ffdcce1463 Merge pull request #1352 from wollerman/patch-1
Add a section on managing local seed data
2022-12-08 16:17:54 +01:00
Guido Curcio
15b3100c63 pass on data from previously fetched users table 2022-12-08 12:17:22 -03:00
Guido Curcio
f7ef7d106d open drawer on edit user 2022-12-08 11:18:11 -03:00
Szilárd Dóró
0dbbcc5595 chore(dashboard): improve column autocomplete 2022-12-08 15:16:13 +01:00
Szilárd Dóró
a3dcb6106e Merge pull request #1355 from nhost/chore/revert-types-react-bump
chore(dashboard): revert `@types/react` bump
2022-12-08 15:03:24 +01:00
Szilárd Dóró
208d224763 chore(dashboard): revert @types/react bump 2022-12-08 14:46:36 +01:00
Szilárd Dóró
816f8d069d fix(dashboard): pnpm-lock file 2022-12-08 14:20:28 +01:00
Guido Curcio
72c31622cd render user's table with dropdown trigger 2022-12-08 09:25:07 -03:00
Guido Curcio
6959461e3f handle creating users (CreateUserForm) 2022-12-08 08:40:13 -03:00
Guido Curcio
103472ac77 empty state for new users page 2022-12-08 07:57:42 -03:00
Szilárd Dóró
2ebf99ff8f chore(dashboard): improved column autocomplete 2022-12-08 09:32:51 +01:00
renovate[bot]
c13e492bbf chore(deps): update dependency typescript to v4.9.4 2022-12-08 01:41:29 +00:00
Matt Wollerman
564d000bfc add link to overview description of seed data 2022-12-07 20:21:09 -05:00
Szilárd Dóró
63476a2351 feat(dashboard): start work on column autocomplete 2022-12-07 16:49:55 +01:00
Matt Wollerman
266fda07ab add a section on managing local seed data 2022-12-07 08:45:40 -05:00
Szilárd Dóró
782252c059 chore(dashboard): improved Rule Group editor 2022-12-07 14:42:20 +01:00
Szilárd Dóró
e86978a1ff chore(dashboard): upgrade storybook
- chore(dashboard): improve mobile layout of the rule group editor
2022-12-07 13:32:05 +01:00
Szilárd Dóró
84cfd11953 chore(dashboard): extend rule group editor story 2022-12-07 13:12:13 +01:00
Szilárd Dóró
9a43e136f6 fix(dashboard): fixed rule group editor form structure 2022-12-07 11:22:50 +01:00
Szilárd Dóró
e9cff26fa0 chore(dashboard): improve rule group editor layout 2022-12-07 10:11:54 +01:00
Szilárd Dóró
3d32bca2b3 fix(dashboard): fix rule group editor delete button 2022-12-06 16:11:08 +01:00
Szilárd Dóró
4021feaf38 feat(dashboard): rule editor implementation 2022-12-06 14:02:07 +01:00
Pilou
6174e1ddcc Merge pull request #1341 from nhost/refactor/nhost-react-providers
refactor: nhost react providers
2022-12-06 12:57:26 +01:00
Pierre-Louis Mercereau
af2e3eae37 chore: minor bump 2022-12-06 12:39:30 +01:00
Pilou
d2b4c126f3 Merge pull request #1346 from nhost/chore/prettier-ignore-lockfile
chore: prettier ignore pnpm-lock.yaml
2022-12-06 11:01:00 +01:00
Pierre-Louis Mercereau
7f2e182c47 chore: prettier ignore pnpm-lock.yaml 2022-12-06 10:54:16 +01:00
Szilárd Dóró
306ec74356 chore(dashboard): update import paths 2022-12-06 10:16:42 +01:00
Szilárd Dóró
ae40bd54d4 Merge pull request #1302 from nhost/renovate/react-18.x
chore(deps): update dependency @types/react to v18.0.26
2022-12-06 10:01:27 +01:00
Pilou
b5cc47078a Update .changeset/big-pumpkins-march.md
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-12-06 09:59:25 +01:00
Pierre-Louis Mercereau
7f251111e2 chore: 🤖 changeset 2022-12-06 09:41:40 +01:00
Pierre-Louis Mercereau
c03dacc3a3 refactor: use NhostProvider in React and Nextjs 2022-12-06 09:39:44 +01:00
Pilou
8b9e1a0ce8 Merge pull request #1339 from nhost/contributors-readme-action-oSzExU64y7
docs(contributor): contributors readme action update
2022-12-06 07:04:10 +01:00
github-actions[bot]
cf9cfec330 docs(contributor): contrib-readme-action has updated readme 2022-12-06 05:52:28 +00:00
Pilou
1c94f56c59 Merge pull request #1338 from iangabrielsanchez/patch-1
Fix typo
2022-12-06 06:52:14 +01:00
Ian Gabriel Sanchez
f06d5deba3 Fix typo 2022-12-06 10:15:59 +08:00
Nuno Pato
8ff58d7f23 Merge pull request #1330 from nhost/changeset-release/main
chore: update versions
2022-12-05 15:22:02 -01:00
github-actions[bot]
8dd1c7415b chore: update versions 2022-12-05 15:56:54 +00:00
Nuno Pato
ebd2749e38 Merge pull request #1329 from nhost/fix/hasura-duplicate-slug
fix(dashboard): use correct Hasura slug
2022-12-05 14:55:28 -01:00
Szilárd Dóró
80b604adda fix(dashboard): use correct Hasura slug 2022-12-05 16:35:35 +01:00
Nuno Pato
9d73050792 Merge pull request #1322 from nhost/changeset-release/main
chore: update versions
2022-12-05 14:20:47 -01:00
renovate[bot]
2a86b8876c chore(deps): update dependency @types/react to v18.0.26 2022-12-05 14:47:07 +00:00
github-actions[bot]
91a1a41f5d chore: update versions 2022-12-05 14:41:11 +00:00
Nuno Pato
22e9c27c81 Merge pull request #1328 from nhost/fix/graphiql-editor
fix(dashboard): prevent error on GraphQL page
2022-12-05 13:39:28 -01:00
Szilárd Dóró
2d2beb53d2 fix(dashboard): prevent error on GraphQL page 2022-12-05 15:26:37 +01:00
Pilou
b403b0d6a0 Merge pull request #1327 from nhost/ci/unambiguous-git-log
chore: don't use PAT in renovate post PR
2022-12-05 14:21:43 +01:00
Pierre-Louis Mercereau
4dbac55cb4 chore: don't use PAT in renovate post PR 2022-12-05 14:20:56 +01:00
Pilou
c6e31ac741 Merge pull request #1324 from nhost/renovate/xstate-vue-2.x
fix(deps): update dependency @xstate/vue to v2
2022-12-05 13:06:56 +01:00
Pilou
0d3e8b3992 Merge pull request #1325 from nhost/ci/unambiguous-git-log
chore(gh-actions): `git log` unabiguously
2022-12-05 12:58:15 +01:00
Pierre-Louis Mercereau
b2afd14d61 chore(gh-actions): git log unabiguously 2022-12-05 12:57:46 +01:00
renovate[bot]
f28f28b6ee fix(deps): update dependency @xstate/vue to v2 2022-12-05 11:52:06 +00:00
Pilou
834b959271 Merge pull request #1323 from nhost/renovate/vueuse-core-9.x
fix(deps): update dependency @vueuse/core to v9
2022-12-05 12:44:43 +01:00
renovate[bot]
4dbc9ccc87 fix(deps): update dependency @vueuse/core to v9 2022-12-05 11:23:06 +00:00
Pierre-Louis Mercereau
2764a1c4b6 Merge branch 'main' into refactor/merge-core 2022-12-05 12:17:21 +01:00
Nuno Pato
1666ca2ec5 Merge pull request #1250 from nhost/chore/deprecate-old-dns-name
chore(dashboard): deprecate old DNS name
2022-12-05 10:10:37 -01:00
Pilou
346791d4d5 Merge pull request #1321 from nhost/renovate/pnpm-find-workspace-dir-5.x
fix(deps): update dependency @pnpm/find-workspace-dir to v5
2022-12-05 11:55:33 +01:00
Pierre-Louis Mercereau
94bdafe22f chore: adapt sync-versions to find-workspace-dir 5 2022-12-05 11:51:44 +01:00
renovate[bot]
33782e9d41 fix(deps): update dependency @pnpm/find-workspace-dir to v5 2022-12-05 10:46:45 +00:00
Johan Eliasson
ea02e1e104 Merge pull request #1311 from nhost/example-serverless-functions-stripe-webhooks
example(serverless functions): Stripe Webhooks
2022-12-05 11:39:36 +01:00
Johan Eliasson
98bf6e3792 Update examples/serverless-functions/functions/stripe-webhook/index.ts
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-05 11:39:26 +01:00
Johan Eliasson
d9dcafd643 Update examples/serverless-functions/functions/stripe-webhook/index.ts
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-12-05 11:39:20 +01:00
Johan Eliasson
4f3d97b5ad Merge pull request #1316 from nhost/elitan-patch-3
docs clarifications
2022-12-05 11:38:51 +01:00
Nuno Pato
d1801ceae9 dashboard: fix link 2022-12-05 09:12:40 -01:00
Szilárd Dóró
b6f9fe6304 Merge pull request #1301 from nhost/changeset-release/main
chore: update versions
2022-12-05 11:02:10 +01:00
github-actions[bot]
15b652d7e0 chore: update versions 2022-12-05 09:14:59 +00:00
Szilárd Dóró
cdc0047cb7 Merge pull request #1284 from nhost/renovate/graphiql-react-0.x
fix(deps): update dependency @graphiql/react to ^0.15.0
2022-12-05 10:13:19 +01:00
Pilou
7c0e71e8be Merge pull request #1303 from nhost/renovate/eslint-plugin-vue-9.x
chore(deps): update dependency eslint-plugin-vue to v9
2022-12-05 09:38:23 +01:00
Pilou
175d6d8cbc Merge pull request #1315 from plmercereau/ci/nhost-cli-action
ci: generic Nhost CLI action
2022-12-05 09:30:31 +01:00
Pierre-Louis Mercereau
2ae277409a ci: action test cleanup 2022-12-05 09:14:58 +01:00
Pierre-Louis Mercereau
ada10170b7 ci: always checkout 2022-12-05 09:08:04 +01:00
Pierre-Louis Mercereau
0ed77cbe8b ci: add cli action tests 2022-12-05 09:05:51 +01:00
Johan Eliasson
1abc68992f Update users.mdx 2022-12-05 08:15:14 +01:00
Pilou
795962e3c2 Merge pull request #1313 from nhost/ci/e2e-matrix-job-name
ci: improve the names of the e2e matrix jobs
2022-12-05 01:28:13 +01:00
Pilou
ba998eb632 Update README.md 2022-12-05 01:18:13 +01:00
Pierre-Louis Mercereau
d3fc1bbeb9 ci: simplify config injection 2022-12-05 00:07:35 +01:00
Pierre-Louis Mercereau
7b9c2016d0 ci: default is: do not start the app 2022-12-04 23:44:51 +01:00
Pierre-Louis Mercereau
ebf4070be6 ci: final adjustments 2022-12-04 23:39:01 +01:00
Pierre-Louis Mercereau
59e3f6abc6 ci: cli version 2022-12-04 23:32:04 +01:00
Pierre-Louis Mercereau
0c9a03a7ff docs: add nhost-cli action readme 2022-12-04 23:00:24 +01:00
Pierre-Louis Mercereau
42cbe27914 ci: revert 2022-12-04 22:51:04 +01:00
Pierre-Louis Mercereau
d7e7b0e51b ci: cleanup 2022-12-04 22:50:11 +01:00
Pierre-Louis Mercereau
036181dd75 ci: clean 2022-12-04 22:48:19 +01:00
Pierre-Louis Mercereau
2828a9fe01 ci: silence curl 2022-12-04 22:41:16 +01:00
Pierre-Louis Mercereau
88bc71dffc ci: try another version 2022-12-04 22:39:49 +01:00
Pierre-Louis Mercereau
17699870a6 ci: correct curl 2022-12-04 22:34:41 +01:00
Pierre-Louis Mercereau
5c0304ab73 ci: remove sS 2022-12-04 22:30:41 +01:00
Pierre-Louis Mercereau
637265e3d9 ci: again 2022-12-04 22:29:34 +01:00
Pierre-Louis Mercereau
229604d8e1 ci: correct retry 2022-12-04 22:25:45 +01:00
Pierre-Louis Mercereau
1165a33079 ci: --retry-connrefused 2022-12-04 22:22:26 +01:00
Pierre-Louis Mercereau
82c0dd9d87 ci: retry again 2022-12-04 22:17:00 +01:00
Pierre-Louis Mercereau
a9bfab1778 ci: 16.1 2022-12-04 22:15:29 +01:00
Pierre-Louis Mercereau
60b7a664d2 ci: improve wait-for 2022-12-04 22:14:53 +01:00
Pierre-Louis Mercereau
4f708d04d6 ci: correct path 2022-12-04 21:56:24 +01:00
Pierre-Louis Mercereau
a02af56056 ci: config 2022-12-04 21:52:17 +01:00
Pierre-Louis Mercereau
575136dcfb ci: don't fail, and fail 2022-12-04 16:45:44 +01:00
Pierre-Louis Mercereau
2bc6346cbc ci: not siltent 2022-12-04 16:42:17 +01:00
Pierre-Louis Mercereau
91cd494a3d ci: correct nhost dev 2022-12-04 16:37:21 +01:00
Pierre-Louis Mercereau
d57e0a5287 ci: path 2022-12-04 16:36:02 +01:00
Pierre-Louis Mercereau
dd5e7093f0 ci: start 2022-12-04 16:34:47 +01:00
Pierre-Louis Mercereau
3e9bb84f07 ci: don't build packages 2022-12-04 16:34:05 +01:00
Pierre-Louis Mercereau
6665b58ec8 ci: dedicated wip action 2022-12-04 16:33:13 +01:00
Pierre-Louis Mercereau
456e893cd6 ci: change branch reference 2022-12-04 16:24:47 +01:00
Pierre-Louis Mercereau
fd76170ca6 ci: nhost-cli action 2022-12-04 16:23:52 +01:00
Pierre-Louis Mercereau
682aef2d94 ci: improve the names of the e2e matrix jobs 2022-12-03 23:01:46 +01:00
Pilou
cb53f71d4a Merge pull request #1312 from plmercereau/main
Chore(docker-compose): fix tests
2022-12-03 17:28:42 +01:00
Pierre-Louis Mercereau
4fc0b40cb4 chore(docker-compose): increase timeout 2022-12-03 17:20:48 +01:00
Pierre-Louis Mercereau
9da2d01c55 chore(docker-compose): describe 2022-12-03 17:16:11 +01:00
Pierre-Louis Mercereau
0d5e7850f8 chore(docker-compose): retry 2022-12-03 17:14:23 +01:00
Johan Eliasson
8ed965c669 keep migrations file here, otherwise nhost dev won't work 2022-12-03 14:44:22 +01:00
Pilou
cb284b40b1 Merge pull request #1308 from nhost/ci/docker-compose
chore: improve docker-compose example
2022-12-03 13:59:10 +01:00
Johan Eliasson
c59f622feb fix 2022-12-03 13:48:40 +01:00
Johan Eliasson
9a30edd038 example 2022-12-03 13:47:42 +01:00
Johan Eliasson
4b2d2a4f55 merge 2022-12-03 13:36:02 +01:00
Johan Eliasson
eba2bd05b8 update 2022-12-03 13:35:04 +01:00
Johan Eliasson
84a1b28261 Create breezy-donuts-try.md 2022-12-03 13:34:20 +01:00
Johan Eliasson
ff3b9df41e cleanup 2022-12-03 13:32:06 +01:00
Pilou
b8b4e36175 Merge pull request #1307 from nhost/renovate/uuid-9.x
chore(deps): update dependency uuid to v9
2022-12-03 11:33:51 +01:00
Pierre-Louis Mercereau
6e47ef68d5 Merge branch 'ci/docker-compose' of https://github.com/nhost/nhost into ci/docker-compose 2022-12-02 23:11:24 +01:00
Pilou
2697414637 Create fair-students-enjoy.md 2022-12-02 23:08:13 +01:00
Pierre-Louis Mercereau
e753b2faed chore: quiet docker pull 2022-12-02 23:01:55 +01:00
Pierre-Louis Mercereau
6f62ec7d2a fix: use docker-compose v2 syntax 2022-12-02 22:43:32 +01:00
Pierre-Louis Mercereau
d365ef1953 test: 💍 create e2e tests for the docker-compose example 2022-12-02 22:20:12 +01:00
Szilárd Dóró
99ee9fd10d fix(dashboard): move Brazilian flag 2022-12-02 20:29:58 +01:00
Nuno Pato
9608a327c9 dashboard: add brazilian flag 2022-12-02 18:27:14 -01:00
Szilárd Dóró
492b83ef58 fix(dashboard): correct GraphQL URL 2022-12-02 20:25:11 +01:00
renovate[bot]
09f53ae43f chore(deps): update dependency uuid to v9 2022-12-02 18:30:25 +00:00
renovate[bot]
7724ac7e06 chore(deps): update dependency eslint-plugin-vue to v9 2022-12-02 15:56:01 +00:00
renovate[bot]
02343fe171 fix(deps): update dependency @graphiql/react to ^0.15.0 2022-12-02 15:52:13 +00:00
Szilárd Dóró
98dd8d039c Merge pull request #1305 from nhost/fix/pnpm-lock
fix(deps): correct pnpm-lock.yaml
2022-12-02 16:35:13 +01:00
Szilárd Dóró
456e057497 Merge remote-tracking branch 'origin/main' into fix/pnpm-lock 2022-12-02 16:34:46 +01:00
Pilou
93e9b58a58 Merge pull request #1289 from nhost/renovate/faker-6.x
chore(deps): update dependency @types/faker to v6
2022-12-02 16:33:33 +01:00
Szilárd Dóró
019a7c2335 fix: correct pnpm-lock.yaml 2022-12-02 16:26:51 +01:00
Pierre-Louis Mercereau
a0901914ac Merge branch 'main' into refactor/merge-core 2022-12-02 16:09:32 +01:00
Pilou
64882a8e16 Merge pull request #1279 from nhost/renovate/prettier-plugin-tailwindcss-0.x
chore(deps): update dependency prettier-plugin-tailwindcss to ^0.2.0
2022-12-02 15:59:13 +01:00
Pilou
1ed572fe39 Merge pull request #1275 from nhost/renovate/msw-0.x
chore(deps): update dependency msw to ^0.49.0
2022-12-02 15:58:56 +01:00
Pilou
e06271a8ae Merge pull request #1282 from nhost/renovate/vitest-monorepo
chore(deps): update dependency vitest to ^0.25.0
2022-12-02 15:56:09 +01:00
Szilárd Dóró
bca239ebb2 Merge pull request #1296 from nhost/chore/cleanup-deps
chore(deps): remove unused deps, sync @types/react and @types/react-dom
2022-12-02 15:51:40 +01:00
Szilárd Dóró
e33caa046d Merge pull request #1273 from nhost/fix/settings-env-var-empty-list
fix(dashboard): correct section paddings when no env vars
2022-12-02 15:51:05 +01:00
renovate[bot]
cbbd331341 chore(deps): update dependency prettier-plugin-tailwindcss to ^0.2.0 2022-12-02 14:42:50 +00:00
Pierre-Louis Mercereau
c41bfaffdd chore: 🤖 remove unused @types/faker 2022-12-02 15:39:20 +01:00
renovate[bot]
f2596b0b14 chore(deps): update dependency msw to ^0.49.0 2022-12-02 14:31:58 +00:00
Pilou
4d0c3111d1 Merge pull request #1299 from nhost/chore/labeler
chore: don't remove existing labels
2022-12-02 15:29:18 +01:00
Pierre-Louis Mercereau
7ff9644ac7 chore: don't remove existing labels 2022-12-02 15:28:35 +01:00
renovate[bot]
87fdaa7144 chore(deps): update dependency @types/faker to v6 2022-12-02 13:56:59 +00:00
Szilárd Dóró
bc23d051ba Merge pull request #1274 from nhost/changeset-release/main
chore: update versions
2022-12-02 13:40:52 +01:00
Szilárd Dóró
132a4f4be9 chore(deps): synchronize @types/react-dom and @types/react versions 2022-12-02 13:36:26 +01:00
github-actions[bot]
c330dc1c00 chore: update versions 2022-12-02 12:34:54 +00:00
Pilou
4bebd9842b Merge pull request #1297 from nhost/chore/labeler
chore: rename labeler.yaml to .yml
2022-12-02 13:33:09 +01:00
Pierre-Louis Mercereau
541f2d250c chore: rename labeler.yaml to .yml 2022-12-02 13:32:02 +01:00
Szilárd Dóró
6b31e31430 Merge branch 'main' into chore/cleanup-deps 2022-12-02 13:31:09 +01:00
Szilárd Dóró
9ba2208dd7 chore(dashboard): remove unused dependencies 2022-12-02 13:30:02 +01:00
Szilárd Dóró
538541fc79 Merge pull request #1268 from nhost/renovate/netlify-functions-0.x
chore(deps): remove dependency @netlify/functions
2022-12-02 13:18:38 +01:00
Pilou
cb0aab48b3 Merge pull request #1292 from nhost/chore/labeler
chore: use correct PAT
2022-12-02 13:18:16 +01:00
Pierre-Louis Mercereau
dcc760b6bb chore: use correct PAT 2022-12-02 13:17:39 +01:00
Pilou
d2227be0d0 Merge pull request #1291 from nhost/chore/labeler
chore: add labeler workflow
2022-12-02 12:05:35 +01:00
Pierre-Louis Mercereau
93e807edc4 chore: add labeler workflow 2022-12-02 12:04:55 +01:00
Pilou
14738d4b58 Merge pull request #1283 from plmercereau/main
ci: create renovate changeset `after` the pull request is merged
2022-12-02 11:39:06 +01:00
Szilárd Dóró
6ac4cfa80c Merge branch 'main' into renovate/netlify-functions-0.x 2022-12-02 11:32:08 +01:00
Szilárd Dóró
295c6c9110 chore(dashboard): remove @netlify/functions 2022-12-02 11:31:58 +01:00
Szilárd Dóró
02911e4a54 Merge pull request #1267 from nhost/renovate/critters-0.x
chore(deps): update dependency critters to ^0.0.16
2022-12-02 11:19:39 +01:00
Szilárd Dóró
2be825de08 Merge pull request #1285 from nhost/renovate/docusaurus-monorepo
fix(deps): update docusaurus monorepo to v2.2.0
2022-12-02 11:19:14 +01:00
Szilárd Dóró
65afad1b91 fix(deps): pnpm-lock 2022-12-02 11:08:38 +01:00
Pilou
dbea13a1d2 Merge pull request #1287 from nhost/chore/labeler
chore: add labels to pull requests
2022-12-02 10:59:37 +01:00
Szilárd Dóró
5e2a419700 Merge branch 'main' into renovate/critters-0.x 2022-12-02 10:42:52 +01:00
Szilárd Dóró
f1272947dd chore(deps): update @types/react and @types/react-dom 2022-12-02 10:17:32 +01:00
Johan Eliasson
e5041bfd30 Merge branch 'main' into react-urql 2022-12-02 09:59:38 +01:00
Johan Eliasson
3d7cc74feb env vars 2022-12-02 09:42:38 +01:00
Johan Eliasson
d007202783 update 2022-12-02 09:40:26 +01:00
Johan Eliasson
38e92a705d works outside strict mode now 2022-12-02 09:38:16 +01:00
Pierre-Louis Mercereau
9e6660450c chore: add an examples label 2022-12-02 09:19:04 +01:00
Pierre-Louis Mercereau
2db9be03ff chore: 🤖 add labels to pull requests 2022-12-01 23:11:06 +01:00
renovate[bot]
1b8f505050 fix(deps): update docusaurus monorepo to v2.2.0 2022-12-01 21:41:57 +00:00
Pilou
6ab6bccded Merge pull request #1278 from nhost/ci/renovate-label
ci: add renovate label
2022-12-01 22:37:11 +01:00
Pilou
b12bc1c27f Merge pull request #1277 from nhost/chore/missing-version
chore: add missing version field to the vue-starter example
2022-12-01 22:31:55 +01:00
Pierre-Louis Mercereau
04d1641cf7 revert: initial versions 2022-12-01 22:22:06 +01:00
Pierre-Louis Mercereau
e91c09aa9c revert: initial versions 2022-12-01 22:20:46 +01:00
Pierre-Louis Mercereau
7c04aad870 revert: initial bumps 2022-12-01 22:19:13 +01:00
Pilou
520044c5ab Merge branch 'nhost:main' into main 2022-12-01 22:16:18 +01:00
plmercereau
22fed668d6 chore(deps): update dependency uuid to v9 2022-12-01 21:07:31 +00:00
Pilou
ae14fb1a2f Merge pull request #50 from plmercereau/renovate/uuid-9.x
chore(deps): update dependency uuid to v9
2022-12-01 22:06:13 +01:00
Johan Eliasson
74cc63833a package updates 2022-12-01 22:05:28 +01:00
Pilou
f4ca0aab42 Merge pull request #52 from plmercereau/ci/origin
test: 💍 origin
2022-12-01 22:04:55 +01:00
Pierre-Louis Mercereau
d8a0d196af test: 💍 origin 2022-12-01 22:04:23 +01:00
Pierre-Louis Mercereau
cd53718631 ci: origin 2022-12-01 22:03:49 +01:00
Pilou
1fcd3f1851 Merge pull request #49 from plmercereau/renovate/last-sha
test: 💍 last sha
2022-12-01 21:59:26 +01:00
Pierre-Louis Mercereau
67d370feaa test: 💍 last sha 2022-12-01 21:58:01 +01:00
Pierre-Louis Mercereau
0173ec356b ci: last sha 2022-12-01 21:56:45 +01:00
renovate[bot]
2fb43d417a chore(deps): update dependency uuid to v9 2022-12-01 20:41:02 +00:00
Pilou
966b8158c2 Merge pull request #48 from plmercereau/renovate/debug
test: 💍 debug
2022-12-01 21:33:56 +01:00
Pierre-Louis Mercereau
800fac6093 test: 💍 debug 2022-12-01 21:33:20 +01:00
Pierre-Louis Mercereau
20eb04cd46 ci: debug 2022-12-01 21:32:22 +01:00
Johan Eliasson
425320bbb5 lockfile update 2022-12-01 21:31:57 +01:00
Johan Eliasson
499352ad8a Merge branch 'main' into react-urql 2022-12-01 21:30:53 +01:00
Pilou
5d31a88556 Merge pull request #45 from plmercereau/renovate/base_ref
test: 💍 base_ref
2022-12-01 21:27:33 +01:00
Pierre-Louis Mercereau
06019ae7ba test: 💍 base_ref 2022-12-01 21:25:36 +01:00
Pierre-Louis Mercereau
523af2901f ci: base_ref 2022-12-01 21:24:52 +01:00
Pilou
1e0a2c0c43 Merge pull request #1264 from nhost/renovate/react-dom-18.x
chore(deps): update dependency @types/react-dom to v18.0.9
2022-12-01 21:06:41 +01:00
Pilou
9b60f9ca48 Merge pull request #1276 from nhost/renovate/nextjs-monorepo
chore(deps): update dependency next to v12.3.4
2022-12-01 21:06:01 +01:00
Pilou
90bc800c92 Update .github/renovate.json 2022-12-01 21:05:42 +01:00
renovate[bot]
023060cee6 chore(deps): update dependency vitest to ^0.25.0 2022-12-01 20:02:01 +00:00
Szilárd Dóró
0bb3b127d0 chore(dashboard): change local package versions 2022-12-01 20:53:30 +01:00
Pilou
cd914d30ed Merge pull request #44 from plmercereau/renovate/after
test: 💍 add changeset after renovate merge
2022-12-01 20:11:15 +01:00
Pilou
71dddccb9c Merge pull request #41 from plmercereau/renovate/dotenv-16.x
chore(deps): update dependency dotenv to v16
2022-12-01 19:59:03 +01:00
Pierre-Louis Mercereau
2a846040ef test: 💍 add changeset after renovate merge 2022-12-01 19:58:18 +01:00
Pierre-Louis Mercereau
8b580d05c4 ci: add changeset after the renovate pr is merged 2022-12-01 19:57:33 +01:00
Pilou
24d70e8ea8 Update .changeset/tenancy-smothering-cataleptic.md 2022-12-01 19:32:47 +01:00
renovate[bot]
8212432983 chore(deps): update dependency next to v12.3.4 2022-12-01 18:07:07 +00:00
Pierre-Louis Mercereau
7df00a3291 fix: 🐛 disable @antfu's lint rule 2022-12-01 19:04:47 +01:00
Pierre-Louis Mercereau
0186aa5c98 ci: add renovate label 2022-12-01 18:59:38 +01:00
Pierre-Louis Mercereau
67e5cc839c chore: add missing version field to the vue-starter example 2022-12-01 18:56:08 +01:00
Pilou
25c5bd1ccd Merge pull request #1269 from plmercereau/main
ci: improvements on the renovate changeset workflow
2022-12-01 18:51:39 +01:00
renovate[bot]
e5fa48d818 chore(deps): update dependency next to v12.3.4 2022-12-01 17:41:33 +00:00
Pilou
f34da3a715 Merge pull request #1270 from nhost/renovate/xstate-inspect-0.x
chore(deps): update dependency @xstate/inspect to ^0.7.0
2022-12-01 18:38:17 +01:00
Pilou
fab330ce55 Merge pull request #35 from plmercereau/renovate/glob-8.x
chore(deps): update dependency @types/glob to v8
2022-12-01 18:34:47 +01:00
renovate[bot]
3a76080e40 chore(deps): update dependency @types/glob to v8 2022-12-01 16:37:05 +00:00
Szilárd Dóró
db57572f38 fix(dashboard): correct section paddings when no env vars 2022-12-01 15:40:16 +01:00
renovate[bot]
b030eae999 chore(deps): update dependency @xstate/inspect to ^0.7.0 2022-12-01 14:13:16 +00:00
renovate[bot]
b10f4fa631 chore(deps): update dependency @xstate/inspect to ^0.7.0 2022-12-01 14:11:35 +00:00
Pilou
4a6e8c9945 Merge pull request #1263 from nhost/renovate/akhilmhdh-contributors-readme-action-2.x
chore(deps): update akhilmhdh/contributors-readme-action action to v2.3.6
2022-12-01 15:06:20 +01:00
Pierre-Louis Mercereau
3a4d087e6f chore: remove changeset 2022-12-01 15:04:52 +01:00
Pilou
c408b38f28 Merge branch 'nhost:main' into main 2022-12-01 14:54:02 +01:00
Pierre-Louis Mercereau
b2336b2b33 ci: clean 2022-12-01 14:53:49 +01:00
Pierre-Louis Mercereau
fcf68d5c32 ci: separate workflow 2022-12-01 14:48:54 +01:00
Pierre-Louis Mercereau
9e71677cd2 ci: use PAT 2022-12-01 14:36:48 +01:00
Pierre-Louis Mercereau
ce48ce0860 ci: amend 2022-12-01 14:30:57 +01:00
renovate[bot]
9b93cf95ec chore(deps): update dependency @netlify/functions to ^0.11.0 2022-12-01 13:21:48 +00:00
renovate[bot]
34d85e54d6 chore(deps): update dependency critters to ^0.0.16 2022-12-01 13:20:08 +00:00
renovate[bot]
6ae9d6dd01 chore(deps): update dependency @netlify/functions to ^0.11.0 2022-12-01 13:19:41 +00:00
renovate[bot]
1e8d8afe70 chore(deps): update dependency critters to ^0.0.16 2022-12-01 13:18:19 +00:00
Pierre-Louis Mercereau
80478e39e0 ci: put ifs back 2022-12-01 14:11:23 +01:00
Szilárd Dóró
ee7338cc12 Merge pull request #1266 from nhost/changeset-release/main
chore: update versions
2022-12-01 14:10:20 +01:00
renovate[bot]
3a39970d28 chore(deps): update dependency dotenv to v16 2022-12-01 13:09:28 +00:00
Pierre-Louis Mercereau
b0607673ed ci: remove more ifs 2022-12-01 13:57:27 +01:00
Pierre-Louis Mercereau
d9f27c6c65 ci: deactivate 2022-12-01 13:46:15 +01:00
github-actions[bot]
ea0b35fe84 chore: update versions 2022-12-01 12:30:09 +00:00
Szilárd Dóró
4fbd22f232 Merge pull request #1258 from nhost/fix/settings-env-var-character-limit
fix(dashboard): remove character limit from env var inputs
2022-12-01 13:28:30 +01:00
Pierre-Louis Mercereau
c92142845f ci: simplify syntax 2022-12-01 13:27:29 +01:00
Pierre-Louis Mercereau
c93f818315 ci: not the dependencies 2022-12-01 12:42:19 +01:00
Pierre-Louis Mercereau
d20ed86219 ci: don't create changeset if no package is impacted 2022-12-01 12:36:10 +01:00
renovate[bot]
e04390307c chore(deps): update dependency @types/react-dom to v18.0.9 2022-12-01 10:49:12 +00:00
renovate[bot]
5c931f14ae chore(deps): update dependency @types/react-dom to v18.0.9 2022-12-01 10:47:47 +00:00
renovate[bot]
a7ab1243a4 chore(deps): update akhilmhdh/contributors-readme-action action to v2.3.6 2022-12-01 10:43:54 +00:00
Pilou
5638b5e770 Merge pull request #1262 from nhost/ci/adjust-workflows
ci: adjust workflows
2022-12-01 11:43:09 +01:00
renovate[bot]
c5ce895c97 chore(deps): update akhilmhdh/contributors-readme-action action to v2.3.6 2022-12-01 10:42:20 +00:00
Pierre-Louis Mercereau
2be99c0e55 ci: adjust workflows 2022-12-01 11:34:59 +01:00
Pilou
f6299b537d Merge pull request #1261 from plmercereau/main
ci: set Renovate bot
2022-12-01 11:33:30 +01:00
Pilou
11d06cce4b Merge branch 'nhost:main' into main 2022-12-01 10:49:46 +01:00
Pierre-Louis Mercereau
e9e0ad6d3c ci: clean renovate 2022-12-01 10:46:28 +01:00
Pierre-Louis Mercereau
3ad2d5ced8 ci: clean-up 2022-12-01 10:44:47 +01:00
Szilárd Dóró
42bfa7c16d Merge pull request #1259 from nhost/chore/issue-templates
chore: create issue templates
2022-12-01 10:37:51 +01:00
Pierre-Louis Mercereau
0dea974a2e ci: fine-tune 2022-12-01 10:28:13 +01:00
Szilárd Dóró
8165b8f13e chore: create issue templates 2022-12-01 10:25:30 +01:00
Pierre-Louis Mercereau
1c8864c992 ci: debug ref_head 2022-12-01 10:22:40 +01:00
Pierre-Louis Mercereau
dd6921676f ci: correct sed 2022-12-01 10:12:54 +01:00
Szilárd Dóró
a1193da4fb fix(dashboard): remove character limit from env var inputs 2022-12-01 10:05:56 +01:00
Pierre-Louis Mercereau
ff83a29dcc ci: fix filter 2022-12-01 10:03:15 +01:00
Pierre-Louis Mercereau
4771bff65c ci: don't use ambiguous redirection 2022-12-01 09:56:57 +01:00
Pierre-Louis Mercereau
6106265d87 ci: install pnpm 2022-12-01 09:48:48 +01:00
Pierre-Louis Mercereau
3c2455b7e1 ci: echo 2022-12-01 09:39:59 +01:00
Pierre-Louis Mercereau
7bc8de103b ci: correct 2022-12-01 09:36:26 +01:00
Pierre-Louis Mercereau
e49ba4bd02 ci: don't use paste 2022-12-01 09:23:24 +01:00
Pierre-Louis Mercereau
44ac1a0095 ci: shuf 2022-12-01 09:10:41 +01:00
Pierre-Louis Mercereau
04ce686e7c Merge branch 'main' of https://github.com/plmercereau/nhost 2022-12-01 08:46:29 +01:00
Pierre-Louis Mercereau
ca01224083 ci: alway patch 2022-12-01 08:46:02 +01:00
Pilou
d489232cbc Update packages.yaml 2022-12-01 07:43:32 +01:00
Pierre-Louis Mercereau
9efc0522c3 fix(examples): rename test script to e2e:test 2022-11-30 23:54:57 +01:00
Pierre-Louis Mercereau
4c86ed787e ci: shorter job title 2022-11-30 23:50:28 +01:00
Pierre-Louis Mercereau
9a3c05f69b fix(examples): correct examples to pass the build step 2022-11-30 23:48:11 +01:00
Pierre-Louis Mercereau
2b03f80d59 ci: avoid double negative 2022-11-30 23:37:40 +01:00
Pierre-Louis Mercereau
baa3f0531d ci: typo 2022-11-30 23:35:49 +01:00
Pierre-Louis Mercereau
f9bbc78241 ci: correct test 2022-11-30 23:34:37 +01:00
Pierre-Louis Mercereau
7f62c8b7c2 refactor(examples): remove obsolete test 2022-11-30 23:31:04 +01:00
Pierre-Louis Mercereau
de2bcb6320 ci: fix 2022-11-30 23:18:42 +01:00
Pierre-Louis Mercereau
64a6d934e7 ci: dict 2022-11-30 23:17:26 +01:00
Pierre-Louis Mercereau
f455022e6d ci: debug 2022-11-30 23:15:26 +01:00
Pierre-Louis Mercereau
baac8a3605 ci: debug 2022-11-30 23:03:39 +01:00
Pierre-Louis Mercereau
be20cd5cdb ci: remove if 2022-11-30 22:58:17 +01:00
Pilou
1de4137369 Merge pull request #4 from plmercereau/renovate/configure
Configure Renovate
2022-11-30 22:54:17 +01:00
Pierre-Louis Mercereau
18fae1a891 ci(renovate): ignore node and pnpm 2022-11-30 22:54:04 +01:00
Pierre-Louis Mercereau
03c58613b8 ci: adapt renovate 2022-11-30 22:49:46 +01:00
Pierre-Louis Mercereau
fb23dd6b39 ci: prepare renovate 2022-11-30 22:45:33 +01:00
renovate[bot]
c12bd632fc chore(deps): add renovate.json 2022-11-30 20:11:34 +00:00
Pilou
a71eea09a9 Merge pull request #1254 from nhost/ci/create-cli-pr
ci: PR to the CLI with the new dashboard version
2022-11-30 18:25:47 +01:00
Szilárd Dóró
c9f88326b2 chore(dashboard): migrate app URLs to service URLs 2022-11-30 17:12:58 +01:00
Pierre-Louis Mercereau
d1f7842169 chore: set fetch-depth to 0 2022-11-30 16:50:32 +01:00
Pierre-Louis Mercereau
4566c2a202 chore: rephrase 2022-11-30 16:40:31 +01:00
Pierre-Louis Mercereau
c678918e73 ci: PR to the CLI with the new dashboard version 2022-11-30 16:38:03 +01:00
Szilárd Dóró
ac8efcbdd5 chore(dashboard): add changeset 2022-11-30 16:13:30 +01:00
Szilárd Dóró
9bc346e8d4 fix(dashboard): minor layout fixes in provider alert 2022-11-30 16:12:11 +01:00
Nuno Pato
efed987d31 fix linter 2022-11-30 12:12:48 -01:00
Szilárd Dóró
7e113bfb1f Merge pull request #1253 from nhost/changeset-release/main
chore: update versions
2022-11-30 14:11:45 +01:00
Nuno Pato
bdab7da7d3 fix linter 2022-11-30 12:02:10 -01:00
Nuno Pato
c2d9993968 asd 2022-11-30 11:53:30 -01:00
Nuno Pato
508ba62207 update copy 2022-11-30 11:52:41 -01:00
Nuno Pato
a3318de06e incorporate minor changes from comments 2022-11-30 11:49:25 -01:00
github-actions[bot]
f1d358d77c chore: update versions 2022-11-30 11:16:45 +00:00
Szilárd Dóró
d558ef9ecf Merge pull request #1249 from nhost/chore/dashboard-cleanup
chore(dashboard): cleanup unused files
2022-11-30 12:08:39 +01:00
Pierre-Louis Mercereau
26d577d7ae Merge branch 'main' into refactor/merge-core 2022-11-30 11:43:30 +01:00
Szilárd Dóró
75c7ba7f12 Merge pull request #1252 from nhost/changeset-release/main
chore: update versions
2022-11-30 08:29:25 +01:00
github-actions[bot]
d62dfe19a2 chore: update versions 2022-11-30 07:28:00 +00:00
Szilárd Dóró
0dbef188b1 Merge pull request #1247 from nhost/chore/sidebar-menu-item-height
chore(dashboard): update settings sidebar menu item density
2022-11-30 08:26:39 +01:00
Nuno Pato
fa9f7ca052 Deprecate old DNS name 2022-11-30 03:01:17 -01:00
Szilárd Dóró
8857314e22 Merge pull request #1237 from nhost/changeset-release/main
chore: update versions
2022-11-29 20:57:22 +01:00
github-actions[bot]
85f1c4a98e chore: update versions 2022-11-29 19:33:07 +00:00
Pilou
efa6b5755d Merge pull request #1248 from nhost/chore/remove-sort-lint-rule
chore: remove eslint plugin simple-import-sort
2022-11-29 20:31:24 +01:00
Szilárd Dóró
44f13f6240 chore(dashboard): cleanup unused files 2022-11-29 20:29:25 +01:00
Pierre-Louis Mercereau
2b19416787 chore: remove eslint plugin simple-import-sort 2022-11-29 20:28:13 +01:00
Szilárd Dóró
e01cb2ed49 chore(dashboard): add changeset 2022-11-29 17:18:48 +01:00
Szilárd Dóró
388eef041f chore(dashboard): change settings sidebar menu item density 2022-11-29 17:18:09 +01:00
Szilárd Dóró
4e5d43f300 Merge pull request #1245 from nhost/chore/settings-roles-and-permissions-refactor
chore(dashboard): refactor Roles and Permissions settings sections
2022-11-29 17:00:12 +01:00
Pierre-Louis Mercereau
622c48a94b chore: update changeset 2022-11-29 16:18:18 +01:00
Pierre-Louis Mercereau
e1a87a05b1 chore: update lock file 2022-11-29 16:15:49 +01:00
Szilárd Dóró
db342f453e chore(dashboard): add changesets 2022-11-29 16:15:45 +01:00
Pierre-Louis Mercereau
2148317282 Merge branch 'main' into refactor/merge-core 2022-11-29 16:15:05 +01:00
Szilárd Dóró
54386a3b56 chore(dashboard): simplify env var dialog props 2022-11-29 16:14:20 +01:00
Pilou
ff40b99f84 Merge pull request #1242 from nhost/fix/set-access-token
fix: 🐛 Distribute the access token to all the sub-clients
2022-11-29 16:08:00 +01:00
Szilárd Dóró
33f8f1d78a Merge remote-tracking branch 'origin/main' into chore/settings-roles-and-permissions-refactor 2022-11-29 16:07:19 +01:00
Szilárd Dóró
c50fe47ab4 Merge pull request #1215 from nhost/feat/settings-environment-variables
feat(dashboard): add Environment Variables page
2022-11-29 16:04:09 +01:00
Pilou
0580f832c8 Merge pull request #1239 from nhost/chore/version-bumps
chore: 🤖 bump to axios 1.2.0
2022-11-29 15:59:38 +01:00
Szilárd Dóró
7d1eb099c0 fix(dashboard): correct system environment variables 2022-11-29 15:53:11 +01:00
Pierre-Louis Mercereau
e15322296b chore: lint 2022-11-29 15:52:25 +01:00
Pierre-Louis Mercereau
91a2bf905b refactor: simplify 2022-11-29 15:37:31 +01:00
Szilárd Dóró
0f9393fe27 fix(dashboard): change system env vars layout 2022-11-29 15:10:37 +01:00
Szilárd Dóró
aebb822549 feat(dashboard): extend system variables 2022-11-29 15:05:58 +01:00
Pierre-Louis Mercereau
1e2be6fadf Merge branch 'main' into chore/version-bumps 2022-11-29 13:41:00 +01:00
Pilou
aafbf5173d Merge pull request #1240 from nhost/test/nhost-js
test: 💍 `nhost.graphql.request` as an authenticated user
2022-11-29 13:00:46 +01:00
Pierre-Louis Mercereau
01e13e2f8c chore: 🤖 lint 2022-11-29 12:52:34 +01:00
Pierre-Louis Mercereau
4364647501 fix: 🐛 accept any encoding 2022-11-29 12:16:35 +01:00
Pierre-Louis Mercereau
ef117c284e fix: 🐛 Distribute the access token to all the sub-clients 2022-11-29 11:49:59 +01:00
Szilárd Dóró
3f919c0a80 chore(dashboard): refactor system variable layout 2022-11-29 11:30:31 +01:00
Pierre-Louis Mercereau
49e447e7b7 test: 💍 nhost.graphql.request as an authenticated user 2022-11-29 11:04:56 +01:00
Pierre-Louis Mercereau
66b4f3d0be chore: 🤖 bump to axios 1.2.0 2022-11-29 10:29:51 +01:00
Szilárd Dóró
aa7fdafe8b chore(dashboard): split Permission Variable dialog 2022-11-28 21:45:15 +01:00
Pierre-Louis Mercereau
5f9c6c8346 Merge branch 'main' into refactor/merge-core 2022-11-28 21:16:06 +01:00
Pilou
7d6de3b289 Merge pull request #1234 from nhost/chore/bump-hasura-auth
chore: 🤖 bump hasura-auth version
2022-11-28 19:51:10 +01:00
Pilou
57e41f77a9 Merge pull request #1238 from nhost/ci/turbo-team
ci: hardcode turbo team
2022-11-28 19:36:48 +01:00
Pierre-Louis Mercereau
f5c2a0ef4f ci: hardcode turbo team 2022-11-28 18:38:03 +01:00
Johan Eliasson
2e30371086 Merge branch 'main' into react-urql 2022-11-28 17:04:51 +01:00
Szilárd Dóró
d52bc8cca5 chore(dashboard): refactor role delete and default 2022-11-28 16:58:28 +01:00
Pilou
04a3e4c965 Merge pull request #1236 from nhost/refactor/state-snapshots
refactor: use state snapshots
2022-11-28 16:52:27 +01:00
Szilárd Dóró
853c0c5775 chore(dashboard): split RoleForm into multiple forms 2022-11-28 16:44:02 +01:00
Pierre-Louis Mercereau
2e6923dc73 refactor: use state snapshots 2022-11-28 16:41:53 +01:00
Pierre-Louis Mercereau
7d6d70d0c7 chore: 🤖 bump hasura-auth version 2022-11-28 15:59:04 +01:00
Pierre-Louis Mercereau
57db5b83d4 chore: 🤖 changeset 2022-11-28 15:39:21 +01:00
Szilárd Dóró
7a2100cc17 fix(dashboard): do not try to autofocus a disable input 2022-11-28 15:19:42 +01:00
Szilárd Dóró
5d55f3fa60 chore(dashboard): remove async form loading 2022-11-28 15:13:16 +01:00
Szilárd Dóró
8b0c44a93c chore(dashboard): rename env var forms
- chore(dashboard): do not convert env vars to uppercase by default
2022-11-28 14:59:27 +01:00
Szilárd Dóró
e0cc7cce0a chore(dashboard): update env var dialog subtitle 2022-11-28 13:40:25 +01:00
Szilárd Dóró
6e7d5e0dd4 fix(dashboard): change env var name placeholder 2022-11-28 13:19:17 +01:00
Szilárd Dóró
54c143ebf6 fix(dashboard): allow lowercase letters, convert variable to uppercase 2022-11-28 13:18:16 +01:00
Szilárd Dóró
8b9fa0b150 feat(dashboard): env var validation 2022-11-28 13:05:42 +01:00
Szilárd Dóró
c3bb79e1dd chore(dashboard): refactor env var forms 2022-11-28 11:15:38 +01:00
Szilárd Dóró
128d21e4ec Merge branch 'main' into feat/settings-environment-variables 2022-11-28 09:21:56 +01:00
Szilárd Dóró
40e503c356 Merge pull request #1227 from nhost/fix/vercel-deployment-token
fix(changesets): add Vercel deployment token to CI
2022-11-28 08:28:33 +01:00
Szilárd Dóró
d007e0ade8 chore(changesets): do not create dedicated env var for deploy token 2022-11-28 08:26:11 +01:00
Pilou
fa32513ba7 Merge pull request #1231 from nhost/docs/docker-compose-dashboard
docs: run hasura console from the cli to run the dashboard
2022-11-27 22:50:14 +01:00
Pierre-Louis Mercereau
8893d9e010 docs: run hasura console from the cli to run the dashboard 2022-11-27 21:37:37 +01:00
Johan Eliasson
66659bb293 update 2022-11-27 21:31:14 +01:00
Johan Eliasson
579d4f3170 update 2022-11-27 21:14:10 +01:00
Johan Eliasson
bb56548603 urql 2022-11-27 21:12:07 +01:00
Szilárd Dóró
81d2fd865c fix(changesets): add Vercel deployment token to CI 2022-11-27 19:51:07 +01:00
Szilárd Dóró
fe3c462099 Merge pull request #1217 from nhost/fix/vercel-pipeline
fix(changesets): add missing `pnpm` command, pre-build project
2022-11-26 11:49:08 +01:00
Szilárd Dóró
f8b082cb02 chore(changesets): split Vercel CLI command 2022-11-25 16:59:56 +01:00
Szilárd Dóró
0c748e6ee6 feat(dashboard): add env var management 2022-11-25 16:57:22 +01:00
Pilou
e2c4ca85b3 Merge pull request #1219 from nhost/docs/docker-compose-dashboard
docs(docker-compose): add the dashboard to the docker-compose example
2022-11-25 16:38:54 +01:00
Szilárd Dóró
0165b998c2 chore(changesets): create separate step for Vercel 2022-11-25 16:33:09 +01:00
Pierre-Louis Mercereau
5d970cc229 feat(docs): add the dashboard to the docker-compose example 2022-11-25 16:14:46 +01:00
Szilárd Dóró
7167170663 feat(dashboard): add env var management dialog 2022-11-25 15:47:34 +01:00
Szilárd Dóró
0f77de2dd0 feat(dashboard): add menu to env vars 2022-11-25 15:13:54 +01:00
Szilárd Dóró
6ae91e48d1 feat(dashboard): list env vars 2022-11-25 14:52:47 +01:00
Szilárd Dóró
69db1594cc fix(changesets): add missing pnpm command, pre-build project 2022-11-25 14:36:54 +01:00
Szilárd Dóró
158cf0da49 Merge pull request #1216 from nhost/changeset-release/main
chore: update versions
2022-11-25 14:12:10 +01:00
github-actions[bot]
7992fc3baa chore: update versions 2022-11-25 13:09:54 +00:00
Szilárd Dóró
85d9596956 Merge branch 'main' into feat/settings-environment-variables 2022-11-25 14:08:46 +01:00
Szilárd Dóró
16d383516e Merge pull request #1206 from nhost/feat/settings-roles-and-permissions
feat(dashboard): Roles and Permissions
2022-11-25 14:08:13 +01:00
Szilárd Dóró
2ca193ccf3 chore(dashboard): improve inline secrets 2022-11-25 14:07:44 +01:00
Szilárd Dóró
ab8e12003d feat(dashboard): show JWT secret 2022-11-25 14:02:48 +01:00
Szilárd Dóró
29cdf6b125 Merge pull request #1214 from nhost/elitan-patch-3
Update serverless-functions.mdx
2022-11-25 13:51:24 +01:00
Szilárd Dóró
41cc3dc5d0 feat(dashboard): settings page for Environment Variables 2022-11-25 13:50:08 +01:00
Johan Eliasson
6b67c9996a Update serverless-functions.mdx 2022-11-25 12:50:39 +01:00
Szilárd Dóró
23274dee41 chore(docs): add changeset 2022-11-25 11:59:42 +01:00
Szilárd Dóró
a5b55c2667 chore(docs): update permission variables image 2022-11-25 11:58:46 +01:00
Szilárd Dóró
1263676eb3 fix(dashboard): permission variable validation 2022-11-25 11:49:46 +01:00
Szilárd Dóró
b1b647ad96 fix(dashboard): reset default role on role removal 2022-11-25 11:34:51 +01:00
Szilárd Dóró
21bbaf5e95 feat(dashboard): add docs link to roles section 2022-11-25 10:56:14 +01:00
Szilárd Dóró
eef9c91403 feat(dashboard): add support for default roles
- remove unnecessary helper labels from roles and permissions
2022-11-25 10:55:20 +01:00
Johan Eliasson
1742cb444d Merge pull request #1212 from nhost/szilarddoro-patch-1
chore(docs): add WorkOS to Authentication page
2022-11-25 10:49:45 +01:00
Szilárd Dóró
c4f374d7f3 Merge remote-tracking branch 'origin/main' into feat/settings-roles-and-permissions 2022-11-25 09:36:57 +01:00
Szilárd Dóró
369ec13070 chore(docs): add WorkOS to Authentication page 2022-11-25 09:36:21 +01:00
Szilárd Dóró
101129eef2 Update dashboard/src/components/settings/permissions/PermissionVariableSettings/PermissionVariableSettings.tsx
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2022-11-25 09:33:33 +01:00
Szilárd Dóró
228fda0364 Merge pull request #1210 from nhost/fix/vercel-deployment 2022-11-25 09:05:57 +01:00
Szilárd Dóró
74085c67a2 fix(dashboard): correct production deployment 2022-11-24 22:31:11 +01:00
Szilárd Dóró
a273725419 Merge pull request #1209 from nhost/fix/precommit-hook
fix(docgen): prevent docgen from breaking the pre-commit hook
2022-11-24 21:07:40 +01:00
Pierre-Louis Mercereau
c5240f8d74 docs: ✏️ remove irrelevant workaround to fixed docgen git hook 2022-11-24 20:53:17 +01:00
Szilárd Dóró
4490068257 chore(docgen): copy binary to node_modules
execute `pnpm i` to copy the `docgen` binary to every package
2022-11-24 20:41:59 +01:00
Szilárd Dóró
3601de3f85 Merge pull request #1208 from nhost/changeset-release/main
chore: update versions
2022-11-24 20:20:45 +01:00
github-actions[bot]
ac9404610b chore: update versions 2022-11-24 19:09:19 +00:00
Szilárd Dóró
63570db57c Merge pull request #1207 from nhost/contributors-readme-action-MBHUTcRQyD
contributors readme action update
2022-11-24 20:08:33 +01:00
github-actions[bot]
538ed78f5a contrib-readme-action has updated readme 2022-11-24 19:07:02 +00:00
Szilárd Dóró
b1a31ecb00 Merge pull request #1181 from nhost/fix/dashboard-custom-local-ports
feat(dashboard): make backend port configurable
2022-11-24 20:06:44 +01:00
Szilárd Dóró
3d151c448c chore(precommit): extend precommit hook with docgen build 2022-11-24 19:42:23 +01:00
Siarhei Lipchyk
bac8ace434 Add support for custom ports via placeholders 2022-11-24 19:03:02 +01:00
Szilárd Dóró
fdd417ed25 feat(dashboard): add router cancellation to permission form
- chore(dashboard): update terminology
2022-11-24 18:03:04 +01:00
Pierre-Louis Mercereau
3cab18713a Merge branch 'main' into refactor/merge-core 2022-11-24 17:33:18 +01:00
Pilou
a402fc17de Merge pull request #1192 from nhost/changeset-release/main
chore: update versions
2022-11-24 17:21:07 +01:00
Pierre-Louis Mercereau
fb94dae43a chore: merge main 2022-11-24 17:17:04 +01:00
Szilárd Dóró
4416ceb9cf chore(dashboard): cleanup unused files 2022-11-24 17:00:35 +01:00
Pierre-Louis Mercereau
f694846eae chore: 🤖 remove hasura-storage-js to hasura-auth-js 2022-11-24 16:54:13 +01:00
Szilárd Dóró
4762ebf61e fix(dashboard): correct original value for role editing 2022-11-24 16:54:01 +01:00
Szilárd Dóró
73e28b5831 feat(dashboard): simplify role management form 2022-11-24 16:52:26 +01:00
Szilárd Dóró
2a7dc5060f feat(dashboard): add support for permission variable management 2022-11-24 16:25:14 +01:00
Szilárd Dóró
9b8ede40a9 feat(dashboard): prevent invalid characters for variables 2022-11-24 15:50:14 +01:00
Szilárd Dóró
f005c20d99 feat(dashboard): add modals for permission variable management 2022-11-24 15:23:30 +01:00
Szilárd Dóró
4adfd613b6 feat(dashboard): support variable listing
- chore(dashboard): rename RolesSettings to RoleSettings
2022-11-24 15:01:51 +01:00
Szilárd Dóró
b6da82c8e3 fix(dashboard): wrong tooltip appearance 2022-11-24 14:25:49 +01:00
Szilárd Dóró
816456edc4 fix(dashboard): remove unnecessary manual focus 2022-11-24 14:24:07 +01:00
Szilárd Dóró
deaf0e86d4 fix(dashboard): changed role form's logic 2022-11-24 14:16:02 +01:00
Szilárd Dóró
23f8206f18 feat(dashboard): add support for role deletion 2022-11-24 12:46:41 +01:00
Szilárd Dóró
9dde4d7988 feat(dashboard): add support for role editing 2022-11-24 12:31:48 +01:00
Szilárd Dóró
26385b9cf9 fix(dashboard): fix ESLint working directories 2022-11-24 12:17:50 +01:00
Szilárd Dóró
6d318206ef feat(dashboard): finalize Create Role modal
- fix(dashboard): lint errors
- chore(dashboard): reduce max allowed linter warnings
2022-11-24 12:11:41 +01:00
Szilárd Dóró
4d727b78a1 feat(dashboard): updated Roles and Permissions page
- created modal for role creation
2022-11-24 11:46:56 +01:00
github-actions[bot]
de0a125e98 chore: update versions 2022-11-24 09:38:59 +00:00
Pilou
ea1ad29031 Merge pull request #1200 from nhost/plmercereau-patch-storage-tag
Update docker-compose.yaml
2022-11-24 10:37:25 +01:00
Szilárd Dóró
3da40e5712 Merge pull request #1205 from nhost/fix/dashboard-meta
fix(dashboard): update terminology
2022-11-24 10:35:48 +01:00
Szilárd Dóró
b9087a4add fix(dashboard): console / dashboard terminology 2022-11-24 09:54:44 +01:00
Szilárd Dóró
1b7a6d0252 fix(dashboard): update terminology 2022-11-24 09:23:08 +01:00
Szilárd Dóró
1417d3e794 Merge pull request #1203 from nhost/contributors-readme-action-FFIU1CawPP
contributors readme action update
2022-11-24 08:55:41 +01:00
github-actions[bot]
e187923858 contrib-readme-action has updated readme 2022-11-24 07:52:33 +00:00
Johan Eliasson
8a60ed4074 Merge pull request #1199 from nhost/functions-more-examples
examples(serverless-functions): smtp + async/await
2022-11-24 08:52:19 +01:00
Pilou
d7d11a44a7 Update docker-compose.yaml
There's no latest tag on storage
2022-11-23 22:04:40 +01:00
Johan Eliasson
062e4691cd added examples 2022-11-23 21:53:25 +01:00
Pilou
a95d49fa2c Merge pull request #1197 from nhost/docs/custom-claims-singleton-array
docs: custom claims and singleton arrays
2022-11-23 19:06:34 +01:00
Johan Eliasson
d14fc96899 Merge pull request #1036 from ejkkan/feat/add-charges-to-stripe-package
feat(stripe-graphql-js): add charges, payment intents and connected accounts
2022-11-23 19:03:37 +01:00
Johan Eliasson
93db718254 Create blue-ghosts-accept.md 2022-11-23 19:03:12 +01:00
Pierre-Louis Mercereau
c367bd58b9 docs: custom claims and singleton arrays 2022-11-23 19:01:29 +01:00
Pilou
0bfed4d9e1 Merge pull request #1196 from nhost/plmercereau-patch-1
Update docker-compose.yaml
2022-11-23 18:43:36 +01:00
Pilou
1f3aecd379 Merge pull request #1193 from nhost/chore/bump-service-versions
ci: 🎡 bump services versions and trigger CI
2022-11-23 18:43:20 +01:00
Pilou
42306ea3bb Update docker-compose.yaml 2022-11-23 18:19:41 +01:00
Pilou
1b12a175f6 Update docker-compose.yaml 2022-11-23 18:18:06 +01:00
Szilárd Dóró
32060aaea0 Merge pull request #1195 from nhost/chore/dashboard-version
chore(dashboard): add changeset
2022-11-23 16:00:18 +01:00
Szilárd Dóró
f94cace5f2 Merge pull request #1194 from nhost/feat/dashboard-vercel-deployment
feat(dashboard): add Vercel deployment
2022-11-23 15:22:09 +01:00
Szilárd Dóró
5de965d9a5 chore(dashboard): add changeset 2022-11-23 15:15:08 +01:00
Szilárd Dóró
e10b3adc11 chore(changesets): incorporate Vercel deployment into publish process 2022-11-23 15:08:21 +01:00
Szilárd Dóró
457db76b06 Merge pull request #1191 from nhost/fix/sign-in-methods-order
fix(dashboard): alphabetic ordering of providers
2022-11-23 15:04:26 +01:00
Szilárd Dóró
1e952a026e chore(changesets): update publish step's name 2022-11-23 15:01:55 +01:00
Szilárd Dóró
2f4c040789 feat(dashboard): add Vercel deployment 2022-11-23 14:33:00 +01:00
Pierre-Louis Mercereau
74648752b4 ci: use correct hasura version 2022-11-23 13:12:32 +01:00
Szilárd Dóró
09d218a3fe fix(dashboard): sign-in method phrasing 2022-11-23 13:12:24 +01:00
Szilárd Dóró
2e8938dbb0 fix(dashboard): add missing Twilio icon 2022-11-23 13:00:12 +01:00
Pierre-Louis Mercereau
ec60d03536 ci: 🎡 bump services versions and trigger CI 2022-11-23 12:57:04 +01:00
Johan Eliasson
2f3767552f Merge pull request #1189 from nhost/docs-workos
docs(workos): WorkOS Docs
2022-11-23 12:14:57 +01:00
Szilárd Dóró
bc401c0dd2 fix(dashboard): alphabetic ordering of providers
- fixes #1188
- fix checkbox font size on the Settings page
2022-11-23 12:12:39 +01:00
Pilou
2907ecb7ff Merge pull request #1179 from nhost/changeset-release/main
chore: update versions
2022-11-23 11:24:55 +01:00
Pierre-Louis Mercereau
05d7f5207f chore: no major bump of peer dependencies 2022-11-23 11:22:55 +01:00
github-actions[bot]
07a053ee80 chore: update versions 2022-11-23 09:58:39 +00:00
Szilárd Dóró
2145243b19 chore(dashboard): update environment variables 2022-11-23 10:56:47 +01:00
Pilou
61e4414a8f Merge pull request #1190 from nhost/changeset-react-components
react components changeset added
2022-11-23 10:55:04 +01:00
Johan Eliasson
4601d84e0e changeset added 2022-11-23 10:29:19 +01:00
Johan Eliasson
ca012d790c Create tidy-teachers-flow.md 2022-11-23 10:27:23 +01:00
Johan Eliasson
aeda14ef53 docs link 2022-11-23 10:25:18 +01:00
Johan Eliasson
3fa5e2005a updates 2022-11-23 10:23:40 +01:00
Johan Eliasson
4dd2e99159 Merge pull request #1187 from nhost/docs-git-8g712asd
docs(git): git docs updates
2022-11-23 08:27:17 +01:00
Johan Eliasson
282c6c6d24 git docs update 2022-11-23 08:16:55 +01:00
Johan Eliasson
beadd84adb moving files 2022-11-23 07:52:57 +01:00
Johan Eliasson
f8f55d2b99 Merge branch 'main' into feat/add-charges-to-stripe-package 2022-11-23 07:49:17 +01:00
Johan Eliasson
03a98d4f3a config updates 2022-11-23 07:36:31 +01:00
Johan Eliasson
8ed8e04ab6 merge 2022-11-23 07:31:37 +01:00
Erik Magnusson
587efd4551 re-applied isAdmin checks for connected account field types 2022-11-23 08:15:44 +02:00
Johan Eliasson
c78227b085 Merge pull request #1185 from nhost/docs/node-16
docs: update developer's guide
2022-11-23 07:06:10 +01:00
Pierre-Louis Mercereau
d87e520307 docs: lessons learned from Sheena and Chris 2022-11-22 21:44:48 +01:00
Pilou
bbed04e4da Merge pull request #1158 from nhost/fix/use-user-roles
fix: 🐛 make `useUserRoles` reactive
2022-11-22 21:35:06 +01:00
Pilou
273afc9740 Merge pull request #1184 from nhost/contributors-readme-action-h-P6q9XKTD
contributors readme action update
2022-11-22 21:32:07 +01:00
github-actions[bot]
f4083aa4b3 contrib-readme-action has updated readme 2022-11-22 20:12:23 +00:00
Pilou
ddd2641726 Merge pull request #1183 from massless/min-version-node
Update minimum version of node
2022-11-22 21:12:04 +01:00
Chris Wetherell
4658aeb31e Update minimum version of node 2022-11-22 12:08:47 -08:00
Johan Eliasson
cc8e5fe4a9 Merge pull request #1180 from nhost/react-components-iy8gasd9
React Auth components: SignedIn and SignedOut
2022-11-22 19:54:19 +01:00
Szilárd Dóró
85c897c717 chore(docs): update source code references 2022-11-22 18:32:48 +01:00
Szilárd Dóró
c99e5552e6 chore(react): simplify component signature 2022-11-22 18:31:39 +01:00
Szilárd Dóró
97a2520ea1 feat(docgen): add support for components 2022-11-22 18:24:23 +01:00
Johan Eliasson
964af2912b inline docs 2022-11-22 17:04:39 +01:00
Szilárd Dóró
a48dd5bf74 chore(dashboard): add changeset 2022-11-22 14:32:53 +01:00
Szilárd Dóró
ef53df5cb3 feat(dashboard): make backend port configurable
- additionally: improve the way Hasura service ports are. configured through environment variables
2022-11-22 14:32:13 +01:00
Johan Eliasson
afea682a8c merge 2022-11-22 14:09:38 +01:00
Pierre-Louis Mercereau
fefa2baa2e refactor: readability 2022-11-22 13:28:09 +01:00
Pilou
f09b3cfd24 Merge pull request #1178 from nhost/ci/freeze-pnpm-version
ci: set explicit pnpm version in the dashboard dockerfile
2022-11-22 13:20:35 +01:00
Pilou
dd3b2c41f1 Merge pull request #1171 from nhost/chore/vue-file-upload-changeset
chore: add changeset to vue, and correct inline documentation
2022-11-22 13:20:21 +01:00
Szilárd Dóró
aaced20f31 Merge pull request #1173 from nhost/fix/dashboard-provider-redirect-url
fix(dashboard): correct redirect URL input opacity
2022-11-22 13:15:35 +01:00
Pierre-Louis Mercereau
3e91c19e13 ci: set explicit pnpm version in the dashboard dockerfile 2022-11-22 13:11:00 +01:00
Pilou
abe0edcacb Merge pull request #1169 from nhost/changeset-release/main
chore: update versions
2022-11-22 12:37:10 +01:00
github-actions[bot]
f8dae56bda chore: update versions 2022-11-22 10:06:23 +00:00
Pilou
9133726dbe Merge pull request #1176 from nhost/chore/correct-changeset
chore: correct changeset from major to patch
2022-11-22 11:03:17 +01:00
Pierre-Louis Mercereau
7eed617034 chore: correct changeset from major to patch 2022-11-22 10:49:00 +01:00
Johan Eliasson
d4fd4ec3e9 signedin and signedout 2022-11-22 10:48:24 +01:00
Pilou
19a0288861 Merge pull request #1172 from nhost/chore/nextjs-13
chore: nextjs 13
2022-11-22 10:48:10 +01:00
Pilou
da975387ac Merge pull request #1175 from nhost/contributors-readme-action-AN1AN0O3NW
contributors readme action update
2022-11-22 10:42:46 +01:00
github-actions[bot]
e46c77e409 contrib-readme-action has updated readme 2022-11-22 09:41:42 +00:00
Szilárd Dóró
6c642d86f3 Merge pull request #1174 from nhost/fix/dashboard-codegen
fix(dashboard): remove functions folder reference from codegen config
2022-11-22 10:41:30 +01:00
Pierre-Louis Mercereau
46a77f1ce5 chore: change nextjs 13 patch version 2022-11-22 10:37:53 +01:00
Szilárd Dóró
6053560b5a fix(dashboard): remove functions folder reference from codegen config 2022-11-22 10:26:57 +01:00
Szilárd Dóró
89bd37bc28 chore(dashboard): add changeset 2022-11-22 10:20:52 +01:00
Szilárd Dóró
0df73a41c9 fix(dashboard): redirect URL opacity 2022-11-22 10:20:09 +01:00
Pierre-Louis Mercereau
322ab50138 Merge branch 'main' into refactor/merge-core 2022-11-22 09:52:45 +01:00
Pierre-Louis Mercereau
53bdc294e2 chore: nextjs 13 2022-11-22 09:40:52 +01:00
Pierre-Louis Mercereau
f6d2042adb chore: add changeset to vue, and correct inline documentation 2022-11-22 09:34:47 +01:00
Pilou
ba83475ced Merge pull request #1162 from nhost/fix/dashboard-fix-oauth-callback
fix(dashboard): correct redirect URL for oauth providers
2022-11-22 09:32:25 +01:00
Pilou
dafc581c08 Merge pull request #1057 from chrisli-03/main
add useFileUpload composable for vue
2022-11-22 09:28:07 +01:00
Pilou
c88b77ef43 Merge pull request #1166 from nhost/ci/bump-codecov-action
ci: bump codecov/codecov-action to v3
2022-11-22 09:25:20 +01:00
Pilou
1470592aac Merge pull request #1168 from nhost/ci/bump-pnpm
chore: bump pnpm version to v7.17.0
2022-11-22 09:25:01 +01:00
Szilárd Dóró
4e9a560346 chore(dashboard): update changeset 2022-11-22 09:23:59 +01:00
Szilárd Dóró
766cb61243 chore(dashboard): add changeset 2022-11-22 09:22:43 +01:00
Pilou
7a9370abb2 Merge pull request #1165 from nhost/contributors-readme-action-7MgU1b_FLK
contributors readme action update
2022-11-22 09:19:18 +01:00
Pilou
73368c87a2 Merge pull request #1167 from nhost/contributors-readme-action-QJVpJRh9Hj
contributors readme action update
2022-11-22 09:15:46 +01:00
github-actions[bot]
ef20f1f504 contrib-readme-action has updated readme 2022-11-22 08:13:00 +00:00
Pierre-Louis Mercereau
616a71fc89 chore: bump pnpm version to v7.17.0 2022-11-22 09:12:55 +01:00
Szilárd Dóró
9477e11d4c Merge pull request #1161 from nhost/changeset-release/main
chore: update versions
2022-11-22 09:12:45 +01:00
Pierre-Louis Mercereau
3c0adb4922 ci: bump codecov/codecov-action to v3 2022-11-22 09:01:47 +01:00
github-actions[bot]
c1bfc16ec2 contrib-readme-action has updated readme 2022-11-22 06:59:16 +00:00
Johan Eliasson
1fe86f770c Merge pull request #1164 from alexander-mart/patch-1
Vue docs fix: «client» → «nhost»
2022-11-22 07:59:02 +01:00
Alexander Mart
d5de56256a fix: client → nhost 2022-11-22 12:19:28 +07:00
Nuno Pato
b5e8222b76 Fix redirect url for oauth providers 2022-11-21 23:50:25 -01:00
Pilou
7f15375a9a Merge pull request #1157 from nhost/fix/same-site-cookie
fix: 🐛 Set same-site cookie to `lax`
2022-11-21 23:17:44 +01:00
github-actions[bot]
ffd8660bcc chore: update versions 2022-11-21 19:32:34 +00:00
Szilárd Dóró
9159cf46b1 Merge pull request #1159 from nhost/feat/dashboard-feature-migration 2022-11-21 20:29:54 +01:00
Szilárd Dóró
9211743d9c chore(dashboard): add changeset 2022-11-21 17:32:30 +01:00
Szilárd Dóró
cc6aae3fba chore(ci): do not lint dashboard when linting packages 2022-11-21 17:30:53 +01:00
Szilárd Dóró
a9fbe8e0fc fix(dashboard): linter errors
chore(dashboard): bump dependency versions
2022-11-21 17:28:27 +01:00
Szilárd Dóró
40cbeac221 chore(dashboard): generate pnpm-lock, migrate bugfixes 2022-11-21 17:17:27 +01:00
Szilárd Dóró
df8e31305d feat(dashboard): migrate Settings page features
- migrate some features from the old repo to `nhost/nhost`
2022-11-21 17:01:48 +01:00
Pilou
90af9f2224 Merge pull request #1147 from nhost/ci/optimisation
ci: fine-tune the dashboard release
2022-11-21 16:47:00 +01:00
Szilárd Dóró
037fbdf37a chore(actions): fix workflow names 2022-11-21 16:32:49 +01:00
Pierre-Louis Mercereau
843087cb11 fix: 🐛 make useUserRoles reactive 2022-11-21 15:58:55 +01:00
Pierre-Louis Mercereau
435efd2bc5 fix: 🐛 Set same-site cookie to lax 2022-11-21 15:22:05 +01:00
Pierre-Louis Mercereau
f2aaff0504 fix: 🐛 Set same-site cookie to lax 2022-11-21 15:17:47 +01:00
Pierre-Louis Mercereau
ee2f53a052 Merge branch 'main' into ci/optimisation 2022-11-21 13:34:50 +01:00
Pilou
8f5255172e Merge pull request #1156 from nhost/chore/dashboard-ci
chore(dashboard): parallelize build, tests and lint
2022-11-21 13:31:31 +01:00
Szilárd Dóró
c9de90e027 chore(dashboard): parallelize build, tests and lint 2022-11-21 13:23:58 +01:00
Pierre-Louis Mercereau
3341632f23 Merge branch 'ci/optimisation' of https://github.com/nhost/nhost into ci/optimisation 2022-11-21 13:08:03 +01:00
Pierre-Louis Mercereau
e005a67ab4 ci: enable turborepo everywhere 2022-11-21 13:07:19 +01:00
Pilou
1f4bbf75e0 Update .github/workflows/changesets.yaml
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-11-21 09:02:30 +01:00
Pilou
e5934d5dfd Update .github/workflows/changesets.yaml
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-11-21 09:02:18 +01:00
Pilou
8b368ba2e8 Merge pull request #1149 from nhost/remove-crm-example
Remove crm example
2022-11-20 11:26:44 +01:00
Johan Eliasson
16017fb8d2 remove crm example 2022-11-20 09:34:09 +01:00
Pierre-Louis Mercereau
effc0aba52 ci: tag inside the release job 2022-11-19 21:02:16 +01:00
Pierre-Louis Mercereau
45a81ca823 chore: add version dependency to publish to use needs.version 2022-11-19 19:32:09 +01:00
Pierre-Louis Mercereau
377e8f8c37 ci: github release 2022-11-19 19:29:21 +01:00
Pierre-Louis Mercereau
977d58a938 ci: fine-tune the dashboard release 2022-11-19 19:25:15 +01:00
Szilárd Dóró
eb7a14cedb Merge pull request #1146 from nhost/changeset-release/main
chore: update versions
2022-11-18 16:42:24 +01:00
github-actions[bot]
5a64bdf30a chore: update versions 2022-11-18 15:27:02 +00:00
Szilárd Dóró
7acf96d65f Merge pull request #1145 from nhost/fix/dashboard-backend-url
fix(dashboard): avoid using `BACKEND_URL` locally
2022-11-18 16:25:28 +01:00
Pilou
57726864fd Merge pull request #1144 from nhost/ci/fix-dashboard-version
ci: fix version
2022-11-18 16:19:07 +01:00
Szilárd Dóró
73da6a67f1 chore(dashboard): add changeset 2022-11-18 15:52:45 +01:00
Szilárd Dóró
48964b82e0 fix(dashboard): avoid using BACKEND_URL locally 2022-11-18 15:51:31 +01:00
Pierre-Louis Mercereau
9d2fdbadc8 ci: remove env cmd 2022-11-18 15:35:13 +01:00
Pierre-Louis Mercereau
6bd874b485 ci: correct env 2022-11-18 15:19:07 +01:00
Pierre-Louis Mercereau
4b36670897 ci: config turborepo 2022-11-18 15:10:50 +01:00
Pierre-Louis Mercereau
947696efc6 ci: fix version 2022-11-18 14:52:01 +01:00
Pilou
a3168a1dae Merge pull request #1143 from nhost/ci/turbo-cache
ci: fix typo
2022-11-18 14:48:52 +01:00
Pierre-Louis Mercereau
29efea2ad8 ci: fix typo 2022-11-18 14:44:05 +01:00
Pilou
390688feb1 Merge pull request #1142 from nhost/ci/turbo-cache
ci: use turborepo cache when building images
2022-11-18 13:48:29 +01:00
Pierre-Louis Mercereau
20e19ec7db ci: use turborepo cache when building images 2022-11-18 13:27:59 +01:00
Szilárd Dóró
b0c58ff351 Merge pull request #1141 from nhost/changeset-release/main
chore: update versions
2022-11-18 12:18:40 +01:00
github-actions[bot]
7b7cc74948 chore: update versions 2022-11-18 11:17:45 +00:00
Szilárd Dóró
1f501c829c Merge pull request #1123 from nhost/dashboard-docker
Dashboard Docker
2022-11-18 12:15:05 +01:00
Szilárd Dóró
8f9993d8ed chore(dashboard): bump graphiql, fix React warning 2022-11-18 10:31:27 +01:00
Pilou
f53b1f5c13 Merge pull request #1140 from nhost/chore/no-gyp
chore: get rid of node-gyp and its bin dependencies
2022-11-18 10:10:16 +01:00
Pierre-Louis Mercereau
1b8dcf237a chore: get rid of node-gyp and its bin dependencies 2022-11-18 10:07:22 +01:00
Szilárd Dóró
fc559d9e29 chore(changesets): fix review comments 2022-11-18 09:16:24 +01:00
Szilárd Dóró
fe61dbb6dc fix(changesets): push Docker image 2022-11-18 09:06:01 +01:00
Pilou
8f90569230 Merge pull request #1135 from nhost/docs/inline-webauthn
docs: inline webauthn examples
2022-11-17 21:33:05 +01:00
Szilárd Dóró
5a11ace8f0 chore(changesets): incorporate publishing in changesets 2022-11-17 15:49:58 +01:00
Szilárd Dóró
c569c5f60c fix(dashboard): don't block render because of health check 2022-11-17 15:18:44 +01:00
Johan Eliasson
fbcef432a3 Merge pull request #1134 from nhost/elitan-patch-3
Update storage.mdx
2022-11-17 14:57:30 +01:00
Szilárd Dóró
44ae629f86 fix(publish): correct workflow 2022-11-17 13:14:58 +01:00
Szilárd Dóró
e030856660 fix(changesets): remove publish step 2022-11-17 10:47:23 +01:00
Szilárd Dóró
db118f9769 chore(actions): extract publish to a separate workflow 2022-11-17 10:35:29 +01:00
Szilárd Dóró
8a48a897a7 feat(changesets): add Docker publish step 2022-11-17 09:41:13 +01:00
Szilárd Dóró
dce91ec7d8 fix(dashboard): correct client for local development 2022-11-17 09:31:47 +01:00
Pierre-Louis Mercereau
0a3383d6c5 chore: typo 2022-11-17 08:14:22 +01:00
Pierre-Louis Mercereau
97b5310c5d docs: inline webauthn examples 2022-11-17 08:10:48 +01:00
Johan Eliasson
5c8c79444a Update storage.mdx 2022-11-16 23:35:08 +01:00
Johan Eliasson
eb3041341d Merge pull request #1115 from nhost/docs-updates-8yg9hjasd
Docs updates
2022-11-16 23:29:16 +01:00
Szilárd Dóró
f57f237e37 chore(dashboard): create changelog 2022-11-16 16:44:54 +01:00
Szilárd Dóró
b1e90e6e2b Merge branch 'main' into dashboard-docker 2022-11-16 16:21:20 +01:00
Szilárd Dóró
1c947b2995 chore(dashboard): add missing env vars to Dockerfile 2022-11-16 12:42:36 +01:00
Szilárd Dóró
5501a5937e fix(docgen): complex types in markdown tables 2022-11-16 12:27:24 +01:00
Johan Eliasson
d00f6ed84e Update docs/docs/platform/multiple-environments.mdx
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-11-16 12:22:34 +01:00
Johan Eliasson
4c88846d72 Update docs/docs/reference/cli/init.mdx
Co-authored-by: Pilou <24897252+plmercereau@users.noreply.github.com>
2022-11-16 12:21:21 +01:00
Pierre-Louis Mercereau
80a6808a82 Merge branch 'main' into refactor/merge-core 2022-11-16 10:26:11 +01:00
Johan Eliasson
97dc689d79 redirect update 2022-11-16 08:32:01 +01:00
Johan Eliasson
311417d679 typo 2022-11-16 08:27:07 +01:00
Johan Eliasson
ce0e1ee7ae redirect update 2022-11-16 08:24:04 +01:00
Johan Eliasson
1cc6841107 redirect update 2022-11-16 08:19:49 +01:00
Johan Eliasson
4b7fff0440 redirect update 2022-11-16 08:16:43 +01:00
Johan Eliasson
47fc7ffc0e testing redirects 2022-11-16 08:05:26 +01:00
Szilárd Dóró
7c5d0d0ec6 fix(dashboard): copy public folder 2022-11-15 18:02:59 +01:00
Szilárd Dóró
4d9c48f524 chore(dashboard): move Dockerfile, update commands 2022-11-15 15:17:19 +01:00
Pierre-Louis Mercereau
987bd70312 Merge branch 'main' into refactor/merge-core 2022-11-15 14:14:58 +01:00
Szilárd Dóró
842e9892c0 chore(dashboard): update Dockerfile 2022-11-15 12:05:18 +01:00
Johan Eliasson
37fee16552 Merge branch 'main' into docs-updates-8yg9hjasd 2022-11-15 10:58:20 +01:00
Pierre-Louis Mercereau
feb22e62c1 fix: add missing oauth provider: azuread 2022-11-14 23:48:45 +01:00
Pierre-Louis Mercereau
e7d4c77a6d refactor: 💡 restructure hasura-auth-js after the core merger 2022-11-14 23:20:49 +01:00
Pierre-Louis Mercereau
628e32464d Merge branch 'main' into refactor/merge-core 2022-11-14 21:45:05 +01:00
Johan Eliasson
d056fb4dbd Merge branch 'main' into docs-updates-8yg9hjasd 2022-11-14 11:25:36 +01:00
Johan Eliasson
ed6d9e8a85 Dashboard Docker 2022-11-14 11:11:46 +01:00
Johan Eliasson
7840201e91 cli ref updates 2022-11-14 10:21:40 +01:00
Johan Eliasson
af8891686b updates 2022-11-14 10:11:46 +01:00
Johan Eliasson
13efafb000 multiple environments first draft 2022-11-12 10:01:46 +01:00
Johan Eliasson
719a3ddcf9 crazy update 2022-11-11 22:38:22 +01:00
Johan Eliasson
d11980f078 update 2022-11-11 11:16:26 +01:00
Johan Eliasson
bfbe8733f6 updates 2022-11-11 10:01:02 +01:00
Pierre-Louis Mercereau
dc82043254 chore: only include the auth client typedoc 2022-11-09 22:13:20 +01:00
Pierre-Louis Mercereau
997e9d58a8 refactor: 💡 remove @nhost/core 2022-11-09 22:09:17 +01:00
Pierre-Louis Mercereau
8a3f1706fe chore: add auth as a dependency to storage 2022-11-09 22:01:11 +01:00
Pierre-Louis Mercereau
12cbe4d534 chore: lint 2022-11-09 21:52:15 +01:00
Pierre-Louis Mercereau
9f21931201 refactor: copy tests from core 2022-11-09 21:46:32 +01:00
Pierre-Louis Mercereau
09351e1910 Merge branch 'main' into refactor/merge-core 2022-11-09 20:49:33 +01:00
Pierre-Louis Mercereau
1c2ea5a407 refactor: 💡 merge @nhost/core 2022-11-09 20:49:13 +01:00
Erik Magnusson
7055ffc37a Merge branch 'feat/add-charges-to-stripe-package' of https://github.com/ejkkan/nhost into feat/add-charges-to-stripe-package 2022-10-20 20:57:56 +02:00
Erik Magnusson
c68ce6d480 removed isAdmin checks for connected accounts related schema fields 2022-10-20 20:57:01 +02:00
Chris
412b1fa8c6 add useFileUpload composable for vue 2022-10-19 21:30:29 -04:00
Erik Magnusson
98a149c8bf Update packages/stripe-graphql-js/src/schema/charge.ts
Co-authored-by: Johan Eliasson <johan@eliasson.me>
2022-10-18 08:48:58 +02:00
Erik Magnusson
ceb558975e Update packages/stripe-graphql-js/src/schema/charge.ts
Co-authored-by: Johan Eliasson <johan@eliasson.me>
2022-10-18 08:48:46 +02:00
Erik Magnusson
7a87321a7e fixd imports and linting 2022-10-14 21:21:25 +02:00
Erik Magnusson
9349766c0a corrected spelling 2022-10-14 21:19:23 +02:00
Erik Magnusson
31655191a3 added connected accounts 2022-10-14 21:05:57 +02:00
Erik Magnusson
e3b91efa84 feat/added charges 2022-10-14 20:13:35 +02:00
Erik Magnusson
cfe736776a feat/added charges 2022-10-14 20:03:19 +02:00
Erik Magnusson
481bf237cc updated naming convention to camel casing 2022-10-14 10:11:02 +02:00
Erik Magnusson
33ce9bf1b9 added payment intents type for customer and invoice objects 2022-10-04 18:10:02 +02:00
1377 changed files with 37777 additions and 32652 deletions

View File

@@ -7,4 +7,4 @@
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
}

9
.dockerignore Normal file
View File

@@ -0,0 +1,9 @@
**/node_modules
**/npm-debug.log
**/out
**/dist
**/umd
**/.turbo
**/.nhost
**/coverage
**/.next

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,11 +1,20 @@
name: Install Node and package dependencies
description: 'Install Node dependencies with pnpm'
inputs:
TURBO_TOKEN:
description: 'Turborepo token'
TURBO_TEAM:
description: 'Turborepo team'
BUILD:
description: 'Build packages'
default: 'default'
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2.2.4
with:
version: 7.9.1
version: 7.17.0
run_install: false
- name: Get pnpm cache directory
id: pnpm-cache-dir
@@ -30,4 +39,15 @@ runs:
# * They are reused through the Turborepo cache
- shell: bash
name: Build packages
if: ${{ inputs.BUILD == 'all' }}
run: pnpm build:all
env:
TURBO_TOKEN: ${{ inputs.TURBO_TOKEN }}
TURBO_TEAM: ${{ inputs.TURBO_TEAM }}
- shell: bash
name: Build everything in the monorepo
if: ${{ inputs.BUILD == 'default' }}
run: pnpm build
env:
TURBO_TOKEN: ${{ inputs.TURBO_TOKEN }}
TURBO_TEAM: ${{ inputs.TURBO_TEAM }}

108
.github/actions/nhost-cli/README.md vendored Normal file
View File

@@ -0,0 +1,108 @@
# Nhost CLI GitHub Action
## Usage
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI
uses: ./.github/actions/nhost-cli
```
### Install the CLI and start the app
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nhost CLI and start the application
uses: ./.github/actions/nhost-cli
with:
start: true
```
### Set another working directory
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nhost CLI
uses: ./.github/actions/nhost-cli
with:
path: examples/react-apollo
start: true
```
### Don't wait for the app to be ready
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nhost CLI and start app
uses: ./.github/actions/nhost-cli
with:
start: true
wait: false
```
### Stop the app
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Start app
uses: ./.github/actions/nhost-cli
with:
start: true
- name: Do something
cmd: echo "do something"
- name: Stop
uses: ./.github/actions/nhost-cli
with:
stop: true
```
### Install a given value of the CLI
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nhost CLI
uses: ./.github/actions/nhost-cli
with:
version: v0.8.10
```
### Inject values into nhost/config.yaml
```yaml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nhost CLI
uses: ./.github/actions/nhost-cli
with:
config: |
services:
auth:
image: nhost/hasura-auth:0.16.1
```

78
.github/actions/nhost-cli/action.yaml vendored Normal file
View File

@@ -0,0 +1,78 @@
name: Nhost CLI
description: 'Action to install the Nhost CLI and to run an application'
inputs:
start:
description: "Start the application. If false, the application won't be started"
default: 'false'
wait:
description: 'If starting the application, wait until it is ready'
default: 'true'
stop:
description: 'Stop the application'
default: 'false'
path:
description: 'Path to the application'
default: '.'
version:
description: 'Version of the Nhost CLI'
default: 'latest'
config:
description: 'Values to be injected into nhost/config.yaml'
runs:
using: 'composite'
steps:
- name: Check if Nhost CLI is already installed
id: check-nhost-cli
shell: bash
# TODO check if the version is the same
run: |
if [ -z "$(which nhost)" ]
then
echo "installed=false" >> $GITHUB_OUTPUT
else
echo "installed=true" >> $GITHUB_OUTPUT
fi
- name: Install Nhost CLI
if: ${{ steps.check-nhost-cli.outputs.installed == 'false' }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 10
command: bash <(curl --silent -L https://raw.githubusercontent.com/nhost/cli/main/get.sh) ${{ inputs.version }}
- name: Set custom configuration
if: ${{ inputs.config }}
shell: bash
working-directory: ${{ inputs.path }}
run: config="${{ inputs.config }}" yq -i '. *= env(config)' nhost/config.yaml
- name: Start the application
if: ${{ inputs.start == 'true' }}
shell: bash
working-directory: ${{ inputs.path }}
run: nhost dev --no-browser &
- name: Wait for the app to be ready
id: wait
if: ${{ inputs.start == 'true' && inputs.wait == 'true' }}
shell: bash
working-directory: ${{ inputs.path }}
continue-on-error: true
run: |
curl -sSf --connect-timeout 3 \
--max-time 5 \
--retry 300 \
--retry-delay 1 \
--retry-max-time 300 \
--retry-connrefused \
'http://localhost:9695' > /dev/null
- name: Log on failure
if: steps.wait.outcome == 'failure'
shell: bash
working-directory: ${{ inputs.path }}
run: |
nhost logs
exit 1
- name: Stop the application
if: ${{ inputs.stop == 'true' }}
shell: bash
working-directory: ${{ inputs.path }}
run: nhost down

25
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
dashboard:
- dashboard/**/*
documentation:
- any:
- docs/**/*
- '!docs/docs/reference/docgen/**/*'
examples:
- examples/**/*
sdk:
- packages/**/*
integrations:
- integrations/**/*
react:
- '{packages,examples,integrations}/*react*/**/*'
nextjs:
- '{packages,examples}/*next*/**/*'
vue:
- '{packages,examples,integrations}/*vue*/**/*'

23
.github/renovate.json vendored Normal file
View File

@@ -0,0 +1,23 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"docker-compose": {
"enabled": true
},
"ignoreDeps": [
"pnpm",
"node",
"@types/node"
],
"labels": [
"dependencies"
],
"enabledManagers": [
"npm",
"dockerfile",
"docker-compose",
"github-actions"
]
}

View File

@@ -5,26 +5,34 @@ on:
branches: [main]
paths-ignore:
- 'docs/**'
- 'dashboard/**'
- 'examples/**'
- 'assets/**'
- '**.md'
- '!.changeset/**'
- 'LICENSE'
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
DASHBOARD_PACKAGE: '@nhost/dashboard'
jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
dashboardVersion: ${{ steps.dashboard.outputs.dashboardVersion }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
# * Install Node and dependencies
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
- name: Create PR or Publish release
id: changesets
uses: changesets/action@v1
@@ -36,3 +44,137 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check Dashboard tag
id: dashboard
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
DASHBOARD_VERSION=$(jq -r .version dashboard/package.json)
GIT_TAG="${{ env.DASHBOARD_PACKAGE}}@$DASHBOARD_VERSION"
if [ -z "$(git tag -l | grep $GIT_TAG)" ]; then
echo "dashboardVersion=$DASHBOARD_VERSION" >> $GITHUB_OUTPUT
fi
test:
needs: version
name: Dashboard
if: needs.version.outputs.dashboardVersion != ''
uses: ./.github/workflows/dashboard.yaml
secrets: inherit
publish-docker:
name: Publish to Docker Hub
runs-on: ubuntu-latest
needs:
- test
- version
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add git tag
run: |
git tag "${{ env.DASHBOARD_PACKAGE }}@${{ needs.version.outputs.dashboardVersion }}"
git push origin --tags
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
nhost/dashboard
tags: |
type=raw,value=latest,enable=true
type=semver,pattern={{version}},value=v${{ needs.version.outputs.dashboardVersion }}
type=semver,pattern={{major}}.{{minor}},value=v${{ needs.version.outputs.dashboardVersion }}
type=semver,pattern={{major}},value=v${{ needs.version.outputs.dashboardVersion }}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v3
timeout-minutes: 60
with:
context: .
file: ./dashboard/Dockerfile
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
TURBO_TOKEN=${{ env.TURBO_TOKEN }}
TURBO_TEAM=${{ env.TURBO_TEAM }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
- name: Create GitHub Release
uses: taiki-e/create-gh-release-action@v1
with:
changelog: dashboard/CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
prefix: ${{ env.DASHBOARD_PACKAGE }}@
ref: refs/tags/${{ env.DASHBOARD_PACKAGE }}@${{ needs.version.outputs.dashboardVersion }}
- name: Remove tag on failure
if: failure()
run: git push --delete origin ${{ env.DASHBOARD_PACKAGE }}@${{ needs.version.outputs.dashboardVersion }}
publish-vercel:
name: Publish to Vercel
runs-on: ubuntu-latest
needs:
- publish-docker
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
- name: Setup Vercel CLI
run: pnpm add -g vercel
- name: Trigger a Vercel deployment
env:
VERCEL_ORG_ID: ${{ secrets.DASHBOARD_VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.DASHBOARD_VERCEL_PROJECT_ID }}
run: |
vercel pull --environment=production --token=${{ secrets.DASHBOARD_VERCEL_DEPLOY_TOKEN }}
vercel build --prod --token=${{ secrets.DASHBOARD_VERCEL_DEPLOY_TOKEN }}
vercel deploy --prebuilt --prod --token=${{ secrets.DASHBOARD_VERCEL_DEPLOY_TOKEN }}
bump-cli:
name: Bump Dashboard version in the Nhost CLI
runs-on: ubuntu-latest
needs:
- version
- publish-docker
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: nhost/cli
token: ${{ secrets.GH_PAT }}
fetch-depth: 0
- name: Bump version in source code
run: |
IMAGE=$(echo ${{ env.DASHBOARD_PACKAGE }} | sed 's/@\(.\+\)\/\(.\+\)/\1\\\/\2/g')
VERSION="${{ needs.version.outputs.dashboardVersion }}"
EXPRESSION='s/"'$IMAGE':[0-9]\+\.[0-9]\+\.[0-9]\+"/"'$IMAGE':'$VERSION'"/g'
find ./ -type f -exec sed -i -e $EXPRESSION {} \;
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_PAT }}
commit-message: 'chore: bump nhost/dashboard to ${{ needs.version.outputs.dashboardVersion }}'
branch: bump-dashboard-version
delete-branch: true
title: 'chore: bump nhost/dashboard to ${{ needs.version.outputs.dashboardVersion }}'
body: |
This PR bumps the Nhost Dashboard Docker image to version ${{ needs.version.outputs.dashboardVersion }}.

View File

@@ -1,11 +1,9 @@
name: Tests
name: Continuous Integration
on:
push:
branches: [main]
paths-ignore:
- 'dashboard/**'
- 'docs/**'
- 'assets/**'
- '**.md'
- 'LICENSE'
@@ -13,15 +11,16 @@ on:
branches: [main]
types: [opened, synchronize]
paths-ignore:
- 'dashboard/**'
- 'docs/**'
- 'assets/**'
- '**.md'
- 'LICENSE'
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
NEXT_PUBLIC_ENV: dev
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_NHOST_BACKEND_URL: http://localhost:1337
jobs:
build:
name: Build @nhost packages
@@ -33,21 +32,37 @@ jobs:
# * Install Node and dependencies. Package downloads will be cached for the next jobs.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
BUILD: 'all'
- name: Check if the pnpm lockfile changed
id: changed-lockfile
uses: tj-actions/changed-files@v35
with:
files: pnpm-lock.yaml
# * Determine a pnpm filter argument for packages that have been modified.
# * If the lockfile has changed, we don't filter anything in order to run all the e2e tests.
- name: filter packages
id: filter-packages
if: steps.changed-lockfile.outputs.any_changed != 'true' && github.event_name == 'pull_request'
run: echo "filter=${{ format('--filter=...[origin/{0}]', github.base_ref) }}" >> $GITHUB_OUTPUT
# * List packagesthat has an `e2e` script, except the root, and return an array of their name and path
# * In a PR, only include packages that have been modified, and their dependencies
- name: List examples with an e2e script
id: set-matrix
run: |
FILTER_MODIFIED="${{ github.event_name == 'pull_request' && format('--filter=...[origin/{0}]', github.base_ref) || '' }}"
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' $FILTER_MODIFIED \
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' ${{ steps.filter-packages.outputs.filter }} \
| xargs -I@ realpath --relative-to=$PWD @ \
| xargs -I@ jq "if (.scripts.e2e | length) != 0 then {name: .name, path: \"@\"} else null end" @/package.json \
| awk "!/null/" \
| jq -c --slurp)
echo "matrix=$PACKAGES" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
e2e:
name: 'e2e: ${{ matrix.package.name }}'
name: 'e2e (${{ matrix.package.path }})'
needs: build
if: ${{ needs.build.outputs.matrix != '[]' && needs.build.outputs.matrix != '' }}
strategy:
@@ -61,10 +76,13 @@ jobs:
# * Install Node and dependencies. Package dependencies won't be downloaded again as they have been cached by the `build` job.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
# * Install Nhost CLI if a `nhost/config.yaml` file is found
- name: Install Nhost CLI
if: hashFiles(format('{0}/nhost/config.yaml', matrix.package.path)) != ''
run: curl -L https://raw.githubusercontent.com/nhost/cli/main/get.sh | bash
uses: ./.github/actions/nhost-cli
# * Run the `ci` script of the current package of the matrix. Dependencies build is cached by Turborepo
- name: Run e2e test
run: pnpm --filter="${{ matrix.package.name }}" run e2e
@@ -83,6 +101,7 @@ jobs:
path: |
${{format('{0}/cypress/screenshots/**', matrix.package.path)}}
${{format('{0}/cypress/videos/**', matrix.package.path)}}
unit:
name: Unit tests
needs: build
@@ -92,11 +111,14 @@ jobs:
# * Install Node and dependencies. Package dependencies won't be downloaded again as they have been cached by the `build` job.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
# * Run every `test` script in the workspace . Dependencies build is cached by Turborepo
- name: Run unit tests
run: pnpm run test
run: pnpm run test:all
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: '**/coverage/coverage-final.json'
name: codecov-umbrella
@@ -104,6 +126,7 @@ jobs:
run: |
echo '### Code coverage' >> $GITHUB_STEP_SUMMARY
echo 'Visit [codecov](https://app.codecov.io/gh/nhost/nhost/) to see the code coverage reports' >> $GITHUB_STEP_SUMMARY
lint:
name: Lint
needs: build
@@ -113,6 +136,9 @@ jobs:
# * Install Node and dependencies. Package dependencies won't be downloaded again as they have been cached by the `build` job.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
# * Run every `lint` script in the workspace . Dependencies build is cached by Turborepo
- name: Lint
run: pnpm run lint
run: pnpm run lint:all

View File

@@ -1,15 +0,0 @@
name: Add contributors
on:
push:
branches:
- main
jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,73 +1,49 @@
name: 'Dashboard'
on:
push:
branches: [main]
paths:
- 'dashboard/**'
pull_request:
branches: [main]
types: [opened, synchronize]
paths:
- 'dashboard/**'
workflow_call:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
NEXT_PUBLIC_ENV: dev
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_NHOST_BACKEND_URL: http://localhost:1337
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_ENV: dev
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_NHOST_BACKEND_URL: http://localhost:1337
steps:
- uses: actions/checkout@v3
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
- name: Build the application
run: pnpm build:dashboard
- uses: actions/cache@v3.0.11
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
tests:
name: Tests
runs-on: ubuntu-latest
needs: build
env:
NEXT_PUBLIC_ENV: dev
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_NHOST_BACKEND_URL: http://localhost:1337
steps:
- uses: actions/checkout@v3
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
- uses: actions/cache@v3.0.11
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
- name: Run tests
run: pnpm test:dashboard
lint:
name: Lint
runs-on: ubuntu-latest
needs: build
env:
NEXT_PUBLIC_ENV: dev
NEXT_TELEMETRY_DISABLED: 1
NEXT_PUBLIC_NHOST_BACKEND_URL: http://localhost:1337
steps:
- uses: actions/checkout@v3
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
- uses: actions/cache@v3.0.11
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
- run: pnpm lint:dashboard

15
.github/workflows/labeler.yaml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: 'Pull Request Labeler'
on:
- pull_request_target
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GH_PAT }}'
sync-labels: ''

89
.github/workflows/renovate.yaml vendored Normal file
View File

@@ -0,0 +1,89 @@
name: Renovate
on:
pull_request:
branches: [main]
types: [closed]
paths-ignore:
- 'assets/**'
- '**.md'
- 'LICENSE'
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
jobs:
renovate-changeset:
name: Add changeset
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'renovate/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
# * Install Node and dependencies. Package downloads will be cached for the next jobs.
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
with:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
BUILD: 'none'
- name: Determine bumps
id: bumps
run: |
LAST_NON_PR_SHA=$(git log --no-merges main origin/${{ github.head_ref }} --format=format:%h -- | head -2 | tail -1)
echo "result<<EOF" >> $GITHUB_OUTPUT
pnpm recursive list --depth -1 --parseable \
--filter='!nhost-root' \
--filter=[$LAST_NON_PR_SHA] \
| xargs -I@ jq ".name" @/package.json \
| sort \
| uniq -u \
| awk '$0=$0": patch"' \
>> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Install dictionary
if: steps.bumps.outputs.result != ''
run: sudo apt-get install wbritish
- name: Generate changeset file name
id: file_name
if: steps.bumps.outputs.result != ''
run: |
FILE_NAME=$(shuf -n 3 /usr/share/dict/words | tr '\n' '-' | sed 's/-$//' | sed 's/'"'"'s//g' | tr '[:upper:]' '[:lower:]')
echo "result=./.changeset/${FILE_NAME}.md" >> $GITHUB_OUTPUT
- name: Create changeset file
if: steps.bumps.outputs.result != ''
run: |
cat <<EOF > ${{ steps.file_name.outputs.result }}
---
${{ steps.bumps.outputs.result }}
---
${{ github.event.pull_request.title }}
EOF
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_PAT }}
commit-message: ${{ github.event.pull_request.title }}
branch: renovate-changesets
delete-branch: true
title: 'chore: create changesest from Renovate bumps'
labels: |
dependencies
body: |
This PR creates the changesets from the Renovate dependencies that have been merged to main.
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.GH_PAT }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
- name: Auto approve
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ secrets.GH_PAT }}
number: ${{ steps.cpr.outputs.pull-request-number }}

View File

@@ -0,0 +1,104 @@
name: Test Nhost CLI action
on:
pull_request:
branches: [main]
types: [opened, synchronize]
paths:
- '.github/actions/nhost-cli/**'
- '!.github/actions/nhost-cli/**/*.md'
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI
uses: ./.github/actions/nhost-cli
- name: should succeed running the nhost command
run: nhost
start:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI and start the application
uses: ./.github/actions/nhost-cli
with:
path: packages/nhost-js
start: true
- name: should be running
run: curl -sSf 'http://localhost:9695' > /dev/null
stop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI, start and stop the application
uses: ./.github/actions/nhost-cli
with:
path: packages/nhost-js
start: true
stop: true
- name: should have no live docker container
run: |
if [ -z "docker ps -q" ]; then
echo "Some docker containers are still running"
docker ps
exit 1
fi
wait:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI and start the application
uses: ./.github/actions/nhost-cli
with:
path: packages/nhost-js
start: true
wait: false
- name: should not be ready
run: curl -sSf -o /dev/null 'http://localhost:9695' > /dev/null && exit 1 || true
- name: should eventually be ready
run: |
curl -sSf --connect-timeout 3 \
--max-time 5 \
--retry 300 \
--retry-delay 1 \
--retry-max-time 300 \
--retry-connrefused \
'http://localhost:9695' > /dev/null
config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI and run the application
uses: ./.github/actions/nhost-cli
with:
path: packages/nhost-js
start: true
config: |
services:
auth:
image: nhost/hasura-auth:0.15.0
- name: should find the injected hasura-auth version
run: |
VERSION=$(curl -sSf 'http://localhost:1337/v1/auth/version')
EXPECTED_VERSION='{"version":"v0.15.0"}'
if [ "$VERSION" != "$EXPECTED_VERSION" ]; then
echo "Expected version $EXPECTED_VERSION but got $VERSION"
exit 1
fi
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI
uses: ./.github/actions/nhost-cli
with:
version: v0.8.10
- name: should find the correct version
run: nhost version | head -n 1 | grep v0.8.10 || exit 1

4
.gitignore vendored
View File

@@ -48,6 +48,10 @@ todo.md
.netlify
.monorepo-example
# Local Vercel folder
.vercel
# Next.js build output
.next
# TypeDoc output

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
prefer-workspace-packages = true

View File

@@ -14,4 +14,5 @@ package.json
tsconfig.json
tsconfig.*.json
*.d.ts
.next
.next
**/pnpm-lock.yaml

View File

@@ -1,5 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
},
"eslint.workingDirectories": ["./dashboard"]
}

View File

@@ -2,6 +2,8 @@
## Requirements
- This repository works with **Node 16**
- We use [pnpm](https://pnpm.io/) as a package manager to speed up development and builds, and as a basis for our monorepo. You need to make sure it's installed on your machine. There are [several ways to install it](https://pnpm.io/installation), but the easiest way is with `npm`:
```sh
@@ -97,6 +99,7 @@ You can take a look at the changeset documentation: [How to add a changeset](htt
You'll notice that `git commit` takes a few seconds to run. We set a commit hook that scans the changes in the code, automatically generates documentation from the inline [TSDoc](https://tsdoc.org/) annotations, and adds these generated documentation files to the commit. They automatically update the [reference documentation](https://docs.nhost.io/reference).
<!-- ## Good practices
- lint
- prettier

406
README.md
View File

@@ -101,14 +101,17 @@ Nhost is frontend agnostic, which means Nhost works with all frontend frameworks
## Nhost Clients
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/javascript)
- [Dart and Flutter SDK](https://github.com/nhost/nhost-dart)
- [Nhost React](https://docs.nhost.io/reference/react)
- [Nhost Next.js](https://docs.nhost.io/reference/nextjs)
- [Nhost Vue](https://docs.nhost.io/reference/vue)
- [JavaScript/TypeScript](https://docs.nhost.io/reference/javascript)
- [Dart and Flutter](https://github.com/nhost/nhost-dart)
- [React](https://docs.nhost.io/reference/react)
- [Next.js](https://docs.nhost.io/reference/nextjs)
- [Vue](https://docs.nhost.io/reference/vue)
## Integrations
- [Apollo](./integrations/apollo#nhostapollo)
- [React Apollo](./integrations/react-apollo#nhostreact-apollo)
- [React URQL](./integrations/react-urql#nhostreact-urql)
- [Stripe GraphQL API](./integrations/stripe-graphql-js#nhoststripe-graphql-js)
- [Google Translation GraphQL API](./integrations/google-translation#nhostgoogle-translation)
@@ -127,8 +130,8 @@ Also, follow Nhost on [GitHub Discussions](https://github.com/nhost/nhost/discus
This repository, and most of our other open source projects, are licensed under the MIT license.
<a href="https://runacap.com/ross-index/q1-2022/" target="_blank" rel="noopener">
<img style="width: 260px; height: 56px" src="https://runacap.com/wp-content/uploads/2022/06/ROSS_badge_black_Q1_2022.svg" alt="ROSS Index - Fastest Growing Open-Source Startups in Q1 2022 | Runa Capital" width="260" height="56" />
<a href="https://runacap.com/ross-index/" target="_blank" rel="noopener" >
<img style="width: 260px; height: 56px" src="https://runacap.com/wp-content/uploads/2022/06/ROSS_black_edition_badge.svg" alt="ROSS Index - Fastest Growing Open-Source Startups | Runa Capital" width="260" height="56" />
</a>
### How to contribute
@@ -141,387 +144,8 @@ Here are some ways of contributing to making Nhost better:
### Contributors
<!-- readme: contributors -start -->
<table>
<tr>
<td align="center">
<a href="https://github.com/plmercereau">
<img src="https://avatars.githubusercontent.com/u/24897252?v=4" width="100;" alt="plmercereau"/>
<br />
<sub><b>Pilou</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/elitan">
<img src="https://avatars.githubusercontent.com/u/331818?v=4" width="100;" alt="elitan"/>
<br />
<sub><b>Johan Eliasson</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/szilarddoro">
<img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
<br />
<sub><b>Szilárd Dóró</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/nunopato">
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/>
<br />
<sub><b>Nuno Pato</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/gdangelo">
<img src="https://avatars.githubusercontent.com/u/4352286?v=4" width="100;" alt="gdangelo"/>
<br />
<sub><b>Grégory D'Angelo</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/guicurcio">
<img src="https://avatars.githubusercontent.com/u/20285232?v=4" width="100;" alt="guicurcio"/>
<br />
<sub><b>Guido Curcio</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/subatuba21">
<img src="https://avatars.githubusercontent.com/u/34824571?v=4" width="100;" alt="subatuba21"/>
<br />
<sub><b>Subha Das</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/sebagudelo">
<img src="https://avatars.githubusercontent.com/u/43288271?v=4" width="100;" alt="sebagudelo"/>
<br />
<sub><b>Sebagudelo</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mrinalwahal">
<img src="https://avatars.githubusercontent.com/u/9859731?v=4" width="100;" alt="mrinalwahal"/>
<br />
<sub><b>Mrinal Wahal</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/timpratim">
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
<br />
<sub><b>Pratim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/chrtze">
<img src="https://avatars.githubusercontent.com/u/3797215?v=4" width="100;" alt="chrtze"/>
<br />
<sub><b>Christopher Möller</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/GavanWilhite">
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
<br />
<sub><b>Gavan Wilhite</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/FuzzyReason">
<img src="https://avatars.githubusercontent.com/u/62517920?v=4" width="100;" alt="FuzzyReason"/>
<br />
<sub><b>Vadim Smirnov</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ejkkan">
<img src="https://avatars.githubusercontent.com/u/32518962?v=4" width="100;" alt="ejkkan"/>
<br />
<sub><b>Erik Magnusson</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/macmac49">
<img src="https://avatars.githubusercontent.com/u/831190?v=4" width="100;" alt="macmac49"/>
<br />
<sub><b>Macmac49</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/subhendukundu">
<img src="https://avatars.githubusercontent.com/u/20059141?v=4" width="100;" alt="subhendukundu"/>
<br />
<sub><b>Subhendu Kundu</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/heygambo">
<img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/>
<br />
<sub><b>Christian Gambardella</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/dbarrosop">
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
<br />
<sub><b>David Barroso</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/hajek-raven">
<img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/>
<br />
<sub><b>Filip Hájek</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/MelodicCrypter">
<img src="https://avatars.githubusercontent.com/u/18341500?v=4" width="100;" alt="MelodicCrypter"/>
<br />
<sub><b>Hugh Caluscusin</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jerryjappinen">
<img src="https://avatars.githubusercontent.com/u/1101002?v=4" width="100;" alt="jerryjappinen"/>
<br />
<sub><b>Jerry Jäppinen</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mdp18">
<img src="https://avatars.githubusercontent.com/u/11698527?v=4" width="100;" alt="mdp18"/>
<br />
<sub><b>Max</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mustafa-hanif">
<img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/>
<br />
<sub><b>Mustafa Hanif</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/nbourdin">
<img src="https://avatars.githubusercontent.com/u/5602476?v=4" width="100;" alt="nbourdin"/>
<br />
<sub><b>Nicolas Bourdin</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/piromsurang">
<img src="https://avatars.githubusercontent.com/u/17776837?v=4" width="100;" alt="piromsurang"/>
<br />
<sub><b>Piromsurang Rungserichai</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Savinvadim1312">
<img src="https://avatars.githubusercontent.com/u/16936043?v=4" width="100;" alt="Savinvadim1312"/>
<br />
<sub><b>Savin Vadim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Svarto">
<img src="https://avatars.githubusercontent.com/u/24279217?v=4" width="100;" alt="Svarto"/>
<br />
<sub><b>Svarto</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/muttenzer">
<img src="https://avatars.githubusercontent.com/u/49474412?v=4" width="100;" alt="muttenzer"/>
<br />
<sub><b>Muttenzer</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ahmic">
<img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/>
<br />
<sub><b>Amir Ahmic</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/akd-io">
<img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/>
<br />
<sub><b>Anders Kjær Damgaard</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Sonichigo">
<img src="https://avatars.githubusercontent.com/u/53110238?v=4" width="100;" alt="Sonichigo"/>
<br />
<sub><b>Animesh Pathak</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/rustyb">
<img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/>
<br />
<sub><b>Colin Broderick</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/daguitosama">
<img src="https://avatars.githubusercontent.com/u/34744883?v=4" width="100;" alt="daguitosama"/>
<br />
<sub><b>Dago</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/dminkovsky">
<img src="https://avatars.githubusercontent.com/u/218725?v=4" width="100;" alt="dminkovsky"/>
<br />
<sub><b>Dmitry Minkovsky</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/dohomi">
<img src="https://avatars.githubusercontent.com/u/489221?v=4" width="100;" alt="dohomi"/>
<br />
<sub><b>Dominic Garms</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/gaurav1999">
<img src="https://avatars.githubusercontent.com/u/20752142?v=4" width="100;" alt="gaurav1999"/>
<br />
<sub><b>Gaurav Agrawal</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/alveshelio">
<img src="https://avatars.githubusercontent.com/u/8176422?v=4" width="100;" alt="alveshelio"/>
<br />
<sub><b>Helio Alves</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/nkhdo">
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>
<br />
<sub><b>Hoang Do</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/eltociear">
<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/>
<br />
<sub><b>Ikko Ashimine</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jladuval">
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
<br />
<sub><b>Jacob Duval</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/leothorp">
<img src="https://avatars.githubusercontent.com/u/12928449?v=4" width="100;" alt="leothorp"/>
<br />
<sub><b>Leo Thorp</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/LucasBois1">
<img src="https://avatars.githubusercontent.com/u/44686060?v=4" width="100;" alt="LucasBois1"/>
<br />
<sub><b>Lucas Bois</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/MarcelloTheArcane">
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
<br />
<sub><b>Max Reynolds</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/nachoaldamav">
<img src="https://avatars.githubusercontent.com/u/22749943?v=4" width="100;" alt="nachoaldamav"/>
<br />
<sub><b>Nacho Aldama</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ghoshnirmalya">
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
<br />
<sub><b>Nirmalya Ghosh</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/quentin-decre">
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
<br />
<sub><b>Quentin Decré</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/altschuler">
<img src="https://avatars.githubusercontent.com/u/956928?v=4" width="100;" alt="altschuler"/>
<br />
<sub><b>Simon Altschuler</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/atapas">
<img src="https://avatars.githubusercontent.com/u/3633137?v=4" width="100;" alt="atapas"/>
<br />
<sub><b>Tapas Adhikary</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/uulwake">
<img src="https://avatars.githubusercontent.com/u/22399181?v=4" width="100;" alt="uulwake"/>
<br />
<sub><b>Ulrich Wake</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/kwarabei">
<img src="https://avatars.githubusercontent.com/u/102731455?v=4" width="100;" alt="kwarabei"/>
<br />
<sub><b>Vadim</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/TheRedLancer">
<img src="https://avatars.githubusercontent.com/u/58493767?v=4" width="100;" alt="TheRedLancer"/>
<br />
<sub><b>Zach Burnaby</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/komninoschat">
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>
<br />
<sub><b>Komninos</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/meesvandongen">
<img src="https://avatars.githubusercontent.com/u/35409045?v=4" width="100;" alt="meesvandongen"/>
<br />
<sub><b>Meesvandongen</b></sub>
</a>
</td></tr>
</table>
<!-- readme: contributors -end -->
<a href="https://github.com/nhost/nhost/graphs/contributors">
<p align="center">
<img width="720" src="https://contrib.rocks/image?repo=nhost/nhost" alt="A table of avatars from the project's contributors" />
</p>
</a>

View File

@@ -19,9 +19,11 @@ module.exports = {
'*.spec.ts',
'*.spec.tsx',
'tests/**/*.ts',
'tests/**/*.d.ts'
'tests/**/*.d.ts',
'e2e/**/*.ts',
'e2e/**/*.d.ts'
],
plugins: ['@typescript-eslint', 'simple-import-sort', 'cypress'],
plugins: ['@typescript-eslint', 'cypress'],
extends: ['plugin:cypress/recommended'],
parserOptions: {
ecmaVersion: 2020,
@@ -30,31 +32,6 @@ module.exports = {
rules: {
'react/prop-types': 'off',
'no-use-before-define': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)'
],
// Packages
['^\\w'],
// Internal packages.
['^(@|config/)(/*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.s?css$']
]
}
],
'import/no-anonymous-default-export': [
'error',
{

View File

@@ -1,6 +1,4 @@
module.exports = {
'(packages|integrations)/(docgen|hasura-auth-js|hasura-storage-js|nextjs|nhost-js|react|core|vue)/src/**/*.{js,ts,jsx,tsx}':
['pnpm docgen', 'git add docs'],
'(nhost-cloud.yaml|**/nhost/config.yaml)': () => [
'pnpm sync-versions',
"git add ':(glob)**/nhost/config.yaml'"

View File

@@ -28,22 +28,44 @@
"resolveJsonModule": true,
"esModuleInterop": true,
"sourceMap": true,
"types": ["node"],
"types": [
"node"
],
"typeRoots": [
"./node_modules/@types", "**/*/dist", "**/*/build", "**/*/.next", "**/*/umd"
"./node_modules/@types",
"**/*/dist",
"**/*/build",
"**/*/.next",
"**/*/umd"
],
"paths": {
"@nhost/apollo": ["../packages/apollo/src/index.ts"],
"@nhost/core": ["../packages/core/src/index.ts"],
"@nhost/docgen": ["../packages/docgen/src/index.ts"],
"@nhost/hasura-auth-js": ["../packages/hasura-auth-js/src/index.ts"],
"@nhost/hasura-storage-js": ["../packages/hasura-storage-js/src/index.ts"],
"@nhost/nextjs": ["../packages/nextjs/src/index.ts"],
"@nhost/nhost-js": ["../packages/nhost-js/src/index.ts"],
"@nhost/react": ["../packages/react/src/index.ts"],
"@nhost/react-apollo": ["../packages/react-apollo/src/index.ts"],
"@nhost/react-auth": ["../packages/react-auth/src/index.ts"],
"@nhost/vue": ["../packages/vue/src/index.ts"]
"@nhost/apollo": [
"../integrations/apollo/src/index.ts"
],
"@nhost/docgen": [
"../packages/docgen/src/index.ts"
],
"@nhost/hasura-auth-js": [
"../packages/hasura-auth-js/src/index.ts"
],
"@nhost/hasura-storage-js": [
"../packages/hasura-storage-js/src/index.ts"
],
"@nhost/nextjs": [
"../packages/nextjs/src/index.ts"
],
"@nhost/nhost-js": [
"../packages/nhost-js/src/index.ts"
],
"@nhost/react": [
"../packages/react/src/index.ts"
],
"@nhost/react-apollo": [
"../integrations/react-apollo/src/index.ts"
],
"@nhost/vue": [
"../packages/vue/src/index.ts"
]
}
},
"exclude": [

View File

@@ -1,3 +1,4 @@
import replace from '@rollup/plugin-replace'
import fs from 'fs'
import path from 'path'
@@ -18,7 +19,9 @@ export default defineConfig({
tsconfigPaths(),
dts({
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
entryRoot: 'src'
entryRoot: 'src',
// Was defaulting to true until version 1.7
skipDiagnostics: true
})
],
test: {
@@ -41,6 +44,12 @@ export default defineConfig({
},
rollupOptions: {
external: (id) => deps.some((dep) => id.startsWith(dep)),
plugins: [
replace({
preventAssignment: true,
'exports.hasOwnProperty(': 'Object.prototype.hasOwnProperty.call(exports,'
})
],
output: {
globals: {
graphql: 'graphql',

View File

@@ -1,3 +1,4 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ['next', 'airbnb', 'airbnb-typescript', 'airbnb/hooks', 'prettier'],

View File

@@ -6,6 +6,19 @@ module.exports = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-addon-next-router',
{
/**
* Fix Storybook issue with PostCSS@8
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
*/
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
framework: '@storybook/react',
core: {
@@ -26,4 +39,10 @@ module.exports = {
},
};
},
env: (config) => ({
...config,
NEXT_PUBLIC_ENV: 'dev',
NEXT_PUBLIC_NHOST_BACKEND_URL: 'http://localhost:1337',
NEXT_PUBLIC_NHOST_PLATFORM: 'false',
}),
};

View File

@@ -2,9 +2,25 @@ import '@fontsource/inter';
import '@fontsource/inter/500.css';
import '@fontsource/inter/700.css';
import { CssBaseline, ThemeProvider } from '@mui/material';
import { NhostApolloProvider } from '@nhost/react-apollo';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { Buffer } from 'buffer';
import { initialize, mswDecorator } from 'msw-storybook-addon';
import { RouterContext } from 'next/dist/shared/lib/router-context';
import '../src/styles/globals.css';
import defaultTheme from '../src/theme/default';
global.Buffer = Buffer;
initialize({ onUnhandledRequest: 'bypass' });
const queryClient = new QueryClient();
export const parameters = {
nextRouter: {
Provider: RouterContext.Provider,
isReady: true,
},
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
@@ -14,11 +30,25 @@ export const parameters = {
},
};
export const withMuiTheme = (Story) => (
<ThemeProvider theme={defaultTheme}>
<CssBaseline />
<Story />
</ThemeProvider>
);
export const decorators = [withMuiTheme];
export const decorators = [
(Story) => (
<ThemeProvider theme={defaultTheme}>
<CssBaseline />
<Story />
</ThemeProvider>
),
(Story) => (
<QueryClientProvider client={queryClient}>
<Story />
</QueryClientProvider>
),
(Story) => (
<NhostApolloProvider
fetchPolicy="cache-first"
graphqlUrl="http://localhost:1337/v1/graphql"
>
<Story />
</NhostApolloProvider>
),
mswDecorator,
];

258
dashboard/CHANGELOG.md Normal file
View File

@@ -0,0 +1,258 @@
# @nhost/dashboard
## 0.9.5
### Patch Changes
- 200e9f77: chore(deps): update dependency @types/react-dom to v18.0.10
- Updated dependencies [200e9f77]
- @nhost/nextjs@1.13.2
- @nhost/react-apollo@4.13.2
## 0.9.4
### Patch Changes
- dbd3ded5: fix(dashboard): workspaces creation, new form, correct redirects.
## 0.9.3
### Patch Changes
- 85f0f943: fix(dashboard): don't break the table creation process
## 0.9.2
### Patch Changes
- Updated dependencies [d42c27ae]
- Updated dependencies [927be4a2]
- @nhost/nextjs@1.13.1
- @nhost/react-apollo@4.13.1
## 0.9.1
### Patch Changes
- d0f80811: fix(dashboard): don't show error when signing out the user
## 0.9.0
### Minor Changes
- d92891b2: feat(dashboard): add Permission Editor to the Database section
### Patch Changes
- 3d379128: fix(dashboard): create new user
- @nhost/react-apollo@4.13.0
- @nhost/nextjs@1.13.0
## 0.8.1
### Patch Changes
- 7cadd944: fix(dashboard): display Twitter provider settings
## 0.8.0
### Minor Changes
- 9a1aa7bb: add functions to the log dashboard
- f29abe62: feat(dashboard): Users Management v2
### Patch Changes
- 7766624b: feat(dashboard): add JWT secret editor modal
- @nhost/react-apollo@4.12.1
- @nhost/nextjs@1.12.1
## 0.7.13
### Patch Changes
- dd0738d5: fix(dashboard): provisioning status polling
## 0.7.12
### Patch Changes
- b21222b3: chore(deps): update dependency @types/node to v16
- 9e0486a3: fix(dashboard): close modals when navigating
- Updated dependencies [b21222b3]
- Updated dependencies [65687bee]
- Updated dependencies [54df0df4]
- @nhost/nextjs@1.12.0
- @nhost/react-apollo@4.12.0
## 0.7.11
### Patch Changes
- d6527122: fix(dashboard): use correct service URLs
## 0.7.10
### Patch Changes
- Updated dependencies [57db5b83]
- @nhost/nextjs@1.11.0
- @nhost/nhost-js@1.7.0
- @nhost/react@0.17.0
- @nhost/react-apollo@4.11.0
## 0.7.9
### Patch Changes
- a6d31dc2: fix(dashboard): don't break the UI when project is not loaded yet
## 0.7.8
### Patch Changes
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
`NhostReactProvider` and `NhostNextProvider` are now deprecated
- f4d70f88: fix(dashboard): do not break when region is nullish
- 4a9471cc: Windows Live Provider displayed link updated to match backend url
- 594488e4: fix(dashboard): do not show error when submitting Apple provider settings
- Updated dependencies [7f251111]
- @nhost/nextjs@1.10.0
- @nhost/react@0.16.0
- @nhost/react-apollo@4.10.0
## 0.7.7
### Patch Changes
- 80b604ad: fix(dashboard): use correct Hasura slug
## 0.7.6
### Patch Changes
- 2d2beb53: fix(dashboard): prevent error on GraphQL page
- ac8efcbd: chore(dashboard): deprecate old DNS name
## 0.7.5
### Patch Changes
- 132a4f4b: chore(dashboard): remove unused dependencies
- 132a4f4b: chore(deps): synchronize @types/react-dom and @types/react versions
- db57572f: fix(dashboard): correct section paddings when no env vars
- Updated dependencies [132a4f4b]
- @nhost/react@0.15.2
- @nhost/react-apollo@4.9.2
- @nhost/nextjs@1.9.3
## 0.7.4
### Patch Changes
- 34d85e54: chore(deps): update dependency critters to ^0.0.16
- 9b93cf95: chore(deps): update dependency @netlify/functions to ^0.11.0
- e0439030: chore(deps): update dependency @types/react-dom to v18.0.9
- Updated dependencies [82124329]
- @nhost/nextjs@1.9.2
## 0.7.3
### Patch Changes
- a1193da4: fix(dashboard): remove character limit from env var inputs
## 0.7.2
### Patch Changes
- 44f13f62: chore(dashboard): cleanup unused files
## 0.7.1
### Patch Changes
- e01cb2ed: chore(dashboard): change settings sidebar menu item density
## 0.7.0
### Minor Changes
- db342f45: chore(dashboard): refactor Roles and Permissions settings sections
- 8b9fa0b1: feat(dashboard): add Environment Variables page
### Patch Changes
- Updated dependencies [66b4f3d0]
- Updated dependencies [2e6923dc]
- Updated dependencies [ef117c28]
- Updated dependencies [aebb8225]
- @nhost/core@0.9.4
- @nhost/nhost-js@1.6.2
- @nhost/nextjs@1.9.1
- @nhost/react@0.15.1
- @nhost/react-apollo@4.9.1
## 0.6.0
### Minor Changes
- eef9c914: feat(dashboard): add Roles and Permissions page
## 0.5.0
### Minor Changes
- a48dd5bf: feat(dashboard): make backend port configurable
## 0.4.3
### Patch Changes
- 5de965d9: fix(dashboard): alphabetic ordering of providers
- b9087a4a: fix(dashboard): console -> dashboard terminology
- ca012d79: docs(workos): WorkOS Docs
## 0.4.2
### Patch Changes
- 89bd37bc: fix(dashboard): correct redirect URL input opacity
- Updated dependencies [4601d84e]
- Updated dependencies [843087cb]
- @nhost/react@0.15.0
- @nhost/nextjs@1.9.0
- @nhost/react-apollo@4.9.0
## 0.4.1
### Patch Changes
- 766cb612: fix(dashboard): correct redirect URL for oauth providers
- Updated dependencies [53bdc294]
- Updated dependencies [f2aaff05]
- @nhost/nextjs@1.8.3
- @nhost/core@0.9.3
- @nhost/react@0.14.3
- @nhost/nhost-js@1.6.1
- @nhost/react-apollo@4.8.3
## 0.4.0
### Minor Changes
- 9211743d: feat(dashboard): migrate Settings page features
## 0.3.0
### Minor Changes
- 73da6a67: fix(dashboard): avoid using BACKEND_URL locally
## 0.2.0
### Minor Changes
- db118f97: feat(dashboard): generate Docker image

55
dashboard/Dockerfile Normal file
View File

@@ -0,0 +1,55 @@
FROM node:16-alpine AS pruner
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
RUN yarn global add turbo@1
COPY . .
RUN turbo prune --scope="@nhost/dashboard" --docker
FROM node:16-alpine AS builder
ARG TURBO_TOKEN
ARG TURBO_TEAM
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_PUBLIC_ENV dev
ENV NEXT_PUBLIC_NHOST_PLATFORM false
# placeholders for ports, will be replaced on runtime by entrypoint script
ENV NEXT_PUBLIC_NHOST_MIGRATIONS_PORT __NEXT_PUBLIC_NHOST_MIGRATIONS_PORT__
ENV NEXT_PUBLIC_NHOST_HASURA_PORT __NEXT_PUBLIC_NHOST_HASURA_PORT__
ENV NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT __NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT__
RUN yarn global add pnpm@7.17.0
COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-*.yaml .
RUN pnpm install --frozen-lockfile
COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json
COPY config/ config/
RUN pnpm build:dashboard
FROM node:16-alpine AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
COPY --chown=nextjs:nodejs dashboard/docker-entrypoint.sh .
COPY --from=builder --chown=nextjs:nodejs /app/dashboard/next.config.js .
COPY --from=builder --chown=nextjs:nodejs /app/dashboard/package.json .
COPY --from=builder --chown=nextjs:nodejs /app/dashboard/public ./dashboard/public
COPY --from=builder --chown=nextjs:nodejs /app/dashboard/.next/standalone/app ./
COPY --from=builder --chown=nextjs:nodejs /app/dashboard/.next/static ./dashboard/.next/static
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["node", "dashboard/server.js"]

View File

@@ -30,31 +30,35 @@ First, you need to run the following command to start your backend locally:
cd <your_nhost_project> && nhost dev
```
Two environment variables are required to connect the Nhost Dashboard to your local backend:
You can connect the Nhost Dashboard to your locally running backend by setting the following environment variables in `.env.development.local`:
- `NEXT_PUBLIC_NHOST_PLATFORM` should be set to `false`, because otherwise the Nhost Dashboard will try to connect to the Nhost platform.
- `NEXT_PUBLIC_NHOST_MIGRATIONS_URL` should be set to `http://localhost:9693` unless Hasura is configured to run on a different port. This is the URL of Hasura's migrations endpoint.
Example:
```
```bash
NEXT_PUBLIC_ENV=dev
NEXT_PUBLIC_NHOST_PLATFORM=false
NEXT_PUBLIC_NHOST_MIGRATIONS_URL=http://localhost:9693
```
### Storybook
Components are documented using [Storybook](https://storybook.js.org/). To run Storybook, run the following command:
```bash
pnpm storybook
```
### Full list of environment variables
| Name | Description |
| ------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `NEXT_PUBLIC_NHOST_PLATFORM` | This should be set to `false` to connect the Nhost Dashboard to a locally running Nhost backend. |
| `NEXT_PUBLIC_NHOST_MIGRATIONS_URL` | URL of Hasura's migrations endpoint. Used only if local development is enabled. |
| `NEXT_PUBLIC_NHOST_HASURA_URL` | URL of the Hasura Console. Used only when `NEXT_PUBLIC_ENV` is `dev`. |
| `NEXT_PUBLIC_NHOST_BACKEND_URL` | URL of the local backend. This is `http://localhost:1337` by default. |
| `NEXT_PUBLIC_ENV` | `dev`, `staging` or `prod`. Should be set to `dev` in most cases. |
| `NEXT_PUBLIC_STRIPE_PK` | Stripe public key. Not necessary for local development. |
| `NEXT_PUBLIC_GITHUB_APP_INSTALL_URL` | URL of the GitHub application. Not necessary for local development. |
| `NEXT_PUBLIC_ANALYTICS_WRITE_KEY` | Analytics key. Not necessary for local development. |
| `NEXT_PUBLIC_NHOST_BRAGI_WEBSOCKET` | URL of the Bragi websocket. Not necessary for local development. |
| Name | Description |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NEXT_PUBLIC_ENV` | `dev`, `staging` or `prod`. Should be set to `dev` in most cases. |
| `NEXT_PUBLIC_NHOST_PLATFORM` | This should be set to `false` to connect the Nhost Dashboard to a locally running Nhost backend. Setting this to `true` turns off local development. |
| `NEXT_PUBLIC_NHOST_LOCAL_MIGRATIONS_PORT` | Custom port that was passed to the CLI. Used only if local development is enabled. Default: `9693` |
| `NEXT_PUBLIC_NHOST_LOCAL_HASURA_PORT` | Custom port that was passed to the CLI. Used only if local development is enabled and `NEXT_PUBLIC_ENV` is `dev`. Default: `9695` |
| `NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT` | Custom port that was passed to the CLI. Used only if local development is enabled. Default: `1337` |
| `NEXT_PUBLIC_NHOST_BACKEND_URL` | Backend URL. Not necessary for local development. |
| `NEXT_PUBLIC_STRIPE_PK` | Stripe public key. Not necessary for local development. |
| `NEXT_PUBLIC_GITHUB_APP_INSTALL_URL` | URL of the GitHub application. Not necessary for local development. |
| `NEXT_PUBLIC_ANALYTICS_WRITE_KEY` | Analytics key. Not necessary for local development. |
| `NEXT_PUBLIC_NHOST_BRAGI_WEBSOCKET` | URL of the Bragi websocket. Not necessary for local development. |
## ESLint Rules
@@ -67,6 +71,7 @@ NEXT_PUBLIC_NHOST_MIGRATIONS_URL=http://localhost:9693
| `import/extensions` | JS / TS files should be imported without file extensions. |
| `react/jsx-filename-extension` | JSX should only appear in `.jsx` and `.tsx` files. |
| `react/jsx-no-bind` | Further investigation must be made on the performance impact of functions directly passed as props to components. |
| `import/order` | Until we have a better auto-formatter, we disable this rule. |
| `import/no-extraneous-dependencies` | `devDependencies` should be excluded from the list of disallowed imports. |
| `curly` | By default it only enforces curly braces for multi-line blocks, but it should be enforced for single-line blocks as well. |
| `no-restricted-exports` | `export { default } from './module'` is used heavily in `@/ui/v2` which is a restricted export by default. |

15
dashboard/docker-entrypoint.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
# read ports from env variables or use defaults
NEXT_PUBLIC_NHOST_MIGRATIONS_PORT="${NEXT_PUBLIC_NHOST_MIGRATIONS_PORT:=9693}"
NEXT_PUBLIC_NHOST_HASURA_PORT="${NEXT_PUBLIC_NHOST_HASURA_PORT:=9695}"
NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT="${NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT:=1337}"
# replace placeholders
find dashboard -type f -exec sed -i "s/__NEXT_PUBLIC_NHOST_MIGRATIONS_PORT__/${NEXT_PUBLIC_NHOST_MIGRATIONS_PORT}/g" {} +
find dashboard -type f -exec sed -i "s/__NEXT_PUBLIC_NHOST_HASURA_PORT__/${NEXT_PUBLIC_NHOST_HASURA_PORT}/g" {} +
find dashboard -type f -exec sed -i "s/__NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT__/${NEXT_PUBLIC_NHOST_LOCAL_BACKEND_PORT}/g" {} +
exec "$@"

View File

@@ -13,11 +13,3 @@ generates:
- 'typescript-react-apollo'
config:
withRefetchFn: true
functions/utils/__generated__/graphql-request.ts:
documents:
- 'functions/**/*.graphql'
- 'functions/**/*.gql'
plugins:
- 'typescript'
- 'typescript-operations'
- 'typescript-graphql-request'

View File

@@ -1,3 +1,4 @@
const path = require('path');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
@@ -5,6 +6,10 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
module.exports = withBundleAnalyzer({
reactStrictMode: true,
swcMinify: false,
output: 'standalone',
experimental: {
outputFileTracingRoot: path.join(__dirname, '../../'),
},
eslint: {
dirs: ['src'],
},
@@ -61,6 +66,11 @@ module.exports = withBundleAnalyzer({
destination: '/:workspaceSlug/:appSlug/settings/environment-variables',
permanent: true,
},
{
source: '/:workspaceSlug/:appSlug/users/:userId',
destination: '/:workspaceSlug/:appSlug/users?userId=:userId',
permanent: true,
},
];
},
});

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.1.0",
"version": "0.9.5",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -8,16 +8,16 @@
"build": "next build --no-lint",
"analyze": "ANALYZE=true pnpm build --no-lint",
"start": "next start",
"lint": "next lint --max-warnings 6",
"lint": "next lint --max-warnings 3",
"test": "vitest",
"codegen": "graphql-codegen --config graphql.config.yaml --errors-only",
"nhost:dev": "nhost dev -d",
"format": "prettier --write \"src/**/*.{js,ts,tsx,jsx,json,md}\" --plugin-search-dir=.",
"storybook": "start-storybook -p 6006",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook"
},
"dependencies": {
"@apollo/client": "^3.6.2",
"@apollo/client": "^3.7.3",
"@codemirror/language": "^6.3.0",
"@emotion/cache": "^11.10.5",
"@emotion/react": "^11.10.5",
@@ -25,25 +25,24 @@
"@emotion/styled": "^11.10.5",
"@fontsource/inter": "^4.5.14",
"@fontsource/roboto-mono": "^4.5.8",
"@graphiql/react": "^0.13.2",
"@graphiql/react": "^0.15.0",
"@graphiql/toolkit": "^0.8.0",
"@headlessui/react": "^1.6.5",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^2.9.10",
"@mui/base": "^5.0.0-alpha.105",
"@mui/material": "^5.10.13",
"@mui/system": "^5.10.13",
"@mui/base": "^5.0.0-alpha.106",
"@mui/material": "^5.10.14",
"@mui/system": "^5.10.14",
"@mui/x-date-pickers": "^5.0.8",
"@nhost/core": "^0.9.1",
"@nhost/nextjs": "^1.8.1",
"@nhost/nhost-js": "^1.5.2",
"@nhost/react": "^0.14.1",
"@nhost/react-apollo": "^4.8.1",
"@nhost/nextjs": "workspace:*",
"@nhost/react-apollo": "workspace:*",
"@segment/snippet": "^4.15.3",
"@stripe/react-stripe-js": "^1.10.0",
"@stripe/stripe-js": "^1.35.0",
"@tailwindcss/forms": "^0.5.3",
"@tanstack/react-query": "^4.16.1",
"@tanstack/react-table": "^8.5.27",
"@tanstack/react-virtual": "^3.0.0-beta.22",
"@tanstack/react-table": "^8.5.30",
"@tanstack/react-virtual": "^3.0.0-beta.23",
"analytics-node": "^6.2.0",
"axios": "^0.27.2",
"bcryptjs": "^2.4.3",
@@ -51,30 +50,29 @@
"cross-fetch": "^3.1.5",
"date-fns": "^2.29.3",
"generate-password": "^1.7.0",
"graphiql": "^2.0.8",
"graphiql": "^2.2.0",
"graphql": "^16.6.0",
"graphql-request": "^4.3.0",
"graphql-tag": "^2.12.6",
"graphql-ws": "^5.11.2",
"jsonwebtoken": "^8.5.1",
"lodash.debounce": "^4.0.8",
"next": "^12.3.1",
"next-seo": "^5.14.1",
"node-pg-format": "^1.3.5",
"pluralize": "^8.0.0",
"prettysize": "^2.0.0",
"randomstring": "^1.2.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.39.3",
"react-error-boundary": "^3.1.4",
"react-hook-form": "^7.39.5",
"react-hot-toast": "^2.4.0",
"react-is": "17.0.2",
"react-loading-skeleton": "^2.2.0",
"react-merge-refs": "^1.1.0",
"react-syntax-highlighter": "^15.4.5",
"react-table": "^7.8.0",
"sharp": "^0.31.2",
"slugify": "^1.6.5",
"smartlook-client": "^6.0.0",
"stripe": "^10.17.0",
"tailwind-merge": "^1.8.0",
"utility-types": "^3.10.0",
@@ -89,71 +87,63 @@
"@graphql-codegen/typescript-graphql-request": "^4.5.1",
"@graphql-codegen/typescript-operations": "^2.5.1",
"@graphql-codegen/typescript-react-apollo": "^3.3.1",
"@netlify/functions": "^0.7.2",
"@next/bundle-analyzer": "^12.3.1",
"@storybook/addon-actions": "^6.5.13",
"@storybook/addon-essentials": "^6.5.13",
"@storybook/addon-interactions": "^6.5.13",
"@storybook/addon-links": "^6.5.13",
"@storybook/builder-webpack5": "^6.5.13",
"@storybook/manager-webpack5": "^6.5.13",
"@storybook/react": "^6.5.13",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-essentials": "^6.5.14",
"@storybook/addon-interactions": "^6.5.14",
"@storybook/addon-links": "^6.5.14",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/builder-webpack5": "^6.5.14",
"@storybook/manager-webpack5": "^6.5.14",
"@storybook/react": "^6.5.14",
"@storybook/testing-library": "^0.0.13",
"@stripe/react-stripe-js": "^1.10.0",
"@stripe/stripe-js": "^1.35.0",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/express": "^4.17.14",
"@types/lodash.debounce": "^4.0.7",
"@types/node": "^18.11.9",
"@types/node": "^16.11.7",
"@types/pluralize": "^0.0.29",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.8",
"@types/react-dom": "18.0.10",
"@types/react-table": "^7.7.12",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/validator": "^13.7.10",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.0",
"@vitejs/plugin-react": "^2.2.0",
"@vitest/coverage-c8": "^0.25.1",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@vitejs/plugin-react": "^3.0.0",
"@vitest/coverage-c8": "^0.27.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^8.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"concurrently": "^6.3.0",
"critters": "^0.0.10",
"csstype": "^3.0.10",
"dotenv": "^10.0.0",
"eslint": "^8.27.0",
"eslint": "^8.28.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "^13.0.2",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"express": "^4.18.2",
"express-validator": "^6.14.2",
"jsdom": "^20.0.2",
"jsdom": "^20.0.3",
"lint-staged": ">=13",
"msw": "^0.48.2",
"msw": "^0.49.0",
"msw-storybook-addon": "^1.6.3",
"postcss": "^8.4.19",
"postmark": "^2.7.8",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.2.0",
"prettier-plugin-tailwind-css": "^1.5.0",
"prettier-plugin-tailwindcss": "^0.1.13",
"prettier-plugin-tailwindcss": "^0.2.0",
"react-date-fns-hooks": "^0.9.4",
"react-error-boundary": "^3.1.4",
"require-from-string": "^2.0.2",
"storybook-addon-next-router": "^4.0.1",
"tailwindcss": "^3.1.2",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typescript": "^4.8.4",
"vite": "^3.2.3",
"vite-tsconfig-paths": "^3.5.2",
"vitest": "^0.25.1",
"vite": "^4.0.2",
"vite-tsconfig-paths": "^4.0.3",
"vitest": "^0.27.0",
"webpack": "^5.75.0"
},
"browserslist": {
@@ -167,5 +157,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"msw": {
"workerDirectory": "public"
}
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1 @@
<svg width="21" height="21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.08 0c5.578 0 10.08 4.507 10.08 10.09 0 5.584-4.502 10.09-10.08 10.09A10.072 10.072 0 0 1 0 10.09C0 4.507 4.503 0 10.08 0Zm0 2.69a7.375 7.375 0 0 0-7.392 7.4c0 4.104 3.293 7.4 7.392 7.4 4.1 0 7.392-3.296 7.392-7.4 0-4.103-3.293-7.4-7.392-7.4Zm-2.486 7.804c1.142 0 2.083.942 2.083 2.085 0 1.144-.94 2.086-2.083 2.086a2.095 2.095 0 0 1-2.083-2.086c0-1.143.94-2.085 2.083-2.085Zm4.973 0c1.142 0 2.083.942 2.083 2.085 0 1.144-.94 2.086-2.083 2.086a2.095 2.095 0 0 1-2.084-2.086c0-1.143.941-2.085 2.084-2.085Zm0-4.978c1.142 0 2.083.942 2.083 2.085 0 1.144-.94 2.086-2.083 2.086A2.095 2.095 0 0 1 10.483 7.6c0-1.143.941-2.085 2.084-2.085Zm-4.973 0c1.142 0 2.083.942 2.083 2.085 0 1.144-.94 2.086-2.083 2.086A2.095 2.095 0 0 1 5.51 7.6c0-1.143.94-2.085 2.083-2.085Z" fill="#F22F46"/></svg>

After

Width:  |  Height:  |  Size: 869 B

View File

@@ -0,0 +1,303 @@
/* eslint-disable */
/* tslint:disable */
/**
* Mock Service Worker (0.49.0).
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
*/
const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70'
const activeClientIds = new Set()
self.addEventListener('install', function () {
self.skipWaiting()
})
self.addEventListener('activate', function (event) {
event.waitUntil(self.clients.claim())
})
self.addEventListener('message', async function (event) {
const clientId = event.source.id
if (!clientId || !self.clients) {
return
}
const client = await self.clients.get(clientId)
if (!client) {
return
}
const allClients = await self.clients.matchAll({
type: 'window',
})
switch (event.data) {
case 'KEEPALIVE_REQUEST': {
sendToClient(client, {
type: 'KEEPALIVE_RESPONSE',
})
break
}
case 'INTEGRITY_CHECK_REQUEST': {
sendToClient(client, {
type: 'INTEGRITY_CHECK_RESPONSE',
payload: INTEGRITY_CHECKSUM,
})
break
}
case 'MOCK_ACTIVATE': {
activeClientIds.add(clientId)
sendToClient(client, {
type: 'MOCKING_ENABLED',
payload: true,
})
break
}
case 'MOCK_DEACTIVATE': {
activeClientIds.delete(clientId)
break
}
case 'CLIENT_CLOSED': {
activeClientIds.delete(clientId)
const remainingClients = allClients.filter((client) => {
return client.id !== clientId
})
// Unregister itself when there are no more clients
if (remainingClients.length === 0) {
self.registration.unregister()
}
break
}
}
})
self.addEventListener('fetch', function (event) {
const { request } = event
const accept = request.headers.get('accept') || ''
// Bypass server-sent events.
if (accept.includes('text/event-stream')) {
return
}
// Bypass navigation requests.
if (request.mode === 'navigate') {
return
}
// Opening the DevTools triggers the "only-if-cached" request
// that cannot be handled by the worker. Bypass such requests.
if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
return
}
// Bypass all requests when there are no active clients.
// Prevents the self-unregistered worked from handling requests
// after it's been deleted (still remains active until the next reload).
if (activeClientIds.size === 0) {
return
}
// Generate unique request ID.
const requestId = Math.random().toString(16).slice(2)
event.respondWith(
handleRequest(event, requestId).catch((error) => {
if (error.name === 'NetworkError') {
console.warn(
'[MSW] Successfully emulated a network error for the "%s %s" request.',
request.method,
request.url,
)
return
}
// At this point, any exception indicates an issue with the original request/response.
console.error(
`\
[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
request.method,
request.url,
`${error.name}: ${error.message}`,
)
}),
)
})
async function handleRequest(event, requestId) {
const client = await resolveMainClient(event)
const response = await getResponse(event, client, requestId)
// Send back the response clone for the "response:*" life-cycle events.
// Ensure MSW is active and ready to handle the message, otherwise
// this message will pend indefinitely.
if (client && activeClientIds.has(client.id)) {
;(async function () {
const clonedResponse = response.clone()
sendToClient(client, {
type: 'RESPONSE',
payload: {
requestId,
type: clonedResponse.type,
ok: clonedResponse.ok,
status: clonedResponse.status,
statusText: clonedResponse.statusText,
body:
clonedResponse.body === null ? null : await clonedResponse.text(),
headers: Object.fromEntries(clonedResponse.headers.entries()),
redirected: clonedResponse.redirected,
},
})
})()
}
return response
}
// Resolve the main client for the given event.
// Client that issues a request doesn't necessarily equal the client
// that registered the worker. It's with the latter the worker should
// communicate with during the response resolving phase.
async function resolveMainClient(event) {
const client = await self.clients.get(event.clientId)
if (client?.frameType === 'top-level') {
return client
}
const allClients = await self.clients.matchAll({
type: 'window',
})
return allClients
.filter((client) => {
// Get only those clients that are currently visible.
return client.visibilityState === 'visible'
})
.find((client) => {
// Find the client ID that's recorded in the
// set of clients that have registered the worker.
return activeClientIds.has(client.id)
})
}
async function getResponse(event, client, requestId) {
const { request } = event
const clonedRequest = request.clone()
function passthrough() {
// Clone the request because it might've been already used
// (i.e. its body has been read and sent to the client).
const headers = Object.fromEntries(clonedRequest.headers.entries())
// Remove MSW-specific request headers so the bypassed requests
// comply with the server's CORS preflight check.
// Operate with the headers as an object because request "Headers"
// are immutable.
delete headers['x-msw-bypass']
return fetch(clonedRequest, { headers })
}
// Bypass mocking when the client is not active.
if (!client) {
return passthrough()
}
// Bypass initial page load requests (i.e. static assets).
// The absence of the immediate/parent client in the map of the active clients
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
// and is not ready to handle requests.
if (!activeClientIds.has(client.id)) {
return passthrough()
}
// Bypass requests with the explicit bypass header.
// Such requests can be issued by "ctx.fetch()".
if (request.headers.get('x-msw-bypass') === 'true') {
return passthrough()
}
// Notify the client that a request has been intercepted.
const clientMessage = await sendToClient(client, {
type: 'REQUEST',
payload: {
id: requestId,
url: request.url,
method: request.method,
headers: Object.fromEntries(request.headers.entries()),
cache: request.cache,
mode: request.mode,
credentials: request.credentials,
destination: request.destination,
integrity: request.integrity,
redirect: request.redirect,
referrer: request.referrer,
referrerPolicy: request.referrerPolicy,
body: await request.text(),
bodyUsed: request.bodyUsed,
keepalive: request.keepalive,
},
})
switch (clientMessage.type) {
case 'MOCK_RESPONSE': {
return respondWithMock(clientMessage.data)
}
case 'MOCK_NOT_FOUND': {
return passthrough()
}
case 'NETWORK_ERROR': {
const { name, message } = clientMessage.data
const networkError = new Error(message)
networkError.name = name
// Rejecting a "respondWith" promise emulates a network error.
throw networkError
}
}
return passthrough()
}
function sendToClient(client, message) {
return new Promise((resolve, reject) => {
const channel = new MessageChannel()
channel.port1.onmessage = (event) => {
if (event.data && event.data.error) {
return reject(event.data.error)
}
resolve(event.data)
}
client.postMessage(message, [channel.port2])
})
}
function sleep(timeMs) {
return new Promise((resolve) => {
setTimeout(resolve, timeMs)
})
}
async function respondWithMock(response) {
await sleep(response.delay)
return new Response(response.body, response)
}

View File

@@ -1,161 +0,0 @@
import { useDialog } from '@/components/common/DialogProvider';
import features from '@/data/features.json';
import {
useGetWorkspaceMembersQuery,
useUpdateApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { ApplicationStatus } from '@/types/application';
import { Modal } from '@/ui';
import Status, { StatusEnum } from '@/ui/Status';
import Button from '@/ui/v2/Button';
import { Dropdown } from '@/ui/v2/Dropdown';
import ChevronDownIcon from '@/ui/v2/icons/ChevronDownIcon';
import Tooltip from '@/ui/v2/Tooltip';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { getCurrentEnvironment, isDevOrStaging } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useUserData } from '@nhost/react';
import { useState } from 'react';
import { twMerge } from 'tailwind-merge';
import { ChangeApplicationName } from './ChangeApplicationName';
import ResetDatabasePasswordForm from './overview/ResetDatabasePasswordForm';
import { RemoveApplicationModal } from './RemoveApplicationModal';
const isK8SPostgresEnabledInCurrentEnvironment = features[
'k8s-postgres'
].enabled.find((e) => e === getCurrentEnvironment());
export function ApplicationMenuItems() {
const { currentApplication, currentWorkspace } =
useCurrentWorkspaceAndApplication();
const [updateApplication, { client }] = useUpdateApplicationMutation();
const { openAlertDialog } = useDialog();
const user = useUserData();
const [changeApplicationNameModal, setChangeApplicationNameModal] =
useState(false);
const [deleteApplicationModal, setDeleteApplicationModal] = useState(false);
const isProjectUsingRDS = currentApplication?.featureFlags?.find(
(feature) => feature.name === 'fleetcontrol_use_rds',
);
async function handleTriggerPausing() {
try {
await updateApplication({
variables: {
appId: currentApplication.id,
app: {
desiredState: ApplicationStatus.Paused,
},
},
});
await updateOwnCache(client);
discordAnnounce(`${currentApplication.name} set to pause.`);
triggerToast(`${currentApplication.name} set to pause.`);
} catch (e) {
triggerToast(`Error trying to pause ${currentApplication.name}`);
}
}
const { data: workspaceData, loading } = useGetWorkspaceMembersQuery({
variables: { workspaceId: currentWorkspace.id },
fetchPolicy: 'cache-first',
});
if (loading) {
return null;
}
const isOwner = workspaceData.workspace.workspaceMembers.some(
(member) => member.user.id === user.id && member.type === 'owner',
);
return (
<>
<Modal
showModal={changeApplicationNameModal}
close={() => setChangeApplicationNameModal(!changeApplicationNameModal)}
Component={ChangeApplicationName}
/>
<Modal
showModal={deleteApplicationModal}
close={() => setDeleteApplicationModal(!deleteApplicationModal)}
Component={RemoveApplicationModal}
/>
<Dropdown.Root>
<Dropdown.Trigger asChild hideChevron>
<Button
endIcon={<ChevronDownIcon className="h-4 w-4" />}
variant="outlined"
color="secondary"
>
Project Settings
</Button>
</Dropdown.Trigger>
<Dropdown.Content
menu
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
transformOrigin={{ vertical: 'top', horizontal: 'right' }}
className="mt-1"
>
<Dropdown.Item
className="font-display text-sm font-medium text-dark"
onClick={() => setChangeApplicationNameModal(true)}
>
Change Project Name
</Dropdown.Item>
{isDevOrStaging() && (
<Dropdown.Item
className="font-display text-sm font-medium text-dark"
onClick={handleTriggerPausing}
>
<Status status={StatusEnum.Deploying}>Internal</Status>
<span className="ml-2 align-middle">Pause App</span>
</Dropdown.Item>
)}
{isK8SPostgresEnabledInCurrentEnvironment && !isProjectUsingRDS && (
<Dropdown.Item
className="font-display text-sm font-medium text-dark"
onClick={() => {
openAlertDialog({
title: 'Reset Database Password',
payload: <ResetDatabasePasswordForm />,
props: {
hidePrimaryAction: true,
hideSecondaryAction: true,
},
});
}}
>
Reset Database Password
</Dropdown.Item>
)}
<Tooltip
title="Only owners of the workspace can delete apps"
visible={!isOwner}
hasDisabledChildren={!isOwner}
>
<Dropdown.Item
className={twMerge(
'font-display text-sm font-medium text-dark',
!isOwner
? 'cursor-not-allowed text-red text-opacity-70'
: 'font-medium text-red',
)}
onClick={() => setDeleteApplicationModal(true)}
disabled={!isOwner}
>
<span>Delete Project</span>
</Dropdown.Item>
</Tooltip>
</Dropdown.Content>
</Dropdown.Root>
</>
);
}
export default ApplicationMenuItems;

View File

@@ -15,7 +15,7 @@ import {
useInsertFeatureFlagMutation,
useUpdateApplicationMutation,
} from '@/utils/__generated__/graphql';
import { useUserEmail } from '@nhost/react';
import { useUserEmail } from '@nhost/nextjs';
import { useEffect, useState } from 'react';
/**

View File

@@ -11,7 +11,7 @@ import Text from '@/ui/v2/Text';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useUserData } from '@nhost/react';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import { useState } from 'react';
import { RemoveApplicationModal } from './RemoveApplicationModal';

View File

@@ -5,7 +5,7 @@ import { Modal } from '@/ui/Modal';
import Button from '@/ui/v2/Button';
import { Dropdown } from '@/ui/v2/Dropdown';
import Text from '@/ui/v2/Text';
import { useUserData } from '@nhost/react';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import { useState } from 'react';
import ApplicationInfo from './ApplicationInfo';

View File

@@ -1,107 +0,0 @@
import { useWorkspaceContext } from '@/context/workspace-context';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { inputErrorMessages } from '@/utils/getErrorMessage';
import { slugifyString } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useUpdateApplicationMutation } from '@/utils/__generated__/graphql';
import { useRouter } from 'next/router';
import React, { useState } from 'react';
export function ChangeApplicationName({ close }: any) {
const [updateAppName, { client }] = useUpdateApplicationMutation({});
const { workspaceContext } = useWorkspaceContext();
const [name, setName] = useState(workspaceContext.appName);
const [applicationError, setApplicationError] = useState<any>('');
const { currentWorkspace, currentApplication } =
useCurrentWorkspaceAndApplication();
const router = useRouter();
async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault();
const slug = slugifyString(name);
if (slug.length < 4 || slug.length > 32) {
setApplicationError('Slug should be within 4 and 32 characters.');
return;
}
if (!inputErrorMessages(name, setName, setApplicationError, 'project')) {
return;
}
try {
await updateAppName({
variables: {
appId: currentApplication.id,
app: {
name,
slug,
},
},
});
triggerToast('Project name changed');
} catch (error) {
await discordAnnounce(
`Error trying to delete project: ${currentApplication.name}`,
);
}
await updateOwnCache(client);
await router.push(`/${currentWorkspace.slug}/${slug}`);
}
return (
<div className="px-6 py-6 text-left w-modal">
<div className="flex flex-col">
<Text variant="h3" component="h2">
Change Project Name
</Text>
<form onSubmit={handleSubmit}>
<div className="grid grid-flow-row gap-2 mt-4">
<Input
label="New Project Name"
id="projectName"
value={name}
onChange={(e) => {
setName(e.target.value);
setApplicationError('');
}}
fullWidth
autoFocus
helperText={`https://app.nhost.io/${
currentWorkspace.slug
}/${slugifyString(name)}`}
/>
{applicationError && (
<Alert severity="error">{applicationError}</Alert>
)}
</div>
<div className="grid grid-flow-row gap-2 mt-4">
<Button type="submit" disabled={applicationError}>
Save
</Button>
<Button
type="button"
variant="outlined"
color="secondary"
onClick={close}
>
Close
</Button>
</div>
</form>
</div>
</div>
);
}
export default ChangeApplicationName;

View File

@@ -30,7 +30,7 @@ function Plan({
return (
<button
type="button"
className="grid items-center justify-between w-full grid-flow-col px-1 my-4"
className="my-4 grid w-full grid-flow-col items-center justify-between px-1"
onClick={setPlan}
tabIndex={-1}
>
@@ -48,7 +48,7 @@ function Plan({
<Text
variant="h3"
component="p"
className="self-center ml-2 font-medium"
className="ml-2 self-center font-medium"
>
{currentPlan.price > price ? 'Downgrade' : 'Upgrade'} to {planName}
</Text>
@@ -143,7 +143,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
};
return (
<div className="p-6 text-left w-welcome">
<div className="w-welcome p-6 text-left">
<Modal
showModal={paymentModal}
close={closePaymentModal}
@@ -189,7 +189,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
))}
</div>
<div className="grid grid-flow-row gap-2 mt-6">
<div className="mt-6 grid grid-flow-row gap-2">
<Button onClick={handleChangePlanClick} disabled={!selectedPlan}>
{!selectedPlan && 'Change Plan'}
{selectedPlan && isDowngrade && 'Downgrade'}

View File

@@ -1,119 +0,0 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { inputErrorMessages } from '@/utils/getErrorMessage';
import { slugifyString } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast';
import { useUpdateWorkspaceMutation } from '@/utils/__generated__/graphql';
import router from 'next/router';
import type { ChangeEvent } from 'react';
import React, { useState } from 'react';
type ChangeWorkspaceNameProps = {
close: VoidFunction;
};
export default function ChangeWorkspaceName({
close,
}: ChangeWorkspaceNameProps) {
const { currentWorkspace } = useCurrentWorkspaceAndApplication();
const [newWorkspaceName, setNewWorkspaceName] = useState(
currentWorkspace.name,
);
const [workspaceError, setWorkspaceError] = useState<string>('');
const [updateWorkspace, { loading: mutationLoading, error: mutationError }] =
useUpdateWorkspaceMutation({
refetchQueries: [],
});
function handleChange(event: ChangeEvent<HTMLInputElement>) {
inputErrorMessages(
event.target.value,
setNewWorkspaceName,
setWorkspaceError,
'Workspace',
);
}
async function handleSubmit(e: React.SyntheticEvent<HTMLFormElement>) {
e.preventDefault();
const name = newWorkspaceName;
const slug = slugifyString(name);
if (slug.length < 4 || slug.length > 32) {
setWorkspaceError('Slug should be within 4 and 32 characters.');
return;
}
try {
await updateWorkspace({
variables: {
id: currentWorkspace.id,
workspace: {
name,
slug,
},
},
});
close();
triggerToast('Workspace name changed');
} catch (error) {
await discordAnnounce(
`Error trying to remove workspace: ${currentWorkspace.id} - ${error.message}`,
);
}
await router.push(slug);
}
return (
<div className="w-modal px-6 py-6 text-left">
<div className="flex flex-col">
<Text variant="h3" component="h2">
Change Workspace Name
</Text>
<form onSubmit={handleSubmit}>
<div className="mt-4 grid grid-flow-row gap-2">
<Input
id="workspaceName"
label="New Workspace Name"
onChange={handleChange}
value={newWorkspaceName}
placeholder="New workspace name"
fullWidth
autoFocus
autoComplete="off"
helperText={`https://app.nhost.io/${slugifyString(
newWorkspaceName || '',
)}`}
/>
{workspaceError && <Alert severity="error">{workspaceError}</Alert>}
{mutationError && (
<Alert severity="error">{mutationError.toString()}</Alert>
)}
</div>
<div className="mt-6 grid grid-flow-row gap-2">
<Button
type="submit"
disabled={mutationLoading || !!workspaceError}
>
Save Changes
</Button>
<Button variant="outlined" color="secondary" onClick={close}>
Close
</Button>
</div>
</form>
</div>
</div>
);
}

View File

@@ -32,9 +32,12 @@ export default function ConnectGithubModal({ close }: ConnectGithubModalProps) {
useState<ConnectGithubModalState>('CONNECTING');
const [selectedRepoId, setSelectedRepoId] = useState<string | null>(null);
const { data, loading, error } = useGetGithubRepositoriesQuery({
pollInterval: 2000,
});
const { data, loading, error, startPolling } =
useGetGithubRepositoriesQuery();
useEffect(() => {
startPolling(2000);
}, [startPolling]);
const handleSelectAnotherRepository = () => {
setSelectedRepoId(null);
@@ -144,7 +147,7 @@ export default function ConnectGithubModal({ close }: ConnectGithubModalProps) {
</div>
</div>
<RetryableErrorBoundary>
<div className=" h-import divide-y-1 divide-divide overflow-y-auto border-t-1 border-b-1">
<div className="h-import divide-y-1 divide-divide overflow-y-auto border-t-1 border-b-1">
{githubRepositoriesToDisplay.map((repo) => (
<Repo
key={repo.id}

View File

@@ -1,166 +0,0 @@
import { useWorkspaceContext } from '@/context/workspace-context';
import { Modal } from '@/ui/Modal';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import { triggerToast } from '@/utils/toast';
import type { EnvironmentVariableFragment } from '@/utils/__generated__/graphql';
import {
refetchGetEnvironmentVariablesWhereQuery,
useDeleteEnvironmentVariableMutation,
useUpdateEnvironmentVariableMutation,
} from '@/utils/__generated__/graphql';
import React, { useState } from 'react';
type EnvModalProps = {
show: boolean;
close: VoidFunction;
envVar: EnvironmentVariableFragment;
};
export default function EditEnvVarModal({
show,
close,
envVar,
}: EnvModalProps) {
const { workspaceContext } = useWorkspaceContext();
const { appId } = workspaceContext;
const [updateEnvVar, { loading: updateLoading }] =
useUpdateEnvironmentVariableMutation({
refetchQueries: [
refetchGetEnvironmentVariablesWhereQuery({
where: {
appId: {
_eq: appId,
},
},
}),
],
});
const [deleteEnvVar, { loading: deleteLoading }] =
useDeleteEnvironmentVariableMutation({
refetchQueries: [
refetchGetEnvironmentVariablesWhereQuery({
where: {
appId: {
_eq: appId,
},
},
}),
],
});
const [prodValue, setProdValue] = useState(envVar.prodValue || '');
const [devValue, setDevValue] = useState(envVar.devValue || '');
const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {
e.preventDefault();
try {
await updateEnvVar({
variables: {
id: envVar.id,
environmentVariable: {
prodValue,
devValue,
},
},
});
} catch (error) {
close();
triggerToast('Error updating environment variable');
return;
}
triggerToast(`Environment variable ${envVar.name} updated successfully`);
close();
};
const handleDelete = async () => {
try {
await deleteEnvVar({
variables: {
id: envVar.id,
},
});
} catch (error) {
close();
triggerToast('Error deleting environment variable');
return;
}
triggerToast(`Environment variable ${envVar.name} removed successfully`);
close();
};
return (
<Modal showModal={show} close={close}>
<form onSubmit={handleSubmit}>
<div className="w-modal px-6 py-6 text-left">
<div className="grid grid-flow-row gap-1">
<Text variant="h3" component="h2">
{envVar.name}
</Text>
<Text variant="subtitle2">
The default value will be available in all environments, unless
you override it. All values are encrypted.
</Text>
<div className="my-2 grid grid-flow-row gap-2">
<Input
id="name"
label="Name"
autoFocus
disabled
autoComplete="off"
defaultValue={envVar.name}
fullWidth
hideEmptyHelperText
/>
<Input
id="prodValue"
label="Production Value"
fullWidth
placeholder="Enter a value"
value={prodValue}
onChange={(event) => setProdValue(event.target.value)}
hideEmptyHelperText
/>
<Input
id="devValue"
label="Development Value"
fullWidth
placeholder="Enter a value"
value={devValue}
onChange={(event) => setDevValue(event.target.value)}
hideEmptyHelperText
/>
</div>
<div className="grid grid-flow-row gap-2">
<Button type="submit" loading={updateLoading}>
Save
</Button>
<Button
variant="outlined"
color="error"
loading={deleteLoading}
onClick={handleDelete}
>
Delete
</Button>
<Button onClick={close} variant="outlined" color="secondary">
Close
</Button>
</div>
</div>
</div>
</form>
</Modal>
);
}

View File

@@ -1,327 +0,0 @@
import ErrorBoundaryFallback from '@/components/common/ErrorBoundaryFallback';
import TwilioIcon from '@/components/icons/TwilioIcon';
import {
useGetSmsSettingsQuery,
useUpdateAppMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Button, Input } from '@/ui';
import { Alert } from '@/ui/Alert';
import DelayedLoading from '@/ui/DelayedLoading';
import { Text } from '@/ui/Text';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import { useApolloClient } from '@apollo/client';
import { useEffect } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import {
Controller,
FormProvider,
useForm,
useFormContext,
} from 'react-hook-form';
import toast from 'react-hot-toast';
export function EditSMSSettingsForm({
close,
isAlreadyEnabled,
}: {
close: () => void;
isAlreadyEnabled: boolean;
}) {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const {
handleSubmit,
watch,
formState: { isSubmitting, errors },
} = useFormContext<EditSMSSettingsFormData>();
const { control } = useFormContext<EditSMSSettingsFormData>();
const [updateApp] = useUpdateAppMutation();
let toastId: string;
const client = useApolloClient();
const isNotCompleted =
!watch('accountSID') ||
!watch('authToken') ||
!watch('messagingServiceSID');
const handleEditSMSSettings = async (data: EditSMSSettingsFormData) => {
try {
toastId = showLoadingToast('Updating SMS settings...');
await updateApp({
variables: {
id: currentApplication.id,
app: {
authSmsTwilioAccountSid: data.accountSID,
authSmsTwilioAuthToken: data.authToken,
authSmsTwilioMessagingServiceId: data.messagingServiceSID,
authSmsPasswordlessEnabled: true,
},
},
});
await client.refetchQueries({ include: ['getSMSSettings'] });
toast.remove(toastId);
triggerToast('SMS settings updated successfully.');
close();
} catch (error) {
if (toastId) {
toast.remove(toastId);
}
throw error;
}
};
return (
<form
onSubmit={handleSubmit(handleEditSMSSettings)}
className="flex w-full flex-col pb-1"
autoComplete="off"
>
{errors &&
Object.entries(errors).map(([type, error]) => (
<Alert key={type} className="mb-4" severity="error">
{error.message}
</Alert>
))}
<div>
<div className="flex flex-row place-content-between border-t border-b px-2 py-2.5">
<div className="flex w-full flex-row">
<Text
color="greyscaleDark"
className="self-center font-medium"
size="normal"
>
Account SID
</Text>
</div>
<div className="flex w-full">
<Controller
name="accountSID"
control={control}
rules={{
required: true,
pattern: {
value: /^[a-zA-Z0-9-_]+$/,
message:
'The Account SID must contain only letters, hyphens, and numbers.',
},
}}
render={({ field }) => (
<Input
{...field}
id="accountSID"
placeholder="Account SID"
required
value={field.value || ''}
onChange={(value: string) => {
if (value && !/^[a-zA-Z0-9-_]+$/gi.test(value)) {
// prevent the user from entering invalid characters
return;
}
field.onChange(value);
}}
/>
)}
/>
</div>
</div>
<div className="flex flex-row place-content-between border-b px-2 py-2.5">
<div className="flex w-full flex-row">
<Text
color="greyscaleDark"
className="self-center font-medium"
size="normal"
>
Auth Token
</Text>
</div>
<div className="flex w-full">
<Controller
name="authToken"
control={control}
rules={{
required: true,
pattern: {
value: /^[a-zA-Z0-9-_]+$/,
message:
'The Auth Token must contain only letters, hyphens, and numbers.',
},
}}
render={({ field }) => (
<Input
{...field}
id="authToken"
placeholder="Auth Token"
required
value={field.value || ''}
onChange={(value: string) => {
if (value && !/^[a-zA-Z0-9-_/.]+$/gi.test(value)) {
return;
}
field.onChange(value);
}}
/>
)}
/>
</div>
</div>
<div className="flex flex-row place-content-between border-b px-2 py-2.5">
<div className="flex w-full flex-row">
<Text
color="greyscaleDark"
className="self-center font-medium"
size="normal"
>
Messaging Service SID
</Text>
</div>
<div className="flex w-full">
<Controller
name="messagingServiceSID"
control={control}
rules={{
required: true,
pattern: {
value: /^[+a-zA-Z0-9-_/.]+$/,
message:
'The Messaging Service SID must either be a valid phone number or contain only letters, hyphens, and numbers.',
},
}}
render={({ field }) => (
<Input
{...field}
id="messagingServiceSID"
required
placeholder="Messaging Service SID"
value={field.value || ''}
onChange={(value: string) => {
if (value && !/^[+a-zA-Z0-9-_/.]+$/gi.test(value)) {
return;
}
field.onChange(value);
}}
/>
)}
/>
</div>
</div>
</div>
<div className="flex flex-col">
<Button
variant="primary"
type="submit"
className="text-grayscaleDark mt-2 border text-sm+ font-normal"
loading={isSubmitting}
disabled={isSubmitting || isNotCompleted}
>
{isAlreadyEnabled ? 'Update SMS Settings' : 'Enable SMS'}
</Button>
</div>
</form>
);
}
export function EditSMSSettingsModal({
close,
isAlreadyEnabled,
}: {
close: () => void;
isAlreadyEnabled: boolean;
}) {
return (
<div className="w-modal px-6 py-4 text-left">
<div className="flex flex-col">
<div className="mx-auto mt-2.5">
<TwilioIcon className=" text-greyscaleDark" />
</div>
<Text
variant="subHeading"
color="greyscaleDark"
size="large"
className="mt-3 text-center"
>
Set up Twilio SMS Service
</Text>
<Text
variant="body"
color="greyscaleDark"
size="small"
className="mt-0.5 mb-6 text-center font-normal"
>
SMS messages are sent through Twilio. Create an account and a
messaging service at https://console.twilio.com.
</Text>
<div>
<ErrorBoundary fallbackRender={ErrorBoundaryFallback}>
<EditSMSSettingsForm
close={close}
isAlreadyEnabled={isAlreadyEnabled}
/>
</ErrorBoundary>
</div>
</div>
</div>
);
}
export interface EditSMSSettingsProps {
close: () => void;
}
export interface EditSMSSettingsFormData {
accountSID: string;
authToken: string;
messagingServiceSID: string;
}
export function EditSMSSettings({ close }: EditSMSSettingsProps) {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const form = useForm<EditSMSSettingsFormData>({
reValidateMode: 'onSubmit',
defaultValues: {
accountSID: '',
authToken: '',
messagingServiceSID: '',
},
});
const { data, loading, error } = useGetSmsSettingsQuery({
variables: {
id: currentApplication.id,
},
});
useEffect(() => {
if (!data) {
return;
}
form.setValue('accountSID', data.app.authSmsTwilioAccountSid);
form.setValue('authToken', data.app.authSmsTwilioAuthToken);
form.setValue(
'messagingServiceSID',
data.app.authSmsTwilioMessagingServiceId,
);
}, [data, form]);
if (loading) {
return <DelayedLoading delay={500} />;
}
if (error) {
throw error;
}
return (
<FormProvider {...form}>
<EditSMSSettingsModal
close={close}
isAlreadyEnabled={data.app.authSmsPasswordlessEnabled}
/>
</FormProvider>
);
}

View File

@@ -1,134 +0,0 @@
import {
useGetSmsSettingsQuery,
useUpdateAppMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Text, Toggle } from '@/ui';
import DelayedLoading from '@/ui/DelayedLoading';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import { useApolloClient } from '@apollo/client';
import clsx from 'clsx';
import Image from 'next/image';
import { useEffect, useState } from 'react';
import toast from 'react-hot-toast';
export function EnableSMSSignIn({ openSMSSettingsModal }: any) {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [updateApp] = useUpdateAppMutation();
const { data, loading, error } = useGetSmsSettingsQuery({
variables: {
id: currentApplication.id,
},
});
const [enableSMSLoginMethod, setEnableSMSLoginMethod] = useState(false);
const client = useApolloClient();
let toastId: string;
useEffect(() => {
if (!data) {
return;
}
setEnableSMSLoginMethod(data.app.authSmsPasswordlessEnabled);
}, [data]);
if (loading) {
return <DelayedLoading delay={500} />;
}
if (error) {
throw error;
}
const handleDisable = async () => {
try {
toastId = showLoadingToast('Disabling SMS login...');
await updateApp({
variables: {
id: currentApplication.id,
app: {
authSmsPasswordlessEnabled: false,
},
},
});
setEnableSMSLoginMethod(false);
await client.refetchQueries({ include: ['getSMSSettings'] });
toast.remove(toastId);
triggerToast('Passwordless SMS disabled.');
} catch (updateError) {
if (toastId) {
toast.remove(toastId);
}
throw updateError;
}
};
return (
<div className="mt-20">
<div className="mx-auto font-display">
<div className="flex flex-col place-content-between">
<div className="">
<div className="flex flex-row place-content-between">
<div className="relative flex flex-row">
<Image
src="/assets/SMS.svg"
width={24}
height={24}
alt="Phone Number (SMS)"
/>
<Text
variant="body"
size="large"
className="ml-2 font-medium"
color="greyscaleDark"
>
Phone Number (SMS)
</Text>
<div>
<button
type="button"
className={clsx(
'ml-2 align-bottom text-sm- font-medium text-blue transition-opacity duration-300',
!enableSMSLoginMethod && 'invisible opacity-0',
enableSMSLoginMethod && 'opacity-100',
)}
onClick={() => openSMSSettingsModal()}
>
Edit SMS settings
</button>
</div>
</div>
<div className="flex flex-row">
<Toggle
checked={enableSMSLoginMethod}
onChange={async () => {
if (enableSMSLoginMethod) {
await handleDisable();
} else {
openSMSSettingsModal();
}
}}
/>
</div>
</div>
<div className="flex flex-row self-center mt-3 align-middle">
<Text
variant="body"
size="normal"
color="greyscaleDark"
className="self-center"
>
Sign in users with Phone Number (SMS).
</Text>
</div>
</div>
</div>
</div>
</div>
);
}
export default EnableSMSSignIn;

View File

@@ -1,11 +1,16 @@
import { ConnectionDetail } from '@/components/applications/ConnectionDetail';
import { LoadingScreen } from '@/components/common/LoadingScreen';
import ExternalLink from '@/components/icons/ExternalIcon';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import Button from '@/ui/v2/Button';
import ArrowSquareOutIcon from '@/ui/v2/icons/ArrowSquareOutIcon';
import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
import { generateRemoteAppUrl } from '@/utils/helpers';
import generateAppServiceUrl, {
defaultLocalBackendSlugs,
defaultRemoteBackendSlugs,
} from '@/utils/common/generateAppServiceUrl';
import { LOCAL_HASURA_URL } from '@/utils/env';
import Image from 'next/image';
interface HasuraDataProps {
@@ -14,6 +19,7 @@ interface HasuraDataProps {
export function HasuraData({ close }: HasuraDataProps) {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const isPlatform = useIsPlatform();
if (
!currentApplication?.subdomain ||
@@ -23,9 +29,15 @@ export function HasuraData({ close }: HasuraDataProps) {
}
const hasuraUrl =
process.env.NEXT_PUBLIC_ENV === 'dev'
? process.env.NEXT_PUBLIC_NHOST_HASURA_URL || 'http://localhost:9695'
: generateRemoteAppUrl(currentApplication.subdomain);
process.env.NEXT_PUBLIC_ENV === 'dev' || !isPlatform
? `${LOCAL_HASURA_URL}/console`
: generateAppServiceUrl(
currentApplication?.subdomain,
currentApplication?.region.awsName,
'hasura',
defaultLocalBackendSlugs,
{ ...defaultRemoteBackendSlugs, hasura: '/console' },
);
return (
<div className="mx-auto w-full max-w-md px-6 py-4 text-left">
@@ -59,14 +71,14 @@ export function HasuraData({ close }: HasuraDataProps) {
<div className="mt-6 grid grid-flow-row gap-2">
<Link
href={`${hasuraUrl}/console`}
href={hasuraUrl}
target="_blank"
rel="noreferrer noopener"
className="grid grid-flow-col items-center justify-center gap-1 rounded-[4px] bg-btn p-2 text-sm+ font-medium text-white hover:ring-2 motion-safe:transition-all"
underline="none"
>
Open Hasura
<ExternalLink className="ml-0.5 h-4 w-4" />
<ArrowSquareOutIcon className="h-4 w-4" />
</Link>
{close && (

View File

@@ -1,224 +0,0 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useSubmitState } from '@/hooks/useSubmitState';
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import { triggerToast } from '@/utils/toast';
import {
refetchGetAppInjectedVariablesQuery,
useUpdateApplicationMutation,
} from '@/utils/__generated__/graphql';
import { useState } from 'react';
import { Controller, useForm } from 'react-hook-form';
export interface EditCustomUserJWTTokenData {
customUserJWTToken: string;
}
export type JWTSecretModalState = 'SHOW' | 'EDIT';
export interface JWTSecretModalProps {
close: () => void;
data?: any;
jwtSecret: string;
initialModalState?: JWTSecretModalState;
}
export function EditJWTSecretModal({ close }: any) {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const { submitState, setSubmitState } = useSubmitState();
const [updateApplication] = useUpdateApplicationMutation({
refetchQueries: [
refetchGetAppInjectedVariablesQuery({ id: currentApplication.id }),
],
});
const {
handleSubmit,
control,
formState: { isSubmitting },
} = useForm<EditCustomUserJWTTokenData>({
reValidateMode: 'onSubmit',
defaultValues: {
customUserJWTToken: '',
},
});
const handleEditJWTSecret = async (data: EditCustomUserJWTTokenData) => {
setSubmitState({
error: null,
loading: false,
fieldsWithError: [],
});
try {
JSON.parse(data.customUserJWTToken);
} catch (error) {
setSubmitState({
error: new Error('The custom JWT token should be valid json.'),
loading: false,
fieldsWithError: [],
});
return;
}
try {
await updateApplication({
variables: {
appId: currentApplication.id,
app: {
hasuraGraphqlJwtSecret: data.customUserJWTToken,
},
},
});
triggerToast(
`Successfully added custom JWT token to ${currentApplication.name}.`,
);
close();
} catch (error) {
triggerToast(
`Error adding custom JWT token to ${currentApplication.name}`,
);
setSubmitState({ error, loading: false, fieldsWithError: [] });
}
};
return (
<form
className="px-6 py-4 w-modal"
onSubmit={handleSubmit(handleEditJWTSecret)}
>
<div className="grid grid-flow-row gap-2">
<div className="grid grid-flow-row text-left">
<Text variant="h3" component="h2">
Add Custom JWT Secret
</Text>
<Text variant="subtitle2">
You can add your custom JWT key here. Hasura will use this key to
validate the identity of your users.
</Text>
</div>
{submitState.error && (
<Alert severity="error">{submitState.error.message}</Alert>
)}
<Controller
name="customUserJWTToken"
control={control}
rules={{
required: true,
}}
render={({ field }) => (
<Input
{...field}
placeholder="Paste your custom JWT token here..."
componentsProps={{
inputRoot: {
className: 'font-mono bg-header',
},
}}
aria-label="Custom JWT token"
type="text"
value={field.value}
onBlur={() =>
setSubmitState({
error: null,
loading: false,
fieldsWithError: [],
})
}
multiline
rows={6}
fullWidth
hideEmptyHelperText
/>
)}
/>
<div className="grid grid-flow-row gap-2">
<Button type="submit" loading={isSubmitting}>
Save Changes
</Button>
<Button variant="outlined" color="secondary" onClick={close}>
Cancel
</Button>
</div>
</div>
</form>
);
}
export function ShowJWTTokenModal({ JWTKey, editJWTSecret }: any) {
return (
<div className="px-6 py-4 w-modal">
<div className="grid grid-flow-row gap-2">
<div className="grid grid-flow-row text-left">
<Text variant="h3" component="h2">
Auth JWT Secret
</Text>
<Text variant="subtitle2">
This is the key used for generating JWTs. It&apos;s HMAC-SHA-based
and the same as configured in Hasura.
</Text>
</div>
<div>
<Input
defaultValue={JWTKey}
multiline
disabled
fullWidth
hideEmptyHelperText
rows={6}
componentsProps={{
inputRoot: { className: 'font-mono' },
}}
/>
</div>
<div className="max-w-sm mx-auto text-center">
<Text variant="subtitle2">
Already using a third party auth service? <br />
<button
type="button"
className="mt-0.5 ml-0.5 text-xs font-medium text-blue"
onClick={() => {
editJWTSecret();
}}
>
Add your custom JWT token
</button>
</Text>
</div>
</div>
</div>
);
}
export function JWTSecretModal({
close,
data,
jwtSecret,
initialModalState,
}: any) {
const [jwtSecretModalState, setJwtSecretModalState] =
useState<JWTSecretModalState>(initialModalState || 'SHOW');
const editJWTSecret = () => {
setJwtSecretModalState('EDIT');
};
if (jwtSecretModalState === 'EDIT') {
return <EditJWTSecretModal close={close} />;
}
return (
<ShowJWTTokenModal
JWTKey={jwtSecret || data}
editJWTSecret={editJWTSecret}
/>
);
}

View File

@@ -7,6 +7,7 @@ import { triggerToast } from '@/utils/toast';
import { useDeleteApplicationMutation } from '@/utils/__generated__/graphql';
import router from 'next/router';
import { useState } from 'react';
import { twMerge } from 'tailwind-merge';
export interface RemoveApplicationModalProps {
/**
@@ -26,6 +27,10 @@ export interface RemoveApplicationModalProps {
* Description of the modal
*/
description?: string;
/**
* Class name to be applied to the modal.
*/
className?: string;
}
export function RemoveApplicationModal({
@@ -33,6 +38,7 @@ export function RemoveApplicationModal({
handler,
title,
description,
className,
}: RemoveApplicationModalProps) {
const [deleteApplication, { client }] = useDeleteApplicationMutation();
const [loadingRemove, setLoadingRemove] = useState(false);
@@ -72,18 +78,14 @@ export function RemoveApplicationModal({
}
return (
<div className="w-modal text-left">
<div className={twMerge('w-full max-w-sm p-6 text-left', className)}>
<div className="grid grid-flow-row gap-1">
<Text variant="h3" component="h2">
{title || 'Delete Project'}
</Text>
<Text variant="subtitle2">
{description ? (
<div>{description}</div>
) : (
<div>Are you sure you want to delete this app?</div>
)}
{description || 'Are you sure you want to delete this app?'}
</Text>
<Text variant="subtitle2" className="font-bold !text-rose-600">
@@ -98,33 +100,15 @@ export function RemoveApplicationModal({
checked={remove}
onChange={(_event, checked) => setRemove(checked)}
aria-label="Confirm Delete Project #1"
componentsProps={{
formControlLabel: {
componentsProps: {
typography: {
className: '!text-sm+',
},
},
},
}}
/>
<Checkbox
id="accept-2"
label="I understand this action can not be undone"
label="I understand this action cannot be undone"
className="py-2"
checked={remove2}
onChange={(_event, checked) => setRemove2(checked)}
aria-label="Confirm Delete Project #2"
componentsProps={{
formControlLabel: {
componentsProps: {
typography: {
className: '!text-sm+',
},
},
},
}}
/>
</div>

View File

@@ -15,7 +15,7 @@ import { ContainerAllWorkspacesApplications } from './ContainerAllWorkspacesAppl
function ApplicationCreatedAt({ createdAt }: any) {
return (
<Text color="dark" className="self-center text-sm cursor-pointer">
<Text color="dark" className="cursor-pointer self-center text-sm">
created{' '}
{formatDistance(new Date(createdAt), new Date(), {
addSuffix: true,
@@ -30,9 +30,9 @@ function LastSuccesfulDeployment({ deployment }: any) {
<Avatar
name={deployment.commitUserName}
avatarUrl={deployment.commitUserAvatarUrl}
className="self-center w-4 h-4 mr-1"
className="mr-1 h-4 w-4 self-center"
/>
<Text color="dark" className="self-center text-sm cursor-pointer">
<Text color="dark" className="cursor-pointer self-center text-sm">
{deployment.commitUserName} deployed{' '}
{formatDistance(new Date(deployment.deploymentEndedAt), new Date(), {
addSuffix: true,
@@ -48,9 +48,9 @@ function CurrentDeployment({ deployment }: any) {
<Avatar
name={deployment.commitUserName}
avatarUrl={deployment.commitUserAvatarUrl}
className="self-center w-4 h-4 mr-1"
className="mr-1 h-4 w-4 self-center"
/>
<Text color="dark" className="self-center text-sm cursor-pointer">
<Text color="dark" className="cursor-pointer self-center text-sm">
{deployment.commitUserName} updated just now
</Text>
</div>
@@ -103,7 +103,7 @@ export function RenderWorkspacesWithApps({
variant="a"
color="greyscaleGrey"
size="normal"
className="mb-3 font-medium cursor-pointer"
className="mb-3 cursor-pointer font-medium"
>
{workspace.name}
</Text>
@@ -138,16 +138,16 @@ export function RenderWorkspacesWithApps({
? app.deployments[0].deploymentStatus === 'DEPLOYING'
: false;
return (
<div key={app.slug} className="py-4 cursor-pointer">
<div key={app.slug} className="cursor-pointer py-4">
<Link href={`${workspace?.slug}/${app.slug}`} passHref>
<a
href={`${workspace?.slug}/${app.slug}`}
className="flex px-2 bg-white rounded-sm place-content-between border-divide"
className="flex place-content-between rounded-sm border-divide bg-white px-2"
>
<div className="flex flex-col self-center w-full">
<div className="flex flex-row w-full place-content-between">
<div className="flex w-full flex-col self-center">
<div className="flex w-full flex-row place-content-between">
<div className="flex flex-row items-center self-center">
<div className="w-10 h-10 overflow-hidden rounded-lg">
<div className="h-10 w-10 overflow-hidden rounded-lg">
<Image
src="/logos/new.svg"
alt="Nhost Logo"
@@ -155,12 +155,12 @@ export function RenderWorkspacesWithApps({
height={40}
/>
</div>
<div className="flex flex-col ml-2 text-left">
<div className="ml-2 flex flex-col text-left">
<div>
<Text
color="dark"
size="normal"
className="self-center font-medium text-left capitalize cursor-pointer"
className="cursor-pointer self-center text-left font-medium capitalize"
>
{app.name}
</Text>
@@ -192,7 +192,7 @@ export function RenderWorkspacesWithApps({
<div className="flex flex-row">
<div className="flex self-center align-middle">
{app.deployments[0] && (
<div className="flex self-center mr-2 align-middle">
<div className="mr-2 flex self-center align-middle">
<StatusCircle
status={
app.deployments[0]

View File

@@ -1,28 +0,0 @@
import { Avatar } from '@/ui/Avatar';
import { Text } from '@/ui/Text';
import { nhost } from '@/utils/nhost';
import Image from 'next/image';
export function SelectedWorkspaceOnNewApp({ current }: any) {
const user = nhost.auth.getUser();
return (
<div className="flex flex-row space-x-2 self-center">
{current.name === 'Default Workspace' ? (
<Avatar
className="h-5 w-5 self-center rounded-full"
name={user?.displayName}
avatarUrl={user?.avatarUrl}
/>
) : (
<div className="h-5 w-5 overflow-hidden rounded-md">
<Image src="/logos/new.svg" alt="Nhost Logo" width={20} height={20} />
</div>
)}
<Text size="small" color="greyscaleDark" className="font-normal">
{current.name}
</Text>
</div>
);
}
export default SelectedWorkspaceOnNewApp;

View File

@@ -13,14 +13,17 @@ export function FunctionsLogsTerminalPage({ functionName }: any) {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [normalizedFunctionData, setNormalizedFunctionData] = useState(null);
const { data } = useGetFunctionLogQuery({
const { data, startPolling } = useGetFunctionLogQuery({
variables: {
subdomain: currentApplication.subdomain,
functionPaths: [functionName?.split('/').slice(1, 3).join('/')],
},
pollInterval: 3000,
});
useEffect(() => {
startPolling(3000);
}, [startPolling]);
useEffect(() => {
if (!data || data.getFunctionLogs.length === 0) {
return;
@@ -38,8 +41,8 @@ export function FunctionsLogsTerminalPage({ functionName }: any) {
normalizedFunctionData.logs.length === 0
) {
return (
<div className="w-full text-white rounded-lg">
<div className="px-4 py-4 overflow-auto font-mono rounded-lg shadow-sm h-terminal bg-log">
<div className="w-full rounded-lg text-white">
<div className="h-terminal overflow-auto rounded-lg bg-log px-4 py-4 font-mono shadow-sm">
<div className="font-mono text-xs text-grey">
There are no stored logs yet. Try calling your function for logs to
appear.
@@ -50,12 +53,12 @@ export function FunctionsLogsTerminalPage({ functionName }: any) {
);
}
return (
<div className="w-full text-white rounded-lg">
<div className="px-4 py-4 overflow-auto font-mono rounded-lg shadow-sm h-terminal bg-log">
<div className="w-full rounded-lg text-white">
<div className="h-terminal overflow-auto rounded-lg bg-log px-4 py-4 font-mono shadow-sm">
{normalizedFunctionData.logs.map((log) => (
<div
key={`${log.date}-${log.message.slice(66)}`}
className="flex text-sm "
className=" flex text-sm"
>
<div id={`#-${log.date}`}>
<pre className="inline">

View File

@@ -24,7 +24,7 @@ export function EditRepositorySettings({
const { currentApplication } = useCurrentWorkspaceAndApplication();
const form = useForm<EditRepositorySettingsFormData>({
reValidateMode: 'onBlur',
reValidateMode: 'onSubmit',
defaultValues: {
productionBranch: currentApplication.repositoryProductionBranch || 'main',
repoBaseFolder: currentApplication.nhostBaseFolder,

View File

@@ -78,8 +78,8 @@ export function EditRepositorySettingsModal({
return (
<div className="px-1">
<div className="flex flex-col">
<div className="w-8 h-8 mx-auto">
<GithubIcon className="w-8 h-8 text-greyscaleDark" />
<div className="mx-auto h-8 w-8">
<GithubIcon className="h-8 w-8 text-greyscaleDark" />
</div>
<Text
variant="subHeading"
@@ -95,7 +95,7 @@ export function EditRepositorySettingsModal({
variant="body"
color="greyscaleDark"
size="small"
className="font-normal text-center"
className="text-center font-normal"
>
{selectedRepoId
? `We'll deploy changes automatically when you push to the deployment branch. `
@@ -110,7 +110,7 @@ export function EditRepositorySettingsModal({
<div className="">
<RepoAndBranch />
</div>
<div className="flex flex-col mt-2">
<div className="mt-2 flex flex-col">
<Button
type="submit"
color="primary"
@@ -123,7 +123,7 @@ export function EditRepositorySettingsModal({
</Button>
</div>
</form>
<div className="flex flex-col mt-2">
<div className="mt-2 flex flex-col">
<Button
type="button"
variant="outlined"

View File

@@ -1,5 +1,5 @@
import ExternalLink from '@/components/icons/ExternalIcon';
import GithubIcon from '@/components/icons/GithubIcon';
import ArrowSquareOutIcon from '@/ui/v2/icons/ArrowSquareOutIcon';
import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
@@ -27,7 +27,7 @@ export default function GitHubInstallNhostApplication() {
underline="none"
>
Configure the Nhost application on GitHub{' '}
<ExternalLink className="h-4 w-4" />
<ArrowSquareOutIcon className="h-4 w-4" />
</Link>
</div>
);

View File

@@ -20,19 +20,19 @@ export function GitHubNoRepositoriesAdded({
variant="body"
color="greyscaleDark"
size="tiny"
className="font-normal text-center"
className="text-center font-normal"
>
Check the Nhost app&apos;s settings on your GitHub account, or install
the app on a new account.
</Text>
<div className="py-3 my-2 border-t border-b">
<div className="my-2 border-t border-b py-3">
<div className="flex">
{filteredGitHubAppInstallations.map((githubApp) => (
<div key={githubApp.id} className="flex items-center mr-4">
<div key={githubApp.id} className="mr-4 flex items-center">
<Avatar
avatarUrl={githubApp.accountAvatarUrl as string}
className="w-5 h-5 mr-1"
className="mr-1 h-5 w-5"
/>
{githubApp.accountLogin}
</div>
@@ -45,9 +45,9 @@ export function GitHubNoRepositoriesAdded({
rel="noreferrer noopener"
transparent
type={null}
className="text-xs font-medium cursor-pointer text-blue"
className="cursor-pointer text-xs font-medium text-blue"
>
<PlusSmIcon className="w-4 h-4 mr-1 border rounded-full border-btn" />
<PlusSmIcon className="mr-1 h-4 w-4 rounded-full border border-btn" />
Configure the Nhost application on GitHub.
</Button>
</div>

View File

@@ -2,7 +2,7 @@ import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLCl
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select';
import type { RemoteAppGetUsersQuery } from '@/utils/__generated__/graphql';
import type { RemoteAppGetUsersCustomQuery } from '@/utils/__generated__/graphql';
import { useRemoteAppGetUsersCustomQuery } from '@/utils/__generated__/graphql';
import { DEFAULT_ROLES } from './utils';
@@ -57,7 +57,7 @@ export function UserSelect({ onUserChange, ...props }: UserSelectProps) {
return;
}
const user: RemoteAppGetUsersQuery['users'][number] = users.find(
const user: RemoteAppGetUsersCustomQuery['users'][0] = users.find(
({ id }) => id === userId,
);

View File

@@ -1 +0,0 @@
export { default } from './AppDeployments';

View File

@@ -1,167 +0,0 @@
import { useDialog } from '@/components/common/DialogProvider';
import Form from '@/components/common/Form';
import {
useResetPostgresPasswordMutation,
useUpdateApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Text } from '@/ui';
import Button from '@/ui/v2/Button';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import { copy } from '@/utils/copy';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { generateRandomPassword, schema } from '@/utils/generateRandomPassword';
import { triggerToast } from '@/utils/toast';
import { useUserData } from '@nhost/react';
import { useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
export interface ResetDatabasePasswordFormProps {
/**
* The new password to set for the database.
*/
newDatabasePassword: string;
}
export default function ResetDatabasePasswordForm() {
const [passwordError, setPasswordError] = useState('');
const [updateApplication] = useUpdateApplicationMutation();
const form = useForm<ResetDatabasePasswordFormProps>({
reValidateMode: 'onChange',
defaultValues: {
newDatabasePassword: generateRandomPassword(),
},
});
const { setValue, getValues, register } = form;
const { closeAlertDialog } = useDialog();
const [resetPostgresPasswordMutation, { loading }] =
useResetPostgresPasswordMutation();
const user = useUserData();
const { currentApplication } = useCurrentWorkspaceAndApplication();
const handleGenerateRandomPassword = () => {
const newRandomDatabasePassword = generateRandomPassword();
setPasswordError('');
triggerToast('New random database password generated.');
setValue('newDatabasePassword', newRandomDatabasePassword);
};
const handleChangeDatabasePassword = async (
data: ResetDatabasePasswordFormProps,
) => {
try {
await resetPostgresPasswordMutation({
variables: {
appID: currentApplication.id,
newPassword: data.newDatabasePassword,
},
});
await updateApplication({
variables: {
appId: currentApplication.id,
app: {
postgresPassword: data.newDatabasePassword,
},
},
});
closeAlertDialog();
triggerToast(`${currentApplication.name} Database Password changed.`);
} catch (e) {
triggerToast(
`Error trying to change database password for ${currentApplication.name}`,
);
await discordAnnounce(
`Error trying to change database password: ${currentApplication.name} (${user.email}): ${e.message}`,
);
}
};
return (
<FormProvider {...form}>
<Form className="mx-0.5" onSubmit={handleChangeDatabasePassword}>
<Input
{...register('newDatabasePassword')}
name="newDatabasePassword"
id="newDatabasePassword"
autoComplete="new-password"
type="password"
error={Boolean(passwordError)}
helperText={
<>
{passwordError && <div className="pb-2">{passwordError}</div>}
<Text className="font-normal" size="tiny" color="greyscaleDark">
The root postgres password for your database - it must be strong
and hard to guess.{' '}
<Button
onClick={handleGenerateRandomPassword}
className="contents text-xs "
>
<span className="ml-1 font-medium text-greyscaleDark underline underline-offset-2">
Generate a password
</span>
</Button>
</Text>
</>
}
endAdornment={
<InputAdornment position="end" className="absolute right-2">
<Button
sx={{ minWidth: 0, padding: 0 }}
color="secondary"
onClick={() => {
copy(getValues('newDatabasePassword'), 'Postgres password');
}}
variant="borderless"
aria-label="Copy your newly randomly generated password to the clipboard."
>
<CopyIcon className="h-4 w-4" />
</Button>
</InputAdornment>
}
onChange={async (e) => {
if (e.target.value.length === 0) {
setValue('newDatabasePassword', e.target.value);
setPasswordError('Please enter a password');
return;
}
setValue('newDatabasePassword', e.target.value);
setPasswordError('');
try {
await schema.validate({
'Database Password': e.target.value,
});
setPasswordError('');
} catch (validationError) {
setPasswordError(validationError.message);
}
}}
fullWidth
/>
<div className="mt-6 grid grid-flow-col place-content-between py-2">
<Button
color="secondary"
variant="borderless"
onClick={closeAlertDialog}
>
Cancel
</Button>
<Button
color="primary"
type="submit"
disabled={Boolean(passwordError)}
loading={loading}
>
Reset Database Password
</Button>
</div>
</Form>
</FormProvider>
);
}

View File

@@ -1,2 +0,0 @@
export * from './ResetDatabasePasswordForm';
export { default } from './ResetDatabasePasswordForm';

View File

@@ -1,70 +0,0 @@
import { ProviderSetting } from '@/components/applications/settings/providers/helpers';
// TODO: See TODO comment in ProviderSettings.tsx about the react-hook-form
// refactor
export interface AppleProviderSettingsFormProps {
authProviderClientId: string;
authProviderTeamId: string;
authProviderKeyId: string;
authProviderClientSecret: string;
handleClientIdChange: (value: string) => void;
handleTeamIdChange: (value: string) => void;
handleKeyIdChange: (value: string) => void;
handleClientSecretChange: (value: string) => void;
}
export default function AppleProviderSettingsForm({
authProviderClientId,
authProviderTeamId,
authProviderKeyId,
authProviderClientSecret,
handleClientIdChange,
handleTeamIdChange,
handleKeyIdChange,
handleClientSecretChange,
}: AppleProviderSettingsFormProps) {
return (
<div className="space-y-3 divide-y-1 divide-divide">
<ProviderSetting
title="Team ID"
desc="Copy from Apple and enter here"
inputPlaceholder="Paste Team ID here"
input
inputValue={authProviderTeamId}
inputOnChange={handleTeamIdChange}
inputType="text"
/>
<ProviderSetting
title="Service ID"
desc="Copy from Apple and enter here"
inputPlaceholder="Paste Service ID here"
input
inputValue={authProviderClientId}
inputOnChange={handleClientIdChange}
inputType="text"
/>
<ProviderSetting
title="Key ID"
desc="Copy from Apple and enter here"
inputPlaceholder="Paste Key ID here"
input
inputValue={authProviderKeyId}
inputOnChange={handleKeyIdChange}
inputType="text"
/>
<ProviderSetting
title="Private Key"
desc="Copy from Apple and enter here"
inputPlaceholder="Paste Private Key here"
input
inputValue={authProviderClientSecret.replace(/\\n/gi, '\n')}
inputOnChange={handleClientSecretChange}
inputType="text"
multiline
/>
</div>
);
}

View File

@@ -1,2 +0,0 @@
export * from './AppleProviderSettingsForm';
export { default } from './AppleProviderSettingsForm';

View File

@@ -1,44 +0,0 @@
import { ProviderSetting } from '@/components/applications/settings/providers/helpers';
import type { Provider } from '@/types/providers';
// TODO: See TODO comment in ProviderSettings.tsx about the react-hook-form
// refactor
export interface GeneralProviderSettingsFormProps {
provider: Provider;
authProviderClientId: string;
authProviderClientSecret: string;
handleClientIdChange: (value: string) => void;
handleClientSecretChange: (value: string) => void;
}
export default function GeneralProviderSettingsForm({
provider,
authProviderClientId,
authProviderClientSecret,
handleClientIdChange,
handleClientSecretChange,
}: GeneralProviderSettingsFormProps) {
return (
<div className="space-y-3 divide-y-1 divide-divide">
<ProviderSetting
title={`${provider.name} Client ID`}
desc={`Copy from ${provider.name} and enter here`}
inputPlaceholder="Paste Client ID here"
input
inputValue={authProviderClientId}
inputOnChange={handleClientIdChange}
inputType="text"
/>
<ProviderSetting
title={`${provider.name} Client Secret`}
desc={`Copy from ${provider.name} and enter here`}
inputPlaceholder="Paste secret here"
input
inputValue={authProviderClientSecret}
inputOnChange={handleClientSecretChange}
inputType="password"
/>
</div>
);
}

View File

@@ -1,2 +0,0 @@
export * from './GeneralProviderSettingsForm';
export { default } from './GeneralProviderSettingsForm';

View File

@@ -1,20 +0,0 @@
import { capitalize } from '@/utils/helpers';
import Image from 'next/image';
export interface PreviewProps {
provider: string;
}
export function Preview({ provider }: PreviewProps) {
return (
<div className="flex items-center justify-center p-10">
<Image
src={`/assets/social-providers/${provider.toLowerCase()}-preview.svg`}
alt={`${capitalize(provider)} sign in preview`}
className="mx-auto w-full max-w-md"
width={480}
height={267}
/>
</div>
);
}

View File

@@ -1,43 +0,0 @@
import Help from '@/components/icons/Help';
import type { Provider } from '@/types/providers';
import { Text } from '@/ui/Text';
import { resolveProvider } from '@/utils/resolveProvider';
import Image from 'next/image';
import { useRouter } from 'next/router';
type ProviderHeaderProps = {
provider: Provider;
};
export function ProviderHeader({ provider }: ProviderHeaderProps) {
const router = useRouter();
const providerId = router.query.providerId as string;
return (
<div className="flex flex-row items-center space-x-2">
<div className="w-14">
<Image
src={`/assets/${resolveProvider(providerId)}.svg`}
alt={`Logo of ${provider.name}`}
width={56}
height={56}
layout="responsive"
/>
</div>
<div className="flex w-full flex-row place-content-between">
<Text color="dark" className="font-medium capitalize" size="big">
{provider.name}
</Text>
{provider.docsLink && (
<div className="flex flex-col">
<a href={provider.docsLink} target="_blank" rel="noreferrer">
<Help className="h-10 w-10" />
</a>
</div>
)}
</div>
</div>
);
}
export default ProviderHeader;

View File

@@ -1,27 +0,0 @@
import { useGetAppLoginDataQuery } from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import { ProviderPage } from './ProviderPage';
export function ProviderPagePreload() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const { data, loading, error } = useGetAppLoginDataQuery({
variables: {
id: currentApplication?.id,
},
skip: !currentApplication?.id,
});
if (error) {
throw error;
}
if (loading) {
return <ActivityIndicator delay={500} label="Loading providers..." />;
}
return <ProviderPage app={data?.app} />;
}
export default ProviderPagePreload;

View File

@@ -1,102 +0,0 @@
import { Preview } from '@/components/applications/providers/Preview';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useFormSaver } from '@/hooks/useFormSaver';
import type { Provider } from '@/types/providers';
import { FormSaver } from '@/ui/FormSaver';
import { Text } from '@/ui/Text';
import { Toggle } from '@/ui/Toggle';
import { getDynamicVariables } from '@/utils/getDynamicVariables';
import { triggerToast } from '@/utils/toast';
import { useUpdateAppMutation } from '@/utils/__generated__/graphql';
import { useRouter } from 'next/router';
type ProviderInfoProps = {
provider: Provider;
authProviderEnabled: boolean;
setAuthProviderEnabled: (enabled: boolean) => void;
};
export function ProviderInfo({
provider,
authProviderEnabled,
setAuthProviderEnabled,
}: ProviderInfoProps) {
const router = useRouter();
const providerId = router.query.providerId as string;
const { showFormSaver, setShowFormSaver, submitState } = useFormSaver();
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [updateApp, { client }] = useUpdateAppMutation();
const { authEnabled } = getDynamicVariables(providerId, {}, true);
const handleFormSubmit = async () => {
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
[authEnabled as string]: authProviderEnabled,
},
},
});
await client.refetchQueries({
include: ['getAppLoginData'],
});
setShowFormSaver(false);
triggerToast('Settings saved');
} catch (error) {
// TODO: Display error to user and use a logging solution
}
};
return (
<div>
{showFormSaver && (
<FormSaver
show={showFormSaver}
onCancel={() => {
setShowFormSaver(false);
setAuthProviderEnabled(false);
}}
onSave={() => {
handleFormSubmit();
}}
loading={submitState.loading}
/>
)}
<div className="mt-8 flex flex-row place-content-between">
<div className=" space-y-3">
<div className="flex flex-col">
<Text
variant="body"
color="greyscaleDark"
className=" font-bold"
size="normal"
>
Let users sign in with
<span className="ml-1 capitalize">{provider.name}</span>
</Text>
</div>
</div>
<div className="self-center">
<Toggle
checked={authProviderEnabled}
onChange={() => {
if (authProviderEnabled) {
setShowFormSaver(true);
}
setAuthProviderEnabled(!authProviderEnabled);
}}
/>
</div>
</div>
{!authProviderEnabled && <Preview provider={providerId} />}
</div>
);
}
export default ProviderInfo;

View File

@@ -1,45 +0,0 @@
import providers from '@/data/providers.json';
import { resolveProvider } from '@/utils/resolveProvider';
import type { GetAppFragment } from '@/utils/__generated__/graphql';
import { useRouter } from 'next/router';
import { useState } from 'react';
import { ProviderHeader } from './ProviderHeader';
import { ProviderInfo } from './ProviderInfo';
import { ProviderSettings } from './ProviderSettings';
type ProviderPageProps = {
app: GetAppFragment;
};
export function ProviderPage({ app }: ProviderPageProps) {
const router = useRouter();
const providerId = router.query.providerId as string;
const providerEnabled = app[`auth${resolveProvider(providerId)}Enabled`];
const [authProviderEnabled, setAuthProviderEnabled] =
useState(providerEnabled);
const provider = providers.find(
(availableProvider) => providerId === availableProvider.name.toLowerCase(),
);
return (
<>
<ProviderHeader provider={provider} />
<ProviderInfo
provider={provider}
authProviderEnabled={authProviderEnabled}
setAuthProviderEnabled={setAuthProviderEnabled}
/>
<ProviderSettings
provider={provider}
app={app}
authProviderEnabled={authProviderEnabled}
/>
</>
);
}
export default ProviderPage;

View File

@@ -1,378 +0,0 @@
import {
ProviderSetting,
ProviderSettingsSave,
} from '@/components/applications/settings/providers';
import type { GetAppFragment } from '@/generated/graphql';
import { useUpdateAppMutation } from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useFormSaver } from '@/hooks/useFormSaver';
import type { Provider } from '@/types/providers';
import { Alert } from '@/ui/Alert';
import { FormSaver } from '@/ui/FormSaver';
import Button from '@/ui/v2/Button';
import ChevronDownIcon from '@/ui/v2/icons/ChevronDownIcon';
import ChevronUpIcon from '@/ui/v2/icons/ChevronUpIcon';
import { capitalize, generateRemoteAppUrl } from '@/utils/helpers';
import { resolveProvider } from '@/utils/resolveProvider';
import { triggerToast } from '@/utils/toast';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import AppleProviderSettingsForm from './AppleProviderSettingsForm';
import GeneralProviderSettingsForm from './GeneralProviderSettingsForm';
import WorkOsProviderSettingsForm from './WorkOsProviderSettingsForm';
export interface ProviderSettingsProps {
provider: Provider;
app: GetAppFragment;
authProviderEnabled: boolean;
}
// TODO 1: Simplify this component, improve the reusability by redesigning the
// way the component renders the content, because it's hard to create a provider
// specific layout with the current implementation.
// TODO 2: Change the form to use react-hook-form, so that we can avoid passing
// too much props around these components (e.g: passing xy and handleXyChange to
// children would not be necessary at all).
// TODO 3: This is an accessibility improvement, but labels should be connected
// to the inputs.
export function ProviderSettings({
provider,
app,
authProviderEnabled,
}: ProviderSettingsProps) {
const router = useRouter();
const providerId = router.query.providerId as string;
const [hideSettings, setHideSettings] = useState(false);
const [hasSettings, setHasSettings] = useState(false);
const { currentApplication } = useCurrentWorkspaceAndApplication();
const {
authClientId,
authClientSecret,
authTeamId,
authKeyId,
authDefaultDomain,
authDefaultOrganization,
authDefaultConnection,
// TODO: This function should be extracted from this component and also it
// should be checked why values are used from it's return value **inside**
// the function body.
// eslint-disable-next-line @typescript-eslint/no-use-before-define
} = getProviderSpecificVariables(providerId);
const [authProviderClientSecret, setAuthProviderClientSecret] = useState(
app[authClientSecret] || '',
);
const [authProviderClientId, setAuthProviderClientId] = useState(
app[authClientId] || '',
);
const [authProviderTeamId, setAuthProviderTeamId] = useState(
app[authTeamId] || '',
);
const [authProviderKeyId, setAuthProviderKeyId] = useState(
app[authKeyId] || '',
);
const [authProviderDefaultDomain, setAuthProviderDefaultDomain] = useState(
app[authDefaultDomain] || '',
);
const [authProviderDefaultOrganization, setAuthProviderDefaultOrganization] =
useState(app[authDefaultOrganization] || '');
const [authProviderDefaultConnection, setAuthProviderDefaultConnection] =
useState(app[authDefaultConnection] || '');
const [callError, setCallError] = useState({ error: false, message: '' });
const [updateApp, { client, loading }] = useUpdateAppMutation();
const { showFormSaver, setShowFormSaver, submitState } = useFormSaver();
function getProviderSpecificVariables(
targetProvider: string,
{ prefill = true } = {},
) {
if (targetProvider === 'twitter') {
if (!prefill) {
return {
authTwitterEnabled: authProviderEnabled,
authTwitterConsumerKey: authProviderClientId,
authTwitterConsumerSecret: authProviderClientSecret,
};
}
return {
authEnabled: 'authTwitterEnabled',
authClientId: 'authTwitterConsumerKey',
authClientSecret: 'authTwitterConsumerSecret',
};
}
if (targetProvider === 'apple') {
if (!prefill) {
return {
authAppleEnabled: authProviderEnabled,
authAppleClientId: authProviderClientId,
authAppleKeyId: authProviderKeyId,
authAppleTeamId: authProviderTeamId,
authApplePrivateKey: authProviderClientSecret.replace(/\n/gi, '\\n'),
};
}
return {
authEnabled: 'authAppleEnabled',
authClientId: 'authAppleClientId',
authClientSecret: 'authApplePrivateKey',
authTeamId: 'authAppleTeamId',
authKeyId: 'authAppleKeyId',
};
}
if (targetProvider === 'workos') {
if (!prefill) {
return {
authWorkOsEnabled: authProviderEnabled,
authWorkOsClientId: authProviderClientId,
authWorkOsClientSecret: authProviderClientSecret,
authWorkOsDefaultDomain: authProviderDefaultDomain,
authWorkOsDefaultOrganization: authProviderDefaultOrganization,
authWorkOsDefaultConnection: authProviderDefaultConnection,
};
}
return {
authEnabled: 'authWorkOsEnabled',
authClientId: 'authWorkOsClientId',
authClientSecret: 'authWorkOsClientSecret',
authDefaultDomain: 'authWorkOsDefaultDomain',
authDefaultOrganization: 'authWorkOsDefaultOrganization',
authDefaultConnection: 'authWorkOsDefaultConnection',
};
}
const authEnabled = `auth${resolveProvider(providerId)}Enabled`;
const clientId = `auth${resolveProvider(providerId)}ClientId`;
const clientSecret = `auth${resolveProvider(providerId)}ClientSecret`;
if (!prefill) {
return {
[authEnabled]: authProviderEnabled,
[clientId]: authProviderClientId,
[clientSecret]: authProviderClientSecret,
};
}
return {
authEnabled,
authClientId: clientId,
authClientSecret: clientSecret,
};
}
useEffect(() => {
// Gets the particular providerId GQL field.
const { authEnabled } = getProviderSpecificVariables(providerId);
// Checks if the providerId field is enabled on the app that we get from origin.
if (app[authEnabled]) {
setHasSettings(true);
setHideSettings(true);
}
}, [hasSettings, setHasSettings, app]);
useEffect(() => {
const {
authClientId: clientId,
authTeamId: teamId,
authKeyId: keyId,
authClientSecret: clientSecret,
} = getProviderSpecificVariables(providerId);
// This side effect checks if the clientId or secret doesn't equal the app's clientId or secret and shows the form saver, which can be used to save the new changes.
if (
hasSettings &&
(app[clientSecret] !== authProviderClientSecret ||
app[clientId] !== authProviderClientId ||
app[teamId] !== authProviderTeamId ||
app[keyId] !== authProviderKeyId)
) {
setShowFormSaver(true);
}
}, [
hasSettings,
authProviderClientSecret,
authProviderClientId,
authProviderTeamId,
authProviderKeyId,
authClientSecret,
authClientId,
]);
const handleSettingsToggle = (e) => {
e.preventDefault();
setHideSettings(!hideSettings);
};
const handleSubmit = async (e?: React.SyntheticEvent<HTMLFormElement>) => {
if (e) {
e.preventDefault();
}
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
...getProviderSpecificVariables(providerId, { prefill: false }),
},
},
});
} catch (error) {
setCallError({ error: true, message: error.message });
return;
}
await client.refetchQueries({
include: ['getAppLoginData'],
});
setShowFormSaver(false);
triggerToast('Settings saved');
};
const handleClientIdChange = (value: string) => {
setCallError({ error: false, message: '' });
setAuthProviderClientId(value);
};
const handleTeamIdChange = (value: string) => {
setCallError({ error: false, message: '' });
setAuthProviderTeamId(value);
};
const handleKeyIdChange = (value: string) => {
setCallError({ error: false, message: '' });
setAuthProviderKeyId(value);
};
const handleClientSecretChange = (value: string) => {
setCallError({ error: false, message: '' });
setAuthProviderClientSecret(value);
};
return (
<>
{showFormSaver && (
<FormSaver
show={showFormSaver}
onCancel={() => {
setShowFormSaver(false);
}}
onSave={() => {
handleSubmit();
}}
loading={submitState.loading}
/>
)}
<form onSubmit={handleSubmit}>
{authProviderEnabled && (
<div className="mt-8 space-y-3 divide-y-1 divide-divide border-t border-b pb-2">
{!hideSettings && (
<>
{providerId === 'apple' && (
<AppleProviderSettingsForm
authProviderClientId={authProviderClientId}
authProviderTeamId={authProviderTeamId}
authProviderKeyId={authProviderKeyId}
authProviderClientSecret={authProviderClientSecret}
handleClientIdChange={handleClientIdChange}
handleTeamIdChange={handleTeamIdChange}
handleKeyIdChange={handleKeyIdChange}
handleClientSecretChange={handleClientSecretChange}
/>
)}
{providerId !== 'apple' && (
<GeneralProviderSettingsForm
provider={provider}
authProviderClientId={authProviderClientId}
authProviderClientSecret={authProviderClientSecret}
handleClientIdChange={handleClientIdChange}
handleClientSecretChange={handleClientSecretChange}
/>
)}
{providerId === 'workos' && (
<WorkOsProviderSettingsForm
defaultDomain={authProviderDefaultDomain}
defaultOrganization={authProviderDefaultOrganization}
defaultConnection={authProviderDefaultConnection}
handleDefaultDomainChange={setAuthProviderDefaultDomain}
handleDefaultOrganizationChange={
setAuthProviderDefaultOrganization
}
handleDefaultConnectionChange={
setAuthProviderDefaultConnection
}
/>
)}
</>
)}
<ProviderSetting
title={hideSettings ? 'Login button URL' : 'OAuth Callback URL'}
desc={
hideSettings
? `Use this in your frontend`
: `Paste into ${capitalize(providerId)}`
}
inputPlaceholder=""
input={false}
showCopy
link={
hideSettings
? `${generateRemoteAppUrl(
app.subdomain,
)}/v1/auth/signin/provider/${providerId.toLowerCase()}`
: `${generateRemoteAppUrl(
app.subdomain,
)}/v1/auth/signin/provider/${providerId.toLowerCase()}/callback`
}
/>
</div>
)}
{callError.error && (
<Alert severity="error">
{callError.message ||
'Error trying to update login provider settings.'}
</Alert>
)}
{authProviderEnabled && hasSettings && (
<div className="mt-4 px-2">
<Button
variant="borderless"
onClick={handleSettingsToggle}
className="grid grid-flow-col gap-1.5 text-xs"
>
{hideSettings ? (
<>
View Settings
<ChevronDownIcon className="h-4 w-4" />
</>
) : (
<>
Hide Settings
<ChevronUpIcon className="h-4 w-4" />
</>
)}
</Button>
</div>
)}
{authProviderEnabled && !hasSettings && (
<ProviderSettingsSave provider={provider} loading={loading} />
)}
</form>
</>
);
}

View File

@@ -1,55 +0,0 @@
import { ProviderSetting } from '@/components/applications/settings/providers/helpers';
// TODO: See TODO comment in ProviderSettings.tsx about the react-hook-form
// refactor
export interface WorkOsProviderSettingsFormProps {
defaultDomain: string;
defaultOrganization: string;
defaultConnection: string;
handleDefaultDomainChange: (value: string) => void;
handleDefaultOrganizationChange: (value: string) => void;
handleDefaultConnectionChange: (value: string) => void;
}
export default function WorkOsProviderSettingsForm({
defaultDomain,
defaultOrganization,
defaultConnection,
handleDefaultDomainChange,
handleDefaultOrganizationChange,
handleDefaultConnectionChange,
}: WorkOsProviderSettingsFormProps) {
return (
<div className="grid grid-flow-row gap-3 divide-y-1">
<ProviderSetting
title="Default Domain"
desc=""
inputPlaceholder=""
input
inputValue={defaultDomain}
inputOnChange={handleDefaultDomainChange}
inputType="text"
/>
<ProviderSetting
title="Default Organization"
desc=""
inputPlaceholder=""
input
inputValue={defaultOrganization}
inputOnChange={handleDefaultOrganizationChange}
inputType="text"
/>
<ProviderSetting
title="Default Connection"
desc=""
inputPlaceholder=""
input
inputValue={defaultConnection}
inputOnChange={handleDefaultConnectionChange}
inputType="text"
/>
</div>
);
}

View File

@@ -1,2 +0,0 @@
export * from './WorkOsProviderSettingsForm';
export { default } from './WorkOsProviderSettingsForm';

View File

@@ -1,138 +0,0 @@
import { PermissionSetting } from '@/components/applications/users/PermissionSetting';
import { SettingsSection } from '@/components/applications/users/SettingsSection';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useSubmitState } from '@/hooks/useSubmitState';
import { Alert } from '@/ui/Alert';
import DelayedLoading from '@/ui/DelayedLoading';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import {
useGetAuthSettingsQuery,
useUpdateAppMutation,
} from '@/utils/__generated__/graphql';
import { useApolloClient } from '@apollo/client';
import toast from 'react-hot-toast';
export function GeneralPermissions() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [updateApp] = useUpdateAppMutation();
const client = useApolloClient();
const { submitState, setSubmitState } = useSubmitState();
let toastId: string;
const { loading, data, error } = useGetAuthSettingsQuery({
variables: {
id: currentApplication.id,
},
});
if (loading) {
return <DelayedLoading delay={500} />;
}
if (error) {
throw error;
}
return (
<div className="mx-auto w-full bg-white ">
<SettingsSection
title="General Permissions"
desc="These settings affect all users in your project."
>
{submitState.error && (
<Alert severity="error">{submitState.error.message}</Alert>
)}
<div className="divide-y-1 border-t border-b">
<PermissionSetting
text="Disable New Users"
desc="If set, newly registered users are disabled and won't be able to sign in."
toggle
checked={data.app.authDisableNewUsers}
onChange={async () => {
try {
toastId = showLoadingToast('Saving changes...');
await updateApp({
variables: {
id: currentApplication.id,
app: {
authDisableNewUsers: !data.app.authDisableNewUsers,
},
},
});
await client.refetchQueries({ include: ['getAuthSettings'] });
toast.remove(toastId);
triggerToast(
`Disable new users ${
data.app.authDisableNewUsers ? `Disabled` : `Enabled`
} for ${currentApplication.name}`,
);
} catch (updateError) {
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
if (toastId) {
toast.remove(toastId);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['authDisableNewUsers'],
});
}
}}
/>
<PermissionSetting
text="Allow Anonymous Users"
desc="Enables users to register as an anonymous user."
toggle
checked={data.app.authAnonymousUsersEnabled}
onChange={async () => {
setSubmitState({
loading: true,
error: null,
fieldsWithError: [],
});
try {
toastId = showLoadingToast('Saving changes...');
await updateApp({
variables: {
id: currentApplication.id,
app: {
authAnonymousUsersEnabled:
!data.app.authAnonymousUsersEnabled,
},
},
});
await client.refetchQueries({ include: ['getAuthSettings'] });
toast.remove(toastId);
triggerToast(
`Anonymous users registration ${
data.app.authAnonymousUsersEnabled ? `disabled` : `enabled`
} for ${currentApplication.name}`,
);
} catch (updateError) {
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
if (toastId) {
toast.remove(toastId);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['authAnonymousUsersEnabled'],
});
}
}}
/>
</div>
</SettingsSection>
</div>
);
}
export default GeneralPermissions;

View File

@@ -1,263 +0,0 @@
import { PermissionSetting } from '@/components/applications/users/PermissionSetting';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useSubmitState } from '@/hooks/useSubmitState';
import { Toggle } from '@/ui';
import { Alert } from '@/ui/Alert';
import DelayedLoading from '@/ui/DelayedLoading';
import { Text } from '@/ui/Text';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import {
useGetGravatarSettingsQuery,
useUpdateAppMutation,
} from '@/utils/__generated__/graphql';
import { useApolloClient } from '@apollo/client';
import { useEffect, useState } from 'react';
import toast from 'react-hot-toast';
export function GravatarSettings() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [updateApp] = useUpdateAppMutation();
const client = useApolloClient();
const [currentDefaultGravatar, setCurrentDefaultGravatar] = useState({
id: 'blank',
name: 'blank',
disabled: false,
slug: 'blank',
});
const [currentGravatarRating, setCurrentGravatarRating] = useState({
id: 'g',
name: 'g',
disabled: false,
slug: 'g',
});
const { submitState, setSubmitState } = useSubmitState();
const { loading, data, error } = useGetGravatarSettingsQuery({
variables: {
id: currentApplication.id,
},
});
let toastId: string;
useEffect(() => {
if (!data) {
return;
}
setCurrentDefaultGravatar((previousDefaultGravatar) => ({
...previousDefaultGravatar,
name: data.app.authGravatarDefault,
id: data.app.authGravatarDefault,
slug: data.app.authGravatarDefault,
}));
setCurrentGravatarRating((previousGravatarRating) => ({
...previousGravatarRating,
name: data.app.authGravatarRating,
id: data.app.authGravatarRating,
slug: data.app.authGravatarRating,
}));
}, [data, setCurrentDefaultGravatar, setCurrentGravatarRating]);
if (loading) {
return <DelayedLoading delay={500} />;
}
if (error) {
throw error;
}
return (
<div className="mx-auto w-full font-display">
<div className="flex flex-row place-content-between">
<div className="flex flex-col">
<Text
variant="body"
size="large"
className="font-medium"
color="greyscaleDark"
>
Gravatar Settings
</Text>
<div>
<Text
variant="body"
size="normal"
color="greyscaleDark"
className="mt-1"
>
Enable Gravatars as avatar URL for users.
</Text>
</div>
</div>
<div className="mr-2 flex flex-row">
<Toggle
checked={data.app.authGravatarEnabled}
onChange={async () => {
try {
toastId = showLoadingToast('Saving changes...');
await updateApp({
variables: {
id: currentApplication.id,
app: {
authGravatarEnabled: !data.app.authGravatarEnabled,
},
},
});
await client.refetchQueries({
include: ['getGravatarSettings'],
});
toast.remove(toastId);
triggerToast(
`Gravatars ${
data.app.authGravatarEnabled ? `Disabled` : `Enabled`
} for ${currentApplication.name}`,
);
} catch (updateError) {
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
if (toastId) {
toast.remove(toastId);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['authGravatarEnabled'],
});
}
}}
/>
</div>
</div>
{submitState.error && (
<Alert severity="error" className="mt-4">
{submitState.error.message}
</Alert>
)}
{data.app.authGravatarEnabled && (
<div className="mt-6 mb-12 flex flex-col divide-y-1 divide-divide border-t border-b">
<PermissionSetting
text="AUTH_GRAVATAR_DEFAULT"
options={[
{
id: '404',
name: '404',
},
{
id: 'mp',
name: 'mp',
},
{
id: 'identicon',
name: 'identicon',
},
{
id: 'monsterid',
name: 'monsterid',
},
{
id: 'waatar',
name: 'waatar',
},
{
id: 'retro',
name: 'retro',
},
{
id: 'robohash',
name: 'robohash',
},
{
id: 'blank',
name: 'blank',
},
]}
value={currentDefaultGravatar}
onChange={async (v: { id: string }) => {
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
authGravatarDefault: v.id,
},
},
});
client.refetchQueries({ include: ['getGravatarSettings'] });
triggerToast(
`Changed default gravatar for ${currentApplication.name}`,
);
} catch (updateError) {
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['authGravatarDefault'],
});
}
}}
/>
<PermissionSetting
text="AUTH_GRAVATAR_RATING"
options={[
{
id: 'g',
name: 'g',
},
{
id: 'pg',
name: 'pg',
},
{
id: 'r',
name: 'r',
},
{
id: 'x',
name: 'x',
},
]}
value={currentGravatarRating}
onChange={async (v: { id: string }) => {
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
authGravatarRating: v.id,
},
},
});
client.refetchQueries({ include: ['getGravatarSettings'] });
triggerToast(
`Changed Gravatar rating for ${currentApplication.name}`,
);
} catch (updateError) {
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['authGravatarRating'],
});
}
}}
/>
</div>
)}
</div>
);
}
export default GravatarSettings;

View File

@@ -1,193 +0,0 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { useFormSaver } from '@/hooks/useFormSaver';
import { FormSaver, Toggle } from '@/ui';
import { Alert } from '@/ui/Alert';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import { showLoadingToast, triggerToast } from '@/utils/toast';
import {
useGetAuthSettingsQuery,
useUpdateAppMutation,
} from '@/utils/__generated__/graphql';
import { useApolloClient } from '@apollo/client';
import { useEffect, useRef, useState } from 'react';
import toast from 'react-hot-toast';
export function MultiFactorAuthentication() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [updateApp] = useUpdateAppMutation();
const [OTPIssuer, setOTPIssuer] = useState('');
const client = useApolloClient();
const { showFormSaver, setShowFormSaver, submitState, setSubmitState } =
useFormSaver();
const toastId = useRef<string>();
const { loading, data, error } = useGetAuthSettingsQuery({
variables: {
id: currentApplication.id,
},
});
useEffect(() => {
if (!data) {
return;
}
if (!data.app.authMfaTotpIssuer) {
return;
}
setOTPIssuer(data.app.authMfaTotpIssuer);
}, [data]);
if (loading) {
return (
<ActivityIndicator
delay={500}
label="Loading settings..."
className="mx-auto"
/>
);
}
if (error) {
throw error;
}
async function handleSaveForm() {
setSubmitState({
loading: true,
error: null,
fieldsWithError: [],
});
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
authMfaTotpIssuer: OTPIssuer,
},
},
});
await client.refetchQueries({ include: ['getAuthSettings'] });
setSubmitState({
loading: false,
error: null,
fieldsWithError: [],
});
setShowFormSaver(false);
triggerToast('All changes saved');
} catch (updateError) {
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['OTPIssuer'],
});
}
}
async function handleToggleMFA() {
try {
toastId.current = showLoadingToast('Saving changes...');
await updateApp({
variables: {
id: currentApplication.id,
app: {
authMfaEnabled: !data.app.authMfaEnabled,
},
},
});
await client.refetchQueries({ include: ['getAuthSettings'] });
if (toastId?.current) {
toast.remove(toastId.current);
}
triggerToast(
`Multi-Factor Authentication ${
data.app.authMfaEnabled ? `Disabled` : `Enabled`
} for ${currentApplication.name}`,
);
} catch (updateError) {
if (toastId?.current) {
toast.remove(toastId.current);
}
if (updateError instanceof Error) {
triggerToast(updateError.message);
}
setSubmitState({
loading: false,
error: updateError,
fieldsWithError: ['authMfaEnabled'],
});
}
}
return (
<div className="grid w-full grid-flow-row gap-4">
{showFormSaver && (
<FormSaver
show={showFormSaver}
onCancel={() => {
setShowFormSaver(false);
}}
onSave={handleSaveForm}
loading={submitState.loading}
/>
)}
<div className="flex flex-row place-content-between">
<div className="grid grid-flow-row gap-1.5">
<Text variant="h3" component="h2">
Multi-Factor Authentication
</Text>
<Text>Enable users to use multi-factor authentication (MFA).</Text>
</div>
<div className="mr-2 flex flex-row">
<Toggle
checked={data.app.authMfaEnabled}
onChange={handleToggleMFA}
/>
</div>
</div>
{submitState.error && (
<Alert severity="error">{submitState.error.message}</Alert>
)}
{data.app.authMfaEnabled && (
<div className="border-t border-b border-gray-200 py-4">
<Input
id="otpIssuer"
label="Name of the One Time Password (OTP) issuer"
onChange={(e) => {
setShowFormSaver(true);
setOTPIssuer(e.target.value);
}}
variant="inline"
value={OTPIssuer}
error={submitState.fieldsWithError?.includes('OTPIssuer')}
placeholder={currentApplication.name}
fullWidth
hideEmptyHelperText
inlineInputProportion="50%"
componentsProps={{
label: { className: 'text-sm+' },
}}
/>
</div>
)}
</div>
);
}
export default MultiFactorAuthentication;

View File

@@ -1,122 +0,0 @@
import Copy from '@/components/icons/Copy';
import type { Provider } from '@/types/providers';
import { Button } from '@/ui/Button';
import CheckBoxes from '@/ui/Checkboxes';
import { Input } from '@/ui/Input';
import { Text } from '@/ui/Text';
import { copy } from '@/utils/copy';
import clsx from 'clsx';
import { useState } from 'react';
// TODO: Instead of a `helpers.tsx`, we should have designated files for these
// components
type ProviderSettingsProps = {
title: string;
desc: string;
inputPlaceholder?: string;
input: boolean;
inputValue?: string;
inputOnChange?: (v: string) => void;
inputType?: 'text' | 'password';
multiline?: boolean;
link?: string;
showCopy?: boolean;
};
export function ProviderSetting({
title,
desc,
inputPlaceholder,
input,
inputValue,
inputOnChange,
inputType,
link,
showCopy = false,
multiline,
}: ProviderSettingsProps) {
return (
<div
className={clsx(
'flex w-full flex-row items-center justify-between px-2 pt-3 pb-1',
)}
>
<div className="flex w-80 flex-col">
<Text
variant="body"
color="greyscaleDark"
size="normal"
className="font-medium capitalize"
>
{title}
</Text>
<Text color="greyscaleDark" size="tiny" className="font-normal">
{desc}
</Text>
</div>
<div className="flex w-full flex-row place-content-between self-center">
{input ? (
<Input
placeholder={inputPlaceholder || ''}
className="h-full w-full"
type={inputType}
value={inputValue}
onChange={inputOnChange}
multiline={multiline}
/>
) : (
<div className="flex flex-row self-center align-middle">
<Text
color="greyscaleDark"
size="tiny"
className="self-center font-normal"
>
{link}
</Text>
</div>
)}
{showCopy && (
<Copy
className="ml-1 mr-4 h-4 w-4 cursor-pointer self-center text-greyscaleDark"
onClick={() => {
copy(link as string, title);
}}
/>
)}
</div>
</div>
);
}
type ProviderSettingsSaveProps = {
provider: Provider;
loading: boolean;
};
export function ProviderSettingsSave({
provider,
loading,
}: ProviderSettingsSaveProps) {
const [confirmed, setConfirmed] = useState(false);
return (
<div className="mt-4 flex w-full flex-row place-content-between px-2">
<CheckBoxes
id="confirm-paste"
state={confirmed}
setState={() => setConfirmed(!confirmed)}
checkBoxText={`I have pasted the redirect URI into ${provider.name}.`}
/>
<div />
<Button
type="submit"
variant="primary"
disabled={!confirmed}
loading={loading}
className="self-center"
>
Confirm Settings
</Button>
</div>
);
}

View File

@@ -1 +0,0 @@
export * from './helpers';

View File

@@ -1,71 +0,0 @@
import type { SelectorOption } from '@/ui/Selector';
import Selector from '@/ui/Selector';
import { Text } from '@/ui/Text';
import { Toggle } from '@/ui/Toggle';
import clsx from 'clsx';
export interface PermissionSettingsProps {
text: string;
desc?: string;
toggle?: boolean;
onChange?: any;
checked?: boolean;
options?: any;
value?: SelectorOption;
} // @TODO: Fix alt attribute on images.
// @FIX: Double border
export function PermissionSetting({
text,
desc,
toggle,
checked = false,
onChange,
options,
value,
}: PermissionSettingsProps) {
return (
<div className="flex flex-row place-content-between py-2">
<div
className={clsx(
'flex flex-col space-y-1 self-center px-0.5',
!desc && 'py-3.5',
desc && 'py-2',
)}
>
<Text
variant="body"
size="normal"
className="font-medium"
color="greyscaleDark"
>
{text}
</Text>
{desc && (
<Text
variant="body"
size="tiny"
className="font-normal"
color="greyscaleDark"
>
{desc}
</Text>
)}
</div>
{toggle ? (
<div className="flex flex-row">
<Toggle checked={checked} onChange={onChange} />
</div>
) : (
<div className="flex flex-row self-center">
<Selector
width="w-28"
options={options}
onChange={onChange}
value={value}
/>
</div>
)}
</div>
);
}

View File

@@ -1,58 +0,0 @@
import type { Provider as ProviderType } from '@/types/providers';
import Status, { StatusEnum } from '@/ui/Status';
import { Text } from '@/ui/Text';
import { ChevronRightIcon } from '@heroicons/react/solid';
import Image from 'next/image';
import Link from 'next/link';
import { useRouter } from 'next/router';
interface ProviderProps {
provider: ProviderType;
enabled: boolean;
}
export function Provider({ provider, enabled }: ProviderProps) {
const { name, logo } = provider;
const {
query: { workspaceSlug, appSlug },
} = useRouter();
const nameLowerCase = name.toLowerCase();
return (
<Link
href={`/${workspaceSlug}/${appSlug}/settings/sign-in-methods/${nameLowerCase}`}
passHref
>
<a
href={`${workspaceSlug}/${appSlug}/settings/sign-in-methods/${nameLowerCase}`}
className="flex cursor-pointer flex-row place-content-between border-t py-2.5"
>
<div className="grid grid-flow-col items-center gap-2">
<div className="h-6 w-6">
<Image
src={logo}
alt={`Logo of ${name}`}
width={24}
height={24}
layout="responsive"
/>
</div>
<Text className="font-medium" color="greyscaleDark" size="normal">
{name}
</Text>
</div>
<div className="flex flex-row">
{enabled ? (
<Status status={StatusEnum.Live}>Enabled</Status>
) : (
<Status status={StatusEnum.Closed}>Disabled</Status>
)}
<ChevronRightIcon className="ml-2 h-4 w-4 cursor-pointer self-center" />
</div>
</a>
</Link>
);
}
export default Provider;

View File

@@ -1,183 +0,0 @@
import { CreateUserRoleModal } from '@/components/applications/users/roles/CreateRoleModal';
import { EditUserRoleModal } from '@/components/applications/users/roles/EditUserRoleModal';
import Lock from '@/components/icons/Lock';
import type { GetRolesQuery } from '@/generated/graphql';
import { Modal } from '@/ui';
import { Text } from '@/ui/Text';
import { ChevronRightIcon } from '@heroicons/react/solid';
import clsx from 'clsx';
import type { Dispatch, MouseEvent, MouseEventHandler } from 'react';
import { useReducer } from 'react';
function RolesTableHead() {
return (
<thead>
<tr>
<th className="w-64 py-3 text-left font-medium text-base">
<Text className="text-xs font-bold text-greyscaleDark">Role</Text>
</th>
</tr>
</thead>
);
}
interface UserRoleProps {
role: string;
isSystemRole: boolean;
onClick?: MouseEventHandler<HTMLTableRowElement>;
}
function UserRole({ role, isSystemRole, onClick }: UserRoleProps) {
return (
<tr
className={clsx(isSystemRole ? 'cursor-not-allowed' : 'cursor-pointer')}
onClick={onClick}
>
<td className="py-2">
<Text
size="normal"
className={clsx(
isSystemRole ? 'text-greyscaleGrey' : 'text-greyscaleDark',
'pl-1 font-medium',
)}
>
{role}
</Text>
</td>
<td className="text-right">
{isSystemRole ? (
<div className="inline-flex pr-1">
<Text
size="tiny"
className=" font-mono text-xs font-medium uppercase tracking-wide text-greyscaleGrey"
>
System Role
</Text>
<Lock className="ml-1 h-5 w-5 text-greyscaleGrey" />
</div>
) : (
<div className="inline-flex self-center py-2 pr-1.5">
<ChevronRightIcon className="h-4.5 w-4.5 text-greyscaleDark" />
</div>
)}
</td>
</tr>
);
}
export type UserRoleDetails = {
name: string;
isSystemRole: boolean;
};
export const getUserRoles = (data): UserRoleDetails[] => {
const authUserDefaultAllowedRoles =
data.app.authUserDefaultAllowedRoles.split(',');
return authUserDefaultAllowedRoles.map((role: string) => ({
name: role,
isSystemRole: ['user', 'me'].includes(role),
}));
};
type ModalState = {
visible: boolean;
type: 'create' | 'edit';
payload: UserRoleDetails;
};
type ModalAction = {
type: 'OPEN_CREATE_MODAL' | 'OPEN_EDIT_MODAL' | 'CLOSE_MODAL';
payload?: UserRoleDetails;
};
function modalStateReducer(state: ModalState, action: ModalAction): ModalState {
switch (action.type) {
case 'OPEN_CREATE_MODAL':
return { ...state, visible: true, type: 'create', payload: null };
case 'OPEN_EDIT_MODAL':
return { ...state, visible: true, type: 'edit', payload: action.payload };
case 'CLOSE_MODAL':
return { ...state, visible: false };
default:
throw new Error(`Action type ${action.type} is not supported.`);
}
}
function AddNewUserRole({ dispatch }: { dispatch: Dispatch<ModalAction> }) {
return (
<tr className="cursor-pointer border-y-1 border-solid border-gray-300">
<td className="p-2">
<button
type="button"
onClick={() => dispatch({ type: 'OPEN_CREATE_MODAL' })}
>
<Text className="text-sm+ font-medium text-blue">
Create New Role
</Text>
</button>
</td>
<td />
</tr>
);
}
function RolesTableBody({ data }: { data: GetRolesQuery }) {
const userRoles = getUserRoles(data);
const [
{ visible: modalVisible, type: modalType, payload: modalPayload },
dispatch,
] = useReducer(modalStateReducer, {
visible: false,
type: null,
payload: null,
});
function handleRoleEdit(event: MouseEvent<HTMLTableRowElement>, role: any) {
dispatch({ type: 'OPEN_EDIT_MODAL', payload: role });
}
return (
<>
<Modal
showModal={modalVisible}
close={() => dispatch({ type: 'CLOSE_MODAL' })}
>
{modalType === 'create' ? (
<CreateUserRoleModal
onClose={() => dispatch({ type: 'CLOSE_MODAL' })}
/>
) : (
<EditUserRoleModal
onClose={() => dispatch({ type: 'CLOSE_MODAL' })}
payload={modalPayload}
/>
)}
</Modal>
<tbody className="divide-y-1 border-t-1 border-b-1 border-solid border-gray-300 ">
{userRoles.map((role) => (
<UserRole
key={role.name}
role={role.name}
isSystemRole={role.isSystemRole}
onClick={
role.isSystemRole
? undefined
: (event) => handleRoleEdit(event, role)
}
/>
))}
<AddNewUserRole dispatch={dispatch} />
</tbody>
</>
);
}
export function RolesTable({ data }: { data: GetRolesQuery }) {
return (
<table className="w-full table-fixed overflow-x-auto">
<RolesTableHead />
<RolesTableBody data={data} />
</table>
);
}

View File

@@ -1,73 +0,0 @@
import type { TextProps } from '@/ui/Text';
import { Text } from '@/ui/Text';
import type { PropsWithChildren, ReactNode } from 'react';
import { twMerge } from 'tailwind-merge';
export interface SettingsSectionProps {
/**
* Title of this section.
*/
title: ReactNode;
/**
* Props to be passed to the title component.
*/
titleProps?: TextProps;
/**
* Props to be passed to the wrapper component.
*/
wrapperProps?: TextProps;
/**
* Description of this section.
*/
desc?: ReactNode;
/**
* Props to be passed to the description component.
*/
descriptionProps?: TextProps;
}
export function SettingsSection({
children,
title,
titleProps,
descriptionProps,
desc,
wrapperProps,
}: PropsWithChildren<SettingsSectionProps>) {
const { className: titleClassName, ...restTitleProps } = titleProps || {};
const { className: wrapperClassName } = wrapperProps || {};
const { className: descriptionClassName, ...restDescriptionProps } =
descriptionProps || {};
return (
<div className={twMerge('mt-10', wrapperClassName)}>
<div className="mx-auto font-display">
<div className="flex flex-col place-content-between">
<div>
<Text
size="large"
variant="heading"
className={twMerge('mb-1.5 font-medium', titleClassName)}
color="greyscaleDark"
{...restTitleProps}
>
{title}
</Text>
{desc && (
<Text
variant="body"
size="normal"
color="greyscaleDark"
className={twMerge('mb-3 font-normal', descriptionClassName)}
{...restDescriptionProps}
>
{desc}
</Text>
)}
</div>
</div>
{children}
</div>
</div>
);
}

View File

@@ -32,25 +32,25 @@ function Users({ users }: any) {
key={user.id}
passHref
>
<tr className="cursor-pointer w-52">
<td className="py-1 pr-6 whitespace-nowrap">
<tr className="w-52 cursor-pointer">
<td className="whitespace-nowrap py-1 pr-6">
<div className="flex items-center">
<IconButton
variant="borderless"
color="secondary"
className="p-1 mr-2"
className="mr-2 p-1"
aria-label="Copy user ID"
onClick={(event) => {
event.stopPropagation();
copy(user.id, `User ID`);
}}
>
<CopyIcon className="w-4 h-4" />
<CopyIcon className="h-4 w-4" />
</IconButton>
<div className="flex-shrink-0 w-8 h-8">
<div className="h-8 w-8 flex-shrink-0">
<Avatar
className="w-8 h-8"
className="h-8 w-8"
avatarUrl={user.avatarUrl}
name={user.displayName}
/>
@@ -63,7 +63,7 @@ function Users({ users }: any) {
<Text
variant="a"
color="greyscaleDark"
className="font-medium cursor-pointer"
className="cursor-pointer font-medium"
size="normal"
>
{user.displayName ||
@@ -78,7 +78,7 @@ function Users({ users }: any) {
</div>
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<td className="whitespace-nowrap px-6 py-4">
<Text color="greyscaleDark" className="font-normal" size="normal">
{format(new Date(user.createdAt), 'd MMM yyyy')}
</Text>
@@ -103,13 +103,13 @@ function Users({ users }: any) {
);
})}
</td>
<td className="py-4 pl-6 text-sm font-medium text-right whitespace-nowrap">
<td className="whitespace-nowrap py-4 pl-6 text-right text-sm font-medium">
<Link
href={`/${workspaceSlug}/${appSlug}/users/${user.id}`}
passHref
>
<a href={`${workspaceSlug}/${appSlug}/users/${user.id}`}>
<ChevronRightIcon className="self-center w-4 h-4 ml-2 cursor-pointer" />
<ChevronRightIcon className="ml-2 h-4 w-4 cursor-pointer self-center" />
</a>
</Link>
</td>
@@ -131,7 +131,7 @@ function UserPages({ totalNrOfPages, setCurrentPage }: any) {
<button
type="button"
key={i}
className="px-2 cursor-pointer"
className="cursor-pointer px-2"
onClick={() => {
setCurrentPage(i);
}}
@@ -212,15 +212,15 @@ export function UsersTable({
}
return (
<div className="flex flex-col mt-2 font-display">
<div className="inline-block min-w-full py-2 align-">
<div className="mt-2 flex flex-col font-display">
<div className="align- inline-block min-w-full py-2">
<div className="overflow-hidden border-b">
<table className="min-w-full divide-y divide-gray-200">
<thead className="">
<tr>
<th
scope="col"
className="px-4 py-3 text-xs font-medium tracking-wider text-left text-dark"
className="px-4 py-3 text-left text-xs font-medium tracking-wider text-dark"
>
{data ? (
<TotalUsers
@@ -244,7 +244,7 @@ export function UsersTable({
</th>
<th
scope="col"
className="px-6 py-3 text-xs font-medium tracking-wider text-left text-dark"
className="px-6 py-3 text-left text-xs font-medium tracking-wider text-dark"
>
<Text size="tiny" color="greyscaleDark" className="font-bold">
Signed up at
@@ -253,7 +253,7 @@ export function UsersTable({
<th
scope="col"
className="px-6 py-3 text-xs font-medium tracking-wider text-left text-dark"
className="px-6 py-3 text-left text-xs font-medium tracking-wider text-dark"
>
<Text size="tiny" color="greyscaleDark" className="font-bold">
Roles

View File

@@ -1,110 +0,0 @@
import { useWorkspaceContext } from '@/context/workspace-context';
import useCustomClaims from '@/hooks/useCustomClaims';
import type { CustomClaim } from '@/types/application';
import { Alert } from '@/ui/Alert';
import { triggerToast } from '@/utils/toast';
import {
refetchGetAppCustomClaimsQuery,
useUpdateAppMutation,
} from '@/utils/__generated__/graphql';
import { useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import type {
CreatePermissionVariableBaseFormData,
CreatePermissionVariableModalBaseProps,
} from './CreatePermissionVariableModalBase';
import CreatePermissionVariableModalBase from './CreatePermissionVariableModalBase';
export type CreatePermissionVariableFormData =
CreatePermissionVariableBaseFormData;
export type CreatePermissionVariableModalProps = Pick<
CreatePermissionVariableModalBaseProps,
'onClose'
>;
export default function CreatePermissionVariableModal({
onClose,
}: CreatePermissionVariableModalProps) {
const [error, setError] = useState<Error>();
const form = useForm<CreatePermissionVariableFormData>({
reValidateMode: 'onBlur',
});
const {
workspaceContext: { appId },
} = useWorkspaceContext();
const { data: customClaims } = useCustomClaims({ appId });
const [updateApp] = useUpdateAppMutation({
refetchQueries: [refetchGetAppCustomClaimsQuery({ id: appId })],
});
async function handleSubmit(permissionVariable: CustomClaim) {
setError(undefined);
try {
if (
customClaims.some(
(claim) =>
claim.key.toLowerCase() === permissionVariable.key.toLowerCase(),
)
) {
throw new Error(
'Permission variable with this field name already exists.',
);
}
await updateApp({
variables: {
id: appId,
app: {
authJwtCustomClaims: [...customClaims, permissionVariable]
.filter((claim) => !claim.system)
.reduce(
(authJwtCustomClaims, claim) => ({
...authJwtCustomClaims,
[claim.key]: claim.value,
}),
{},
),
},
},
});
triggerToast('Permission variable created');
if (!onClose) {
return;
}
onClose();
} catch (updateError) {
if (updateError instanceof Error) {
setError(updateError);
} else {
setError(new Error(updateError));
}
}
}
return (
<FormProvider {...form}>
<CreatePermissionVariableModalBase
title="Create Permission Variable"
type="create"
onSubmit={handleSubmit}
onClose={onClose}
errorComponent={
error && (
<Alert className="mt-4" severity="error">
{error.message}
</Alert>
)
}
/>
</FormProvider>
);
}

View File

@@ -1,187 +0,0 @@
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import type { ChangeEvent, MouseEventHandler, ReactNode } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { useFormContext } from 'react-hook-form';
export interface CreatePermissionVariableBaseFormData {
key: string;
value: string;
}
export interface CreateModalBaseProps<T> {
/**
* Title of this modal.
*/
title: string;
/**
* Type of this modal.
*/
type?: 'create' | 'edit';
/**
* Callback to be called when the modal is closed.
*/
onClose?: VoidFunction;
/**
* Callback to be called when remove button is clicked.
*/
onRemove?: MouseEventHandler<HTMLButtonElement>;
/**
* Callback to be called when the form is submitted.
*/
onSubmit: SubmitHandler<T>;
/**
* Error to be displayed.
*/
errorComponent?: ReactNode;
}
export type CreatePermissionVariableModalBaseProps =
CreateModalBaseProps<CreatePermissionVariableBaseFormData>;
export default function CreatePermissionVariableModalBase({
title,
type,
onClose,
onRemove,
onSubmit,
errorComponent,
}: CreatePermissionVariableModalBaseProps) {
const {
handleSubmit,
watch,
register,
formState: { isSubmitting, errors },
} = useFormContext<CreatePermissionVariableBaseFormData>();
const keyHandlers = register('key', {
required: true,
pattern: {
value: /^[a-zA-Z-]+$/i,
message: 'Must contain only letters and hyphens',
},
});
const valueHandlers = register('value', {
required: true,
pattern: {
value: /^[a-zA-Z0-9._[\]]+$/i,
message: 'Must contain only letters, dots, brackets, and underscores',
},
});
const isComplete = !!watch('key') && !!watch('value');
return (
<div className="w-modal p-6 text-left">
<div className="grid w-full grid-flow-col items-center justify-between">
<Text variant="h3" component="h2">
{title}
</Text>
{type === 'edit' && onRemove && (
<Button variant="borderless" color="error" onClick={onRemove}>
Remove
</Button>
)}
</div>
<Text className="mt-2 text-sm+ text-greyscaleDark">
Enter the field name and the path you want to use in this permission
variable.
</Text>
{errorComponent}
<form onSubmit={handleSubmit(onSubmit)} autoComplete="off">
<div className="my-4 grid grid-flow-row divide-y-1 divide-solid divide-gray-200 border-y border-gray-200">
<Input
{...keyHandlers}
value={watch('key')}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
if (
event.target.value &&
!/^[a-zA-Z-]+$/gi.test(event.target.value)
) {
// prevent the user from entering invalid characters
return;
}
keyHandlers.onChange(event);
}}
id="key"
variant="inline"
inlineInputProportion="66%"
label="Field name"
fullWidth
startAdornment={
<Text className="min-w-[73px] text-sm+ text-greyscaleGrey">
X-Hasura-
</Text>
}
componentsProps={{
inputWrapper: { className: 'my-1' },
input: {
className: 'border-transparent focus-within:border-solid pl-2',
},
inputRoot: { className: '!pl-[1px]' },
}}
autoFocus
error={!!errors?.key?.message}
helperText={errors?.key?.message}
hideEmptyHelperText
/>
<Input
{...valueHandlers}
value={watch('value')}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
if (
event.target.value &&
!/^[a-zA-Z-]+$/gi.test(event.target.value)
) {
// prevent the user from entering invalid characters
return;
}
valueHandlers.onChange(event);
}}
id="value"
variant="inline"
inlineInputProportion="66%"
label="Path"
fullWidth
startAdornment={
<Text className="text-sm+ text-greyscaleGrey">user.</Text>
}
componentsProps={{
inputWrapper: { className: 'my-1' },
input: {
className: 'border-transparent focus-within:border-solid pl-2',
},
inputRoot: { className: '!pl-[1px]' },
}}
error={!!errors?.value?.message}
helperText={errors?.value?.message}
hideEmptyHelperText
/>
</div>
<div className="grid gap-2">
<Button
type="submit"
loading={isSubmitting}
disabled={isSubmitting || !isComplete}
>
{type === 'create' ? 'Create Permission Variable' : 'Save Changes'}
</Button>
<Button variant="outlined" color="secondary" onClick={onClose}>
Close
</Button>
</div>
</form>
</div>
);
}

View File

@@ -1,209 +0,0 @@
import { useWorkspaceContext } from '@/context/workspace-context';
import useCustomClaims from '@/hooks/useCustomClaims';
import type { CustomClaim } from '@/types/application';
import { Alert } from '@/ui/Alert';
import { Modal } from '@/ui/Modal';
import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';
import { triggerToast } from '@/utils/toast';
import {
refetchGetAppCustomClaimsQuery,
useUpdateAppMutation,
} from '@/utils/__generated__/graphql';
import { useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import type {
CreatePermissionVariableBaseFormData,
CreatePermissionVariableModalBaseProps,
} from './CreatePermissionVariableModalBase';
import CreatePermissionVariableModalBase from './CreatePermissionVariableModalBase';
export type EditPermissionVariableFormData =
CreatePermissionVariableBaseFormData;
export type EditPermissionVariableModalProps = Pick<
CreatePermissionVariableModalBaseProps,
'onClose'
> & {
/**
* The permission variable to edit.
*/
payload: CustomClaim;
};
export default function EditPermissionVariableModal({
payload: originalCustomClaim,
...props
}: EditPermissionVariableModalProps) {
const [error, setError] = useState<Error>();
const [showRemoveModal, setShowRemoveModal] = useState(false);
const form = useForm<EditPermissionVariableFormData>({
reValidateMode: 'onBlur',
defaultValues: {
key: originalCustomClaim.key || '',
value: originalCustomClaim.value || '',
},
});
const {
workspaceContext: { appId },
} = useWorkspaceContext();
const { data: customClaims } = useCustomClaims({ appId });
const [updateApp] = useUpdateAppMutation({
refetchQueries: [refetchGetAppCustomClaimsQuery({ id: appId })],
});
async function handleSubmit(permissionVariable: CustomClaim) {
setError(undefined);
try {
if (
originalCustomClaim.key.toLowerCase() !==
permissionVariable.key.toLowerCase() &&
customClaims.some(
(claim) =>
claim.key.toLowerCase() === permissionVariable.key.toLowerCase(),
)
) {
throw new Error(
'Permission variable with this field name already exists.',
);
}
// we need to preserve the original position of the permission variable
const currentIndex = customClaims.findIndex(
(claim) =>
claim.key.toLowerCase() === originalCustomClaim.key.toLowerCase(),
);
await updateApp({
variables: {
id: appId,
app: {
authJwtCustomClaims: customClaims
.slice(0, currentIndex)
.concat(permissionVariable)
.concat(customClaims.slice(currentIndex + 1))
.filter((claim) => !claim.system)
.reduce(
(authJwtCustomClaims, claim) => ({
...authJwtCustomClaims,
[claim.key]: claim.value,
}),
{},
),
},
},
});
triggerToast(`Permission variable updated`);
if (props.onClose) {
props.onClose();
}
} catch (updateError) {
if (updateError instanceof Error) {
setError(updateError);
} else {
setError(new Error(updateError));
}
}
}
async function handleRemove() {
setError(undefined);
try {
await updateApp({
variables: {
id: appId,
app: {
authJwtCustomClaims: customClaims
.filter(
(claim) =>
claim.key !== originalCustomClaim.key && !claim.system,
)
.reduce(
(authJwtCustomClaims, claim) => ({
...authJwtCustomClaims,
[claim.key]: claim.value,
}),
{},
),
},
},
});
setShowRemoveModal(false);
triggerToast('Permission variable removed');
if (props.onClose) {
props.onClose();
}
} catch (updateError) {
if (updateError instanceof Error) {
setError(updateError);
} else {
setError(new Error(updateError));
}
}
}
return (
<>
<Modal
showModal={showRemoveModal}
close={() => setShowRemoveModal(false)}
>
<div className="grid w-96 grid-flow-row gap-2 p-6 text-left text-greyscaleDark">
<Text variant="h3" component="h2">
Remove {originalCustomClaim.key}?
</Text>
<Text>You will not be able to use it in permissions anymore.</Text>
<Text>
If you have permission checks currently using this property, they
will never resolve to true.
</Text>
<div className="mt-2 grid grid-flow-row gap-2">
<Button color="error" onClick={handleRemove} className="w-full">
Remove Permission Variable
</Button>
<Button
variant="outlined"
color="secondary"
onClick={() => setShowRemoveModal(false)}
className="w-full"
>
Cancel
</Button>
</div>
</div>
</Modal>
<FormProvider {...form}>
<CreatePermissionVariableModalBase
title="Edit Permission Variable"
type="edit"
onSubmit={handleSubmit}
onRemove={() => setShowRemoveModal(true)}
errorComponent={
error && (
<Alert className="mt-4" severity="error">
{error.message}
</Alert>
)
}
{...props}
/>
</FormProvider>
</>
);
}

View File

@@ -1,101 +0,0 @@
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Alert } from '@/ui/Alert';
import Loading from '@/ui/Loading';
import {
refetchGetRolesQuery,
useGetRolesQuery,
useUpdateAppMutation,
} from '@/utils/__generated__/graphql';
import { useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import type {
CreateUserRoleBaseFormData,
CreateUserRoleModalBaseProps,
} from './CreateUserRoleModalBase';
import { CreateUserRoleModalBase } from './CreateUserRoleModalBase';
export type CreateUserRoleFormData = CreateUserRoleBaseFormData;
export type CreateUserRoleModalProps = Pick<
CreateUserRoleModalBaseProps,
'onClose'
>;
export function CreateUserRoleModal({ onClose }: CreateUserRoleModalProps) {
const [error, setError] = useState<Error>();
const { currentApplication } = useCurrentWorkspaceAndApplication();
const form = useForm<CreateUserRoleBaseFormData>({
reValidateMode: 'onBlur',
});
const [updateApp] = useUpdateAppMutation({
refetchQueries: [refetchGetRolesQuery({ id: currentApplication.id })],
});
const {
data: currentRolesData,
loading,
error: getRolesError,
} = useGetRolesQuery({
variables: {
id: currentApplication.id,
},
});
if (loading) {
return <Loading />;
}
if (getRolesError) {
return (
<div className="mx-auto max-w-2.5xl">
<Alert severity="error">{error.message}</Alert>
</div>
);
}
async function handleSubmit(data) {
setError(undefined);
const newAuthUserDefaultAllowedRoles = `${currentRolesData.app.authUserDefaultAllowedRoles},${data.roleName}`;
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
authUserDefaultAllowedRoles: newAuthUserDefaultAllowedRoles,
},
},
});
if (!onClose) {
return;
}
onClose();
} catch (updateError) {
setError(updateError);
}
}
return (
<FormProvider {...form}>
<CreateUserRoleModalBase
title="Create New Role"
type="create"
onSubmit={handleSubmit}
onClose={onClose}
errorComponent={
error && (
<Alert className="mt-4" severity="error">
{error.message}
</Alert>
)
}
/>
</FormProvider>
);
}

View File

@@ -1,102 +0,0 @@
import type { CreateModalBaseProps } from '@/components/applications/users/permissions/modal/CreatePermissionVariableModalBase';
import { Input } from '@/ui';
import { Button } from '@/ui/Button';
import { Text } from '@/ui/Text';
import { Controller, useFormContext } from 'react-hook-form';
export interface CreateUserRoleBaseFormData {
roleName: string;
}
export type CreateUserRoleModalBaseProps =
CreateModalBaseProps<CreateUserRoleBaseFormData>;
export type CreateUserRoleModal = Pick<CreateUserRoleModalBaseProps, 'onClose'>;
export function CreateUserRoleModalBase({
title,
type,
onRemove,
onSubmit,
errorComponent,
}: CreateUserRoleModalBaseProps) {
const {
control,
handleSubmit,
formState: { isSubmitting },
} = useFormContext<CreateUserRoleBaseFormData>();
return (
<div className="w-modal- p-6 text-left">
<div className="mx-auto items-center justify-between">
<Text
variant="heading"
className="text-center text-lg font-medium text-greyscaleDark"
>
{title}
</Text>
</div>
{errorComponent}
<form onSubmit={handleSubmit(onSubmit)} autoComplete="off">
<div className="mt-3 mb-3 divide-y border-t border-b py-1">
<div className="flex flex-row place-content-between py-2">
<div className="flex w-full flex-row">
<Text
color="greyscaleDark"
className="self-center font-medium"
size="normal"
>
New Role Name
</Text>
</div>
<div className="flex w-full">
<Controller
name="roleName"
control={control}
rules={{
required: true,
pattern: {
value: /^[a-zA-Z0-9-_]+$/,
message: 'Must contain only letters, hyphens, and numbers.',
},
}}
render={({ field }) => (
<Input
{...field}
id="roleName"
required
value={field.value || ''}
onChange={(value: string) => {
if (value && !/^[a-zA-Z0-9-_]+$/gi.test(value)) {
// prevent the user from entering invalid characters
return;
}
field.onChange(value);
}}
/>
)}
/>
</div>
</div>
</div>
<div className="grid gap-2">
<Button
variant="primary"
type="submit"
loading={isSubmitting}
disabled={isSubmitting}
>
{type === 'create' ? 'Create New User Role' : 'Save Changes'}
</Button>
{type === 'edit' && onRemove && (
<Button variant="menu" border onClick={onRemove}>
<Text className="text-sm+ font-medium text-red">Remove Role</Text>
</Button>
)}
</div>
</form>
</div>
);
}

View File

@@ -1,190 +0,0 @@
import type { GetRolesQuery } from '@/generated/graphql';
import {
refetchGetRolesQuery,
useGetRolesQuery,
useUpdateAppMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import { Alert } from '@/ui/Alert';
import { Button } from '@/ui/Button';
import Loading from '@/ui/Loading';
import { Modal } from '@/ui/Modal';
import { Text } from '@/ui/Text';
import { triggerToast } from '@/utils/toast';
import { useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import type {
CreateUserRoleBaseFormData,
CreateUserRoleModalBaseProps,
} from './CreateUserRoleModalBase';
import { CreateUserRoleModalBase } from './CreateUserRoleModalBase';
export type EditUserRoleFormData = CreateUserRoleBaseFormData;
export type EditUserRoleModalProps = Pick<
CreateUserRoleModalBaseProps,
'onClose'
> & {
/**
* The permission variable to edit.
*/
payload: any;
};
export function EditUserRoleModal({
payload: originalRole,
...props
}: EditUserRoleModalProps) {
const [error, setError] = useState<Error>();
const [showRemoveModal, setShowRemoveModal] = useState(false);
const { currentApplication } = useCurrentWorkspaceAndApplication();
const form = useForm<EditUserRoleFormData>({
reValidateMode: 'onBlur',
defaultValues: {
roleName: originalRole.name || '',
},
});
const [updateApp, { loading: loadingUpdateAppMutation }] =
useUpdateAppMutation({
refetchQueries: [refetchGetRolesQuery({ id: currentApplication.id })],
});
const {
data: currentRolesData,
loading,
error: getRolesError,
} = useGetRolesQuery({
variables: {
id: currentApplication.id,
},
});
if (loading) {
return <Loading />;
}
if (getRolesError) {
return (
<div className="mx-auto max-w-2.5xl">
<Alert severity="error">{error.message}</Alert>
</div>
);
}
async function handleSubmit(data: EditUserRoleFormData) {
setError(undefined);
const currentUserRoles =
currentRolesData.app.authUserDefaultAllowedRoles.split(',');
const roleBeingEdited = currentUserRoles.find(
(role) => role === originalRole.name,
);
const indexofRoleBeingEdited = currentUserRoles.indexOf(roleBeingEdited);
const newRoleName = data.roleName;
const newAuthUserDefaultAllowedRoles = currentUserRoles.slice();
if (data.roleName !== originalRole.name) {
newAuthUserDefaultAllowedRoles[indexofRoleBeingEdited] = newRoleName;
}
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
authUserDefaultAllowedRoles:
newAuthUserDefaultAllowedRoles.join(','),
},
},
});
triggerToast(`Role "${data.roleName}" updated successfully`);
props.onClose();
} catch (updateError) {
setError(updateError);
}
}
async function handleRemove(data: GetRolesQuery) {
setError(undefined);
// Get the current roles of this application.
const currentUserRoles = data.app.authUserDefaultAllowedRoles.split(',');
// Remove the role from the current roles.
const filteredCurrentUserRoles = currentUserRoles.filter(
(role) => role !== originalRole.name,
);
const newAuthUserDefaultAllowedRoles = filteredCurrentUserRoles.join(',');
try {
await updateApp({
variables: {
id: currentApplication.id,
app: {
authUserDefaultAllowedRoles: newAuthUserDefaultAllowedRoles,
},
},
});
props.onClose();
triggerToast(`Role "${originalRole.name}" removed successfully`);
} catch (updateError) {
setError(updateError);
}
}
return (
<>
<Modal
showModal={showRemoveModal}
close={() => setShowRemoveModal(false)}
>
<div className="px-6 pt-5 text-center text-greyscaleDark">
<Text variant="heading" className="mb-2 text-lg font-medium">
Remove Role &quot;{originalRole.name}&quot;?
</Text>
<div className="my-4">
<Button
variant="danger"
onClick={() => handleRemove(currentRolesData)}
className="w-full"
loading={loadingUpdateAppMutation}
>
Remove Role
</Button>
<Button
onClick={() => setShowRemoveModal(false)}
className="w-full"
>
Cancel
</Button>
</div>
</div>
</Modal>
<FormProvider {...form}>
<CreateUserRoleModalBase
title="Edit Role"
type="edit"
onSubmit={handleSubmit}
onRemove={() => setShowRemoveModal(true)}
errorComponent={
error && (
<Alert className="mt-4" severity="error">
{error.message}
</Alert>
)
}
{...props}
/>
</FormProvider>
</>
);
}

View File

@@ -1,201 +0,0 @@
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import { useState } from 'react';
type EnvModalProps = {
onSubmit: (props: {
name: string;
prodValue: string;
devValue: string;
}) => Promise<void>;
name?: string;
prodValue?: string;
devValue?: string;
close: VoidFunction;
};
interface AddEnvVarModalVariablesError {
hasError: boolean;
message: string;
}
const DISABLED_START_ENV_VARIABLES = [
'NHOST_',
'HASURA_',
'AUTH_',
'STORAGE_',
'POSTGRES_',
];
const DISABLED_ENV_VARIABLES = [
'PATH',
'NODE_PATH',
'PYTHONPATH',
'GEM_PATH',
'HOSTNAME',
'TERM',
'NODE_VERSION',
'YARN_VERSION',
'NODE_ENV',
'HOME',
];
export default function AddEnvVarModal({
name: externalName,
prodValue: externalProdValue,
devValue: externalDevValue,
close,
onSubmit,
}: EnvModalProps) {
const [name, setName] = useState(externalName || '');
const [prodValue, setProdValue] = useState(externalProdValue || '');
const [devValue, setDevValue] = useState(externalDevValue || '');
const [error, setError] = useState<AddEnvVarModalVariablesError>({
hasError: false,
message: '',
});
const noError: AddEnvVarModalVariablesError = {
hasError: false,
message: '',
};
const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {
setError({ hasError: false, message: '' });
e.preventDefault();
if (
DISABLED_START_ENV_VARIABLES.some((envVar) =>
name.toUpperCase().startsWith(envVar),
)
) {
setError({
hasError: true,
message:
'The environment variable name cannot start with a value that is reserved for an internal environment variable.',
});
return;
}
if (
DISABLED_ENV_VARIABLES.some((envVar) => envVar === name.toUpperCase())
) {
setError({
hasError: true,
message:
'The environment variable name cannot be a value that is reserved for internal use.',
});
return;
}
// only allow alphabet characters and underscores
const onlyLettersWithNumbersStartsWithLetter = /^[a-zA-Z_]+[a-zA-Z0-9_]*$/;
if (!onlyLettersWithNumbersStartsWithLetter.test(name)) {
setError({
hasError: true,
message:
'The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should start with a letter.',
});
return;
}
if (!name) {
setError({ hasError: true, message: 'Variable name is required.' });
return;
}
if (!prodValue) {
setError({ hasError: true, message: 'Production value is required.' });
return;
}
if (!devValue) {
setError({ hasError: true, message: 'Development value is required.' });
return;
}
await onSubmit({
name,
prodValue,
devValue,
});
close();
};
return (
<form onSubmit={handleSubmit}>
<div className="w-modal px-6 py-6 text-left">
<div className="grid grid-flow-row gap-1">
<Text variant="h3" component="h2">
{name || 'EXAMPLE_NAME'}
</Text>
<Text variant="subtitle2">
The default value will be available in all environments, unless you
override it. All values are encrypted.
</Text>
<div className="my-2 grid grid-flow-row gap-2">
<Input
id="name"
label="Name"
autoFocus
autoComplete="off"
fullWidth
placeholder="EXAMPLE_NAME"
value={name}
onChange={(event) => {
setError(noError);
setName(event.target.value);
}}
hideEmptyHelperText
/>
<Input
id="prodValue"
label="Production Value"
fullWidth
placeholder="Enter a value"
value={prodValue}
onChange={(event) => {
setError(noError);
setProdValue(event.target.value);
}}
hideEmptyHelperText
/>
<Input
id="devValue"
label="Development Value"
fullWidth
placeholder="Enter a value"
value={devValue}
onChange={(event) => {
setError(noError);
setDevValue(event.target.value);
}}
hideEmptyHelperText
/>
</div>
{error.hasError && (
<Alert severity="warning" className="mb-2">
<Text className="font-medium">Warning</Text>
<Text>{error.message}</Text>
</Alert>
)}
<div className="grid grid-flow-row gap-2">
<Button type="submit">Add</Button>
<Button onClick={close} variant="outlined" color="secondary">
Close
</Button>
</div>
</div>
</div>
</form>
);
}

View File

@@ -146,7 +146,7 @@ function AddPaymentMethodForm({
};
return (
<div className="px-6 pt-6 pb-6 text-left w-modal2">
<div className="w-modal2 px-6 pt-6 pb-6 text-left">
<div className="flex flex-col">
<form onSubmit={handleSubmit}>
<Text
@@ -161,11 +161,11 @@ function AddPaymentMethodForm({
variant="body"
color="greyscaleDark"
size="small"
className="font-normal text-center"
className="text-center font-normal"
>
We&apos;ll store these in your workspace for future use.
</Text>
<div className="w-full px-2 py-2 my-2 mt-6 rounded-lg border-1">
<div className="my-2 mt-6 w-full rounded-lg border-1 px-2 py-2">
<CardElement
onReady={(element) => element.focus()}
options={{

View File

@@ -37,20 +37,29 @@ function ControlledAutocomplete(
}: ControlledAutocompleteProps<AutocompleteOption>,
ref: ForwardedRef<HTMLInputElement>,
) {
const { setValue } = useFormContext();
const form = useFormContext();
const { field } = useController({
...controllerProps,
...(controllerProps || {}),
name: controllerProps?.name || name || '',
control: controllerProps?.control || control,
});
if (!form) {
throw new Error('ControlledAutocomplete must be used in a FormContext.');
}
const { setValue } = form || {};
return (
<Autocomplete
inputValue={typeof field.value === 'string' ? field.value : undefined}
{...props}
{...field}
ref={mergeRefs([field.ref, ref])}
onChange={(event, options, reason, details) => {
setValue(controllerProps?.name || name, options);
setValue?.(controllerProps?.name || name, options, {
shouldDirty: true,
});
if (props.onChange) {
props.onChange(event, options, reason, details);

View File

@@ -53,7 +53,7 @@ function ControlledCheckbox(
name={field.name}
ref={mergeRefs([field.ref, ref])}
onChange={(event, checked) => {
setValue(controllerProps?.name || name, checked);
setValue(controllerProps?.name || name, checked, { shouldDirty: true });
if (props.onChange) {
props.onChange(event, checked);

View File

@@ -0,0 +1,59 @@
import type { SwitchProps } from '@/ui/v2/Switch';
import Switch from '@/ui/v2/Switch';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import { useController, useFormContext } from 'react-hook-form';
import type {
ControllerProps,
FieldValues,
UseControllerProps,
} from 'react-hook-form/dist/types';
import mergeRefs from 'react-merge-refs';
export interface ControlledSwitchProps<TFieldValues extends FieldValues = any>
extends SwitchProps {
/**
* Props passed to the react-hook-form controller.
*/
controllerProps?: ControllerProps;
/**
* Name of the field.
*/
name?: string;
/**
* Control for the input field.
*/
control?: UseControllerProps<TFieldValues>['control'];
}
function ControlledSwitch(
{ controllerProps, name, control, ...props }: ControlledSwitchProps,
ref: ForwardedRef<HTMLSpanElement>,
) {
const { setValue } = useFormContext();
const { field } = useController({
...controllerProps,
name: controllerProps?.name || name || '',
control: controllerProps?.control || control,
});
return (
<Switch
{...props}
{...field}
ref={mergeRefs([field.ref, ref])}
onChange={(event) => {
setValue(controllerProps?.name || name, event.target.checked, {
shouldDirty: true,
});
if (props.onChange) {
props.onChange(event);
}
}}
checked={field.value || false}
/>
);
}
export default forwardRef(ControlledSwitch);

View File

@@ -0,0 +1,2 @@
export * from './ControlledSwitch';
export { default } from './ControlledSwitch';

View File

@@ -2,11 +2,11 @@ import DataGridBody from '@/components/common/DataGridBody';
import DataGridFrame from '@/components/common/DataGridFrame';
import type { DataGridHeaderProps } from '@/components/common/DataGridHeader';
import DataGridHeader from '@/components/common/DataGridHeader';
import DataBrowserEmptyState from '@/components/data-browser/DataBrowserEmptyState';
import DataBrowserEmptyState from '@/components/dataBrowser/DataBrowserEmptyState';
import { DataGridProvider } from '@/context/DataGridContext';
import type { UseDataGridOptions } from '@/hooks/useDataGrid';
import useDataGrid from '@/hooks/useDataGrid';
import type { DataBrowserGridColumn } from '@/types/data-browser';
import type { DataBrowserGridColumn } from '@/types/dataBrowser';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import type { ForwardedRef } from 'react';
import { forwardRef, useEffect, useRef } from 'react';

View File

@@ -1,7 +1,7 @@
import type { DataGridProps } from '@/components/common/DataGrid';
import DataGridCell from '@/components/common/DataGridCell';
import useDataGridConfig from '@/hooks/useDataGridConfig';
import type { DataBrowserGridColumn } from '@/types/data-browser';
import type { DataBrowserGridColumn } from '@/types/dataBrowser';
import Button from '@/ui/v2/Button';
import PlusIcon from '@/ui/v2/icons/PlusIcon';
import type { DetailedHTMLProps, HTMLProps, KeyboardEvent } from 'react';
@@ -35,15 +35,15 @@ function InsertPlaceholderTableRow({
}: InsertPlaceholderTableRowProps) {
return (
<div
className="h-12 border-r-1 border-b-1 border-gray-200 bg-white"
className="h-12 bg-white border-gray-200 border-r-1 border-b-1"
{...props}
>
<Button
onClick={onInsertRow}
variant="borderless"
color="secondary"
className="h-full w-full justify-start rounded-none px-2 py-3 text-xs font-normal hover:shadow-none focus:shadow-none focus:outline-none"
startIcon={<PlusIcon className="h-4 w-4 text-greyscaleGrey" />}
className="justify-start w-full h-full px-2 py-3 text-xs font-normal rounded-none hover:shadow-none focus:shadow-none focus:outline-none"
startIcon={<PlusIcon className="w-4 h-4 text-greyscaleGrey" />}
>
Insert New Row
</Button>
@@ -181,7 +181,7 @@ export default function DataGridBody<T extends object>({
return (
<div {...getTableBodyProps()} ref={bodyRef} {...props}>
{rows.length === 0 && !loading && (
<div className="flex flex-nowrap pr-5">
<div className="flex pr-5 flex-nowrap">
{onInsertRow ? (
<InsertPlaceholderTableRow
style={{
@@ -279,7 +279,7 @@ export default function DataGridBody<T extends object>({
})}
{allowInsertColumn && (
<div className="h-12 w-25 border-r-1 border-b-1 border-gray-200 bg-white" />
<div className="h-12 bg-white border-gray-200 w-25 border-r-1 border-b-1" />
)}
</div>

Some files were not shown because too many files have changed in this diff Show More