Compare commits

..

126 Commits

Author SHA1 Message Date
Szilárd Dóró
809a2d35f8 Merge pull request #1940 from nhost/changeset-release/main
chore: update versions
2023-05-22 11:51:04 +02:00
github-actions[bot]
e17ec7fce7 chore: update versions 2023-05-22 07:26:27 +00:00
Szilárd Dóró
241175b158 Merge pull request #1935 from nhost/renovate/prettier-plugin-tailwindcss-0.x
chore(deps): update dependency prettier-plugin-tailwindcss to ^0.3.0
2023-05-22 09:14:39 +02:00
Szilárd Dóró
51ceaf2696 Merge pull request #1950 from nhost/fix/nextjs-react-error
fix(nextjs): don't break Next.js when using SignedIn/SignedOut
2023-05-22 09:00:26 +02:00
Szilárd Dóró
490b77cde4 Merge pull request #1949 from nhost/fix/local-infinite-loop
fix(dashboard): don't enter an infinite loop in local mode
2023-05-21 18:14:05 +02:00
Szilárd Dóró
7fea29a8b4 chore: add changeset 2023-05-21 18:13:34 +02:00
Szilárd Dóró
1a34e011ad fix: don't break Next.js when using SignedIn/SignedOut 2023-05-21 18:08:42 +02:00
Szilárd Dóró
395839f449 chore: check service URL when creating client 2023-05-21 16:34:00 +02:00
Szilárd Dóró
399009d66a fix(gql): don't enter an infinite loop when fetching remote app data 2023-05-21 16:31:57 +02:00
Szilárd Dóró
12eb236c4a chore: add changeset 2023-05-19 17:14:22 +02:00
Szilárd Dóró
2218e5cd5b Merge branch 'main' into renovate/prettier-plugin-tailwindcss-0.x 2023-05-19 17:12:36 +02:00
Szilárd Dóró
2dcf1b38c6 Merge pull request #1945 from nhost/fix/404-not-found
fix(dashboard): don't redirect to 404 on project creation
2023-05-19 16:16:13 +02:00
Szilárd Dóró
ad49c92879 fix: trigger project list refetch properly 2023-05-19 15:31:17 +02:00
Szilárd Dóró
13dd57eeb4 Merge pull request #1943 from nhost/fix/deployment-sorting
fix(dashboard): sync deployment sorting
2023-05-19 15:27:44 +02:00
Szilárd Dóró
1345741b11 fix: don't redirect to 404 2023-05-19 15:26:20 +02:00
renovate[bot]
511615f176 chore(deps): update dependency prettier-plugin-tailwindcss to ^0.3.0 2023-05-19 09:51:56 +00:00
Szilárd Dóró
1198c201f1 Merge pull request #1922 from nhost/renovate/turbo-1.x
chore(deps): update dependency turbo to v1.9.8
2023-05-19 11:48:43 +02:00
Szilárd Dóró
f9b81a2ae9 chore: bump version in the Dockerfile as well 2023-05-19 10:34:21 +02:00
Szilárd Dóró
dff0894f37 Revert "fix: sync deployment sorting"
This reverts commit 80f3645d57.
2023-05-19 09:38:04 +02:00
Szilárd Dóró
80f3645d57 fix: sync deployment sorting 2023-05-19 09:27:24 +02:00
Szilárd Dóró
7ddb9a654e fix: sync deployment sorting 2023-05-19 09:10:44 +02:00
Szilárd Dóró
71f3be15d8 Merge pull request #1941 from nhost/chore/under-the-hood-improvements
chore(dashboard): under the hood improvements
2023-05-19 09:03:46 +02:00
Szilárd Dóró
96a9070836 chore: loosen eslint rules 2023-05-18 17:07:15 +02:00
Szilárd Dóró
329e5a91b9 fix: use the correct deployment ordering 2023-05-18 16:01:44 +02:00
Szilárd Dóró
6d559d6e23 chore: under the hood improvements 2023-05-18 11:39:22 +02:00
renovate[bot]
f4f1450d06 chore(deps): update dependency turbo to v1.9.8 2023-05-18 08:22:54 +00:00
Szilárd Dóró
a1eea9df7d Merge pull request #1932 from nhost/renovate/docusaurus-monorepo
fix(deps): update docusaurus monorepo to v2.4.1
2023-05-18 10:16:23 +02:00
Szilárd Dóró
26f2b665e6 Merge pull request #1924 from nhost/feat/pat
feat(hasura-auth-js): add support for personal access tokens
2023-05-18 10:14:12 +02:00
renovate[bot]
224a5cc805 fix(deps): update docusaurus monorepo to v2.4.1 2023-05-17 11:05:58 +00:00
David Barroso
59125b3c77 Merge pull request #1937 from nhost/dbarroso/react-apollo-example-update
chore: update react-apollo example's dependencies
2023-05-17 13:02:09 +02:00
Szilárd Dóró
5b69e3efd8 fix: don't break builds 2023-05-17 10:41:27 +02:00
Szilárd Dóró
c9a444d048 chore: sync playwright versions 2023-05-17 10:21:03 +02:00
David Barroso
2eeac45718 asd 2023-05-17 09:54:44 +02:00
David Barroso
fe8ca8aba6 Update examples/react-apollo/package.json
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-05-17 09:32:13 +02:00
David Barroso
086ee46b08 chore: update react-apollo example's dependencies 2023-05-17 09:21:25 +02:00
Szilárd Dóró
203bc97f51 feat: add useSignInPAT to @nhost/vue 2023-05-16 14:42:55 +02:00
Szilárd Dóró
b24af44aac feat: add support for refreshTokenId 2023-05-16 12:54:51 +02:00
Szilárd Dóró
cdaa6d4e73 chore: remove hash function 2023-05-16 12:16:35 +02:00
Szilárd Dóró
09e2c8f5c7 feat: add hash function 2023-05-16 11:24:52 +02:00
Szilárd Dóró
4581677830 chore: update docs 2023-05-16 09:37:51 +02:00
Szilárd Dóró
7bfa6c9f93 fix: use correct hasura-auth image 2023-05-16 08:59:17 +02:00
Szilárd Dóró
80ef430d70 feat: add personal access token docs 2023-05-16 08:51:22 +02:00
Szilárd Dóró
bad8af0fd1 Merge branch 'main' into feat/pat 2023-05-16 08:35:24 +02:00
Szilárd Dóró
69caa34c43 Merge pull request #1934 from nhost/changeset-release/main
chore: update versions
2023-05-16 08:34:38 +02:00
github-actions[bot]
1d898e2893 chore: update versions 2023-05-15 18:43:10 +00:00
Szilárd Dóró
e87621cbde Merge pull request #1936 from nhost/fix/security-key-url
fix(hasura-auth-js): make the call to the correct endpoint
2023-05-15 20:41:59 +02:00
Szilárd Dóró
0d6fc42158 fix: make the call to the correct endpoint 2023-05-15 19:46:26 +02:00
Szilárd Dóró
f6fbee6b13 Merge pull request #1933 from nhost/fix/project-rename-prevent-404
fix(dashboard): don't redirect to 404 on project rename
2023-05-15 16:59:00 +02:00
Szilárd Dóró
1230b72222 fix: don't redirect to 404 on project rename 2023-05-15 16:05:45 +02:00
Szilárd Dóró
6cc7704555 Merge pull request #1931 from nhost/changeset-release/main
chore: update versions
2023-05-15 15:47:22 +02:00
github-actions[bot]
c0954dec09 chore: update versions 2023-05-15 13:30:42 +00:00
Szilárd Dóró
6c25480a7a Merge pull request #1929 from nhost/fix/build-targets
chore: change build target to ES2019
2023-05-15 15:29:32 +02:00
Szilárd Dóró
da03bf390c chore: change build target to ES2019 2023-05-15 11:09:00 +02:00
Szilárd Dóró
3b513be9f2 Merge pull request #1926 from nhost/changeset-release/main
chore: update versions
2023-05-12 16:55:46 +02:00
github-actions[bot]
e450e9d636 chore: update versions 2023-05-12 14:27:16 +00:00
Szilárd Dóró
ed1ee10879 Merge pull request #1925 from nhost/fix/postgres-connection-string
fix(dashboard): show correct postgres connection string
2023-05-12 16:25:51 +02:00
Szilárd Dóró
a6120bf366 feat: update API
chore: fix tests
2023-05-12 14:59:07 +02:00
Szilárd Dóró
349aac369e chore: add changeset 2023-05-12 14:23:54 +02:00
Szilárd Dóró
5a84362c80 fix: construct postgres connection string 2023-05-12 14:23:05 +02:00
Szilárd Dóró
b23dc058a6 Merge branch 'main' into feat/pat 2023-05-12 14:14:09 +02:00
Szilárd Dóró
ad0dda7493 feat: extend nhost.auth.createPAT with id 2023-05-12 14:09:57 +02:00
Szilárd Dóró
4063507d59 chore: improve CLI example 2023-05-12 14:01:11 +02:00
Szilárd Dóró
f59a77b1c8 Merge pull request #1923 from nhost/changeset-release/main
chore: update versions
2023-05-12 10:25:12 +02:00
github-actions[bot]
30686bc4ce chore: update versions 2023-05-12 08:03:41 +00:00
Szilárd Dóró
0c4ac8d368 Merge pull request #1919 from nhost/chore/update-staging-urls
chore(dashboard): change URL construction
2023-05-12 10:02:32 +02:00
Szilárd Dóró
85439307a9 feat: finalize CLI example 2023-05-12 09:34:22 +02:00
Szilárd Dóró
0d8baa4065 feat: allow PAT creation through the example 2023-05-12 08:56:56 +02:00
Szilárd Dóró
7da0e5e256 Merge pull request #1918 from nhost/changeset-release/main
chore: update versions
2023-05-11 15:30:16 +02:00
Szilárd Dóró
4bca94425e chore: add useful information to the README 2023-05-11 15:26:15 +02:00
Szilárd Dóró
9f948385c0 feat: improve readability, add book relationship 2023-05-11 15:23:59 +02:00
Szilárd Dóró
294c504b61 chore: update pnpm-lock file 2023-05-11 15:10:28 +02:00
Szilárd Dóró
1469ec2969 Merge branch 'main' into feat/pat 2023-05-11 15:09:31 +02:00
github-actions[bot]
8229101efe chore: update versions 2023-05-11 13:07:57 +00:00
Szilárd Dóró
afad1778f8 Merge pull request #1895 from nhost/renovate/react-monorepo
chore(deps): update react monorepo
2023-05-11 15:06:23 +02:00
Szilárd Dóró
28fc7b84c7 chore: update changeset 2023-05-11 13:38:39 +02:00
Szilárd Dóró
3f478a4e3c chore: include vitest in the bump, add changeset 2023-05-11 13:37:34 +02:00
Szilárd Dóró
aa54666941 fix: don't break builds 2023-05-11 12:53:45 +02:00
Szilárd Dóró
20fb69faba chore: change URL construction 2023-05-11 12:46:49 +02:00
renovate[bot]
1caeb2a548 chore(deps): update react monorepo 2023-05-11 10:12:59 +00:00
Szilárd Dóró
6356c5a2c8 Merge pull request #1906 from nhost/chore/bump-pnpm
chore: bump `pnpm` and `turbo` version
2023-05-11 12:10:10 +02:00
Szilárd Dóró
6ec1dd3248 chore: bump lock file again 2023-05-11 11:07:27 +02:00
Szilárd Dóró
8a4b5031dc Merge branch 'main' into chore/bump-pnpm 2023-05-11 11:06:57 +02:00
Szilárd Dóró
4790fee41f Merge pull request #1916 from nhost/changeset-release/main
chore: update versions
2023-05-11 09:26:44 +02:00
github-actions[bot]
0a8033812d chore: update versions 2023-05-11 06:56:16 +00:00
Szilárd Dóró
2b56ffc29e Merge pull request #1915 from nhost/fix/project-redirects
fix(dashboard): redirect an invalid project to the 404 page
2023-05-11 08:54:58 +02:00
Szilárd Dóró
aa9b926cd7 Merge branch 'main' into fix/project-redirects 2023-05-10 17:21:18 +02:00
Szilárd Dóró
575404ad62 Merge pull request #1917 from nhost/fix/imports
fix(dashboard): don't break builds
2023-05-10 17:20:37 +02:00
Szilárd Dóró
3f6dfc7bcd fix: don't break builds 2023-05-10 17:19:32 +02:00
Szilárd Dóró
682e64d7a3 fix: don't break build 2023-05-10 16:51:59 +02:00
Szilárd Dóró
30cee4f86c Merge branch 'main' into fix/project-redirects 2023-05-10 16:51:06 +02:00
Szilárd Dóró
29dcc8c63e Merge pull request #1911 from nhost/fix/non-owner-functionality
fix(dashboard): restrict non-owner functionality
2023-05-10 16:47:06 +02:00
Szilárd Dóró
d926f15676 fix: redirect an invalid project to the 404 page 2023-05-10 16:46:16 +02:00
Szilárd Dóró
726c33d1b2 feat: finalize CLI example 2023-05-10 16:41:49 +02:00
Szilárd Dóró
11b9cfbc0d feat: add an example CLI tool to showcase PATs 2023-05-10 15:35:54 +02:00
Szilárd Dóró
d4a0aad2dd Merge pull request #1913 from nhost/changeset-release/main
chore: update versions
2023-05-10 14:24:09 +02:00
github-actions[bot]
1030813279 chore: update versions 2023-05-10 11:50:46 +00:00
Nuno Pato
917a14aa40 Merge pull request #1912 from nhost/docs/add-metrics
Add section on Metrics to the documentation
2023-05-10 11:49:27 +00:00
Szilárd Dóró
6381d1b095 Merge pull request #1893 from nhost/feat/metrics-page 2023-05-10 13:43:34 +02:00
Nuno Pato
8dbdc0bf50 asd 2023-05-10 11:32:34 +00:00
Nuno Pato
8c072a4c6e asd 2023-05-10 10:10:38 +00:00
Nuno Pato
fe341519f7 Add section on Metrics to the documentation 2023-05-10 10:09:12 +00:00
Szilárd Dóró
ea09384064 fix: update import paths 2023-05-10 10:45:20 +02:00
Szilárd Dóró
49b9972885 chore: add changeset 2023-05-10 10:42:35 +02:00
Szilárd Dóró
98c541ee52 feat: introduce useIsCurrentUserOwner hook
- chore: improve file structure
2023-05-10 10:41:35 +02:00
Szilárd Dóró
79aaa91e67 chore: update hasura-auth version 2023-05-09 17:19:40 +02:00
Szilárd Dóró
df4d24320a chore: update example metadata 2023-05-09 14:33:49 +02:00
Szilárd Dóró
757c888656 Merge pull request #1910 from nhost/changeset-release/main
chore: update versions
2023-05-09 11:40:16 +02:00
github-actions[bot]
7c13eb5f9b chore: update versions 2023-05-09 09:17:43 +00:00
Szilárd Dóró
a84608e086 Merge pull request #1907 from nhost/fix/upgrade
fix(dashboard): unpause after upgrading a paused project to pro
2023-05-09 11:13:44 +02:00
Szilárd Dóró
e43c079b9c feat: poll project state after unpausing with upgrade 2023-05-09 10:50:34 +02:00
Szilárd Dóró
3f396a9ebb chore: add changesets 2023-05-08 19:28:42 +02:00
Szilárd Dóró
6ed605beb8 fix: update desiredState on plan change 2023-05-08 17:58:06 +02:00
Szilárd Dóró
edd223d29c fix: don't go to 404 page unnecessarily 2023-05-08 17:47:04 +02:00
Szilárd Dóró
baa3ef794e feat(examples): add PAT example 2023-05-08 17:03:49 +02:00
Szilárd Dóró
da7ffbe523 feat: add useSignInPAT hook 2023-05-08 16:04:00 +02:00
Szilárd Dóró
15a985e079 fix: don't break dashboard build 2023-05-08 15:29:29 +02:00
Szilárd Dóró
8ff00a4258 chore(ci): bump pnpm version to v8.4.0 2023-05-08 15:19:53 +02:00
Szilárd Dóró
7e27d7c0a1 chore: update changeset, bump turbo version 2023-05-08 15:17:42 +02:00
Szilárd Dóró
49f9b8372a chore: bump pnpm version to v8.4.0 2023-05-08 15:09:29 +02:00
Szilárd Dóró
3ca70554c8 feat: add support for PAT sign in 2023-05-08 14:34:12 +02:00
Szilárd Dóró
077b200510 Merge branch 'main' into feat/pat 2023-05-08 14:04:11 +02:00
Szilárd Dóró
b17e8d6f3c fix: don't break e2e tests 2023-05-03 10:00:29 +02:00
Szilárd Dóró
12e2855f01 chore: update description and prevent free access
- bump `jsdom` to v22
- increase test timeout
2023-05-03 09:57:11 +02:00
Szilárd Dóró
c1080d9e63 fix: don't break the UI 2023-05-03 09:38:48 +02:00
Szilárd Dóró
e4972b8307 feat: add Grafana page 2023-05-03 09:35:06 +02:00
Szilárd Dóró
2f220db84a extend machine with PAT sign in 2023-04-27 17:06:26 +02:00
365 changed files with 13268 additions and 10134 deletions

