Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions[bot]
58dec6e7b2 chore: update versions (#2853)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost/apollo@7.1.6

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost/react-apollo@12.0.6

### Patch Changes

-   @nhost/apollo@7.1.6
-   @nhost/react@3.5.6

## @nhost/react-urql@9.0.6

### Patch Changes

-   @nhost/react@3.5.6

## @nhost/hasura-auth-js@2.5.6

### Patch Changes

- 8b12426: fix: correct signout to send accessToken when clearing all
session

## @nhost/nextjs@2.1.20

### Patch Changes

-   @nhost/react@3.5.6

## @nhost/nhost-js@3.1.9

### Patch Changes

-   Updated dependencies [8b12426]
    -   @nhost/hasura-auth-js@2.5.6

## @nhost/react@3.5.6

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost/vue@2.6.6

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost-examples/react-apollo@1.0.0

### Major Changes

-   cffdec5: feat: rewrite example using shadcn ui components

### Patch Changes

-   @nhost/react@3.5.6
-   @nhost/react-apollo@12.0.6

## @nhost/dashboard@1.28.0

### Minor Changes

- 526183a: feat: allow filtering users in "make request as" in graphql
section
-   be3b85b: feat: add conceal errors toggle on auth settings page

### Patch Changes

- 35a2f12: fix: prevent run service details from opening when attempting
to delete
    -   @nhost/react-apollo@12.0.6
    -   @nhost/nextjs@2.1.20

## @nhost/docs@2.17.0

### Minor Changes

- cffdec5: feat: update react quickstart guide to use the nhost react
apollo template
-   4cf6677: feat: update list of postgres extensions

## @nhost-examples/cli@0.3.11

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost-examples/codegen-react-apollo@0.4.11

### Patch Changes

-   @nhost/react@3.5.6
-   @nhost/react-apollo@12.0.6

## @nhost-examples/codegen-react-query@0.4.11

### Patch Changes

-   @nhost/react@3.5.6

## @nhost-examples/codegen-react-urql@0.3.11

### Patch Changes

-   @nhost/react@3.5.6
-   @nhost/react-urql@9.0.6

## @nhost-examples/multi-tenant-one-to-many@2.2.11

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost-examples/nextjs@0.3.11

### Patch Changes

-   @nhost/react@3.5.6
-   @nhost/react-apollo@12.0.6
-   @nhost/nextjs@2.1.20

## @nhost-examples/node-storage@0.2.11

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost-examples/nextjs-server-components@0.4.12

### Patch Changes

-   @nhost/nhost-js@3.1.9

## @nhost-examples/react-gqty@1.2.11

### Patch Changes

-   @nhost/react@3.5.6

## @nhost-examples/react-native@0.0.5

### Patch Changes

-   @nhost/react@3.5.6
-   @nhost/react-apollo@12.0.6

## @nhost-examples/vue-apollo@0.6.11

### Patch Changes

-   @nhost/nhost-js@3.1.9
-   @nhost/apollo@7.1.6
-   @nhost/vue@2.6.6

## @nhost-examples/vue-quickstart@0.2.11

### Patch Changes

-   @nhost/apollo@7.1.6
-   @nhost/vue@2.6.6

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-09 12:19:53 +01:00
David BM
526183ab88 feat (dashboard): allow filtering users in "make request as" feature of graphql section (#2805)
Resolves #2593
2024-09-09 05:55:49 -04:00
Hassan Ben Jobrane
435b65a65a fix(react-apollo): change relyingParty ID to nhost.io (#2861) 2024-09-04 14:56:54 +01:00
56 changed files with 333 additions and 93 deletions

View File

@@ -1,5 +0,0 @@
---
'@nhost/docs': minor
---
feat: update react quickstart guide to use the nhost react apollo template

View File

@@ -1,5 +0,0 @@
---
'@nhost/dashboard': patch
---
fix: prevent run service details from opening when attempting to delete

View File

@@ -1,5 +0,0 @@
---
'@nhost/docs': minor
---
feat: update list of postgres extensions

View File

@@ -1,5 +0,0 @@
---
'@nhost/dashboard': minor
---
feat: add conceal errors toggle on auth settings page

View File

@@ -1,5 +0,0 @@
---
'@nhost-examples/react-apollo': major
---
feat: rewrite example using shadcn ui components

View File

@@ -1,5 +0,0 @@
---
'@nhost/hasura-auth-js': patch
---
fix: correct signout to send accessToken when clearing all session

View File

@@ -1,5 +1,18 @@
# @nhost/dashboard
## 1.28.0
### Minor Changes
- 526183a: feat: allow filtering users in "make request as" in graphql section
- be3b85b: feat: add conceal errors toggle on auth settings page
### Patch Changes
- 35a2f12: fix: prevent run service details from opening when attempting to delete
- @nhost/react-apollo@12.0.6
- @nhost/nextjs@2.1.20
## 1.27.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "1.27.0",
"version": "1.28.0",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",

View File

@@ -1,11 +1,12 @@
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Option } from '@/components/ui/v2/Option';
import { Select } from '@/components/ui/v2/Select';
import { Autocomplete } from '@/components/ui/v2/Autocomplete';
import { DEFAULT_ROLES } from '@/features/graphql/common/utils/constants';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLClient';
import type { RemoteAppGetUsersCustomQuery } from '@/utils/__generated__/graphql';
import { useRemoteAppGetUsersCustomQuery } from '@/utils/__generated__/graphql';
import {
useRemoteAppGetUsersCustomLazyQuery,
type RemoteAppGetUsersCustomQuery,
} from '@/utils/__generated__/graphql';
import { debounce } from '@mui/material/utils';
import { useCallback, useEffect, useMemo, useState } from 'react';
export interface UserSelectProps {
/**
@@ -13,7 +14,7 @@ export interface UserSelectProps {
*/
onUserChange: (userId: string, availableRoles?: string[]) => void;
/**
* Class name to be applied to the `<Select />` element.
* Class name to be applied to the `<Autocomplete />` element.
*/
className?: string;
}
@@ -22,35 +23,87 @@ export default function UserSelect({
onUserChange,
...props
}: UserSelectProps) {
const { currentProject } = useCurrentWorkspaceAndProject();
const [inputValue, setInputValue] = useState('');
const [users, setUsers] = useState([]);
const [active, setActive] = useState(true);
const userApplicationClient = useRemoteApplicationGQLClient();
const { data, loading, error } = useRemoteAppGetUsersCustomQuery({
const [fetchAppUsers, { loading }] = useRemoteAppGetUsersCustomLazyQuery({
client: userApplicationClient,
variables: { where: {}, limit: 250, offset: 0 },
skip: !currentProject,
variables: {
where: {},
limit: 250,
offset: 0,
},
});
if (loading) {
return (
<div className={props.className}>
<ActivityIndicator label="Loading users..." delay={500} />
</div>
);
}
const fetchUsers = useCallback(
async (
request: { input: string },
callback: (results?: RemoteAppGetUsersCustomQuery['users']) => void,
) => {
const ilike = `%${request.input === 'Admin' ? '' : request.input}%`;
const { data } = await fetchAppUsers({
client: userApplicationClient,
variables: {
where: {
displayName: { _ilike: ilike },
},
limit: 250,
offset: 0,
},
});
if (error) {
throw error;
}
callback(data?.users);
},
[fetchAppUsers, userApplicationClient],
);
const fetchOptions = useMemo(() => debounce(fetchUsers, 1000), [fetchUsers]);
useEffect(() => {
fetchOptions({ input: inputValue }, (results) => {
if (active || inputValue === '') {
setUsers(results);
}
});
}, [inputValue, fetchOptions, active]);
const autocompleteOptions = [
{
value: 'admin',
label: 'Admin',
group: 'Admin',
},
...users.map((user) => ({
value: user.id,
label: user.displayName,
group: 'Users',
})),
];
return (
<Select
<Autocomplete
{...props}
id="user-select"
label="Make Request As"
hideEmptyHelperText
defaultValue="admin"
slotProps={{ root: { className: 'truncate' } }}
onChange={(_event, userId) => {
label="Make request as"
options={autocompleteOptions}
defaultValue={{
value: 'admin',
label: 'Admin',
group: 'Admin',
}}
autoComplete
fullWidth
autoSelect
groupBy={(option) => option.group}
autoHighlight
includeInputInList
loading={loading}
onChange={(_event, _value, reason, details) => {
setActive(false);
const userId = details.option.value;
if (typeof userId !== 'string') {
return;
}
@@ -61,22 +114,23 @@ export default function UserSelect({
return;
}
const user: RemoteAppGetUsersCustomQuery['users'][0] = data?.users.find(
const user: RemoteAppGetUsersCustomQuery['users'][0] = users.find(
({ id }) => id === userId,
);
const roles = user?.roles.map(({ role }) => role);
const roles = user?.roles?.map(({ role }) => role);
onUserChange(user.id, roles);
onUserChange(userId, roles ?? DEFAULT_ROLES);
fetchUsers({ input: '' }, (results) => {
if (results) {
setUsers(results);
}
});
}}
>
<Option value="admin">Admin</Option>
{data?.users.map(({ id, displayName, email, phoneNumber }) => (
<Option key={id} value={id}>
{displayName || email || phoneNumber || id}
</Option>
))}
</Select>
onInputChange={(event, newInputValue) => {
setInputValue(newInputValue);
}}
/>
);
}

View File

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

View File

@@ -0,0 +1,54 @@
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useRemoteApplicationGQLClient } from '@/hooks/useRemoteApplicationGQLClient';
import type {
RemoteAppGetUsersCustomQuery,
RemoteAppGetUsersCustomQueryVariables,
} from '@/utils/__generated__/graphql';
import { useRemoteAppGetUsersCustomQuery } from '@/utils/__generated__/graphql';
import type { QueryHookOptions } from '@apollo/client';
export type UseFilesOptions = {
searchString?: string;
limit?: number;
offset?: number;
/**
* Custom options for the query.
*/
options?: QueryHookOptions<
RemoteAppGetUsersCustomQuery,
RemoteAppGetUsersCustomQueryVariables
>;
};
export default function useGetAppUsers({
searchString,
limit = 250,
offset = 0,
options = {},
}: UseFilesOptions) {
const { currentProject } = useCurrentWorkspaceAndProject();
const userApplicationClient = useRemoteApplicationGQLClient();
const { data, error, loading } = useRemoteAppGetUsersCustomQuery({
...options,
client: userApplicationClient,
variables: {
...options.variables,
where: searchString
? {
displayName: { _ilike: `%${searchString}%` },
}
: {},
limit,
offset,
},
skip: !currentProject,
});
const users = data?.users || [];
return {
users,
loading,
error,
};
}

View File

@@ -1,5 +1,12 @@
# @nhost/docs
## 2.17.0
### Minor Changes
- cffdec5: feat: update react quickstart guide to use the nhost react apollo template
- 4cf6677: feat: update list of postgres extensions
## 2.16.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "2.16.0",
"version": "2.17.0",
"private": true,
"scripts": {
"start": "mintlify dev"

View File

@@ -1,5 +1,11 @@
# @nhost-examples/cli
## 0.3.11
### Patch Changes
- @nhost/nhost-js@3.1.9
## 0.3.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/cli",
"version": "0.3.10",
"version": "0.3.11",
"main": "src/index.mjs",
"private": true,
"scripts": {

View File

@@ -1,5 +1,12 @@
# @nhost-examples/codegen-react-apollo
## 0.4.11
### Patch Changes
- @nhost/react@3.5.6
- @nhost/react-apollo@12.0.6
## 0.4.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-apollo",
"version": "0.4.10",
"version": "0.4.11",
"private": true,
"scripts": {
"codegen": "graphql-codegen",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/codegen-react-query
## 0.4.11
### Patch Changes
- @nhost/react@3.5.6
## 0.4.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-query",
"version": "0.4.10",
"version": "0.4.11",
"private": true,
"scripts": {
"codegen": "graphql-codegen",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/react-urql
## 0.3.11
### Patch Changes
- @nhost/react@3.5.6
- @nhost/react-urql@9.0.6
## 0.3.10
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/codegen-react-urql",
"private": true,
"version": "0.3.10",
"version": "0.3.11",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/multi-tenant-one-to-many
## 2.2.11
### Patch Changes
- @nhost/nhost-js@3.1.9
## 2.2.10
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/multi-tenant-one-to-many",
"private": true,
"version": "2.2.10",
"version": "2.2.11",
"description": "",
"main": "index.js",
"scripts": {},

View File

@@ -1,5 +1,13 @@
# @nhost-examples/nextjs
## 0.3.11
### Patch Changes
- @nhost/react@3.5.6
- @nhost/react-apollo@12.0.6
- @nhost/nextjs@2.1.20
## 0.3.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs",
"version": "0.3.10",
"version": "0.3.11",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/node-storage
## 0.2.11
### Patch Changes
- @nhost/nhost-js@3.1.9
## 0.2.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/node-storage",
"version": "0.2.10",
"version": "0.2.11",
"private": true,
"description": "This is an example of how to use the Storage with Node.js",
"main": "src/index.mjs",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/nextjs-server-components
## 0.4.12
### Patch Changes
- @nhost/nhost-js@3.1.9
## 0.4.11
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs-server-components",
"version": "0.4.11",
"version": "0.4.12",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -1,5 +1,16 @@
# @nhost-examples/react-apollo
## 1.0.0
### Major Changes
- cffdec5: feat: rewrite example using shadcn ui components
### Patch Changes
- @nhost/react@3.5.6
- @nhost/react-apollo@12.0.6
## 0.8.11
### Patch Changes

View File

@@ -143,7 +143,7 @@ enabled = false
enabled = true
[auth.method.webauthn.relyingParty]
id = 'https://react-apollo.example.nhost.io'
id = 'nhost.io'
name = 'apollo-example'
origins = ['https://react-apollo.example.nhost.io']

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/react-apollo",
"version": "0.8.11",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,11 @@
# @nhost-examples/react-gqty
## 1.2.11
### Patch Changes
- @nhost/react@3.5.6
## 1.2.10
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/react-gqty",
"private": true,
"version": "1.2.10",
"version": "1.2.11",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/react-native
## 0.0.5
### Patch Changes
- @nhost/react@3.5.6
- @nhost/react-apollo@12.0.6
## 0.0.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/react-native",
"version": "0.0.4",
"version": "0.0.5",
"private": true,
"scripts": {
"android": "react-native run-android",

View File

@@ -1,5 +1,13 @@
# @nhost-examples/vue-apollo
## 0.6.11
### Patch Changes
- @nhost/nhost-js@3.1.9
- @nhost/apollo@7.1.6
- @nhost/vue@2.6.6
## 0.6.10
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/vue-apollo",
"private": true,
"version": "0.6.10",
"version": "0.6.11",
"scripts": {
"dev": "vite",
"build": "vite build",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/vue-quickstart
## 0.2.11
### Patch Changes
- @nhost/apollo@7.1.6
- @nhost/vue@2.6.6
## 0.2.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/vue-quickstart",
"version": "0.2.10",
"version": "0.2.11",
"private": true,
"scripts": {
"build": "vite build",

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 7.1.6
### Patch Changes
- @nhost/nhost-js@3.1.9
## 7.1.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "7.1.5",
"version": "7.1.6",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 12.0.6
### Patch Changes
- @nhost/apollo@7.1.6
- @nhost/react@3.5.6
## 12.0.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "12.0.5",
"version": "12.0.6",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react-urql
## 9.0.6
### Patch Changes
- @nhost/react@3.5.6
## 9.0.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-urql",
"version": "9.0.5",
"version": "9.0.6",
"description": "Nhost React URQL client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-auth-js
## 2.5.6
### Patch Changes
- 8b12426: fix: correct signout to send accessToken when clearing all session
## 2.5.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-auth-js",
"version": "2.5.5",
"version": "2.5.6",
"description": "Hasura-auth client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 2.1.20
### Patch Changes
- @nhost/react@3.5.6
## 2.1.19
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "2.1.19",
"version": "2.1.20",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 3.1.9
### Patch Changes
- Updated dependencies [8b12426]
- @nhost/hasura-auth-js@2.5.6
## 3.1.8
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "3.1.8",
"version": "3.1.9",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react
## 3.5.6
### Patch Changes
- @nhost/nhost-js@3.1.9
## 3.5.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "3.5.5",
"version": "3.5.6",
"description": "Nhost React library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 2.6.6
### Patch Changes
- @nhost/nhost-js@3.1.9
## 2.6.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/vue",
"version": "2.6.5",
"version": "2.6.6",
"description": "Nhost Vue library",
"license": "MIT",
"keywords": [