diff --git a/dashboard/CHANGELOG.md b/dashboard/CHANGELOG.md index bf37eb2b91..da26ba13aa 100644 --- a/dashboard/CHANGELOG.md +++ b/dashboard/CHANGELOG.md @@ -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 diff --git a/dashboard/package.json b/dashboard/package.json index b0f12fbe6b..9fde0565a4 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@nhost/dashboard", - "version": "1.3.1", + "version": "1.3.2", "private": true, "scripts": { "preinstall": "npx only-allow pnpm", diff --git a/dashboard/src/features/ai/settings/components/AISettings.tsx b/dashboard/src/features/ai/settings/components/AISettings.tsx index 595d804d27..a6514070e3 100644 --- a/dashboard/src/features/ai/settings/components/AISettings.tsx +++ b/dashboard/src/features/ai/settings/components/AISettings.tsx @@ -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" > - - - Version - - - - - { - if (state.inputValue === ai?.version) { - return options; + {availableVersions.length > 0 && ( + + + Version + + + + + 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}"` - } - /> - + /> + + )} diff --git a/dashboard/src/features/authentication/settings/components/AuthServiceVersionSettings/AuthServiceVersionSettings.tsx b/dashboard/src/features/authentication/settings/components/AuthServiceVersionSettings/AuthServiceVersionSettings.tsx index 5bea978d82..b2638b6e70 100644 --- a/dashboard/src/features/authentication/settings/components/AuthServiceVersionSettings/AuthServiceVersionSettings.tsx +++ b/dashboard/src/features/authentication/settings/components/AuthServiceVersionSettings/AuthServiceVersionSettings.tsx @@ -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() { { - 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" diff --git a/dashboard/src/features/database/settings/components/DatabaseServiceVersionSettings/DatabaseServiceVersionSettings.tsx b/dashboard/src/features/database/settings/components/DatabaseServiceVersionSettings/DatabaseServiceVersionSettings.tsx index aa67025e86..c9a38d18f1 100644 --- a/dashboard/src/features/database/settings/components/DatabaseServiceVersionSettings/DatabaseServiceVersionSettings.tsx +++ b/dashboard/src/features/database/settings/components/DatabaseServiceVersionSettings/DatabaseServiceVersionSettings.tsx @@ -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() { { - 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" diff --git a/dashboard/src/features/hasura/settings/components/HasuraServiceVersionSettings/HasuraServiceVersionSettings.tsx b/dashboard/src/features/hasura/settings/components/HasuraServiceVersionSettings/HasuraServiceVersionSettings.tsx index 35d2f80d21..a0e226eaea 100644 --- a/dashboard/src/features/hasura/settings/components/HasuraServiceVersionSettings/HasuraServiceVersionSettings.tsx +++ b/dashboard/src/features/hasura/settings/components/HasuraServiceVersionSettings/HasuraServiceVersionSettings.tsx @@ -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() { { - 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" diff --git a/dashboard/src/features/storage/settings/components/HasuraServiceVersionSettings/StorageServiceVersionSettings.tsx b/dashboard/src/features/storage/settings/components/HasuraServiceVersionSettings/StorageServiceVersionSettings.tsx index 5983142647..b59aa35dc7 100644 --- a/dashboard/src/features/storage/settings/components/HasuraServiceVersionSettings/StorageServiceVersionSettings.tsx +++ b/dashboard/src/features/storage/settings/components/HasuraServiceVersionSettings/StorageServiceVersionSettings.tsx @@ -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() { { - 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" diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ee51c25a22..f92ba8f606 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -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 diff --git a/docs/package.json b/docs/package.json index cfbd28214a..3c494bea05 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@nhost/docs", - "version": "0.7.4", + "version": "0.7.5", "private": true, "scripts": { "docusaurus": "docusaurus", diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index a2d0fe331d..2a8f33bab3 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -1,5 +1,11 @@ # @nhost/vue +## 2.0.2 + +### Patch Changes + +- 184c341f0: fix: include `ServiceUrls` in `NhostVueClientConstructorParams` interface + ## 2.0.1 ### Patch Changes diff --git a/packages/vue/package.json b/packages/vue/package.json index be98297974..ba1b2ba405 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@nhost/vue", - "version": "2.0.1", + "version": "2.0.2", "description": "Nhost Vue library", "license": "MIT", "keywords": [