Compare commits

..

19 Commits

Author SHA1 Message Date
Hassan Ben Jobrane
172fd8dfed Merge pull request #2448 from nhost/changeset-release/main
chore: update versions
2024-01-05 15:30:30 +01:00
github-actions[bot]
a99ca90279 chore: update versions 2024-01-05 14:19:10 +00:00
Hassan Ben Jobrane
5892fd7f01 Merge pull request #2451 from nhost/fix/graphite/version-setting
fix: remove hardcoded ai settings version
2024-01-05 15:17:07 +01:00
Hassan Ben Jobrane
0344cc9a6d fix: update filterOptions logic in service version selector 2024-01-05 13:56:53 +01:00
Hassan Ben Jobrane
2697e28cf2 Merge pull request #2452 from nhost/fix/default-allowed-roles
chore: change `Allowed Roles` to `Default Allowed Roles`
2024-01-04 17:10:27 +01:00
Hassan Ben Jobrane
54231b119f fix: remove filtering in software version selector 2024-01-04 16:58:19 +01:00
Hassan Ben Jobrane
7c977e7143 chore: add changeset 2024-01-04 11:52:51 +01:00
Hassan Ben Jobrane
7c3019389e chore: change Allowed Roles to Default Allowed Roles 2024-01-04 11:50:14 +01:00
Hassan Ben Jobrane
46f028b9fd chore: add changeset 2024-01-04 11:00:59 +01:00
Hassan Ben Jobrane
683e85b89f fix: remove hardcoded ai settings version 2024-01-04 10:59:00 +01:00
Hassan Ben Jobrane
b0f27c908d Merge pull request #2444 from nhost/chore/fix-graphql-codegen
chore(dashboard): use env variables for graphql codegen
2024-01-03 21:47:28 +01:00
Hassan Ben Jobrane
5f2618e183 chore: run pnpm codegen 2024-01-03 16:59:28 +01:00
Hassan Ben Jobrane
29037147f2 Merge pull request #2447 from nhost/fix/vue-sdk/constructor-params
fix(vue-sdk): include `ServiceUrls` in `NhostVueClientConstructorParams`
2024-01-03 16:09:57 +01:00
Hassan Ben Jobrane
95b630a621 chore: fix pnpm-lock.yaml 2024-01-03 15:54:31 +01:00
Hassan Ben Jobrane
0fdfd8ad81 chore: run pnpm codegen 2024-01-03 15:54:31 +01:00
Hassan Ben Jobrane
174b4165b3 chore: add changeset 2024-01-03 15:54:31 +01:00
Hassan Ben Jobrane
04257bc09c chore: use env variables when running graphql codegen 2024-01-03 15:54:31 +01:00
Hassan Ben Jobrane
184c341f05 chore: add changeset 2024-01-03 15:53:20 +01:00
Hassan Ben Jobrane
52fdce291f fix(vue-sdk): include ServiceUrls in NhostVueClientConstructorParams interface 2024-01-03 15:51:29 +01:00
17 changed files with 187 additions and 74 deletions

View File

@@ -16,3 +16,6 @@ NEXT_PUBLIC_STRIPE_PK=<nhost_stripe_public_key>
NEXT_PUBLIC_GITHUB_APP_INSTALL_URL=<github_app_install_url>
NEXT_PUBLIC_ANALYTICS_WRITE_KEY=<analytics_write_key>
NEXT_PUBLIC_NHOST_BRAGI_WEBSOCKET=<nhost_bragi_websocket>
CODEGEN_GRAPHQL_URL=https://local.graphql.nhost.run/v1
CODEGEN_HASURA_ADMIN_SECRET=nhost-admin-secret

View File

@@ -1,5 +1,13 @@
# @nhost/dashboard
## 1.3.2
### Patch Changes
- 174b4165b: chore: use env variables when running graphql codegen
- 7c977e714: chore: change `Allowed Roles` to `Default Allowed Roles`
- 46f028b9f: fix: remove hardcoded ai version setting
## 1.3.1
### Patch Changes

View File

