Fix wrong path used by backend (#14352)
After moving a section on the frontend, this broke the path that was sent by email on the backend. This kind of error comes back every ~2-3 month under different forms so we need a more robust solution: I moved routes to the shared folder, that way we will share one common source of truth between the frontend and the backend. Fixes #14343
This commit is contained in:
+7
-3
@@ -20,8 +20,8 @@ import {
|
||||
useReactFlow,
|
||||
} from '@xyflow/react';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { Button, IconButtonGroup } from 'twenty-ui/input';
|
||||
import { SettingsPath } from 'twenty-shared/types';
|
||||
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
|
||||
import {
|
||||
IconLock,
|
||||
IconLockOpen,
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
IconPlus,
|
||||
IconX,
|
||||
} from 'twenty-ui/display';
|
||||
import { Button, IconButtonGroup } from 'twenty-ui/input';
|
||||
|
||||
const nodeTypes: NodeTypes = {
|
||||
object: SettingsDataModelOverviewObject,
|
||||
@@ -184,7 +185,10 @@ export const SettingsDataModelOverview = () => {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<StyledCloseButton>
|
||||
<Button Icon={IconX} to="/settings/objects"></Button>
|
||||
<Button
|
||||
Icon={IconX}
|
||||
to={getSettingsPath(SettingsPath.Objects)}
|
||||
></Button>
|
||||
</StyledCloseButton>
|
||||
<SettingsDataModelOverviewEffect
|
||||
setEdges={setEdges}
|
||||
|
||||
+2
-2
@@ -11,11 +11,11 @@ import { getObjectTypeLabel } from '@/settings/data-model/utils/getObjectTypeLab
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
|
||||
import { ObjectFieldRowWithoutRelation } from '@/settings/data-model/graph-overview/components/SettingsDataModelOverviewFieldWithoutRelation';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
import '@xyflow/react/dist/style.css';
|
||||
import { useState } from 'react';
|
||||
import { SettingsPath } from 'twenty-shared/types';
|
||||
import { getSettingsPath } from 'twenty-shared/utils';
|
||||
import { IconChevronDown, IconChevronUp, useIcons } from 'twenty-ui/display';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
|
||||
type SettingsDataModelOverviewObjectNode = Node<ObjectMetadataItem, 'object'>;
|
||||
type SettingsDataModelOverviewObjectProps =
|
||||
|
||||
Reference in New Issue
Block a user