Compare commits

..

6 Commits

Author SHA1 Message Date
Szilárd Dóró
69caa34c43 Merge pull request #1934 from nhost/changeset-release/main
chore: update versions
2023-05-16 08:34:38 +02:00
github-actions[bot]
1d898e2893 chore: update versions 2023-05-15 18:43:10 +00:00
Szilárd Dóró
e87621cbde Merge pull request #1936 from nhost/fix/security-key-url
fix(hasura-auth-js): make the call to the correct endpoint
2023-05-15 20:41:59 +02:00
Szilárd Dóró
0d6fc42158 fix: make the call to the correct endpoint 2023-05-15 19:46:26 +02:00
Szilárd Dóró
f6fbee6b13 Merge pull request #1933 from nhost/fix/project-rename-prevent-404
fix(dashboard): don't redirect to 404 on project rename
2023-05-15 16:59:00 +02:00
Szilárd Dóró
1230b72222 fix: don't redirect to 404 on project rename 2023-05-15 16:05:45 +02:00
21 changed files with 98 additions and 31 deletions

View File

@@ -1,5 +1,13 @@
# @nhost/dashboard
## 0.16.11
### Patch Changes
- 1230b722: fix(projects): don't redirect to 404 on when the project is renamed
- @nhost/react-apollo@5.0.22
- @nhost/nextjs@1.13.24
## 0.16.10
### Patch Changes

View File

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

View File

@@ -4,6 +4,7 @@ import { ApplicationStatus } from '@/types/application';
import { GetWorkspaceAndProjectDocument } from '@/utils/__generated__/graphql';
import { getHasuraAdminSecret } from '@/utils/env';
import { useNhostClient, useUserData } from '@nhost/nextjs';
import type { RefetchOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import { useMemo } from 'react';
@@ -28,7 +29,7 @@ export interface UseCurrentWorkspaceAndProjectReturnType {
/**
* Refetch the query.
*/
refetch: (options?: any) => Promise<any>;
refetch: (options?: RefetchOptions) => Promise<any>;
}
export default function useCurrentWorkspaceAndProject(): UseCurrentWorkspaceAndProjectReturnType {

View File

@@ -13,12 +13,12 @@ import {
usePauseApplicationMutation,
useUpdateApplicationMutation,
} from '@/generated/graphql';
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import Input from '@/ui/v2/Input';
import { discordAnnounce } from '@/utils/discordAnnounce';
import { slugifyString } from '@/utils/helpers';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import { useApolloClient } from '@apollo/client';
import { yupResolver } from '@hookform/resolvers/yup';
import { useRouter } from 'next/router';
import type { ReactElement } from 'react';
@@ -38,11 +38,15 @@ export type ProjectNameValidationSchema = Yup.InferType<
>;
export default function SettingsGeneralPage() {
const { currentWorkspace, currentProject } = useCurrentWorkspaceAndProject();
const {
currentWorkspace,
currentProject,
loading,
refetch: refetchWorkspaceAndProject,
} = useCurrentWorkspaceAndProject();
const isOwner = useIsCurrentUserOwner();
const { openDialog, openAlertDialog, closeDialog } = useDialog();
const [updateApp] = useUpdateApplicationMutation();
const client = useApolloClient();
const [pauseApplication] = usePauseApplicationMutation({
variables: { appId: currentProject?.id },
refetchQueries: [GetAllWorkspacesAndProjectsDocument],
@@ -98,7 +102,7 @@ export default function SettingsGeneralPage() {
});
try {
await toast.promise(
const { data: updateAppData } = await toast.promise(
updateAppMutation,
{
loading: `Project name is being updated...`,
@@ -109,24 +113,24 @@ export default function SettingsGeneralPage() {
},
getToastStyleProps(),
);
const updateAppResult = updateAppData?.updateApp;
if (!updateAppResult) {
await discordAnnounce('Failed to update project name.');
return;
}
form.reset(undefined, { keepValues: true, keepDirty: false });
await refetchWorkspaceAndProject();
await router.replace(
`/${currentWorkspace.slug}/${updateAppResult.slug}/settings/general`,
);
} catch {
// Note: The toast will handle the error.
}
try {
form.reset(undefined, { keepValues: true, keepDirty: false });
await router.push(
`/${currentWorkspace.slug}/${newProjectSlug}/settings/general`,
);
await client.refetchQueries({
include: [GetAllWorkspacesAndProjectsDocument],
});
} catch (error) {
await discordAnnounce(
error.message ||
'An error occurred while trying to update application cache.',
);
}
}
async function handleDeleteApplication() {
@@ -161,6 +165,10 @@ export default function SettingsGeneralPage() {
await router.push('/');
}
if (loading) {
return <ActivityIndicator label="Loading project..." />;
}
return (
<Container
className="grid max-w-5xl grid-flow-row gap-8 bg-transparent"
@@ -195,7 +203,7 @@ export default function SettingsGeneralPage() {
</Form>
</FormProvider>
{currentProject.plan.isFree && (
{currentProject?.plan.isFree && (
<SettingsContainer
title="Pause Project"
description="While your project is paused, it will not be accessible. You can wake it up anytime after."

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 5.2.6
### Patch Changes
- @nhost/nhost-js@2.2.4
## 5.2.5
### Patch Changes

View File

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

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 5.0.22
### Patch Changes
- @nhost/apollo@5.2.6
- @nhost/react@2.0.18
## 5.0.21
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/react-urql
## 2.0.19
### Patch Changes
- @nhost/react@2.0.18
## 2.0.18
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-auth-js
## 2.1.3
### Patch Changes
- 0d6fc421: fix(webauthn): make the call to the correct Hasura Auth endpoint
## 2.1.2
### Patch Changes

View File

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

View File

@@ -21,7 +21,7 @@ export const addSecurityKeyPromise = async (
): Promise<AddSecurityKeyHandlerResult> => {
try {
const { data: options } = await postFetch<PublicKeyCredentialCreationOptionsJSON>(
'/user/webauthn/add',
`${backendUrl}/user/webauthn/add`,
{},
interpreter?.getSnapshot().context.accessToken.value
)

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 1.13.24
### Patch Changes
- @nhost/react@2.0.18
## 1.13.23
### Patch Changes

View File

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

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 2.2.4
### Patch Changes
- Updated dependencies [0d6fc421]
- @nhost/hasura-auth-js@2.1.3
## 2.2.3
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/react
## 2.0.18
### Patch Changes
- @nhost/nhost-js@2.2.4
## 2.0.17
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 1.13.24
### Patch Changes
- @nhost/nhost-js@2.2.4
## 1.13.23
### Patch Changes

View File

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