Compare commits

..

17 Commits

Author SHA1 Message Date
Hassan Ben Jobrane
1c59c363ee Merge pull request #2328 from nhost/changeset-release/main
chore: update versions
2023-10-24 11:20:22 +01:00
github-actions[bot]
1d99f26fec chore: update versions 2023-10-24 09:59:28 +00:00
Hassan Ben Jobrane
49edb0e627 Merge pull request #2332 from ttiras/patch-1
Update Docs for useChangeEmail.ts Example
2023-10-24 10:56:55 +01:00
Hassan Ben Jobrane
f011e71ae1 chore: fix typo 2023-10-23 19:49:05 +01:00
Hassan Ben Jobrane
00c363f808 chore: add changeset 2023-10-23 18:10:04 +01:00
Hassan Ben Jobrane
0b2f749ae9 fix: docs: vuejs: update changeEmail docs reference 2023-10-23 18:05:24 +01:00
Hassan Ben Jobrane
cf62a1e6e3 Merge pull request #2331 from nhost/fix/custom-domains/reset-domain
fix(dashboard): allow resetting custom domains
2023-10-20 17:58:06 +01:00
Hassan Ben Jobrane
8df84d782f chore: add changeset 2023-10-20 16:01:47 +01:00
Hassan Ben Jobrane
f0deffafe1 fix(dashboard): allow resetting custom domains 2023-10-20 15:59:54 +01:00
Hassan Ben Jobrane
a291da661d Merge pull request #2321 from MainaMary/bug/update-use-change-password-interface
fix: update useChangePassword hook interface
2023-10-20 11:42:41 +01:00
Mary
66c3193bc9 chore: add changeset 2023-10-20 13:03:00 +03:00
Hassan Ben Jobrane
ac7be49cef Merge pull request #2327 from nhost/chore/run/tweaks
chore(dashboard): fixes and tweaks to services form and dialog
2023-10-19 11:53:32 +01:00
Hassan Ben Jobrane
fa79b77093 chore: add changeset 2023-10-19 11:22:18 +01:00
Hassan Ben Jobrane
5823947933 chore: add missing key to service details dialog 2023-10-19 11:21:11 +01:00
Hassan Ben Jobrane
333837fb57 chore: fix update button icon on service form 2023-10-19 11:10:01 +01:00
Mary
61fc83996b fix: update useChangePassword hook interface 2023-10-17 13:29:49 +03:00
ttiras
9ddb37e9bb Update useChangeEmail.ts
the wrong example has been modified from;
 
 await changeEmail({
    email: 'new@example.com'
  })

to;

 await changeEmail('new@example.com')
2023-10-14 13:53:07 +03:00
22 changed files with 154 additions and 45 deletions

View File

@@ -1,5 +1,14 @@
# @nhost/dashboard
## 0.20.27
### Patch Changes
- fa79b7709: chore(dashboard): tweaks and fixes to the service form and dialog
- 8df84d782: fix(dashboard): allow resetting custom domains
- @nhost/react-apollo@6.0.0
- @nhost/nextjs@1.13.39
## 0.20.26
### Patch Changes

View File

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

View File

@@ -0,0 +1,44 @@
import type { IconProps } from '@/components/ui/v2/icons';
function ArrowsClockwise(props: IconProps) {
return (
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
aria-label="Update"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M11.0103 6.23227H14.0103V3.23227"
stroke="currentColor"
strokeWidth="1.5"
strokeLinejoin="round"
/>
<path
d="M4.11084 4.11091C4.62156 3.60019 5.22788 3.19506 5.89517 2.91866C6.56246 2.64226 7.27766 2.5 7.99993 2.5C8.7222 2.5 9.4374 2.64226 10.1047 2.91866C10.772 3.19506 11.3783 3.60019 11.889 4.11091L14.0103 6.23223"
stroke="currentColor"
strokeWidth="1.5"
strokeLinejoin="round"
/>
<path
d="M4.98975 9.76773H1.98975V12.7677"
stroke="currentColor"
strokeWidth="1.5"
strokeLinejoin="round"
/>
<path
d="M11.8892 11.8891C11.3785 12.3998 10.7722 12.8049 10.1049 13.0813C9.43762 13.3577 8.72242 13.5 8.00015 13.5C7.27788 13.5 6.56269 13.3577 5.89539 13.0813C5.2281 12.8049 4.62179 12.3998 4.11107 11.8891L1.98975 9.76776"
stroke="currentColor"
strokeWidth="1.5"
strokeLinejoin="round"
/>
</svg>
);
}
ArrowsClockwise.displayName = 'NhostArrowsClockwise';
export default ArrowsClockwise;

