Compare commits

..

106 Commits

Author SHA1 Message Date
Szilárd Dóró
9b8a19a316 Merge pull request #1987 from nhost/changeset-release/main
chore: update versions
2023-06-01 13:57:05 +02:00
github-actions[bot]
26b8519add chore: update versions 2023-06-01 11:33:06 +00:00
Szilárd Dóró
f372b167d9 Merge pull request #1988 from nhost/chore/bump-deps
chore(deps): bump `@types/react`, `turbo` and `tj-actions/changed-files`
2023-06-01 13:31:48 +02:00
Szilárd Dóró
fbaea49b28 fix: ignore secrets correctly 2023-06-01 13:24:39 +02:00
Szilárd Dóró
0b4a2041e2 Merge branch 'main' into chore/bump-deps 2023-06-01 13:24:14 +02:00
Szilárd Dóró
444206b0f7 Merge pull request #1993 from nhost/chore/allow-empty-secrets-env-vars
chore(dashboard): allow empty secrets and environment variables
2023-06-01 13:23:38 +02:00
Szilárd Dóró
624ef79110 chore: bump turbo to v1.10.1 2023-06-01 13:19:09 +02:00
Szilárd Dóró
711ef45815 Merge branch 'chore/bump-deps' of https://github.com/nhost/nhost into chore/bump-deps 2023-06-01 13:17:46 +02:00
Szilárd Dóró
21e13db05a chore: add changeset 2023-06-01 13:17:44 +02:00
Szilárd Dóró
a1862b80ba chore: bump turbo, @types/react and tj-actions/changed-files 2023-06-01 13:17:43 +02:00
Szilárd Dóró
42e8d102e9 Merge pull request #1985 from nhost/fix/ci
fix(ci): use new CLI
2023-06-01 13:16:21 +02:00
Szilárd Dóró
aa3c629892 chore: add changeset 2023-06-01 12:49:25 +02:00
Szilárd Dóró
f016afed5d chore: bump pnpm version 2023-06-01 12:12:54 +02:00
Szilárd Dóró
9d4ee99553 fix: don't break E2E tests 2023-06-01 12:10:04 +02:00
Szilárd Dóró
6cbe1f662f fix: don't break E2E tests 2023-06-01 11:37:56 +02:00
Szilárd Dóró
abd9c88e5a Revert "fix: use correct mailhog URL in tests"
This reverts commit 788090e917.
2023-06-01 10:40:04 +02:00
Szilárd Dóró
27e5ef8f5a fix: use correct mailhog URL in tests 2023-06-01 10:34:50 +02:00
Szilárd Dóró
788090e917 fix: use correct mailhog URL in tests 2023-06-01 10:34:10 +02:00
Szilárd Dóró
f16433ae67 chore: allow empty secrets and environment variables 2023-06-01 10:17:14 +02:00
Szilárd Dóró
33e3bba700 fix: don't break E2E tests 2023-06-01 10:12:38 +02:00
Szilárd Dóró
517bb6930a chore: bump CLI version in all examples 2023-06-01 09:09:25 +02:00
Szilárd Dóró
4b17964e8d fix: simplify CI 2023-06-01 08:53:50 +02:00
Szilárd Dóró
ebc016377b fix: use proper dummy JWT secret 2023-06-01 08:45:55 +02:00
Szilárd Dóró
eae670f4d1 fix: don't start nhost up in the background 2023-06-01 08:42:55 +02:00
Szilárd Dóró
c642649853 chore: revert insecure curl requests 2023-06-01 08:26:16 +02:00
David Barroso
095f2c73b9 fix: update nhost's upgrade command (#1989) 2023-05-31 17:54:43 +02:00
Szilárd Dóró
42753d2b1f chore: add changeset 2023-05-31 16:00:42 +02:00
Szilárd Dóró
328c0a6600 chore: bump turbo, @types/react and tj-actions/changed-files 2023-05-31 15:59:52 +02:00
Szilárd Dóró
93101430c8 fix: temporarily allow insecure URL for curl 2023-05-31 15:53:28 +02:00
Szilárd Dóró
c14738b8c1 fix: use dummy .secrets file 2023-05-31 15:53:28 +02:00
Szilárd Dóró
683ef4f2fe fix: use dummy .secrets file 2023-05-31 15:53:28 +02:00
Szilárd Dóró
528f02874c fix: use dummy .secrets file 2023-05-31 15:53:28 +02:00
Szilárd Dóró
5f72ba57d3 chore: upgrade the Nhost app in packages/nhost-js 2023-05-31 15:53:27 +02:00
Szilárd Dóró
e71e3af530 fix: use CLI v1.0.1 2023-05-31 15:53:27 +02:00
Szilárd Dóró
aa05cd4b61 fix: temp CLI version change 2023-05-31 15:53:27 +02:00
Szilárd Dóró
bd87a36c6e update CLI install script 2023-05-31 15:53:27 +02:00
Szilárd Dóró
9c88947b86 change CLI version in CI 2023-05-31 15:53:27 +02:00
Szilárd Dóró
1b03ce7259 fix test CLI action 2023-05-31 15:53:27 +02:00
Szilárd Dóró
de1137a876 update CLI commands 2023-05-31 15:53:27 +02:00
Szilárd Dóró
770c4d1801 fix: don't break CI because of new Nhost CLI 2023-05-31 15:53:26 +02:00
Szilárd Dóró
60e25b3425 Merge pull request #1984 from nhost/chore/under-the-hood-improvements-pt-3
chore(dashboard): under the hood improvements
2023-05-31 15:50:06 +02:00
Szilárd Dóró
f4d2a305a5 Merge pull request #1980 from nhost/changeset-release/main
chore: update versions
2023-05-31 14:56:02 +02:00
Szilárd Dóró
01eeef9de7 chore: add changeset 2023-05-31 10:50:44 +02:00
Szilárd Dóró
f395375cd0 chore: @/ui -> @/components/ui
also improve ESLint rules
2023-05-31 10:48:40 +02:00
Szilárd Dóró
ae3599d2b4 chore: update codegen, simplify types 2023-05-31 10:40:51 +02:00
David Barroso
9a3c782fcb fix: update to new subcommand structure (#1983) 2023-05-31 10:30:56 +02:00
Szilárd Dóró
28c1633695 chore: remove unused hook 2023-05-31 10:27:56 +02:00
Szilárd Dóró
66822f8673 chore: nest remaining unnested utils 2023-05-31 10:26:19 +02:00
Szilárd Dóró
86b82bf5cf chore: simplify utils structure 2023-05-31 10:24:17 +02:00
Szilárd Dóró
f77454a848 chore: move utility function to features 2023-05-31 09:40:15 +02:00
Szilárd Dóró
3426000edf chore: simplify project structure 2023-05-31 09:33:21 +02:00
Szilárd Dóró
7bd9da909c chore: move components from the common folder 2023-05-31 09:26:42 +02:00
Szilárd Dóró
fcb84bfb3d chore: simplify component structure 2023-05-31 09:12:30 +02:00
Szilárd Dóró
991e4c0cc5 chore: move files to the features folder 2023-05-31 09:07:25 +02:00
github-actions[bot]
a7f03bc6ce chore: update versions 2023-05-31 06:53:53 +00:00
Szilárd Dóró
5684fdbf0b Merge pull request #1977 from nhost/chore/under-the-hood-improvements-pt-2
chore(dashboard): under the hood improvements
2023-05-31 08:52:34 +02:00
Nuno Pato
39980e6c54 Merge pull request #1979 from nhost/blog/config
update docs on cli
2023-05-30 16:50:18 +00:00
Nuno Pato
5b959cce0e asd 2023-05-30 16:25:15 +00:00
Nuno Pato
117098d8da config blog post 2023-05-30 15:20:36 +00:00
Szilárd Dóró
1fce4ca93d fix: don't break linter step 2023-05-30 15:45:04 +02:00
Szilárd Dóró
6a74a97cd0 Merge pull request #1978 from nhost/changeset-release/main
chore: update versions
2023-05-30 15:07:59 +02:00
Szilárd Dóró
7446fb30db fix: don't break build 2023-05-30 15:00:17 +02:00
github-actions[bot]
291185e609 chore: update versions 2023-05-30 12:43:56 +00:00
Szilárd Dóró
b1a2dd6ab3 Merge remote-tracking branch 'origin/main' into chore/under-the-hood-improvements-pt-2 2023-05-30 14:43:44 +02:00
Szilárd Dóró
d3f965048a Merge pull request #1976 from nhost/feat/enable-secrets
feat(dashboard): enable secrets
2023-05-30 14:42:39 +02:00
Szilárd Dóró
9acecfd638 chore: simplify file structure 2023-05-30 14:37:00 +02:00
Szilárd Dóró
134773be86 chore: break down UIContext 2023-05-30 14:31:12 +02:00
Szilárd Dóró
88a4983f2e chore: add changeset 2023-05-30 14:21:27 +02:00
Szilárd Dóró
7526f573c3 Merge remote-tracking branch 'origin/main' into chore/under-the-hood-improvements-pt-2 2023-05-30 14:21:18 +02:00
Szilárd Dóró
9b0d4dde50 feat: enable secrets 2023-05-30 14:16:20 +02:00
Szilárd Dóró
9934514dde chore: nest unnested hooks and utils 2023-05-30 13:07:46 +02:00
Szilárd Dóró
c7084d1759 chore: misc cleanup 2023-05-30 12:43:11 +02:00
Szilárd Dóró
f0a122d39b chore: remove unused components 2023-05-30 12:32:53 +02:00
Szilárd Dóró
34f1795e40 chore: update remaining default exports 2023-05-30 12:32:15 +02:00
Szilárd Dóró
2032494b27 chore: update provider exports 2023-05-30 12:30:10 +02:00
Szilárd Dóró
b5dce47370 chore: update secret components 2023-05-30 12:25:10 +02:00
Szilárd Dóró
60f1a03d33 chore: update roles components' exports 2023-05-30 12:24:02 +02:00
Szilárd Dóró
881b2d752c chore: update environment variable imports 2023-05-30 12:22:59 +02:00
Szilárd Dóró
db293808f3 chore: update BasePermissionVariableForm imports 2023-05-30 12:22:17 +02:00
Szilárd Dóró
7414b39f48 chore: update BaseEnvironmentVariableForm imports 2023-05-30 12:18:16 +02:00
Szilárd Dóró
7ebc555e4c chore: update ErrorMessage imports 2023-05-30 12:17:05 +02:00
Szilárd Dóró
830e627da1 chore: update import paths 2023-05-30 12:15:46 +02:00
Szilárd Dóró
176e3d5ea6 chore: update import paths 2023-05-30 11:35:45 +02:00
Szilárd Dóró
759aa9c221 chore: update Box imports 2023-05-30 11:28:27 +02:00
Szilárd Dóró
3acfd032bd chore: update Text imports 2023-05-30 11:25:59 +02:00
Szilárd Dóró
b77711000a chore: nest the remaining unnested components 2023-05-30 11:23:09 +02:00
Szilárd Dóró
79fa77f28f chore: remove unused components, update avatars 2023-05-30 11:19:33 +02:00
Szilárd Dóró
bd6fe2f85f chore: move Resource settings components 2023-05-30 11:03:13 +02:00
Szilárd Dóró
acb8a4f187 chore: remove default Button export 2023-05-30 11:00:19 +02:00
Szilárd Dóró
97cfb5c514 chore: remove unnecessary components 2023-05-25 14:08:38 +02:00
Szilárd Dóró
f0be842325 chore: create v1 folder for old UI components 2023-05-25 12:39:28 +02:00
Szilárd Dóró
30a0fd1698 chore: create folders for basic components 2023-05-25 12:34:01 +02:00
Szilárd Dóró
ce45f3b707 chore: move icons to the correct place 2023-05-25 12:23:07 +02:00
Szilárd Dóró
8b9df13725 chore: move generic components 2023-05-25 12:11:58 +02:00
Szilárd Dóró
8f31258d11 chore: move data grid components and hooks 2023-05-25 12:04:46 +02:00
Szilárd Dóró
877f857010 chore: improve hook structure 2023-05-25 11:46:49 +02:00
Szilárd Dóró
5773521b03 chore: move workspace-related components 2023-05-25 11:29:20 +02:00
Szilárd Dóró
549dd83f3e chore: partially move workspace-related components 2023-05-25 11:19:38 +02:00
Szilárd Dóró
e72c19c9da chore: move logs-related components 2023-05-25 11:08:28 +02:00
Szilárd Dóró
70d5dcf170 chore: move graphql-related files 2023-05-25 10:48:05 +02:00
Szilárd Dóró
c439174821 chore: move project-related components 2023-05-25 10:36:24 +02:00
Szilárd Dóró
2f7b2532ea chore: move backup and project-related components 2023-05-25 10:28:09 +02:00
Szilárd Dóró
faa21af7fb chore: move deployment-related files 2023-05-25 10:19:17 +02:00
Szilárd Dóró
a5fdc46a57 chore: move database utils 2023-05-25 10:10:36 +02:00
Szilárd Dóró
04e8728753 chore: move common project-related hooks 2023-05-25 10:09:34 +02:00
Szilárd Dóró
34cf922643 chore: cleanup Git related files 2023-05-25 10:07:56 +02:00
1001 changed files with 14998 additions and 5239 deletions

View File

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

View File

@@ -49,21 +49,9 @@ runs:
if: ${{ inputs.start == 'true' }}
shell: bash
working-directory: ${{ inputs.path }}
run: nhost dev --no-browser &
- name: Wait for the app to be ready
id: wait
if: ${{ inputs.start == 'true' && inputs.wait == 'true' }}
shell: bash
working-directory: ${{ inputs.path }}
continue-on-error: true
run: |
curl -sSf --connect-timeout 3 \
--max-time 5 \
--retry 300 \
--retry-delay 1 \
--retry-max-time 300 \
--retry-connrefused \
'http://localhost:9695' > /dev/null
cp .secrets.example .secrets
nhost up
- name: Log on failure
if: steps.wait.outcome == 'failure'
shell: bash

View File

@@ -43,7 +43,7 @@ jobs:
BUILD: 'all'
- name: Check if the pnpm lockfile changed
id: changed-lockfile
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v36
with:
files: pnpm-lock.yaml
# * Determine a pnpm filter argument for packages that have been modified.

View File

@@ -28,7 +28,7 @@ jobs:
path: packages/nhost-js
start: true
- name: should be running
run: curl -sSf 'http://localhost:9695' > /dev/null
run: curl -sSf 'https://local.hasura.nhost.run' > /dev/null
stop:
runs-on: ubuntu-latest
@@ -48,28 +48,6 @@ jobs:
exit 1
fi
wait:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install the Nhost CLI and start the application
uses: ./.github/actions/nhost-cli
with:
path: packages/nhost-js
start: true
wait: false
- name: should not be ready
run: curl -sSf -o /dev/null 'http://localhost:9695' > /dev/null && exit 1 || true
- name: should eventually be ready
run: |
curl -sSf --connect-timeout 3 \
--max-time 5 \
--retry 300 \
--retry-delay 1 \
--retry-max-time 300 \
--retry-connrefused \
'http://localhost:9695' > /dev/null
config:
runs-on: ubuntu-latest
steps:
@@ -79,14 +57,10 @@ jobs:
with:
path: packages/nhost-js
start: true
config: |
services:
auth:
image: nhost/hasura-auth:0.15.0
- name: should find the injected hasura-auth version
run: |
VERSION=$(curl -sSf 'http://localhost:1337/v1/auth/version')
EXPECTED_VERSION='{"version":"v0.15.0"}'
VERSION=$(curl -sSf 'https://local.auth.nhost.run/v1/version')
EXPECTED_VERSION='{"version":"v0.20.1"}'
if [ "$VERSION" != "$EXPECTED_VERSION" ]; then
echo "Expected version $EXPECTED_VERSION but got $VERSION"
exit 1
@@ -99,6 +73,6 @@ jobs:
- name: Install the Nhost CLI
uses: ./.github/actions/nhost-cli
with:
version: v0.8.10
version: v1.0.1
- name: should find the correct version
run: nhost version | head -n 1 | grep v0.8.10 || exit 1
run: nhost --version | head -n 1 | grep v1.0.1 || exit 1

1
.gitignore vendored
View File

@@ -26,6 +26,7 @@ tmp/
.pnpm-store
.turbo
.env
.secrets
out/
# Custom

View File

@@ -25,13 +25,9 @@ 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 }],
// TODO: Temporarily disable this rule because of a WIP refactoring
'import/no-named-as-default': 'off',
curly: ['error', 'all'],
'no-restricted-exports': 'off',
'no-undef': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
@@ -70,17 +66,7 @@ module.exports = {
{
group: ['..*'],
message:
'Please use absolute imports instead. (e.g: @/ui/, @/hooks/, etc.)',
},
{
group: ['@/components/ui', '@/components/ui/*'],
message:
'Please use shorthand imports instead. (e.g: @/ui/ActivityIndicator, @/ui/Button, etc.)',
},
{
group: ['@/components/ui/v2*'],
message:
'Please use shorthand imports instead. (e.g: @/ui/v2/ActivityIndicator, @/ui/v2/Button, etc.)',
'Please use absolute imports instead. (e.g: @/components/, @/hooks/, etc.)',
},
{
group: ['@testing-library/react*'],

View File

@@ -1,5 +1,28 @@
# @nhost/dashboard
## 0.17.3
### Patch Changes
- 01eeef9de: chore(misc): under the hood improvements
- 21e13db05: chore(deps): bump `@types/react` to `v18.2.7` and `turbo` to `v1.10.1`
- f16433ae6: chore(secrets): allow empty secrets and environment variables
- aa3c62989: chore(cli): bump Nhost CLI version to v1.0
- @nhost/react-apollo@5.0.24
- @nhost/nextjs@1.13.26
## 0.17.2
### Patch Changes
- 88a4983f: chore(misc): under the hood improvements
## 0.17.1
### Patch Changes
- 9b0d4dde: feat(secrets): enable secrets
## 0.17.0
### Minor 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.9.8
RUN yarn global add turbo@1.10.1
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@8.4.0
RUN yarn global add pnpm@8.6.0
COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-*.yaml .

View File

@@ -13,7 +13,7 @@ pnpm install
Depending on the environment you wish to target you can configure environment variables in `.env.<target_environment>.local`.
- `.env.development`: This file is used if you run `nhost dev`
- `.env.development`: This file is used if you run `nhost up`
- `.env.development.local`: This file is used if you run `pnpm dev`. It takes precedence over `.env.local` if available.
- `.env.production.local`: This file is used if you run `pnpm build`. It takes precedence over `.env.local` if available.
- `.env.local`: This file is used if you run either `pnpm dev` or `pnpm build`.
@@ -27,7 +27,7 @@ You can connect the Nhost Dashboard to your **locally running** Nhost backend in
First, you need to run the following command to start your backend locally:
```bash
cd <your_nhost_project> && nhost dev
cd <your_nhost_project> && nhost up
```
You can connect the Nhost Dashboard to your locally running backend by setting the following environment variables in `.env.development.local`:
@@ -92,7 +92,7 @@ pnpm storybook
| Name | Description |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `react/react-in-jsx-scope` | Disabled because we don't need to import `React` anymore. |
| `react/jsx-props-no-spreading` | Disabled because we heavily rely on props spreading in our `@/ui/v2` components. |
| `react/jsx-props-no-spreading` | Disabled because we heavily rely on props spreading in our `@/components/ui/v2` components. |
| `react/require-default-props` | Disabled because we use TypeScript instead of PropTypes. |
| `react-hooks/exhaustive-deps` | Because we already had several rule violations when proper ESLint rules were introduced, we changed this rule to a warning. |
| `import/extensions` | JS / TS files should be imported without file extensions. |
@@ -101,7 +101,6 @@ pnpm storybook
| `import/order` | Until we have a better auto-formatter, we disable this rule. |
| `import/no-extraneous-dependencies` | `devDependencies` should be excluded from the list of disallowed imports. |
| `curly` | By default it only enforces curly braces for multi-line blocks, but it should be enforced for single-line blocks as well. |
| `no-restricted-exports` | `export { default } from './module'` is used heavily in `@/ui/v2` which is a restricted export by default. |
| `@typescript-eslint/no-use-before-define` | Order of type references should be ignored. |
| `no-undef` | [Official TypeScript ESLint packages](https://github.com/typescript-eslint/typescript-eslint/issues/4671#issuecomment-1065948494) are turning off this rule. |
| `@typescript-eslint/no-shadow` | TypeScript specific implementation of `no-shadow`. |

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.17.0",
"version": "0.17.3",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -11,7 +11,7 @@
"lint": "next lint --max-warnings 0",
"test": "vitest",
"codegen": "graphql-codegen --config graphql.config.yaml --errors-only",
"nhost:dev": "nhost dev -d",
"nhost:dev": "nhost up",
"format": "prettier --write \"src/**/*.{js,ts,tsx,jsx,json,md}\" --plugin-search-dir=.",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook",
@@ -104,7 +104,7 @@
"@types/lodash.debounce": "^4.0.7",
"@types/node": "^16.11.7",
"@types/pluralize": "^0.0.29",
"@types/react": "18.2.6",
"@types/react": "18.2.7",
"@types/react-dom": "18.2.4",
"@types/react-table": "^7.7.12",
"@types/testing-library__jest-dom": "^5.14.5",

View File

@@ -1,19 +0,0 @@
import Status, { StatusEnum } from '@/ui/Status';
import Box from '@/ui/v2/Box';
import { isDevOrStaging } from '@/utils/helpers';
import type { PropsWithChildren } from 'react';
export function StagingMetadata({ children }: PropsWithChildren<unknown>) {
return (
isDevOrStaging() && (
<div className="mx-auto mt-10 max-w-sm">
<Box className="mx-auto flex flex-col rounded-md border p-5 text-center">
<Status status={StatusEnum.Deploying}>Internal info</Status>
{children}
</Box>
</div>
)
);
}
export default StagingMetadata;

View File

@@ -1,23 +0,0 @@
import Link from '@/ui/v2/Link';
import Text from '@/ui/v2/Text';
export function CheckGithubConfiguration() {
return (
<Text className="mt-2 text-center text-xs">
Do you miss a repository, or do you need to connect another GitHub
account?{' '}
<Link
href={process.env.NEXT_PUBLIC_GITHUB_APP_INSTALL_URL}
target="_blank"
rel="noreferrer noopener"
className="text-xs font-medium"
underline="hover"
>
Manage your GitHub configuration
</Link>
.
</Text>
);
}
export default CheckGithubConfiguration;

View File

@@ -1,35 +0,0 @@
import GithubIcon from '@/components/icons/GithubIcon';
import Button from '@/ui/v2/Button';
import ArrowSquareOutIcon from '@/ui/v2/icons/ArrowSquareOutIcon';
import Text from '@/ui/v2/Text';
export default function GitHubInstallNhostApplication() {
return (
<div className="grid grid-flow-row justify-center gap-2 p-0.5">
<GithubIcon className="mx-auto h-8 w-8" />
<div className="text-center">
<Text variant="h3" component="h2">
Install the Nhost GitHub Application
</Text>
<Text variant="subtitle2">
Install the Nhost application on your GitHub account and update
permissions to automatically track repositories.
</Text>
</div>
<Button
href={process.env.NEXT_PUBLIC_GITHUB_APP_INSTALL_URL}
// Both `target` and `rel` are available when `href` is set. This is
// a limitation of MUI.
// @ts-ignore
target="_blank"
rel="noreferrer noopener"
endIcon={<ArrowSquareOutIcon className="h-4 w-4" />}
>
Configure the Nhost application on GitHub
</Button>
</div>
);
}

View File

@@ -1,62 +0,0 @@
import { Avatar } from '@/ui/Avatar';
import Divider from '@/ui/v2/Divider';
import PlusCircleIcon from '@/ui/v2/icons/PlusCircleIcon';
import Link from '@/ui/v2/Link';
import List from '@/ui/v2/List';
import { ListItem } from '@/ui/v2/ListItem';
import Text from '@/ui/v2/Text';
import { Fragment } from 'react';
export function GitHubNoRepositoriesAdded({
filteredGitHubAppInstallations,
}: any) {
return (
<div>
<Text className="mt-1 text-center text-lg font-medium">
No repositories found
</Text>
<Text className="text-center text-xs">
Check the Nhost app&apos;s settings on your GitHub account, or install
the app on a new account.
</Text>
<List className="my-2 border-y">
{filteredGitHubAppInstallations.map((githubApp, index) => (
<Fragment key={githubApp.id}>
<ListItem.Root
key={githubApp.id}
className="grid grid-flow-col gap-2 py-2.5 justify-start items-center"
>
<ListItem.Avatar>
<Avatar
avatarUrl={githubApp.accountAvatarUrl as string}
className="mr-1 h-5 w-5"
/>
</ListItem.Avatar>
<ListItem.Text primary={githubApp.accountLogin} />
</ListItem.Root>
{index < filteredGitHubAppInstallations.length - 1 && (
<Divider component="li" />
)}
</Fragment>
))}
</List>
<Link
href={process.env.NEXT_PUBLIC_GITHUB_APP_INSTALL_URL}
target="_blank"
rel="noreferrer noopener"
underline="hover"
className="grid grid-flow-col gap-1 items-center justify-start"
>
<PlusCircleIcon className="w-4 h-4" />
Configure the Nhost application on GitHub.
</Link>
</div>
);
}
export default GitHubNoRepositoriesAdded;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
import type { CommonDialogProps } from '@/components/ui/v2/Dialog';
import type { DialogFormProps } from '@/types/common';
import type { CommonDialogProps } from '@/ui/v2/Dialog';
import type { ReactElement, ReactNode } from 'react';
import { createContext } from 'react';

View File

@@ -1,7 +1,7 @@
import RetryableErrorBoundary from '@/components/common/RetryableErrorBoundary';
import AlertDialog from '@/ui/v2/AlertDialog';
import { BaseDialog } from '@/ui/v2/Dialog';
import Drawer from '@/ui/v2/Drawer';
import { RetryableErrorBoundary } from '@/components/presentational/RetryableErrorBoundary';
import { AlertDialog } from '@/components/ui/v2/AlertDialog';
import { BaseDialog } from '@/components/ui/v2/Dialog';
import { Drawer } from '@/components/ui/v2/Drawer';
import { useRouter } from 'next/router';
import type { BaseSyntheticEvent, PropsWithChildren } from 'react';
import {

View File

@@ -1,4 +1,4 @@
import type { CommonDialogProps } from '@/ui/v2/Dialog';
import type { CommonDialogProps } from '@/components/ui/v2/Dialog';
import type { ReactElement, ReactNode } from 'react';
import type { DialogConfig, OpenDialogOptions } from './DialogContext';

View File

@@ -1,11 +0,0 @@
import ErrorMessage from '@/components/common/ErrorMessage';
import type { FallbackProps } from 'react-error-boundary';
export default function ErrorBoundaryFallback({
error,
resetErrorBoundary,
}: FallbackProps) {
return (
<ErrorMessage onReset={resetErrorBoundary}>{error.message}</ErrorMessage>
);
}

View File

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

View File

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

View File

@@ -1,5 +1,11 @@
import { FeedbackReceived } from '@/components/home/FeedbackReceived';
import { SendFeedback } from '@/components/home/SendFeedback';
import { Avatar } from '@/components/ui/v2/Avatar';
import { Button } from '@/components/ui/v2/Button';
import { Input } from '@/components/ui/v2/Input';
import { Text } from '@/components/ui/v2/Text';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useInsertFeedbackOneMutation } from '@/utils/__generated__/graphql';
import { useUserData } from '@nhost/nextjs';
import Image from 'next/image';
import type { DetailedHTMLProps, HTMLProps } from 'react';
import { useState } from 'react';
import { twMerge } from 'tailwind-merge';
@@ -7,25 +13,136 @@ import { twMerge } from 'tailwind-merge';
export interface FeedbackFormProps
extends DetailedHTMLProps<HTMLProps<HTMLDivElement>, HTMLDivElement> {}
// TODO: Use `react-hook-form` here instead of the custom solution
// TODO: Use `react-hook-form` here instead of the custom form implementation
export default function FeedbackForm({
className,
...props
}: FeedbackFormProps) {
const { currentProject } = useCurrentWorkspaceAndProject();
const [insertFeedback, { loading }] = useInsertFeedbackOneMutation();
const user = useUserData();
const [feedback, setFeedback] = useState('');
const [feedbackSent, setFeedbackSent] = useState(false);
return (
<div className={twMerge('max-w-md py-4 px-5', className)} {...props}>
{!feedbackSent ? (
<SendFeedback
setFeedbackSent={setFeedbackSent}
feedback={feedback}
setFeedback={setFeedback}
function handleClose() {
setTimeout(() => {
setFeedbackSent(false);
}, 500);
}
async function handleSubmit(e: React.SyntheticEvent<HTMLFormElement>) {
e.preventDefault();
const feedbackWithProjectInfo = [
currentProject && `Project ID: ${currentProject.id}`,
typeof window !== 'undefined' && `URL: ${window.location.href}`,
feedback,
]
.filter(Boolean)
.join('\n\n');
try {
await insertFeedback({
variables: {
feedback: {
feedback: feedbackWithProjectInfo,
},
},
});
setFeedbackSent(true);
setFeedback('');
} catch (error) {
// TODO: Display error to user and use a logging solution
}
}
if (feedbackSent) {
return (
<div
className={twMerge(
'grid max-w-md grid-flow-row justify-center gap-4 py-4 px-5 text-center',
className,
)}
{...props}
>
<Image
src="/assets/FeedbackReceived.svg"
alt="Light bulb with a checkmark"
width={72}
height={72}
/>
) : (
<FeedbackReceived setFeedbackSent={setFeedbackSent} close={() => {}} />
<div className="grid grid-flow-row gap-2">
<Text variant="h3" component="h2" className="text-center">
Feedback Received
</Text>
<Text>
Thanks for sending us your thoughts! Feel free to send more feedback
as you explore the beta, and stay tuned for updates.
</Text>
</div>
<Button
variant="outlined"
color="secondary"
className="mt-2 text-sm+ font-normal"
onClick={handleClose}
>
Go Back
</Button>
</div>
);
}
return (
<div
className={twMerge(
'grid max-w-md grid-flow-row gap-2 py-4 px-5',
className,
)}
{...props}
>
<Text variant="h3" component="h2">
Leave Feedback
</Text>
<Text>
Nhost is still in beta and not everything is in place yet, but we&apos;d
love to know what you think of it so far.
</Text>
<form onSubmit={handleSubmit} className="grid grid-flow-row gap-2">
<div className="grid grid-flow-col place-content-between gap-2">
<Text className="font-medium">
What do you think we should improve?
</Text>
<Avatar
className="h-6 w-6 rounded-full"
alt={user?.displayName}
src={user?.avatarUrl}
>
{user?.displayName}
</Avatar>
</div>
<Input
multiline
value={feedback}
onChange={(event) => setFeedback(event.target.value)}
placeholder="Your feedback"
rows={6}
required
fullWidth
hideEmptyHelperText
/>
<Button type="submit" disabled={!feedback} loading={loading}>
Send Feedback
</Button>
</form>
</div>
);
}

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
import type { NavLinkProps } from '@/components/common/NavLink';
import NavLink from '@/components/common/NavLink';
import type { SvgIconProps } from '@/ui/v2/icons/SvgIcon';
import { NavLink } from '@/components/common/NavLink';
import type { SvgIconProps } from '@/components/ui/v2/icons/SvgIcon';
import type { ForwardedRef, PropsWithoutRef, ReactElement } from 'react';
import { cloneElement, forwardRef, isValidElement } from 'react';
import { twMerge } from 'tailwind-merge';

View File

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

View File

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

View File

@@ -1,13 +1,13 @@
import { useIsPlatform } from '@/features/projects/hooks/useIsPlatform';
import { Box } from '@/components/ui/v2/Box';
import { Button } from '@/components/ui/v2/Button';
import { Text } from '@/components/ui/v2/Text';
import { useIsPlatform } from '@/features/projects/common/hooks/useIsPlatform';
import {
GetAllWorkspacesAndProjectsDocument,
GetWorkspaceMemberInvitesToManageDocument,
useGetWorkspaceMemberInvitesToManageQuery,
} from '@/generated/graphql';
import { useSubmitState } from '@/hooks/useSubmitState';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Text from '@/ui/v2/Text';
import { nhost } from '@/utils/nhost';
import { triggerToast } from '@/utils/toast';
import { useApolloClient } from '@apollo/client';
@@ -16,7 +16,7 @@ import { useUserData } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import { useEffect } from 'react';
export function InviteAnnounce() {
export default function InviteNotification() {
const user = useUserData();
const isPlatform = useIsPlatform();
@@ -198,5 +198,3 @@ export function InviteAnnounce() {
</Box>
);
}
export default InviteAnnounce;

View File

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

View File

@@ -1,5 +1,5 @@
import type { LinkProps } from '@/ui/v2/Link';
import Link from '@/ui/v2/Link';
import type { LinkProps } from '@/components/ui/v2/Link';
import { Link } from '@/components/ui/v2/Link';
import NextLink from 'next/link';
import type { ForwardedRef, PropsWithoutRef } from 'react';
import { forwardRef } from 'react';

View File

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

View File

@@ -1,9 +1,9 @@
import type { ButtonProps } from '@/ui/v2/Button';
import Button from '@/ui/v2/Button';
import ChevronLeftIcon from '@/ui/v2/icons/ChevronLeftIcon';
import ChevronRightIcon from '@/ui/v2/icons/ChevronRightIcon';
import Input from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import type { ButtonProps } from '@/components/ui/v2/Button';
import { Button } from '@/components/ui/v2/Button';
import { ChevronLeftIcon } from '@/components/ui/v2/icons/ChevronLeftIcon';
import { ChevronRightIcon } from '@/components/ui/v2/icons/ChevronRightIcon';
import { Input } from '@/components/ui/v2/Input';
import { Text } from '@/components/ui/v2/Text';
import type { DetailedHTMLProps, HTMLProps } from 'react';
import { twMerge } from 'tailwind-merge';

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
import Option from '@/ui/v2/Option';
import type { SelectProps } from '@/ui/v2/Select';
import Select from '@/ui/v2/Select';
import useColorPreference from '@/ui/v2/useColorPreference';
import { Option } from '@/components/ui/v2/Option';
import type { SelectProps } from '@/components/ui/v2/Select';
import { Select } from '@/components/ui/v2/Select';
import { useColorPreference } from '@/components/ui/v2/useColorPreference';
export interface ThemeSwitcherProps extends SelectProps<any> {}

View File

@@ -0,0 +1,19 @@
import { createContext } from 'react';
export interface UIContextProps {
/**
* Determines whether or not the dashboard is in maintenance mode.
*/
maintenanceActive: boolean;
/**
* The date and time when maintenance mode will end.
*/
maintenanceEndDate: Date;
}
const UIContext = createContext<UIContextProps>({
maintenanceActive: false,
maintenanceEndDate: null,
});
export default UIContext;

View File

@@ -0,0 +1,30 @@
import { useRouter } from 'next/router';
import type { PropsWithChildren } from 'react';
import { useMemo } from 'react';
import type { UIContextProps } from './UIContext';
import UIContext from './UIContext';
export default function UIProvider(props: PropsWithChildren<unknown>) {
const router = useRouter();
const maintenanceUnlocked =
process.env.NEXT_PUBLIC_MAINTENANCE_UNLOCK_SECRET &&
process.env.NEXT_PUBLIC_MAINTENANCE_UNLOCK_SECRET ===
router.query.maintenanceUnlockSecret;
const value: UIContextProps = useMemo(
() => ({
maintenanceActive: maintenanceUnlocked
? false
: process.env.NEXT_PUBLIC_MAINTENANCE_ACTIVE === 'true',
maintenanceEndDate:
process.env.NEXT_PUBLIC_MAINTENANCE_END_DATE &&
!Number.isNaN(Date.parse(process.env.NEXT_PUBLIC_MAINTENANCE_END_DATE))
? new Date(Date.parse(process.env.NEXT_PUBLIC_MAINTENANCE_END_DATE))
: null,
}),
[maintenanceUnlocked],
);
return <UIContext.Provider value={value} {...props} />;
}

View File

@@ -0,0 +1,4 @@
export * from './UIContext';
export { default as UIContext } from './UIContext';
export { default as UIProvider } from './UIProvider';
export { default as useUI } from './useUI';

View File

@@ -0,0 +1,12 @@
import { useContext } from 'react';
import UIContext from './UIContext';
export default function useUI() {
const context = useContext(UIContext);
if (!context) {
throw new Error('useUI must be used within a UIProvider');
}
return context;
}

View File

@@ -1,19 +1,19 @@
import DataGridBody from '@/components/common/DataGridBody';
import DataGridFrame from '@/components/common/DataGridFrame';
import type { DataGridHeaderProps } from '@/components/common/DataGridHeader';
import DataGridHeader from '@/components/common/DataGridHeader';
import { DataGridProvider } from '@/context/DataGridContext';
import type { UseDataGridOptions } from '@/components/dataGrid/DataGrid/useDataGrid';
import { DataGridBody } from '@/components/dataGrid/DataGridBody';
import { DataGridConfigProvider } from '@/components/dataGrid/DataGridConfigProvider';
import { DataGridFrame } from '@/components/dataGrid/DataGridFrame';
import type { DataGridHeaderProps } from '@/components/dataGrid/DataGridHeader';
import { DataGridHeader } from '@/components/dataGrid/DataGridHeader';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Box } from '@/components/ui/v2/Box';
import { DataBrowserEmptyState } from '@/features/database/dataGrid/components/DataBrowserEmptyState';
import type { DataBrowserGridColumn } from '@/features/database/dataGrid/types/dataBrowser';
import type { UseDataGridOptions } from '@/hooks/useDataGrid';
import useDataGrid from '@/hooks/useDataGrid';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import type { ForwardedRef } from 'react';
import { forwardRef, useEffect, useRef } from 'react';
import mergeRefs from 'react-merge-refs';
import type { Column, Row, SortingRule, TableOptions } from 'react-table';
import { twMerge } from 'tailwind-merge';
import useDataGrid from './useDataGrid';
export interface DataGridProps<TColumnData extends object>
extends Omit<UseDataGridOptions<TColumnData>, 'tableRef'> {
@@ -130,7 +130,7 @@ function DataGrid<TColumnData extends object>(
}, [allowSort, dataGridProps.state.sortBy, onSort, toggleAllRowsSelected]);
return (
<DataGridProvider
<DataGridConfigProvider
toggleAllRowsSelected={toggleAllRowsSelected}
setSortBy={setSortBy}
tableRef={tableRef}
@@ -176,7 +176,7 @@ function DataGrid<TColumnData extends object>(
{loading && <ActivityIndicator delay={1000} className="my-4" />}
</>
</DataGridProvider>
</DataGridConfigProvider>
);
}

View File

@@ -0,0 +1,4 @@
export * from './DataGrid';
export { default as DataGrid } from './DataGrid';
export * from './useDataGrid';
export { default as useDataGrid } from './useDataGrid';

View File

@@ -1,4 +1,4 @@
import Checkbox from '@/ui/v2/Checkbox';
import { Checkbox } from '@/components/ui/v2/Checkbox';
import type { MutableRefObject } from 'react';
import { useMemo } from 'react';
import type { PluginHook, TableInstance, TableOptions } from 'react-table';

View File

@@ -1,11 +1,11 @@
import type { DataGridProps } from '@/components/common/DataGrid';
import DataGridCell from '@/components/common/DataGridCell';
import type { DataGridProps } from '@/components/dataGrid/DataGrid';
import { DataGridCell } from '@/components/dataGrid/DataGridCell';
import { useDataGridConfig } from '@/components/dataGrid/DataGridConfigProvider';
import type { BoxProps } from '@/components/ui/v2/Box';
import { Box } from '@/components/ui/v2/Box';
import { Button } from '@/components/ui/v2/Button';
import { PlusIcon } from '@/components/ui/v2/icons/PlusIcon';
import type { DataBrowserGridColumn } from '@/features/database/dataGrid/types/dataBrowser';
import useDataGridConfig from '@/hooks/useDataGridConfig';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import PlusIcon from '@/ui/v2/icons/PlusIcon';
import type { DetailedHTMLProps, HTMLProps, KeyboardEvent } from 'react';
import { Fragment, useMemo, useRef } from 'react';
import type { Row } from 'react-table';

View File

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

View File

@@ -1,7 +1,7 @@
import type { CommonDataGridCellProps } from '@/components/common/DataGridCell';
import { useDataGridCell } from '@/components/common/DataGridCell';
import ReadOnlyToggle from '@/components/common/ReadOnlyToggle';
import { Dropdown } from '@/ui/v2/Dropdown';
import type { CommonDataGridCellProps } from '@/components/dataGrid/DataGridCell';
import { useDataGridCell } from '@/components/dataGrid/DataGridCell';
import { ReadOnlyToggle } from '@/components/presentational/ReadOnlyToggle';
import { Dropdown } from '@/components/ui/v2/Dropdown';
import type { KeyboardEvent as ReactKeyboardEvent, MouseEvent } from 'react';
import { twMerge } from 'tailwind-merge';
@@ -70,7 +70,7 @@ export default function DataGridBooleanCell<TData extends object>({
<Dropdown.Trigger
id="boolean-trigger"
className={twMerge(
'h-full w-full border-none outline-none p-0',
'h-full w-full border-none p-0 outline-none',
isEditing && 'p-1.5',
)}
ref={inputRef}

View File

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

View File

@@ -1,12 +1,12 @@
import { useDialog } from '@/components/common/DialogProvider';
import type { BoxProps } from '@/components/ui/v2/Box';
import { Box } from '@/components/ui/v2/Box';
import { Tooltip, useTooltip } from '@/components/ui/v2/Tooltip';
import type {
ColumnType,
DataBrowserGridCell,
DataBrowserGridCellProps,
} from '@/features/database/dataGrid/types/dataBrowser';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import Tooltip, { useTooltip } from '@/ui/v2/Tooltip';
import { triggerToast } from '@/utils/toast';
import type { FocusEvent, KeyboardEvent, MouseEvent } from 'react';
import {

View File

@@ -1,5 +1,5 @@
export * from './DataGridCell';
export { default } from './DataGridCell';
export { default as DataGridCell } from './DataGridCell';
export * from './DataGridCellProvider';
export { default as DataGridCellProvider } from './DataGridCellProvider';
export { default as useDataGridCell } from './useDataGridCell';

View File

@@ -0,0 +1,6 @@
import type { UseDataGridReturn } from '@/components/dataGrid/DataGrid';
import { createContext } from 'react';
const DataGridConfigContext = createContext<Partial<UseDataGridReturn>>(null);
export default DataGridConfigContext;

View File

@@ -0,0 +1,16 @@
import type { UseDataGridReturn } from '@/components/dataGrid/DataGrid';
import type { PropsWithChildren } from 'react';
import DataGridConfigContext from './DataGridConfigContext';
export default function DataGridConfigProvider<T extends object = {}>({
children,
...value
}: PropsWithChildren<UseDataGridReturn<T>>) {
return (
<DataGridConfigContext.Provider
value={value as unknown as UseDataGridReturn<{}>}
>
{children}
</DataGridConfigContext.Provider>
);
}

View File

@@ -0,0 +1,3 @@
export { default as DataGridConfigContext } from './DataGridConfigContext';
export { default as DataGridConfigProvider } from './DataGridConfigProvider';
export { default as useDataGridConfig } from './useDataGridConfig';

View File

@@ -0,0 +1,15 @@
import type { UseDataGridReturn } from '@/components/dataGrid/DataGrid';
import { useContext } from 'react';
import DataGridConfigContext from './DataGridConfigContext';
export default function useDataGridConfig<T extends object = {}>() {
const context = useContext(DataGridConfigContext);
if (!context) {
throw new Error(
`useDataGridConfig must be used within a DataGridConfigContext`,
);
}
return context as unknown as UseDataGridReturn<T>;
}

View File

@@ -1,9 +1,9 @@
import type { CommonDataGridCellProps } from '@/components/common/DataGridCell';
import { useDataGridCell } from '@/components/common/DataGridCell';
import Input, { inputClasses } from '@/ui/v2/Input';
import type { TextProps } from '@/ui/v2/Text';
import Text from '@/ui/v2/Text';
import { getDateComponents } from '@/utils/formatDate';
import type { CommonDataGridCellProps } from '@/components/dataGrid/DataGridCell';
import { useDataGridCell } from '@/components/dataGrid/DataGridCell';
import { Input, inputClasses } from '@/components/ui/v2/Input';
import type { TextProps } from '@/components/ui/v2/Text';
import { Text } from '@/components/ui/v2/Text';
import { getDateComponents } from '@/utils/getDateComponents';
import type { ChangeEvent, KeyboardEvent } from 'react';
import { twMerge } from 'tailwind-merge';

View File

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

View File

@@ -1,4 +1,4 @@
import useDataGridConfig from '@/hooks/useDataGridConfig';
import { useDataGridConfig } from '@/components/dataGrid/DataGridConfigProvider';
import clsx from 'clsx';
import type { DetailedHTMLProps, HTMLProps } from 'react';

View File

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

View File

@@ -1,15 +1,15 @@
import type { DataGridProps } from '@/components/common/DataGrid';
import type { DataGridProps } from '@/components/dataGrid/DataGrid';
import { useDataGridConfig } from '@/components/dataGrid/DataGridConfigProvider';
import { Box } from '@/components/ui/v2/Box';
import { Button } from '@/components/ui/v2/Button';
import { Divider } from '@/components/ui/v2/Divider';
import { Dropdown } from '@/components/ui/v2/Dropdown';
import { ArrowDownIcon } from '@/components/ui/v2/icons/ArrowDownIcon';
import { ArrowUpIcon } from '@/components/ui/v2/icons/ArrowUpIcon';
import { PencilIcon } from '@/components/ui/v2/icons/PencilIcon';
import { PlusIcon } from '@/components/ui/v2/icons/PlusIcon';
import { TrashIcon } from '@/components/ui/v2/icons/TrashIcon';
import type { DataBrowserGridColumn } from '@/features/database/dataGrid/types/dataBrowser';
import useDataGridConfig from '@/hooks/useDataGridConfig';
import Box from '@/ui/v2/Box';
import Button from '@/ui/v2/Button';
import Divider from '@/ui/v2/Divider';
import { Dropdown } from '@/ui/v2/Dropdown';
import ArrowDownIcon from '@/ui/v2/icons/ArrowDownIcon';
import ArrowUpIcon from '@/ui/v2/icons/ArrowUpIcon';
import PencilIcon from '@/ui/v2/icons/PencilIcon';
import PlusIcon from '@/ui/v2/icons/PlusIcon';
import TrashIcon from '@/ui/v2/icons/TrashIcon';
import type { DetailedHTMLProps, HTMLProps } from 'react';
import { twMerge } from 'tailwind-merge';

View File

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

View File

@@ -1,7 +1,7 @@
import type { CommonDataGridCellProps } from '@/components/common/DataGridCell';
import { useDataGridCell } from '@/components/common/DataGridCell';
import Input, { inputClasses } from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import type { CommonDataGridCellProps } from '@/components/dataGrid/DataGridCell';
import { useDataGridCell } from '@/components/dataGrid/DataGridCell';
import { Input, inputClasses } from '@/components/ui/v2/Input';
import { Text } from '@/components/ui/v2/Text';
import type { ChangeEvent, KeyboardEvent } from 'react';
export type DataGridNumericCellProps<TData extends object> =

View File

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

View File

@@ -1,10 +1,10 @@
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import type { IconButtonProps } from '@/ui/v2/IconButton';
import IconButton from '@/ui/v2/IconButton';
import ChevronLeftIcon from '@/ui/v2/icons/ChevronLeftIcon';
import ChevronRightIcon from '@/ui/v2/icons/ChevronRightIcon';
import Text from '@/ui/v2/Text';
import type { BoxProps } from '@/components/ui/v2/Box';
import { Box } from '@/components/ui/v2/Box';
import type { IconButtonProps } from '@/components/ui/v2/IconButton';
import { IconButton } from '@/components/ui/v2/IconButton';
import { ChevronLeftIcon } from '@/components/ui/v2/icons/ChevronLeftIcon';
import { ChevronRightIcon } from '@/components/ui/v2/icons/ChevronRightIcon';
import { Text } from '@/components/ui/v2/Text';
import clsx from 'clsx';
export interface DataGridPaginationProps extends BoxProps {

View File

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

View File

@@ -1,14 +1,14 @@
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 { useAppClient } from '@/features/projects/hooks/useAppClient';
import { useCurrentWorkspaceAndProject } from '@/features/projects/hooks/useCurrentWorkspaceAndProject';
import { Modal } from '@/ui/Modal';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Box from '@/ui/v2/Box';
import IconButton from '@/ui/v2/IconButton';
import XIcon from '@/ui/v2/icons/XIcon';
import { Modal } from '@/components/ui/v1/Modal';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Box } from '@/components/ui/v2/Box';
import { IconButton } from '@/components/ui/v2/IconButton';
import { AudioPreviewIcon } from '@/components/ui/v2/icons/AudioPreviewIcon';
import { FilePreviewIcon } from '@/components/ui/v2/icons/FilePreviewIcon';
import { PDFPreviewIcon } from '@/components/ui/v2/icons/PDFPreviewIcon';
import { VideoPreviewIcon } from '@/components/ui/v2/icons/VideoPreviewIcon';
import { XIcon } from '@/components/ui/v2/icons/XIcon';
import { useAppClient } from '@/features/projects/common/hooks/useAppClient';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import clsx from 'clsx';
import type { ReactNode } from 'react';
import { useEffect, useReducer, useState } from 'react';
@@ -234,7 +234,7 @@ export default function DataGridPreviewCell<TData extends object>({
className="grid w-full grid-flow-col items-center justify-center gap-1 text-center"
sx={{ color: 'error.main' }}
>
<FileIcon error /> Error
<FilePreviewIcon error /> Error
</Box>
);
}
@@ -390,12 +390,12 @@ export default function DataGridPreviewCell<TData extends object>({
aria-label={alt}
className="grid h-full w-full items-center justify-center self-center"
>
{isVideo && <VideoPreview className="h-5 w-5" />}
{isVideo && <VideoPreviewIcon className="h-5 w-5" />}
{isAudio && <AudioPreview className="h-5 w-5" />}
{isAudio && <AudioPreviewIcon className="h-5 w-5" />}
{mimeType === 'application/pdf' && (
<PDFPreview className="h-5 w-5" />
<PDFPreviewIcon className="h-5 w-5" />
)}
{!isVideo &&

View File

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

View File

@@ -1,9 +1,9 @@
import type { CommonDataGridCellProps } from '@/components/common/DataGridCell';
import { useDataGridCell } from '@/components/common/DataGridCell';
import Button from '@/ui/v2/Button';
import CopyIcon from '@/ui/v2/icons/CopyIcon';
import Input, { inputClasses } from '@/ui/v2/Input';
import Text from '@/ui/v2/Text';
import type { CommonDataGridCellProps } from '@/components/dataGrid/DataGridCell';
import { useDataGridCell } from '@/components/dataGrid/DataGridCell';
import { Button } from '@/components/ui/v2/Button';
import { CopyIcon } from '@/components/ui/v2/icons/CopyIcon';
import { Input, inputClasses } from '@/components/ui/v2/Input';
import { Text } from '@/components/ui/v2/Text';
import { copy } from '@/utils/copy';
import type { ChangeEvent, KeyboardEvent, Ref } from 'react';
import { useEffect } from 'react';

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,9 +1,9 @@
import type {
AutocompleteOption,
AutocompleteProps,
} from '@/ui/v2/Autocomplete';
import { Autocomplete } from '@/ui/v2/Autocomplete';
import callAll from '@/utils/callAll';
} from '@/components/ui/v2/Autocomplete';
import { Autocomplete } from '@/components/ui/v2/Autocomplete';
import { callAll } from '@/utils/callAll';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { FieldValues, UseControllerProps } from 'react-hook-form';

View File

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

View File

@@ -1,6 +1,6 @@
import type { CheckboxProps } from '@/ui/v2/Checkbox';
import Checkbox from '@/ui/v2/Checkbox';
import callAll from '@/utils/callAll';
import type { CheckboxProps } from '@/components/ui/v2/Checkbox';
import { Checkbox } from '@/components/ui/v2/Checkbox';
import { callAll } from '@/utils/callAll';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { FieldValues, UseControllerProps } from 'react-hook-form';

View File

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

View File

@@ -1,5 +1,5 @@
import type { SelectProps } from '@/ui/v2/Select';
import { Select } from '@/ui/v2/Select';
import type { SelectProps } from '@/components/ui/v2/Select';
import { Select } from '@/components/ui/v2/Select';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { FieldValues, UseControllerProps } from 'react-hook-form';

View File

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

View File

@@ -1,5 +1,5 @@
import type { SwitchProps } from '@/ui/v2/Switch';
import Switch from '@/ui/v2/Switch';
import type { SwitchProps } from '@/components/ui/v2/Switch';
import { Switch } from '@/components/ui/v2/Switch';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import { useController, useFormContext } from 'react-hook-form';

View File

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

View File

@@ -1,13 +1,16 @@
import Option from '@/ui/v2/Option';
import Select from '@/ui/v2/Select';
import { Option } from '@/components/ui/v2/Option';
import { Select } from '@/components/ui/v2/Select';
import { useGetCountriesQuery } from '@/utils/__generated__/graphql';
type CountrySelectorProps = {
export type CountrySelectorProps = {
value: string;
onChange: (value: string) => void;
};
export function CountrySelector({ value, onChange }: CountrySelectorProps) {
export default function CountrySelector({
value,
onChange,
}: CountrySelectorProps) {
const { data, error } = useGetCountriesQuery();
if (error) {
@@ -38,5 +41,3 @@ export function CountrySelector({ value, onChange }: CountrySelectorProps) {
</Select>
);
}
export default CountrySelector;

View File

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

View File

@@ -1,5 +1,5 @@
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import type { BoxProps } from '@/components/ui/v2/Box';
import { Box } from '@/components/ui/v2/Box';
import type { KeyboardEvent } from 'react';
import { useRef } from 'react';
import { useFormContext } from 'react-hook-form';

View File

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

View File

@@ -1,6 +1,6 @@
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import type { BoxProps } from '@/ui/v2/Box';
import Box from '@/ui/v2/Box';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import type { BoxProps } from '@/components/ui/v2/Box';
import { Box } from '@/components/ui/v2/Box';
import { twMerge } from 'tailwind-merge';
export interface FormActivityIndicatorProps extends BoxProps {}

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