@@ -1,7 +1,7 @@
schema:
- https://local.graphql.nhost.run/v1:
- ${CODEGEN_GRAPHQL_URL}:
headers:
x-hasura-admin-secret: nhost-admin-secret
x-hasura-admin-secret: ${CODEGEN_HASURA_ADMIN_SECRET}
generates:
src/utils/__generated__/graphql.ts:
documents:

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "1.3.1",
"version": "1.3.2",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -10,7 +10,7 @@
"start": "next start",
"lint": "next lint --max-warnings 0",
"test": "vitest",
"codegen": "graphql-codegen --config graphql.config.yaml --errors-only",
"codegen": "DOTENV_CONFIG_PATH=./.env.local graphql-codegen -r dotenv/config --config graphql.config.yaml --errors-only",
"codegen-graphite": "graphql-codegen --config graphite.graphql.config.yaml --errors-only",
"format": "prettier --write \"src/**/*.{js,ts,tsx,jsx,json,md}\" --plugin-search-dir=.",
"storybook": "start-storybook -p 6006 -s public",

View File

@@ -5,7 +5,6 @@ import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Alert } from '@/components/ui/v2/Alert';
import { filterOptions } from '@/components/ui/v2/Autocomplete';
import { Box } from '@/components/ui/v2/Box';
import { InfoIcon } from '@/components/ui/v2/icons/InfoIcon';
import { Input } from '@/components/ui/v2/Input';
@@ -95,8 +94,8 @@ export default function AISettings() {
reValidateMode: 'onSubmit',
defaultValues: {
version: {
label: '0.1.0',
value: '0.1.0',
label: ai?.version ?? availableVersions?.at(0)?.label,
value: ai?.version ?? availableVersions?.at(0)?.value,
},
webhookSecret: '',
organization: '',
@@ -110,12 +109,17 @@ export default function AISettings() {
resolver: yupResolver(validationSchema),
});
const { register, formState, reset, watch } = form;
const { register, formState, reset, watch, setValue } = form;
const aiSettingsFormValues = watch();
useEffect(() => {
if (ai) {
reset({
version: { label: ai?.version, value: ai?.version },
version: {
label: ai?.version,
value: ai?.version,
},
webhookSecret: ai?.webhookSecret,
synchPeriodMinutes: ai?.autoEmbeddings?.synchPeriodMinutes,
apiKey: ai?.openai?.apiKey,
@@ -130,10 +134,27 @@ export default function AISettings() {
setAIServiceEnabled(!!ai);
}, [ai, reset]);
useEffect(() => {
if (
!loadingGraphiteVersionsData &&
availableVersions.length > 0 &&
!ai &&
!aiSettingsFormValues.version.value
) {
setValue('version', availableVersions?.at(0));
}
}, [
ai,
setValue,
availableVersions,
aiSettingsFormValues,
loadingGraphiteVersionsData,
]);
const toggleAIService = async (enabled: boolean) => {
setAIServiceEnabled(enabled);
if (!enabled) {
if (!enabled && ai) {
openDialog({
title: 'Confirm Disabling the AI service',
component: (
@@ -203,8 +224,6 @@ export default function AISettings() {
}
}
const aiSettingsFormValues = watch();
const getAIResourcesCost = () => {
const vCPUs = `${
aiSettingsFormValues.compute.cpu / RESOURCE_VCPU_MULTIPLIER
@@ -240,37 +259,54 @@ export default function AISettings() {
className="flex flex-col"
>
<Box className="space-y-4">
<Box className="space-y-2">
<Box className="flex flex-row items-center space-x-2">
<Text className="text-lg font-semibold">Version</Text>
<Tooltip title="Version of the service to use.">
<InfoIcon
aria-label="Info"
className="h-4 w-4"
color="primary"
/>
</Tooltip>
</Box>
<ControlledAutocomplete
id="version"
name="version"
filterOptions={(options, state) => {
if (state.inputValue === ai?.version) {
return options;
{availableVersions.length > 0 && (
<Box className="space-y-2">
<Box className="flex flex-row items-center space-x-2">
<Text className="text-lg font-semibold">Version</Text>
<Tooltip title="Version of the service to use.">
<InfoIcon
aria-label="Info"
className="h-4 w-4"
color="primary"
/>
</Tooltip>
</Box>
<ControlledAutocomplete
id="version"
name="version"
autoHighlight
isOptionEqualToValue={() => false}
filterOptions={(options, { inputValue }) => {
const inputValueLower = inputValue.toLowerCase();
const matched = [];
const otherOptions = [];
options.forEach((option) => {
const optionLabelLower = option.label.toLowerCase();
if (optionLabelLower.startsWith(inputValueLower)) {
matched.push(option);
} else {
otherOptions.push(option);
}
});
const result = [...matched, ...otherOptions];
return result;
}}
fullWidth
className="col-span-4"
options={availableVersions}
error={!!formState.errors?.version?.message}
helperText={formState.errors?.version?.message}
showCustomOption="auto"
customOptionLabel={(value) =>
`Use custom value: "${value}"`
}
return filterOptions(options, state);
}}
fullWidth
className="col-span-4"
options={availableVersions}
error={!!formState.errors?.version?.message}
helperText={formState.errors?.version?.message}
showCustomOption="auto"
customOptionLabel={(value) =>
`Use custom value: "${value}"`
}
/>
</Box>
/>
</Box>
)}
<Box className="space-y-2">
<Box className="flex flex-row items-center space-x-2">

View File

@@ -3,7 +3,6 @@ import { ControlledAutocomplete } from '@/components/form/ControlledAutocomplete
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { filterOptions } from '@/components/ui/v2/Autocomplete';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetAuthenticationSettingsDocument,
@@ -134,12 +133,26 @@ export default function AuthServiceVersionSettings() {
<ControlledAutocomplete
id="version"
name="version"
filterOptions={(options, state) => {
if (state.inputValue === version) {
return options;
}
autoHighlight
isOptionEqualToValue={() => false}
filterOptions={(options, { inputValue }) => {
const inputValueLower = inputValue.toLowerCase();
const matched = [];
const otherOptions = [];
return filterOptions(options, state);
options.forEach((option) => {
const optionLabelLower = option.label.toLowerCase();
if (optionLabelLower.startsWith(inputValueLower)) {
matched.push(option);
} else {
otherOptions.push(option);
}
});
const result = [...matched, ...otherOptions];
return result;
}}
fullWidth
className="lg:col-span-2"

View File

@@ -3,7 +3,6 @@ import { ControlledAutocomplete } from '@/components/form/ControlledAutocomplete
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { filterOptions } from '@/components/ui/v2/Autocomplete';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetPostgresSettingsDocument,
@@ -136,12 +135,26 @@ export default function DatabaseServiceVersionSettings() {
<ControlledAutocomplete
id="version"
name="version"
filterOptions={(options, state) => {
if (state.inputValue === version) {
return options;
}
autoHighlight
isOptionEqualToValue={() => false}
filterOptions={(options, { inputValue }) => {
const inputValueLower = inputValue.toLowerCase();
const matched = [];
const otherOptions = [];
return filterOptions(options, state);
options.forEach((option) => {
const optionLabelLower = option.label.toLowerCase();
if (optionLabelLower.startsWith(inputValueLower)) {
matched.push(option);
} else {
otherOptions.push(option);
}
});
const result = [...matched, ...otherOptions];
return result;
}}
fullWidth
className="lg:col-span-2"

View File

@@ -3,7 +3,6 @@ import { ControlledAutocomplete } from '@/components/form/ControlledAutocomplete
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { filterOptions } from '@/components/ui/v2/Autocomplete';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetHasuraSettingsDocument,
@@ -136,12 +135,26 @@ export default function HasuraServiceVersionSettings() {
<ControlledAutocomplete
id="version"
name="version"
filterOptions={(options, state) => {
if (state.inputValue === version) {
return options;
}
autoHighlight
isOptionEqualToValue={() => false}
filterOptions={(options, { inputValue }) => {
const inputValueLower = inputValue.toLowerCase();
const matched = [];
const otherOptions = [];
return filterOptions(options, state);
options.forEach((option) => {
const optionLabelLower = option.label.toLowerCase();
if (optionLabelLower.startsWith(inputValueLower)) {
matched.push(option);
} else {
otherOptions.push(option);
}
});
const result = [...matched, ...otherOptions];
return result;
}}
fullWidth
className="lg:col-span-2"

View File

@@ -36,7 +36,7 @@ export interface RoleSettingsFormValues {
*/
authUserDefaultRole: string;
/**
* Allowed roles for the project.
* Default Allowed roles for the project.
*/
authUserDefaultAllowedRoles: Role[];
}
@@ -169,8 +169,8 @@ export default function RoleSettings() {
return (
<SettingsContainer
title="Allowed Roles"
description="Allowed roles are roles users get automatically when they sign up."
title="Default Allowed Roles"
description="Default Allowed Roles are roles users get automatically when they sign up."
docsLink="https://docs.nhost.io/authentication/users#allowed-roles"
rootClassName="gap-0"
className={twMerge(

View File

@@ -3,7 +3,6 @@ import { ControlledAutocomplete } from '@/components/form/ControlledAutocomplete
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { filterOptions } from '@/components/ui/v2/Autocomplete';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
GetStorageSettingsDocument,
@@ -136,12 +135,26 @@ export default function StorageServiceVersionSettings() {
<ControlledAutocomplete
id="version"
name="version"
filterOptions={(options, state) => {
if (state.inputValue === version) {
return options;
}
autoHighlight
isOptionEqualToValue={() => false}
filterOptions={(options, { inputValue }) => {
const inputValueLower = inputValue.toLowerCase();
const matched = [];
const otherOptions = [];
return filterOptions(options, state);
options.forEach((option) => {
const optionLabelLower = option.label.toLowerCase();
if (optionLabelLower.startsWith(inputValueLower)) {
matched.push(option);
} else {
otherOptions.push(option);
}
});
const result = [...matched, ...otherOptions];
return result;
}}
fullWidth
className="lg:col-span-2"

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 0.7.5
### Patch Changes
- 7c977e714: chore: change `Allowed Roles` to `Default Allowed Roles`
## 0.7.4
### Patch Changes

View File

@@ -34,9 +34,9 @@ The default role is used when no role is specified in the request. By default, u
You can change what the default role for new users should be at **Settings -> Roles and Permissions**.
### Allowed Roles
### Default Allowed Roles
Allowed roles are roles the user is allowed to use when making a request. Usually, you would change the role from `user` (the default role) to some other role because you want to use a different role to resolve permissions for a particular request.
Default Allowed roles are roles the user is allowed to use when making a request. Usually, you would change the role from `user` (the default role) to some other role because you want to use a different role to resolve permissions for a particular request.
By default, users have two allowed roles:

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "0.7.4",
"version": "0.7.5",
"private": true,
"scripts": {
"docusaurus": "docusaurus",

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 2.0.2
### Patch Changes
- 184c341f0: fix: include `ServiceUrls` in `NhostVueClientConstructorParams` interface
## 2.0.1
### Patch Changes

View File

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

View File

@@ -2,6 +2,7 @@ import {
NhostAuthConstructorParams,
NhostClient as VanillaClient,
removeParameterFromWindow,
ServiceUrls,
Subdomain
} from '@nhost/nhost-js'
import { App, warn } from 'vue'
@@ -11,6 +12,7 @@ export type { ErrorPayload, NhostSession, Subdomain, User } from '@nhost/nhost-j
export interface NhostVueClientConstructorParams
extends Partial<Subdomain>,
Partial<ServiceUrls>,
Omit<NhostAuthConstructorParams, 'url' | 'start' | 'client'> {}
export class NhostClient extends VanillaClient {

2
pnpm-lock.yaml generated
View File

@@ -36442,4 +36442,4 @@ packages:
/zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
dev: false
dev: false