View File

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

View File

@@ -8,6 +8,7 @@ import { VerifyDomain } from '@/features/projects/custom-domains/settings/compon
import {
useGetAuthenticationSettingsQuery,
useUpdateConfigMutation,
type ConfigIngressUpdateInput,
} from '@/generated/graphql';
import { getToastStyleProps } from '@/utils/constants/settings';
import { getServerError } from '@/utils/getServerError';
@@ -18,7 +19,7 @@ import { toast } from 'react-hot-toast';
import * as Yup from 'yup';
const validationSchema = Yup.object({
auth_fqdn: Yup.string().required(),
auth_fqdn: Yup.string(),
});
export type AuthDomainFormValues = Yup.InferType<typeof validationSchema>;
@@ -43,13 +44,14 @@ export default function AuthDomain() {
},
});
const { networking } = data?.config?.auth?.resources || {};
const initialValue = networking?.ingresses?.[0]?.fqdn?.[0];
useEffect(() => {
if (!loading && data) {
const { networking } = data?.config?.auth?.resources || {};
const fqdn = networking?.ingresses?.[0]?.fqdn?.[0];
form.reset({ auth_fqdn: fqdn });
form.reset({ auth_fqdn: initialValue });
}
}, [data, loading, form]);
}, [data, loading, form, initialValue]);
if (loading) {
return (
@@ -71,6 +73,9 @@ export default function AuthDomain() {
const auth_fqdn = watch('auth_fqdn');
async function handleSubmit(formValues: AuthDomainFormValues) {
const ingresses: ConfigIngressUpdateInput[] =
formValues.auth_fqdn.length > 0 ? [{ fqdn: [formValues.auth_fqdn] }] : [];
const updateConfigPromise = updateConfig({
variables: {
appId: currentProject.id,
@@ -78,11 +83,7 @@ export default function AuthDomain() {
auth: {
resources: {
networking: {
ingresses: [
{
fqdn: [formValues.auth_fqdn],
},
],
ingresses,
},
},
},
@@ -118,7 +119,8 @@ export default function AuthDomain() {
description="Enter below your custom domain for the authentication service."
slotProps={{
submitButton: {
disabled: !isDirty || maintenanceActive || !isVerified,
disabled:
!isDirty || maintenanceActive || (!isVerified && !initialValue),
loading: formState.isSubmitting,
},
}}

View File

@@ -8,6 +8,7 @@ import { VerifyDomain } from '@/features/projects/custom-domains/settings/compon
import {
useGetHasuraSettingsQuery,
useUpdateConfigMutation,
type ConfigIngressUpdateInput,
} from '@/generated/graphql';
import { getToastStyleProps } from '@/utils/constants/settings';
import { getServerError } from '@/utils/getServerError';
@@ -18,7 +19,7 @@ import { toast } from 'react-hot-toast';
import * as Yup from 'yup';
const validationSchema = Yup.object({
hasura_fqdn: Yup.string().required(),
hasura_fqdn: Yup.string(),
});
export type HasuraDomainFormValues = Yup.InferType<typeof validationSchema>;
@@ -43,13 +44,14 @@ export default function HasuraDomain() {
},
});
const { networking } = data?.config?.hasura?.resources || {};
const initialValue = networking?.ingresses?.[0]?.fqdn?.[0];
useEffect(() => {
if (!loading && data) {
const { networking } = data?.config?.hasura?.resources || {};
const fqdn = networking?.ingresses?.[0]?.fqdn?.[0];
form.reset({ hasura_fqdn: fqdn });
form.reset({ hasura_fqdn: initialValue });
}
}, [data, loading, form]);
}, [data, loading, form, initialValue]);
if (loading) {
return (
@@ -71,6 +73,11 @@ export default function HasuraDomain() {
const hasura_fqdn = watch('hasura_fqdn');
async function handleSubmit(formValues: HasuraDomainFormValues) {
const ingresses: ConfigIngressUpdateInput[] =
formValues.hasura_fqdn.length > 0
? [{ fqdn: [formValues.hasura_fqdn] }]
: [];
const updateConfigPromise = updateConfig({
variables: {
appId: currentProject.id,
@@ -78,11 +85,7 @@ export default function HasuraDomain() {
hasura: {
resources: {
networking: {
ingresses: [
{
fqdn: [formValues.hasura_fqdn],
},
],
ingresses,
},
},
},
@@ -118,7 +121,8 @@ export default function HasuraDomain() {
description="Enter below your custom domain for the Hasura/GraphQL service."
slotProps={{
submitButton: {
disabled: !isDirty || maintenanceActive || !isVerified,
disabled:
!isDirty || maintenanceActive || (!isVerified && !initialValue),
loading: formState.isSubmitting,
},
}}

View File

@@ -21,7 +21,7 @@ interface RunServicePortProps {
}
const validationSchema = Yup.object({
runServicePortFQDN: Yup.string().required(),
runServicePortFQDN: Yup.string(),
});
export type RunServicePortFormValues = Yup.InferType<typeof validationSchema>;
@@ -38,16 +38,18 @@ export default function RunServicePortDomain({
const [updateRunServiceConfig] = useUpdateRunServiceConfigMutation();
const runServicePort = service.config.ports.find((p) => p.port === port);
const initialValue = runServicePort?.ingresses?.[0]?.fqdn?.[0];
const form = useForm<{ runServicePortFQDN: string }>({
reValidateMode: 'onSubmit',
defaultValues: {
runServicePortFQDN: runServicePort?.ingresses?.[0].fqdn?.[0],
runServicePortFQDN: initialValue,
},
resolver: yupResolver(validationSchema),
});
const { formState, register, watch } = form;
const isDirty = Object.keys(formState.dirtyFields).length > 0;
const runServicePortFQDN = watch('runServicePortFQDN');
@@ -68,7 +70,10 @@ export default function RunServicePortDomain({
if (rest.port === port) {
return {
...rest,
ingresses: [{ fqdn: [formValues.runServicePortFQDN] }],
ingresses:
formValues.runServicePortFQDN.length > 0
? [{ fqdn: [formValues.runServicePortFQDN] }]
: [],
};
}
@@ -128,7 +133,12 @@ export default function RunServicePortDomain({
<Button
variant="outlined"
type="submit"
disabled={loading || !isVerified || maintenanceActive}
disabled={
loading ||
!isDirty ||
maintenanceActive ||
(!isVerified && !initialValue)
}
>
Save
</Button>

View File

@@ -3,6 +3,7 @@ import { Form } from '@/components/form/Form';
import { Alert } from '@/components/ui/v2/Alert';
import { Box } from '@/components/ui/v2/Box';
import { Button } from '@/components/ui/v2/Button';
import { ArrowsClockwise } from '@/components/ui/v2/icons/ArrowsClockwise';
import { CopyIcon } from '@/components/ui/v2/icons/CopyIcon';
import { InfoIcon } from '@/components/ui/v2/icons/InfoIcon';
import { PlusIcon } from '@/components/ui/v2/icons/PlusIcon';
@@ -344,7 +345,7 @@ export default function ServiceForm({
<Tooltip title="Name of the service, must be unique per project.">
<InfoIcon
aria-label="Info"
className="h-4 w-4"
className="w-4 h-4"
color="primary"
/>
</Tooltip>
@@ -384,7 +385,7 @@ export default function ServiceForm({
>
<InfoIcon
aria-label="Info"
className="h-4 w-4"
className="w-4 h-4"
color="primary"
/>
</Tooltip>
@@ -415,7 +416,7 @@ export default function ServiceForm({
<Tooltip title="Command to run when to start the service. This is optional as the image may already have a baked-in command.">
<InfoIcon
aria-label="Info"
className="h-4 w-4"
className="w-4 h-4"
color="primary"
/>
</Tooltip>
@@ -459,7 +460,7 @@ export default function ServiceForm({
{createServiceFormError && (
<Alert
severity="error"
className="grid grid-flow-col items-center justify-between px-4 py-3"
className="grid items-center justify-between grid-flow-col px-4 py-3"
>
<span className="text-left">
<strong>Error:</strong> {createServiceFormError.message}
@@ -482,7 +483,7 @@ export default function ServiceForm({
<Button
type="submit"
disabled={isSubmitting}
startIcon={<PlusIcon />}
startIcon={serviceID ? <ArrowsClockwise /> : <PlusIcon />}
>
{serviceID ? 'Update' : 'Create'}
</Button>

View File

@@ -55,7 +55,8 @@ export default function ServiceDetailsDialog({
.filter((port) => port.publish)
.map((port) => (
<InfoCard
title={`${port.type}:${port.port}`}
key={String(port.port)}
title={`${port.type} <--> ${port.port}`}
value={getPortURL(port.port)}
/>
))}

View File

@@ -1,5 +1,13 @@
# @nhost/react-apollo
## 6.0.0
### Patch Changes
- Updated dependencies [00c363f80]
- Updated dependencies [66c3193bc]
- @nhost/react@2.1.0
## 5.0.38
### Patch Changes

View File

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

View File

@@ -1,5 +1,13 @@
# @nhost/react-urql
## 3.0.0
### Patch Changes
- Updated dependencies [00c363f80]
- Updated dependencies [66c3193bc]
- @nhost/react@2.1.0
## 2.0.33
### Patch Changes

View File

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

View File

@@ -1,5 +1,13 @@
# @nhost/nextjs
## 1.13.39
### Patch Changes
- Updated dependencies [00c363f80]
- Updated dependencies [66c3193bc]
- @nhost/react@2.1.0
## 1.13.38
### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# @nhost/react
## 2.1.0
### Minor Changes
- 66c3193bc: Update useChangePassword hook interface to include ActionLoadingState
### Patch Changes
- 00c363f80: fix(docs): update changeEmail usage reference
## 2.0.32
### Patch Changes

View File

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

View File

@@ -30,9 +30,7 @@ export interface ChangeEmailHookResult extends ChangeEmailState {
* const handleFormSubmit = async (e) => {
* e.preventDefault();
*
* await changeEmail({
* email: 'new@example.com',
* })
* await changeEmail('new@example.com')
* }
* ```
*

View File

@@ -1,5 +1,6 @@
import {
ActionErrorState,
ActionLoadingState,
ActionSuccessState,
ChangePasswordHandlerResult,
changePasswordPromise,
@@ -13,7 +14,7 @@ interface ChangePasswordHandler {
(password: string): Promise<ChangePasswordHandlerResult>
}
export interface ChangePasswordHookResult extends ActionErrorState, ActionSuccessState {
export interface ChangePasswordHookResult extends ActionErrorState, ActionLoadingState, ActionSuccessState {
/** Requests the password change. Returns a promise with the current context */
changePassword: ChangePasswordHandler
}

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 1.13.39
### Patch Changes
- 00c363f80: fix(docs): update changeEmail usage reference
## 1.13.38
### Patch Changes

View File

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

View File

@@ -29,9 +29,7 @@ export interface ChangeEmailComposableResult extends ToRefs<ChangeEmailState> {
* const handleFormSubmit = async (e) => {
* e.preventDefault();
*
* await changeEmail({
* email: 'new@example.com',
* })
* await changeEmail('new@example.com')
* }
* ```
*