Compare commits
6 Commits
@nhost/rea
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69caa34c43 | ||
|
|
1d898e2893 | ||
|
|
e87621cbde | ||
|
|
0d6fc42158 | ||
|
|
f6fbee6b13 | ||
|
|
1230b72222 |
@@ -1,5 +1,13 @@
|
|||||||
# @nhost/dashboard
|
# @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
|
## 0.16.10
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/dashboard",
|
"name": "@nhost/dashboard",
|
||||||
"version": "0.16.10",
|
"version": "0.16.11",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { ApplicationStatus } from '@/types/application';
|
|||||||
import { GetWorkspaceAndProjectDocument } from '@/utils/__generated__/graphql';
|
import { GetWorkspaceAndProjectDocument } from '@/utils/__generated__/graphql';
|
||||||
import { getHasuraAdminSecret } from '@/utils/env';
|
import { getHasuraAdminSecret } from '@/utils/env';
|
||||||
import { useNhostClient, useUserData } from '@nhost/nextjs';
|
import { useNhostClient, useUserData } from '@nhost/nextjs';
|
||||||
|
import type { RefetchOptions } from '@tanstack/react-query';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
@@ -28,7 +29,7 @@ export interface UseCurrentWorkspaceAndProjectReturnType {
|
|||||||
/**
|
/**
|
||||||
* Refetch the query.
|
* Refetch the query.
|
||||||
*/
|
*/
|
||||||
refetch: (options?: any) => Promise<any>;
|
refetch: (options?: RefetchOptions) => Promise<any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function useCurrentWorkspaceAndProject(): UseCurrentWorkspaceAndProjectReturnType {
|
export default function useCurrentWorkspaceAndProject(): UseCurrentWorkspaceAndProjectReturnType {
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ import {
|
|||||||
usePauseApplicationMutation,
|
usePauseApplicationMutation,
|
||||||
useUpdateApplicationMutation,
|
useUpdateApplicationMutation,
|
||||||
} from '@/generated/graphql';
|
} from '@/generated/graphql';
|
||||||
|
import ActivityIndicator from '@/ui/v2/ActivityIndicator';
|
||||||
import Input from '@/ui/v2/Input';
|
import Input from '@/ui/v2/Input';
|
||||||
import { discordAnnounce } from '@/utils/discordAnnounce';
|
import { discordAnnounce } from '@/utils/discordAnnounce';
|
||||||
import { slugifyString } from '@/utils/helpers';
|
import { slugifyString } from '@/utils/helpers';
|
||||||
import getServerError from '@/utils/settings/getServerError';
|
import getServerError from '@/utils/settings/getServerError';
|
||||||
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
|
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
|
||||||
import { useApolloClient } from '@apollo/client';
|
|
||||||
import { yupResolver } from '@hookform/resolvers/yup';
|
import { yupResolver } from '@hookform/resolvers/yup';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import type { ReactElement } from 'react';
|
import type { ReactElement } from 'react';
|
||||||
@@ -38,11 +38,15 @@ export type ProjectNameValidationSchema = Yup.InferType<
|
|||||||
>;
|
>;
|
||||||
|
|
||||||
export default function SettingsGeneralPage() {
|
export default function SettingsGeneralPage() {
|
||||||
const { currentWorkspace, currentProject } = useCurrentWorkspaceAndProject();
|
const {
|
||||||
|
currentWorkspace,
|
||||||
|
currentProject,
|
||||||
|
loading,
|
||||||
|
refetch: refetchWorkspaceAndProject,
|
||||||
|
} = useCurrentWorkspaceAndProject();
|
||||||
const isOwner = useIsCurrentUserOwner();
|
const isOwner = useIsCurrentUserOwner();
|
||||||
const { openDialog, openAlertDialog, closeDialog } = useDialog();
|
const { openDialog, openAlertDialog, closeDialog } = useDialog();
|
||||||
const [updateApp] = useUpdateApplicationMutation();
|
const [updateApp] = useUpdateApplicationMutation();
|
||||||
const client = useApolloClient();
|
|
||||||
const [pauseApplication] = usePauseApplicationMutation({
|
const [pauseApplication] = usePauseApplicationMutation({
|
||||||
variables: { appId: currentProject?.id },
|
variables: { appId: currentProject?.id },
|
||||||
refetchQueries: [GetAllWorkspacesAndProjectsDocument],
|
refetchQueries: [GetAllWorkspacesAndProjectsDocument],
|
||||||
@@ -98,7 +102,7 @@ export default function SettingsGeneralPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await toast.promise(
|
const { data: updateAppData } = await toast.promise(
|
||||||
updateAppMutation,
|
updateAppMutation,
|
||||||
{
|
{
|
||||||
loading: `Project name is being updated...`,
|
loading: `Project name is being updated...`,
|
||||||
@@ -109,24 +113,24 @@ export default function SettingsGeneralPage() {
|
|||||||
},
|
},
|
||||||
getToastStyleProps(),
|
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 {
|
} catch {
|
||||||
// Note: The toast will handle the error.
|
// 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() {
|
async function handleDeleteApplication() {
|
||||||
@@ -161,6 +165,10 @@ export default function SettingsGeneralPage() {
|
|||||||
await router.push('/');
|
await router.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return <ActivityIndicator label="Loading project..." />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
className="grid max-w-5xl grid-flow-row gap-8 bg-transparent"
|
className="grid max-w-5xl grid-flow-row gap-8 bg-transparent"
|
||||||
@@ -195,7 +203,7 @@ export default function SettingsGeneralPage() {
|
|||||||
</Form>
|
</Form>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
|
|
||||||
{currentProject.plan.isFree && (
|
{currentProject?.plan.isFree && (
|
||||||
<SettingsContainer
|
<SettingsContainer
|
||||||
title="Pause Project"
|
title="Pause Project"
|
||||||
description="While your project is paused, it will not be accessible. You can wake it up anytime after."
|
description="While your project is paused, it will not be accessible. You can wake it up anytime after."
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @nhost/apollo
|
# @nhost/apollo
|
||||||
|
|
||||||
|
## 5.2.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@2.2.4
|
||||||
|
|
||||||
## 5.2.5
|
## 5.2.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/apollo",
|
"name": "@nhost/apollo",
|
||||||
"version": "5.2.5",
|
"version": "5.2.6",
|
||||||
"description": "Nhost Apollo Client library",
|
"description": "Nhost Apollo Client library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# @nhost/react-apollo
|
# @nhost/react-apollo
|
||||||
|
|
||||||
|
## 5.0.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/apollo@5.2.6
|
||||||
|
- @nhost/react@2.0.18
|
||||||
|
|
||||||
## 5.0.21
|
## 5.0.21
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react-apollo",
|
"name": "@nhost/react-apollo",
|
||||||
"version": "5.0.21",
|
"version": "5.0.22",
|
||||||
"description": "Nhost React Apollo client",
|
"description": "Nhost React Apollo client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @nhost/react-urql
|
# @nhost/react-urql
|
||||||
|
|
||||||
|
## 2.0.19
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@2.0.18
|
||||||
|
|
||||||
## 2.0.18
|
## 2.0.18
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react-urql",
|
"name": "@nhost/react-urql",
|
||||||
"version": "2.0.18",
|
"version": "2.0.19",
|
||||||
"description": "Nhost React URQL client",
|
"description": "Nhost React URQL client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @nhost/hasura-auth-js
|
# @nhost/hasura-auth-js
|
||||||
|
|
||||||
|
## 2.1.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 0d6fc421: fix(webauthn): make the call to the correct Hasura Auth endpoint
|
||||||
|
|
||||||
## 2.1.2
|
## 2.1.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/hasura-auth-js",
|
"name": "@nhost/hasura-auth-js",
|
||||||
"version": "2.1.2",
|
"version": "2.1.3",
|
||||||
"description": "Hasura-auth client",
|
"description": "Hasura-auth client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const addSecurityKeyPromise = async (
|
|||||||
): Promise<AddSecurityKeyHandlerResult> => {
|
): Promise<AddSecurityKeyHandlerResult> => {
|
||||||
try {
|
try {
|
||||||
const { data: options } = await postFetch<PublicKeyCredentialCreationOptionsJSON>(
|
const { data: options } = await postFetch<PublicKeyCredentialCreationOptionsJSON>(
|
||||||
'/user/webauthn/add',
|
`${backendUrl}/user/webauthn/add`,
|
||||||
{},
|
{},
|
||||||
interpreter?.getSnapshot().context.accessToken.value
|
interpreter?.getSnapshot().context.accessToken.value
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @nhost/nextjs
|
# @nhost/nextjs
|
||||||
|
|
||||||
|
## 1.13.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/react@2.0.18
|
||||||
|
|
||||||
## 1.13.23
|
## 1.13.23
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/nextjs",
|
"name": "@nhost/nextjs",
|
||||||
"version": "1.13.23",
|
"version": "1.13.24",
|
||||||
"description": "Nhost NextJS library",
|
"description": "Nhost NextJS library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# @nhost/nhost-js
|
# @nhost/nhost-js
|
||||||
|
|
||||||
|
## 2.2.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [0d6fc421]
|
||||||
|
- @nhost/hasura-auth-js@2.1.3
|
||||||
|
|
||||||
## 2.2.3
|
## 2.2.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/nhost-js",
|
"name": "@nhost/nhost-js",
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"description": "Nhost JavaScript SDK",
|
"description": "Nhost JavaScript SDK",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @nhost/react
|
# @nhost/react
|
||||||
|
|
||||||
|
## 2.0.18
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@2.2.4
|
||||||
|
|
||||||
## 2.0.17
|
## 2.0.17
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/react",
|
"name": "@nhost/react",
|
||||||
"version": "2.0.17",
|
"version": "2.0.18",
|
||||||
"description": "Nhost React library",
|
"description": "Nhost React library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @nhost/vue
|
# @nhost/vue
|
||||||
|
|
||||||
|
## 1.13.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @nhost/nhost-js@2.2.4
|
||||||
|
|
||||||
## 1.13.23
|
## 1.13.23
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nhost/vue",
|
"name": "@nhost/vue",
|
||||||
"version": "1.13.23",
|
"version": "1.13.24",
|
||||||
"description": "Nhost Vue library",
|
"description": "Nhost Vue library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
Reference in New Issue
Block a user