View File

@@ -14,7 +14,7 @@ runs:
steps:
- uses: pnpm/action-setup@v2.2.4
with:
version: 7.17.0
version: 8.4.0
run_install: false
- name: Get pnpm cache directory
id: pnpm-cache-dir

View File

@@ -36,6 +36,7 @@ export default defineConfig({
}
},
build: {
target: 'es2019',
sourcemap: true,
lib: {
entry,

View File

@@ -25,6 +25,7 @@ module.exports = {
'error',
{ allowArrowFunctions: true, allowFunctions: true },
],
'import/no-named-as-default': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
curly: ['error', 'all'],

View File

@@ -1,5 +1,75 @@
# @nhost/dashboard
## 0.16.12
### Patch Changes
- 399009d6: fix(gql): don't enter an infinite loop when fetching remote app data
- 329e5a91: fix(deployments): use the same sorting of deployments everywhere
- 6d559d6e: chore(settings): add under the hood improvements to the settings page
- 12eb236c: chore(deps): bump `prettier-plugin-tailwindcss` to `v0.3.0`
- f9b81a2a: chore(deps): bump `turbo` to `v1.9.8`
- 1345741b: fix(projects): don't redirect to 404 on project creation
- Updated dependencies [7fea29a8]
- @nhost/react-apollo@5.0.23
- @nhost/nextjs@1.13.25
## 0.16.11
### Patch Changes
- 1230b722: fix(projects): don't redirect to 404 on when the project is renamed
- @nhost/react-apollo@5.0.22
- @nhost/nextjs@1.13.24
## 0.16.10
### Patch Changes
- Updated dependencies [da03bf39]
- @nhost/react-apollo@5.0.21
- @nhost/nextjs@1.13.23
## 0.16.9
### Patch Changes
- 349aac36: fix(settings): use region domain when constructing the postgres connection string
## 0.16.8
### Patch Changes
- 20fb69fa: chore(projects): change the way how API URLs are constructed
## 0.16.7
### Patch Changes
- 49f9b837: chore(docker): bump `pnpm` to `v8.4.0` and `turbo` to `v1.9.3`
- 3f478a4e: chore(deps): bump `vitest` to `v0.31.0`, `@types/react` to `v18.2.6` and `@types/react-dom` to `v18.2.4`
## 0.16.6
### Patch Changes
- d926f156: fix(projects): redirect to 404 when an invalid project is opened
- 49b99728: fix(projects): disable features for non-owner members of workspaces
## 0.16.5
### Patch Changes
- 12e2855f: chore(deps): bump `jsdom` to v22
- e4972b83: feat(metrics): add Grafana page
## 0.16.4
### Patch Changes
- 3f396a9e: fix(projects): unpause after upgrading a paused project to pro
- 3f396a9e: fix(projects): don't redirect to 404 page after project creation
## 0.16.3
### Patch Changes

View File

@@ -3,7 +3,7 @@ RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
RUN yarn global add turbo@1.8.6
RUN yarn global add turbo@1.9.8
COPY . .
RUN turbo prune --scope="@nhost/dashboard" --docker
@@ -29,7 +29,7 @@ ENV NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL __NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL_
ENV NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL __NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL__
ENV NEXT_PUBLIC_NHOST_HASURA_API_URL __NEXT_PUBLIC_NHOST_HASURA_API_URL__
RUN yarn global add pnpm@7.17.0
RUN yarn global add pnpm@8.4.0
COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-*.yaml .

View File

@@ -30,7 +30,7 @@ test('should show a sidebar with menu items', async () => {
const navLocator = page.getByRole('navigation', { name: /main navigation/i });
await expect(navLocator).toBeVisible();
await expect(navLocator.getByRole('list').getByRole('listitem')).toHaveCount(
10,
11,
);
await expect(
navLocator.getByRole('link', { name: /overview/i }),
@@ -53,6 +53,9 @@ test('should show a sidebar with menu items', async () => {
navLocator.getByRole('link', { name: /backups/i }),
).toBeVisible();
await expect(navLocator.getByRole('link', { name: /logs/i })).toBeVisible();
await expect(
navLocator.getByRole('link', { name: /metrics/i }),
).toBeVisible();
await expect(
navLocator.getByRole('link', { name: /settings/i }),
).toBeVisible();

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.16.3",
"version": "0.16.12",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -15,7 +15,7 @@
"format": "prettier --write \"src/**/*.{js,ts,tsx,jsx,json,md}\" --plugin-search-dir=.",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook",
"e2e": "npx playwright@1.31.2 install --with-deps && playwright test"
"e2e": "npx playwright@1.33.0 install --with-deps && playwright test"
},
"dependencies": {
"@apollo/client": "^3.7.10",
@@ -88,7 +88,7 @@
"@graphql-codegen/typescript-operations": "^3.0.0",
"@graphql-codegen/typescript-react-apollo": "^3.3.1",
"@next/bundle-analyzer": "^12.3.1",
"@playwright/test": "^1.31.2",
"@playwright/test": "^1.33.0",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-essentials": "^6.5.14",
"@storybook/addon-interactions": "^6.5.14",
@@ -105,15 +105,15 @@
"@types/lodash.debounce": "^4.0.7",
"@types/node": "^16.11.7",
"@types/pluralize": "^0.0.29",
"@types/react": "18.2.0",
"@types/react-dom": "18.2.1",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"@types/react-table": "^7.7.12",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/validator": "^13.7.10",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@vitejs/plugin-react": "^4.0.0",
"@vitest/coverage-c8": "^0.30.0",
"@vitest/coverage-c8": "^0.31.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^8.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
@@ -129,7 +129,7 @@
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^21.0.0",
"jsdom": "^22.0.0",
"lint-staged": ">=13",
"msw": "^1.0.1",
"msw-storybook-addon": "^1.6.3",
@@ -137,7 +137,7 @@
"postcss": "^8.4.19",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.2.0",
"prettier-plugin-tailwindcss": "^0.2.0",
"prettier-plugin-tailwindcss": "^0.3.0",
"react-date-fns-hooks": "^0.9.4",
"require-from-string": "^2.0.2",
"snake-case": "^3.0.4",
@@ -147,8 +147,7 @@
"tsconfig-paths-webpack-plugin": "^4.0.0",
"vite": "^4.0.2",
"vite-tsconfig-paths": "^4.0.3",
"vitest": "^0.30.1",
"webpack": "^5.75.0"
"vitest": "^0.31.0"
},
"browserslist": {
"production": [

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -114,6 +114,9 @@ export default function AppDeployments(props: AppDeploymentsProps) {
const { deployments } = deploymentPageData || { deployments: [] };
const { deployments: scheduledOrPendingDeployments } =
scheduledOrPendingDeploymentsData || { deployments: [] };
const isDeploymentInProgress = deployments?.some((deployment) =>
['PENDING', 'SCHEDULED'].includes(deployment.deploymentStatus),
);
const latestDeployment = latestDeploymentData?.deployments[0];
const latestLiveDeployment = latestLiveDeploymentData?.deployments[0];
@@ -135,7 +138,10 @@ export default function AppDeployments(props: AppDeploymentsProps) {
deployment={deployment}
isLive={liveDeploymentId === deployment.id}
showRedeploy={latestDeployment.id === deployment.id}
disableRedeploy={scheduledOrPendingDeployments?.length > 0}
disableRedeploy={
scheduledOrPendingDeployments?.length > 0 ||
isDeploymentInProgress
}
/>
{index !== deployments.length - 1 && <Divider component="li" />}

View File

@@ -1,6 +1,6 @@
import FeedbackForm from '@/components/common/FeedbackForm';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useInterval } from '@/hooks/useInterval';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Button from '@/ui/v2/Button';
import { Dropdown } from '@/ui/v2/Dropdown';

View File

@@ -1,8 +1,9 @@
import FeedbackForm from '@/components/common/FeedbackForm';
import Container from '@/components/layout/Container';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useIsCurrentUserOwner } from '@/features/projects/common/hooks/useIsCurrentUserOwner';
import { useAppCreatedAt } from '@/hooks/useAppCreatedAt';
import { useCurrentDate } from '@/hooks/useCurrentDate';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { ApplicationState } from '@/types/application';
import { ApplicationStatus } from '@/types/application';
import { Modal } from '@/ui/Modal';
@@ -20,8 +21,6 @@ import { discordAnnounce } from '@/utils/discordAnnounce';
import { getPreviousApplicationState } from '@/utils/getPreviousApplicationState';
import { getApplicationStatusString } from '@/utils/helpers';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useApolloClient } from '@apollo/client';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import { useState } from 'react';
@@ -31,7 +30,11 @@ import { RemoveApplicationModal } from './RemoveApplicationModal';
import { StagingMetadata } from './StagingMetadata';
export default function ApplicationErrored() {
const { currentWorkspace, currentProject } = useCurrentWorkspaceAndProject();
const {
currentWorkspace,
currentProject,
refetch: refetchProject,
} = useCurrentWorkspaceAndProject();
const [changingApplicationStateLoading, setChangingApplicationStateLoading] =
useState(false);
@@ -53,12 +56,9 @@ export default function ApplicationErrored() {
const [showRecreateModal, setShowRecreateModal] = useState(false);
const [showDeleteModal, setShowDeleteModal] = useState(false);
const [insertApp] = useInsertApplicationMutation();
const client = useApolloClient();
const { currentDate } = useCurrentDate();
const user = useUserData();
const isOwner = currentWorkspace.workspaceMembers.some(
({ id, type }) => id === user?.id && type === 'owner',
);
const isOwner = useIsCurrentUserOwner();
const { appCreatedAt } = useAppCreatedAt();
@@ -95,7 +95,7 @@ export default function ApplicationErrored() {
});
discordAnnounce(`Recreating: ${currentProject?.name} (${user.email})`);
triggerToast(`Recreating ${currentProject?.name} `);
await updateOwnCache(client);
await refetchProject();
} catch (e) {
triggerToast(`Error trying to recreate: ${currentProject?.name}`);
}

View File

@@ -1,12 +1,12 @@
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAllWorkspacesAndProjectsDocument,
useDeleteApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import Button from '@/ui/v2/Button';
import ArrowRightIcon from '@/ui/v2/icons/ArrowRightIcon';
import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
import ArrowRightIcon from '@/ui/v2/icons/ArrowRightIcon';
import { copy } from '@/utils/copy';
import { getApplicationStatusString } from '@/utils/helpers';
import getServerError from '@/utils/settings/getServerError';
@@ -18,18 +18,14 @@ import { toast } from 'react-hot-toast';
export default function ApplicationInfo() {
const { currentProject } = useCurrentWorkspaceAndProject();
const [deleteApplication] = useDeleteApplicationMutation({
refetchQueries: [GetAllWorkspacesAndProjectsDocument],
refetchQueries: [{ query: GetAllWorkspacesAndProjectsDocument }],
});
const router = useRouter();
async function handleClickRemove() {
try {
await toast.promise(
deleteApplication({
variables: {
appId: currentProject.id,
},
}),
deleteApplication({ variables: { appId: currentProject.id } }),
{
loading: 'Deleting project...',
success: 'The project has been deleted successfully.',

View File

@@ -3,12 +3,13 @@ import { ChangePlanModal } from '@/components/applications/ChangePlanModal';
import { StagingMetadata } from '@/components/applications/StagingMetadata';
import { useDialog } from '@/components/common/DialogProvider';
import Container from '@/components/layout/Container';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useIsCurrentUserOwner } from '@/features/projects/common/hooks/useIsCurrentUserOwner';
import {
GetAllWorkspacesAndProjectsDocument,
useGetFreeAndActiveProjectsQuery,
useUnpauseApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { Modal } from '@/ui';
import { Alert } from '@/ui/Alert';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
@@ -26,19 +27,15 @@ import { RemoveApplicationModal } from './RemoveApplicationModal';
export default function ApplicationPaused() {
const { openDialog } = useDialog();
const {
currentWorkspace,
currentProject,
refetch: refetchWorkspaceAndProject,
} = useCurrentWorkspaceAndProject();
const { currentProject, refetch: refetchWorkspaceAndProject } =
useCurrentWorkspaceAndProject();
const isOwner = useIsCurrentUserOwner();
const user = useUserData();
const isOwner = currentWorkspace.workspaceMembers.some(
({ id, type }) => id === user?.id && type === 'owner',
);
const [showDeletingModal, setShowDeletingModal] = useState(false);
const [unpauseApplication, { loading: changingApplicationStateLoading }] =
useUnpauseApplicationMutation({
refetchQueries: [GetAllWorkspacesAndProjectsDocument],
refetchQueries: [{ query: GetAllWorkspacesAndProjectsDocument }],
});
const { data, loading } = useGetFreeAndActiveProjectsQuery({
@@ -120,20 +117,22 @@ export default function ApplicationPaused() {
</Box>
<Box className="grid grid-flow-row gap-2">
<Button
className="mx-auto w-full max-w-[280px]"
onClick={() => {
openDialog({
component: <ChangePlanModal />,
props: {
PaperProps: { className: 'p-0' },
maxWidth: 'lg',
},
});
}}
>
Upgrade to Pro
</Button>
{isOwner && (
<Button
className="mx-auto w-full max-w-[280px]"
onClick={() => {
openDialog({
component: <ChangePlanModal />,
props: {
PaperProps: { className: 'p-0' },
maxWidth: 'lg',
},
});
}}
>
Upgrade to Pro
</Button>
)}
<div className="grid grid-flow-row gap-2">
<Button

View File

@@ -1,6 +1,6 @@
import Container from '@/components/layout/Container';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useCheckProvisioning } from '@/hooks/useCheckProvisioning';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { ApplicationStatus } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Text from '@/ui/v2/Text';

View File

@@ -1,6 +1,6 @@
import Container from '@/components/layout/Container';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useCheckProvisioning } from '@/hooks/useCheckProvisioning';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { ApplicationStatus } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Text from '@/ui/v2/Text';

View File

@@ -1,11 +1,11 @@
import FeedbackForm from '@/components/common/FeedbackForm';
import Container from '@/components/layout/Container';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useIsCurrentUserOwner } from '@/features/projects/common/hooks/useIsCurrentUserOwner';
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/nextjs';
import Image from 'next/image';
import { useState } from 'react';
import ApplicationInfo from './ApplicationInfo';
@@ -13,12 +13,9 @@ import { RemoveApplicationModal } from './RemoveApplicationModal';
import { StagingMetadata } from './StagingMetadata';
export default function ApplicationUnknown() {
const { currentWorkspace, currentProject } = useCurrentWorkspaceAndProject();
const { currentProject } = useCurrentWorkspaceAndProject();
const [showDeleteModal, setShowDeleteModal] = useState(false);
const user = useUserData();
const isOwner = currentWorkspace.workspaceMembers.some(
({ id, type }) => id === user?.id && type === 'owner',
);
const isOwner = useIsCurrentUserOwner();
return (
<>

View File

@@ -1,5 +1,5 @@
import Container from '@/components/layout/Container';
import useProjectRedirectWhenReady from '@/hooks/common/useProjectRedirectWhenReady';
import { useProjectRedirectWhenReady } from '@/features/projects/common/hooks/useProjectRedirectWhenReady';
import Image from 'next/image';
import { AppLoader } from './AppLoader';

View File

@@ -1,12 +1,14 @@
import { useDialog } from '@/components/common/DialogProvider';
import { BillingPaymentMethodForm } from '@/components/workspace/BillingPaymentMethodForm';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
refetchGetApplicationPlanQuery,
useGetAppPlanAndGlobalPlansQuery,
useGetPaymentMethodsQuery,
useUpdateApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import useApplicationState from '@/hooks/useApplicationState';
import { ApplicationStatus } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
@@ -15,11 +17,11 @@ import { BaseDialog } from '@/ui/v2/Dialog';
import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
import { planDescriptions } from '@/utils/planDescriptions';
import getServerError from '@/utils/settings/getServerError/getServerError';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import Image from 'next/image';
import { useRouter } from 'next/router';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { toast } from 'react-hot-toast';
function Plan({ planName, price, setPlan, planId, selectedPlanId }: any) {
@@ -53,7 +55,7 @@ function Plan({ planName, price, setPlan, planId, selectedPlanId }: any) {
</div>
<Text variant="h3" component="p">
$ {price}/mo
${price}/mo
</Text>
</button>
);
@@ -62,12 +64,14 @@ function Plan({ planName, price, setPlan, planId, selectedPlanId }: any) {
export function ChangePlanModalWithData({ app, plans, close }: any) {
const [selectedPlanId, setSelectedPlanId] = useState('');
const { closeAlertDialog } = useDialog();
const [pollingCurrentProject, setPollingCurrentProject] = useState(false);
const {
currentWorkspace,
currentProject,
refetch: refetchWorkspaceAndProject,
} = useCurrentWorkspaceAndProject();
const { state } = useApplicationState();
const { data } = useGetPaymentMethodsQuery({
variables: {
@@ -82,6 +86,29 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
const currentPlan = plans.find((plan) => plan.id === app.plan.id);
const selectedPlan = plans.find((plan) => plan.id === selectedPlanId);
useEffect(() => {
if (!pollingCurrentProject || state === ApplicationStatus.Paused) {
return;
}
close?.();
closeAlertDialog();
setShowPaymentModal(false);
setPollingCurrentProject(false);
}, [state, pollingCurrentProject, close, closeAlertDialog]);
useEffect(() => {
if (!pollingCurrentProject) {
return () => {};
}
const interval = setInterval(() => {
refetchWorkspaceAndProject();
}, 1000);
return () => clearInterval(interval);
}, [pollingCurrentProject, refetchWorkspaceAndProject, currentProject]);
const [updateApp] = useUpdateApplicationMutation({
refetchQueries: [
refetchGetApplicationPlanQuery({
@@ -99,6 +126,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
appId: app.id,
app: {
planId: selectedPlan.id,
desiredState: 5,
},
},
}),
@@ -112,11 +140,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
getToastStyleProps(),
);
await refetchWorkspaceAndProject();
close?.();
closeAlertDialog();
setShowPaymentModal(false);
setPollingCurrentProject(true);
} catch (error) {
// Note: Error is handled by the toast.
}
@@ -134,12 +158,49 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
}
await handleUpdateAppPlan();
setShowPaymentModal(false);
close?.();
closeAlertDialog();
};
if (pollingCurrentProject) {
return (
<Box className="mx-auto w-full max-w-xl rounded-lg p-6 text-left">
<div className="flex flex-col">
<div className="mx-auto">
<Image
src="/assets/upgrade.svg"
alt="Nhost Logo"
width={72}
height={72}
/>
</div>
<Text variant="h3" component="h2" className="mt-2 text-center">
Successfully upgraded to {currentPlan.name}
</Text>
<ActivityIndicator
label="We are unpausing your project. This may take some time..."
className="mx-auto mt-2"
/>
<Button
variant="outlined"
color="secondary"
className="mx-auto mt-4 w-full max-w-sm"
onClick={() => {
if (close) {
close();
}
closeAlertDialog();
}}
>
Cancel
</Button>
</div>
</Box>
);
}
if (app.plan.id !== plans.find((plan) => plan.isFree)?.id) {
return (
<Box className="mx-auto w-full max-w-xl rounded-lg p-6 text-left">
@@ -215,7 +276,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
You&apos;re currently on the <strong>{app.plan.name}</strong> plan.
</Text>
<div className="mt-5">
<div className="mt-2">
{plans
.filter((plan) => plan.id !== app.plan.id)
.map((plan) => (
@@ -233,8 +294,12 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
))}
</div>
<div className="mt-6 grid grid-flow-row gap-2">
<Button onClick={handleChangePlanClick} disabled={!selectedPlan}>
<div className="mt-2 grid grid-flow-row gap-2">
<Button
onClick={handleChangePlanClick}
disabled={!selectedPlan}
loading={pollingCurrentProject}
>
Upgrade
</Button>

View File

@@ -1,12 +1,12 @@
import { LoadingScreen } from '@/components/common/LoadingScreen';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import IconButton from '@/ui/v2/IconButton';
import Text from '@/ui/v2/Text';
import ArrowSquareOutIcon from '@/ui/v2/icons/ArrowSquareOutIcon';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Text from '@/ui/v2/Text';
import generateAppServiceUrl, {
defaultLocalBackendSlugs,
defaultRemoteBackendSlugs,
@@ -33,7 +33,7 @@ export function HasuraData({ close }: HasuraDataProps) {
? `${getHasuraConsoleServiceUrl()}`
: generateAppServiceUrl(
currentProject?.subdomain,
currentProject?.region.awsName,
currentProject?.region,
'hasura',
defaultLocalBackendSlugs,
{ ...defaultRemoteBackendSlugs, hasura: '/console' },

View File

@@ -1,4 +1,4 @@
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Checkbox from '@/ui/v2/Checkbox';
@@ -46,7 +46,7 @@ export function RemoveApplicationModal({
className,
}: RemoveApplicationModalProps) {
const [deleteApplication] = useDeleteApplicationMutation({
refetchQueries: [GetAllWorkspacesAndProjectsDocument],
refetchQueries: [{ query: GetAllWorkspacesAndProjectsDocument }],
});
const [loadingRemove, setLoadingRemove] = useState(false);
const { currentProject } = useCurrentWorkspaceAndProject();

View File

@@ -1,4 +1,4 @@
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Checkbox from '@/ui/v2/Checkbox';

View File

@@ -1,5 +1,6 @@
import { ChangePlanModal } from '@/components/applications/ChangePlanModal';
import { useDialog } from '@/components/common/DialogProvider';
import { useIsCurrentUserOwner } from '@/features/projects/common/hooks/useIsCurrentUserOwner';
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';
@@ -20,25 +21,36 @@ export function UnlockFeatureByUpgrading({
...props
}: UnlockFeatureByUpgradingProps) {
const { openDialog } = useDialog();
const isOwner = useIsCurrentUserOwner();
return (
<div className={twMerge('flex', className)} {...props}>
<Alert className="grid w-full grid-flow-col place-content-between items-center gap-2">
<Text className="text-left">{message}</Text>
<Text className="grid grid-flow-row justify-items-start gap-0.5">
<Text component="span">{message}</Text>
<Button
variant="borderless"
onClick={() => {
openDialog({
component: <ChangePlanModal />,
props: {
PaperProps: { className: 'p-0 max-w-xl w-full' },
},
});
}}
>
Upgrade
</Button>
{!isOwner && (
<Text component="span" color="secondary" className="text-sm">
Ask an owner of this workspace to upgrade the project.
</Text>
)}
</Text>
{isOwner && (
<Button
variant="borderless"
onClick={() => {
openDialog({
component: <ChangePlanModal />,
props: {
PaperProps: { className: 'p-0 max-w-xl w-full' },
},
});
}}
>
Upgrade
</Button>
)}
</Alert>
</div>
);

View File

@@ -1,5 +1,5 @@
import type { ConnectGithubModalState } from '@/components/applications/ConnectGithubModal';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { FormProvider, useForm } from 'react-hook-form';
import { EditRepositorySettingsModal } from './EditRepositorySettingsModal';

View File

@@ -2,14 +2,12 @@ import type { EditRepositorySettingsFormData } from '@/components/applications/g
import { useDialog } from '@/components/common/DialogProvider';
import ErrorBoundaryFallback from '@/components/common/ErrorBoundaryFallback';
import GithubIcon from '@/components/icons/GithubIcon';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useUpdateApplicationMutation } from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useApolloClient } from '@apollo/client';
import { ErrorBoundary } from 'react-error-boundary';
import { useFormContext } from 'react-hook-form';
import { RepoAndBranch } from './RepoAndBranch';
@@ -27,12 +25,11 @@ export function EditRepositorySettingsModal({
const isNotCompleted = !watch('productionBranch') || !watch('repoBaseFolder');
const { closeAlertDialog } = useDialog();
const { currentProject } = useCurrentWorkspaceAndProject();
const { currentProject, refetch: refetchProject } =
useCurrentWorkspaceAndProject();
const [updateApp, { loading }] = useUpdateApplicationMutation();
const client = useApolloClient();
const handleEditGitHubIntegration = async (
data: EditRepositorySettingsFormData,
) => {
@@ -60,7 +57,8 @@ export function EditRepositorySettingsModal({
});
}
await updateOwnCache(client);
await refetchProject();
if (close) {
close();
} else {

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLClient';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select';

View File

@@ -1,6 +1,6 @@
import NavLink from '@/components/common/NavLink';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import Text from '@/ui/v2/Text';

View File

@@ -2,8 +2,8 @@ import AudioPreview from '@/components/icons/AudioPreview';
import { FileIcon } from '@/components/icons/FileIcon';
import PDFPreview from '@/components/icons/PDFPreview';
import VideoPreview from '@/components/icons/VideoPreview';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useAppClient } from '@/hooks/useAppClient';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { Modal } from '@/ui/Modal';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';

View File

@@ -9,12 +9,12 @@ import FormActivityIndicator from '@/components/common/FormActivityIndicator';
import InlineCode from '@/components/common/InlineCode';
import DataBrowserEmptyState from '@/components/dataBrowser/DataBrowserEmptyState';
import DataBrowserGridControls from '@/components/dataBrowser/DataBrowserGridControls';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useDeleteColumnWithToastMutation from '@/hooks/dataBrowser/useDeleteColumnMutation/useDeleteColumnWithToastMutation';
import useTableQuery from '@/hooks/dataBrowser/useTableQuery';
import type { UpdateRecordVariables } from '@/hooks/dataBrowser/useUpdateRecordMutation';
import useUpdateRecordWithToastMutation from '@/hooks/dataBrowser/useUpdateRecordMutation/useUpdateRecordWithToastMutation';
import useTablePath from '@/hooks/useTablePath';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type {
DataBrowserGridColumn,
NormalizedQueryDataRow,

View File

@@ -1,9 +1,9 @@
import type { DataGridPaginationProps } from '@/components/common/DataGridPagination';
import DataGridPagination from '@/components/common/DataGridPagination';
import { useDialog } from '@/components/common/DialogProvider';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useDeleteRecordMutation from '@/hooks/dataBrowser/useDeleteRecordMutation';
import useDataGridConfig from '@/hooks/useDataGridConfig';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { DataBrowserGridColumn } from '@/types/dataBrowser';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';

View File

@@ -3,10 +3,10 @@ import FormActivityIndicator from '@/components/common/FormActivityIndicator';
import InlineCode from '@/components/common/InlineCode';
import NavLink from '@/components/common/NavLink';
import RetryableErrorBoundary from '@/components/common/RetryableErrorBoundary';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import useDatabaseQuery from '@/hooks/dataBrowser/useDatabaseQuery';
import useDeleteTableWithToastMutation from '@/hooks/dataBrowser/useDeleteTableMutation/useDeleteTableWithToastMutation';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import FloatingActionButton from '@/ui/FloatingActionButton';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Backdrop from '@/ui/v2/Backdrop';
@@ -17,6 +17,12 @@ import Chip from '@/ui/v2/Chip';
import Divider from '@/ui/v2/Divider';
import { Dropdown } from '@/ui/v2/Dropdown';
import IconButton from '@/ui/v2/IconButton';
import Link from '@/ui/v2/Link';
import List from '@/ui/v2/List';
import { ListItem } from '@/ui/v2/ListItem';
import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select';
import Text from '@/ui/v2/Text';
import ArrowRightIcon from '@/ui/v2/icons/ArrowRightIcon';
import DotsHorizontalIcon from '@/ui/v2/icons/DotsHorizontalIcon';
import LockIcon from '@/ui/v2/icons/LockIcon';
@@ -24,12 +30,6 @@ import PencilIcon from '@/ui/v2/icons/PencilIcon';
import PlusIcon from '@/ui/v2/icons/PlusIcon';
import TrashIcon from '@/ui/v2/icons/TrashIcon';
import UsersIcon from '@/ui/v2/icons/UsersIcon';
import Link from '@/ui/v2/Link';
import List from '@/ui/v2/List';
import { ListItem } from '@/ui/v2/ListItem';
import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select';
import Text from '@/ui/v2/Text';
import { isSchemaLocked } from '@/utils/dataBrowser/schemaHelpers';
import { useQueryClient } from '@tanstack/react-query';
import dynamic from 'next/dynamic';

View File

@@ -1,8 +1,8 @@
import { useDialog } from '@/components/common/DialogProvider';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useMetadataQuery from '@/hooks/dataBrowser/useMetadataQuery';
import useTableQuery from '@/hooks/dataBrowser/useTableQuery';
import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLClient';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { DialogFormProps } from '@/types/common';
import type {
DatabaseAccessLevel,

View File

@@ -1,7 +1,7 @@
import ControlledSelect from '@/components/common/ControlledSelect';
import type { RolePermissionEditorFormValues } from '@/components/dataBrowser/EditPermissionsForm/RolePermissionEditorForm';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useTableQuery from '@/hooks/dataBrowser/useTableQuery';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Autocomplete from '@/ui/v2/Autocomplete';
import Button from '@/ui/v2/Button';

View File

@@ -1,4 +1,4 @@
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { Rule, RuleGroup } from '@/types/dataBrowser';
import { Alert } from '@/ui/Alert';
import type { BoxProps } from '@/ui/v2/Box';
@@ -194,7 +194,7 @@ export default function RuleGroupEditor({
<Link
href={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region?.awsName,
currentProject.region,
'hasura',
)}/console/data/default/schema/${schema}/tables/${table}/permissions`}
underline="hover"

View File

@@ -3,7 +3,7 @@ import ControlledSelect from '@/components/common/ControlledSelect';
import ReadOnlyToggle from '@/components/common/ReadOnlyToggle';
import type { ColumnAutocompleteProps } from '@/components/dataBrowser/ColumnAutocomplete';
import ColumnAutocomplete from '@/components/dataBrowser/ColumnAutocomplete';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { HasuraOperator } from '@/types/dataBrowser';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import type { AutocompleteOption } from '@/ui/v2/Autocomplete';

View File

@@ -1,20 +1,24 @@
import NavLink from '@/components/common/NavLink';
import AppDeploymentDuration from '@/components/deployments/AppDeploymentDuration';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { Avatar } from '@/ui/Avatar';
import type { DeploymentStatus } from '@/ui/StatusCircle';
import { StatusCircle } from '@/ui/StatusCircle';
import Button from '@/ui/v2/Button';
import Chip from '@/ui/v2/Chip';
import { Chip } from '@/ui/v2/Chip';
import { ListItem } from '@/ui/v2/ListItem';
import Tooltip from '@/ui/v2/Tooltip';
import { Tooltip } from '@/ui/v2/Tooltip';
import ArrowCounterclockwiseIcon from '@/ui/v2/icons/ArrowCounterclockwiseIcon';
import ChevronRightIcon from '@/ui/v2/icons/ChevronRightIcon';
import type { DeploymentRowFragment } from '@/utils/__generated__/graphql';
import { useInsertDeploymentMutation } from '@/utils/__generated__/graphql';
import {
GetAllWorkspacesAndProjectsDocument,
useInsertDeploymentMutation,
} from '@/utils/__generated__/graphql';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import { formatDistanceToNowStrict, parseISO } from 'date-fns';
import type { MouseEvent } from 'react';
import { toast } from 'react-hot-toast';
import { twMerge } from 'tailwind-merge';
@@ -52,9 +56,39 @@ export default function DeploymentListItem({
})
: '';
const [insertDeployment, { loading }] = useInsertDeploymentMutation();
const [insertDeployment, { loading }] = useInsertDeploymentMutation({
refetchQueries: [{ query: GetAllWorkspacesAndProjectsDocument }],
});
const { commitMessage } = deployment;
async function redeployDeployment(event: MouseEvent<HTMLButtonElement>) {
event.stopPropagation();
event.preventDefault();
const insertDeploymentPromise = insertDeployment({
variables: {
object: {
appId: currentProject?.id,
commitMessage: deployment.commitMessage,
commitSHA: deployment.commitSHA,
commitUserAvatarUrl: deployment.commitUserAvatarUrl,
commitUserName: deployment.commitUserName,
deploymentStatus: 'SCHEDULED',
},
},
});
await toast.promise(
insertDeploymentPromise,
{
loading: 'Scheduling deployment...',
success: 'Deployment has been scheduled successfully.',
error: getServerError('An error occurred when scheduling deployment.'),
},
getToastStyleProps(),
);
}
return (
<ListItem.Root>
<ListItem.Button
@@ -88,7 +122,7 @@ export default function DeploymentListItem({
{showRedeploy && (
<Tooltip
title={
!disableRedeploy && !loading
disableRedeploy || loading
? 'Deployments cannot be re-triggered when a deployment is in progress.'
: ''
}
@@ -100,35 +134,7 @@ export default function DeploymentListItem({
size="small"
color="secondary"
variant="outlined"
onClick={async (event) => {
event.stopPropagation();
event.preventDefault();
const insertDeploymentPromise = insertDeployment({
variables: {
object: {
appId: currentProject?.id,
commitMessage: deployment.commitMessage,
commitSHA: deployment.commitSHA,
commitUserAvatarUrl: deployment.commitUserAvatarUrl,
commitUserName: deployment.commitUserName,
deploymentStatus: 'SCHEDULED',
},
},
});
await toast.promise(
insertDeploymentPromise,
{
loading: 'Scheduling deployment...',
success: 'Deployment has been scheduled successfully.',
error: getServerError(
'An error occurred when scheduling deployment.',
),
},
getToastStyleProps(),
);
}}
onClick={redeployDeployment}
startIcon={
<ArrowCounterclockwiseIcon className={twMerge('h-4 w-4')} />
}

View File

@@ -7,11 +7,11 @@ import DataGridPreviewCell from '@/components/common/DataGridPreviewCell';
import DataGridTextCell from '@/components/common/DataGridTextCell';
import FilesDataGridControls from '@/components/files/FilesDataGridControls';
import { FileIcon } from '@/components/icons/FileIcon';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useAppClient } from '@/hooks/useAppClient';
import useBuckets from '@/hooks/useBuckets';
import useFiles from '@/hooks/useFiles';
import useFilesAggregate from '@/hooks/useFilesAggregate';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { Files } from '@/utils/__generated__/graphql';
import { Order_By as OrderBy } from '@/utils/__generated__/graphql';
import { getHasuraAdminSecret } from '@/utils/env';

View File

@@ -1,9 +1,9 @@
import type { DataGridPaginationProps } from '@/components/common/DataGridPagination';
import DataGridPagination from '@/components/common/DataGridPagination';
import { useDialog } from '@/components/common/DialogProvider';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useAppClient } from '@/hooks/useAppClient';
import useDataGridConfig from '@/hooks/useDataGridConfig';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { FileUploadButtonProps } from '@/ui/FileUploadButton';
import FileUploadButton from '@/ui/FileUploadButton';
import type { BoxProps } from '@/ui/v2/Box';

View File

@@ -10,7 +10,6 @@ import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';
import { nhost } from '@/utils/nhost';
import { triggerToast } from '@/utils/toast';
import { updateOwnCache } from '@/utils/updateOwnCache';
import { useApolloClient } from '@apollo/client';
import { alpha } from '@mui/system';
import { useUserData } from '@nhost/nextjs';
@@ -28,13 +27,18 @@ export function InviteAnnounce() {
useSubmitState();
// @FIX: We probably don't want to poll every ten seconds for possible invites. (We can change later depending on how it works in production.) Maybe just on the workspace page?
const { data, loading, error, refetch, startPolling } =
useGetWorkspaceMemberInvitesToManageQuery({
variables: {
userId: user?.id,
},
skip: !isPlatform || !user,
});
const {
data,
loading,
error,
refetch: refetchInvitations,
startPolling,
} = useGetWorkspaceMemberInvitesToManageQuery({
variables: {
userId: user?.id,
},
skip: !isPlatform || !user,
});
useEffect(() => {
startPolling(15000);
@@ -79,9 +83,14 @@ export function InviteAnnounce() {
});
}
await updateOwnCache(client);
await client.refetchQueries({
include: [
GetAllWorkspacesAndProjectsDocument,
GetWorkspaceMemberInvitesToManageDocument,
],
});
await router.push(`/${invite.workspace.slug}`);
await refetch();
await refetchInvitations();
triggerToast('Workspace invite accepted');
return setSubmitState({
error: null,

View File

@@ -1,5 +1,5 @@
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useInsertFeedbackOneMutation } from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { Avatar } from '@/ui/Avatar';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';

View File

@@ -207,19 +207,6 @@ export default function WorkspaceAndProjectList({
</div>
))}
</Box>
<Text className="font-medium" color="secondary">
Looking for your old apps? They&apos;re still on{' '}
<Link
href="https://console.nhost.io"
target="_blank"
rel="noreferrer"
underline="always"
>
console.nhost.io
</Link>{' '}
during this beta.
</Text>
</Box>
);
}

View File

@@ -2,11 +2,11 @@ import DesktopNav from '@/components/common/DesktopNav';
import { LoadingScreen } from '@/components/common/LoadingScreen';
import type { AuthenticatedLayoutProps } from '@/components/layout/AuthenticatedLayout';
import AuthenticatedLayout from '@/components/layout/AuthenticatedLayout';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import useProjectRoutes from '@/hooks/common/useProjectRoutes';
import { useNavigationVisible } from '@/hooks/useNavigationVisible';
import useNotFoundRedirect from '@/hooks/useNotFoundRedirect';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import { NextSeo } from 'next-seo';

View File

@@ -1,5 +1,5 @@
import LogsDatePicker from '@/components/logs/LogsDatePicker';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { AvailableLogsServices, LogsCustomInterval } from '@/types/logs';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';

View File

@@ -2,7 +2,7 @@ import useGitHubModal from '@/components/applications/github/useGitHubModal';
import DeploymentListItem from '@/components/deployments/DeploymentListItem';
import GithubIcon from '@/components/icons/GithubIcon';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
@@ -119,6 +119,9 @@ function OverviewDeploymentList() {
const liveDeploymentId = getLastLiveDeployment(deployments);
const { deployments: scheduledOrPendingDeployments } =
scheduledOrPendingDeploymentsData || { deployments: [] };
const isDeploymentInProgress = deployments?.some((deployment) =>
['PENDING', 'SCHEDULED'].includes(deployment.deploymentStatus),
);
return (
<List
@@ -131,7 +134,10 @@ function OverviewDeploymentList() {
deployment={deployment}
isLive={deployment.id === liveDeploymentId}
showRedeploy={index === 0}
disableRedeploy={scheduledOrPendingDeployments?.length > 0}
disableRedeploy={
scheduledOrPendingDeployments?.length > 0 ||
isDeploymentInProgress
}
/>
{index !== deployments.length - 1 && <Divider component="li" />}

View File

@@ -1,6 +1,6 @@
import type { MetricsCardProps } from '@/components/overview/MetricsCard';
import { MetricsCard } from '@/components/overview/MetricsCard';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import Text from '@/ui/v2/Text';
import { useGetProjectMetricsQuery } from '@/utils/__generated__/graphql';
import { prettifyNumber } from '@/utils/common/prettifyNumber';

View File

@@ -1,5 +1,5 @@
import InfoCard from '@/components/overview/InfoCard';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import Text from '@/ui/v2/Text';
import Image from 'next/image';

View File

@@ -1,6 +1,6 @@
import GithubIcon from '@/components/icons/GithubIcon';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';

View File

@@ -1,12 +1,13 @@
import { ChangePlanModal } from '@/components/applications/ChangePlanModal';
import { useDialog } from '@/components/common/DialogProvider';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useIsCurrentUserOwner } from '@/features/projects/common/hooks/useIsCurrentUserOwner';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import Button from '@/ui/v2/Button';
import Chip from '@/ui/v2/Chip';
import CogIcon from '@/ui/v2/icons/CogIcon';
import Text from '@/ui/v2/Text';
import CogIcon from '@/ui/v2/icons/CogIcon';
import { formatDistanceToNowStrict, parseISO } from 'date-fns';
import Image from 'next/image';
import Link from 'next/link';
@@ -14,6 +15,7 @@ import Link from 'next/link';
export default function OverviewTopBar() {
const isPlatform = useIsPlatform();
const { currentWorkspace, currentProject } = useCurrentWorkspaceAndProject();
const isOwner = useIsCurrentUserOwner();
const isPro = !currentProject?.plan?.isFree;
const { openDialog } = useDialog();
const { maintenanceActive } = useUI();
@@ -87,7 +89,7 @@ export default function OverviewTopBar() {
color={isPro ? 'primary' : 'default'}
/>
{!isPro && (
{!isPro && isOwner && (
<Button
variant="borderless"
className="mr-2"

View File

@@ -1,4 +1,5 @@
import RetryableErrorBoundary from '@/components/common/RetryableErrorBoundary';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
useGetAppFunctionsMetadataQuery,
useGetProjectMetricsQuery,
@@ -6,7 +7,6 @@ import {
} from '@/generated/graphql';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLClient';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import LinearProgress from '@/ui/v2/LinearProgress';
import Text from '@/ui/v2/Text';
import { prettifySize } from '@/utils/common/prettifySize';

View File

@@ -1,15 +1,15 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
useResetPostgresPasswordMutation,
useUpdateApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
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 CopyIcon from '@/ui/v2/icons/CopyIcon';
import { copy } from '@/utils/copy';
import { discordAnnounce } from '@/utils/discordAnnounce';
import generateRandomDatabasePassword from '@/utils/settings/generateRandomDatabasePassword';
@@ -56,7 +56,9 @@ export default function ResetDatabasePasswordSettings() {
const handleGenerateRandomPassword = () => {
const newRandomDatabasePassword = generateRandomDatabasePassword();
triggerToast('New random database password generated.');
setValue('databasePassword', newRandomDatabasePassword);
setValue('databasePassword', newRandomDatabasePassword, {
shouldDirty: true,
});
};
const handleChangeDatabasePassword = async (

View File

@@ -1,5 +1,5 @@
import NavLink from '@/components/common/NavLink';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import FloatingActionButton from '@/ui/FloatingActionButton';
import Backdrop from '@/ui/v2/Backdrop';
import type { BoxProps } from '@/ui/v2/Box';

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -1,7 +1,7 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {
GetAuthenticationSettingsDocument,

View File

@@ -2,12 +2,12 @@ import ControlledSelect from '@/components/common/ControlledSelect';
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Option from '@/ui/v2/Option';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -5,7 +5,7 @@ import type {
import BaseEnvironmentVariableForm, {
baseEnvironmentVariableFormValidationSchema,
} from '@/components/settings/environmentVariables/BaseEnvironmentVariableForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {
GetEnvironmentVariablesDocument,

View File

@@ -5,7 +5,7 @@ import type {
import BaseEnvironmentVariableForm, {
baseEnvironmentVariableFormValidationSchema,
} from '@/components/settings/environmentVariables/BaseEnvironmentVariableForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { EnvironmentVariable } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {

View File

@@ -1,6 +1,6 @@
import { useDialog } from '@/components/common/DialogProvider';
import Form from '@/components/common/Form';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { DialogFormProps } from '@/types/common';
import Button from '@/ui/v2/Button';
import Input from '@/ui/v2/Input';

View File

@@ -3,7 +3,7 @@ import SettingsContainer from '@/components/settings/SettingsContainer';
import CreateEnvironmentVariableForm from '@/components/settings/environmentVariables/CreateEnvironmentVariableForm';
import EditEnvironmentVariableForm from '@/components/settings/environmentVariables/EditEnvironmentVariableForm';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { EnvironmentVariable } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';

View File

@@ -3,9 +3,9 @@ import InlineCode from '@/components/common/InlineCode';
import SettingsContainer from '@/components/settings/SettingsContainer';
import EditJwtSecretForm from '@/components/settings/environmentVariables/EditJwtSecretForm';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import useIsPlatform from '@/hooks/common/useIsPlatform';
import { useAppClient } from '@/hooks/useAppClient';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
@@ -107,7 +107,7 @@ export default function SystemEnvironmentVariableSettings() {
? `${getHasuraConsoleServiceUrl()}/console`
: generateAppServiceUrl(
currentProject?.subdomain,
currentProject?.region.awsName,
currentProject?.region,
'hasura',
defaultLocalBackendSlugs,
{ ...defaultRemoteBackendSlugs, hasura: '/console' },

View File

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

View File

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

View File

@@ -5,7 +5,7 @@ import type {
import BasePermissionVariableForm, {
basePermissionVariableValidationSchema,
} from '@/components/settings/permissions/BasePermissionVariableForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {
GetRolesPermissionsDocument,

View File

@@ -5,7 +5,7 @@ import type {
import BasePermissionVariableForm, {
basePermissionVariableValidationSchema,
} from '@/components/settings/permissions/BasePermissionVariableForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { PermissionVariable } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {

View File

@@ -3,7 +3,7 @@ import SettingsContainer from '@/components/settings/SettingsContainer';
import CreatePermissionVariableForm from '@/components/settings/permissions/CreatePermissionVariableForm';
import EditPermissionVariableForm from '@/components/settings/permissions/EditPermissionVariableForm';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { PermissionVariable } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';

View File

@@ -1,7 +1,7 @@
import { calculateBillableResources } from '@/features/settings/resources/utils/calculateBillableResources';
import { prettifyMemory } from '@/features/settings/resources/utils/prettifyMemory';
import { prettifyVCPU } from '@/features/settings/resources/utils/prettifyVCPU';
import type { ResourceSettingsFormValues } from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
import { calculateBillableResources } from '@/features/projects/settings/resources/utils/calculateBillableResources';
import { prettifyMemory } from '@/features/projects/settings/resources/utils/prettifyMemory';
import { prettifyVCPU } from '@/features/projects/settings/resources/utils/prettifyVCPU';
import type { ResourceSettingsFormValues } from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import { useProPlan } from '@/hooks/common/useProPlan';
import { Alert } from '@/ui/Alert';
import Box from '@/ui/v2/Box';

View File

@@ -4,11 +4,11 @@ import SettingsContainer from '@/components/settings/SettingsContainer';
import ResourcesConfirmationDialog from '@/components/settings/resources/ResourcesConfirmationDialog';
import ServiceResourcesFormFragment from '@/components/settings/resources/ServiceResourcesFormFragment';
import TotalResourcesFormFragment from '@/components/settings/resources/TotalResourcesFormFragment';
import { calculateBillableResources } from '@/features/settings/resources/utils/calculateBillableResources';
import type { ResourceSettingsFormValues } from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
import { resourceSettingsValidationSchema } from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { calculateBillableResources } from '@/features/projects/settings/resources/utils/calculateBillableResources';
import type { ResourceSettingsFormValues } from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import { resourceSettingsValidationSchema } from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import { useProPlan } from '@/hooks/common/useProPlan';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { Alert } from '@/ui/Alert';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';

View File

@@ -1,5 +1,5 @@
import { calculateBillableResources } from '@/features/settings/resources/utils/calculateBillableResources';
import type { ResourceSettingsFormValues } from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
import { calculateBillableResources } from '@/features/projects/settings/resources/utils/calculateBillableResources';
import type { ResourceSettingsFormValues } from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import { useProPlan } from '@/hooks/common/useProPlan';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';

View File

@@ -1,6 +1,6 @@
import { prettifyMemory } from '@/features/settings/resources/utils/prettifyMemory';
import { prettifyVCPU } from '@/features/settings/resources/utils/prettifyVCPU';
import type { ResourceSettingsFormValues } from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
import { prettifyMemory } from '@/features/projects/settings/resources/utils/prettifyMemory';
import { prettifyVCPU } from '@/features/projects/settings/resources/utils/prettifyVCPU';
import type { ResourceSettingsFormValues } from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import {
MAX_SERVICE_MEMORY,
MAX_SERVICE_REPLICAS,
@@ -8,7 +8,7 @@ import {
MIN_SERVICE_MEMORY,
MIN_SERVICE_REPLICAS,
MIN_SERVICE_VCPU,
} from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
} from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import Box from '@/ui/v2/Box';
import Slider from '@/ui/v2/Slider';
import Text from '@/ui/v2/Text';

View File

@@ -1,12 +1,12 @@
import { calculateBillableResources } from '@/features/settings/resources/utils/calculateBillableResources';
import { getAllocatedResources } from '@/features/settings/resources/utils/getAllocatedResources';
import { prettifyMemory } from '@/features/settings/resources/utils/prettifyMemory';
import { prettifyVCPU } from '@/features/settings/resources/utils/prettifyVCPU';
import type { ResourceSettingsFormValues } from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
import { calculateBillableResources } from '@/features/projects/settings/resources/utils/calculateBillableResources';
import { getAllocatedResources } from '@/features/projects/settings/resources/utils/getAllocatedResources';
import { prettifyMemory } from '@/features/projects/settings/resources/utils/prettifyMemory';
import { prettifyVCPU } from '@/features/projects/settings/resources/utils/prettifyVCPU';
import type { ResourceSettingsFormValues } from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import {
MAX_TOTAL_VCPU,
MIN_TOTAL_VCPU,
} from '@/features/settings/resources/utils/resourceSettingsValidationSchema';
} from '@/features/projects/settings/resources/utils/resourceSettingsValidationSchema';
import { useProPlan } from '@/hooks/common/useProPlan';
import { Alert } from '@/ui/Alert';
import Box from '@/ui/v2/Box';

View File

@@ -5,7 +5,7 @@ import type {
import BaseRoleForm, {
baseRoleFormValidationSchema,
} from '@/components/settings/roles/BaseRoleForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {
GetRolesPermissionsDocument,

View File

@@ -5,7 +5,7 @@ import type {
import BaseRoleForm, {
baseRoleFormValidationSchema,
} from '@/components/settings/roles/BaseRoleForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { Role } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import {

View File

@@ -3,7 +3,7 @@ import SettingsContainer from '@/components/settings/SettingsContainer';
import CreateRoleForm from '@/components/settings/roles/CreateRoleForm';
import EditRoleForm from '@/components/settings/roles/EditRoleForm';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { Role } from '@/types/application';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';

View File

@@ -5,7 +5,7 @@ import type {
import BaseSecretForm, {
baseSecretFormValidationSchema,
} from '@/components/settings/secrets/BaseSecretForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSecretsDocument,
useInsertSecretMutation,

View File

@@ -5,7 +5,7 @@ import type {
import BaseSecretForm, {
baseSecretFormValidationSchema,
} from '@/components/settings/secrets/BaseSecretForm';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { Secret } from '@/types/application';
import {
GetSecretsDocument,

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';

View File

@@ -1,17 +1,17 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -217,7 +217,7 @@ export default function AppleProviderSettings() {
id="redirectUrl"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/apple/callback`}
className="col-span-2"
@@ -236,7 +236,7 @@ export default function AppleProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/apple/callback`,
'Redirect URL',

View File

@@ -2,17 +2,17 @@ import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import BaseProviderSettings from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -163,7 +163,7 @@ export default function AzureADProviderSettings() {
id="redirectUrl"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/azuread/callback`}
className="col-span-2"
@@ -182,7 +182,7 @@ export default function AzureADProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/azuread/callback`,
'Redirect URL',

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -139,7 +139,7 @@ export default function DiscordProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/discord/callback`}
disabled
@@ -154,7 +154,7 @@ export default function DiscordProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/discord/callback`,
'Redirect URL',

View File

@@ -2,12 +2,12 @@ import ControlledCheckbox from '@/components/common/ControlledCheckbox';
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Text from '@/ui/v2/Text';
import getServerError from '@/utils/settings/getServerError';

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -139,7 +139,7 @@ export default function FacebookProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/facebook/callback`}
disabled
@@ -154,7 +154,7 @@ export default function FacebookProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/facebook/callback`,
'Redirect URL',

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -145,7 +145,7 @@ export default function GitHubProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/github/callback`}
disabled
@@ -160,7 +160,7 @@ export default function GitHubProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/github/callback`,
'Redirect URL',

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -139,7 +139,7 @@ export default function GoogleProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/google/callback`}
disabled
@@ -154,7 +154,7 @@ export default function GoogleProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/google/callback`,
'Redirect URL',

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -139,7 +139,7 @@ export default function LinkedInProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/linkedin/callback`}
disabled
@@ -154,7 +154,7 @@ export default function LinkedInProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/linkedin/callback`,
'Redirect URL',

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import Option from '@/ui/v2/Option';

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -139,7 +139,7 @@ export default function SpotifyProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/spotify/callback`}
disabled
@@ -154,7 +154,7 @@ export default function SpotifyProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/spotify/callback`,
'Redirect URL',

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -145,7 +145,7 @@ export default function TwitchProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/twitch/callback`}
disabled
@@ -160,7 +160,7 @@ export default function TwitchProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/twitch/callback`,
'Redirect URL',

View File

@@ -1,17 +1,17 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -167,7 +167,7 @@ export default function TwitterProviderSettings() {
id="redirectUrl"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/twitter/callback`}
className="col-span-2"
@@ -186,7 +186,7 @@ export default function TwitterProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/twitter/callback`,
'Redirect URL',

View File

@@ -1,12 +1,12 @@
import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';

View File

@@ -5,17 +5,17 @@ import BaseProviderSettings, {
baseProviderValidationSchema,
} from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -138,7 +138,7 @@ export default function WindowsLiveProviderSettings() {
label="Redirect URL"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/windowslive/callback`}
disabled
@@ -153,7 +153,7 @@ export default function WindowsLiveProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/windowslive/callback`,
'Redirect URL',

View File

@@ -2,17 +2,17 @@ import Form from '@/components/common/Form';
import SettingsContainer from '@/components/settings/SettingsContainer';
import BaseProviderSettings from '@/components/settings/signInMethods/BaseProviderSettings';
import { useUI } from '@/context/UIContext';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetSignInMethodsDocument,
useGetSignInMethodsQuery,
useUpdateConfigMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import IconButton from '@/ui/v2/IconButton';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import { copy } from '@/utils/copy';
import getServerError from '@/utils/settings/getServerError';
@@ -184,7 +184,7 @@ export default function WorkOsProviderSettings() {
id="redirectUrl"
defaultValue={`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/workos/callback`}
className="col-span-2"
@@ -203,7 +203,7 @@ export default function WorkOsProviderSettings() {
copy(
`${generateAppServiceUrl(
currentProject.subdomain,
currentProject.region.awsName,
currentProject.region,
'auth',
)}/signin/provider/workos/callback`,
'Redirect URL',

View File

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

View File

@@ -1,4 +1,4 @@
export * from './Tooltip';
export { default } from './Tooltip';
export { default as Tooltip, default } from './Tooltip';
export * from './useTooltip';
export { default as useTooltip } from './useTooltip';

View File

@@ -0,0 +1,26 @@
import type { IconProps } from '@/ui/v2/icons';
import SvgIcon from '@/ui/v2/icons/SvgIcon';
function GaugeIcon(props: IconProps) {
return (
<SvgIcon
width="16"
height="16"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
aria-label="A gauge"
{...props}
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M10.757 3.295A7.25 7.25 0 0 0 8 2.75h-.026c-3.286.011-6.032 2.231-6.92 5.227a.753.753 0 0 0-.081.293 7.359 7.359 0 0 0-.223 1.8v1.43A1.25 1.25 0 0 0 2 12.75h12a1.25 1.25 0 0 0 1.25-1.25V10a7.25 7.25 0 0 0-.246-1.872l-.001-.004V8.12a7.248 7.248 0 0 0-4.246-4.825Zm-2.77 7.955h5.763V10c0-.252-.017-.503-.05-.751l-1.16.31a.75.75 0 1 1-.387-1.448l1.16-.31-.003-.006a5.751 5.751 0 0 0-4.56-3.496V5.5a.75.75 0 0 1-1.5 0V4.3c-2.053.271-3.764 1.645-4.545 3.505l1.142.306A.75.75 0 1 1 3.46 9.56L2.307 9.25a5.895 5.895 0 0 0-.057.82v1.179h3.845l4.05-5.277a.75.75 0 0 1 1.19.913L7.985 11.25Z"
fill="currentColor"
/>
</SvgIcon>
);
}
GaugeIcon.displayName = 'NhostGaugeIcon';
export default GaugeIcon;

View File

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

View File

@@ -1,6 +1,6 @@
import { useDialog } from '@/components/common/DialogProvider';
import Form from '@/components/common/Form';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import type { DialogFormProps } from '@/types/common';
import { Alert } from '@/ui/Alert';
import Button from '@/ui/v2/Button';
@@ -68,7 +68,7 @@ export default function CreateUserForm({
const baseAuthUrl = generateAppServiceUrl(
currentProject?.subdomain,
currentProject?.region?.awsName,
currentProject?.region,
'auth',
);

View File

@@ -3,8 +3,8 @@ import ControlledSelect from '@/components/common/ControlledSelect';
import { useDialog } from '@/components/common/DialogProvider';
import Form from '@/components/common/Form';
import EditUserPasswordForm from '@/components/users/EditUserPasswordForm';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLClient';
import { useCurrentWorkspaceAndProject } from '@/hooks/v2/useCurrentWorkspaceAndProject';
import type { DialogFormProps } from '@/types/common';
import Avatar from '@/ui/v2/Avatar';
import Box from '@/ui/v2/Box';

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