mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 17:26:26 +01:00
🥅 Add alert when procedure failed
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import { Button, Card, Group, Table, Text, Title } from '@mantine/core';
|
import { Alert, Button, Card, Group, Table, Text, Title } from '@mantine/core';
|
||||||
import {
|
import {
|
||||||
|
IconAlertTriangle,
|
||||||
|
IconAlertTriangleFilled,
|
||||||
IconArrowLeft,
|
IconArrowLeft,
|
||||||
IconCheck,
|
IconCheck,
|
||||||
IconInfoCircle,
|
IconInfoCircle,
|
||||||
@@ -21,7 +23,7 @@ export const ReviewInputStep = ({ values, prevStep, nextStep }: ReviewInputStepP
|
|||||||
const { t } = useTranslation('manage/users/create');
|
const { t } = useTranslation('manage/users/create');
|
||||||
|
|
||||||
const utils = api.useContext();
|
const utils = api.useContext();
|
||||||
const { mutateAsync: createAsync, isLoading } = api.user.create.useMutation({
|
const { mutateAsync: createAsync, isLoading, isError, error } = api.user.create.useMutation({
|
||||||
onSettled: () => {
|
onSettled: () => {
|
||||||
void utils.user.all.invalidate();
|
void utils.user.all.invalidate();
|
||||||
},
|
},
|
||||||
@@ -87,6 +89,12 @@ export const ReviewInputStep = ({ values, prevStep, nextStep }: ReviewInputStepP
|
|||||||
</tbody>
|
</tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
|
{isError && (
|
||||||
|
<Alert color="red" icon={<IconAlertTriangleFilled size="0.9rem" />} mb="lg">
|
||||||
|
<Text color="red">User creation has failed: {error.message}</Text>
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
|
|
||||||
<Group position="apart" noWrap>
|
<Group position="apart" noWrap>
|
||||||
<Button leftIcon={<IconArrowLeft size="1rem" />} onClick={prevStep} variant="light" px="xl">
|
<Button leftIcon={<IconArrowLeft size="1rem" />} onClick={prevStep} variant="light" px="xl">
|
||||||
{t('common:previous')}
|
{t('common:previous')}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
IconManualGearbox,
|
IconManualGearbox,
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { OnboardingStepWrapper } from './common-wrapper';
|
import { OnboardingStepWrapper } from './common-wrapper';
|
||||||
|
|
||||||
@@ -22,6 +23,8 @@ export const StepOnboardingFinished = () => {
|
|||||||
|
|
||||||
<Stack>
|
<Stack>
|
||||||
<NavLink
|
<NavLink
|
||||||
|
component={Link}
|
||||||
|
href="/b/default"
|
||||||
rightSection={<IconChevronRight size="0.8rem" stroke={1.5} />}
|
rightSection={<IconChevronRight size="0.8rem" stroke={1.5} />}
|
||||||
className={classes.link}
|
className={classes.link}
|
||||||
icon={<IconDashboard />}
|
icon={<IconDashboard />}
|
||||||
@@ -30,6 +33,8 @@ export const StepOnboardingFinished = () => {
|
|||||||
active
|
active
|
||||||
/>
|
/>
|
||||||
<NavLink
|
<NavLink
|
||||||
|
component={Link}
|
||||||
|
href="/manage"
|
||||||
rightSection={<IconChevronRight size="0.8rem" stroke={1.5} />}
|
rightSection={<IconChevronRight size="0.8rem" stroke={1.5} />}
|
||||||
className={classes.link}
|
className={classes.link}
|
||||||
icon={<IconManualGearbox />}
|
icon={<IconManualGearbox />}
|
||||||
@@ -38,6 +43,9 @@ export const StepOnboardingFinished = () => {
|
|||||||
active
|
active
|
||||||
/>
|
/>
|
||||||
<NavLink
|
<NavLink
|
||||||
|
component='a'
|
||||||
|
href="https://homarr.dev"
|
||||||
|
target="_blank"
|
||||||
rightSection={<IconChevronRight size="0.8rem" stroke={1.5} />}
|
rightSection={<IconChevronRight size="0.8rem" stroke={1.5} />}
|
||||||
className={classes.link}
|
className={classes.link}
|
||||||
icon={<IconFileText />}
|
icon={<IconFileText />}
|
||||||
|
|||||||
Reference in New Issue
Block a user