diff --git a/package.json b/package.json
index 6307f33e6..304e3a3e0 100644
--- a/package.json
+++ b/package.json
@@ -32,16 +32,16 @@
"@dnd-kit/utilities": "^3.2.0",
"@emotion/react": "^11.10.5",
"@emotion/server": "^11.10.0",
- "@mantine/carousel": "^5.9.0",
- "@mantine/core": "^5.9.0",
- "@mantine/dates": "^5.9.0",
- "@mantine/dropzone": "^5.9.0",
- "@mantine/form": "^5.9.0",
- "@mantine/hooks": "^5.9.0",
- "@mantine/modals": "^5.9.0",
- "@mantine/next": "^5.9.0",
- "@mantine/notifications": "^5.9.0",
- "@mantine/prism": "^5.9.0",
+ "@mantine/carousel": "^5.9.2",
+ "@mantine/core": "^5.9.2",
+ "@mantine/dates": "^5.9.2",
+ "@mantine/dropzone": "^5.9.2",
+ "@mantine/form": "^5.9.2",
+ "@mantine/hooks": "^5.9.2",
+ "@mantine/modals": "^5.9.2",
+ "@mantine/next": "^5.9.2",
+ "@mantine/notifications": "^5.9.2",
+ "@mantine/prism": "^5.9.2",
"@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1",
"@tabler/icons": "^1.106.0",
diff --git a/src/components/Dashboard/Modals/EditService/EditServiceModal.tsx b/src/components/Dashboard/Modals/EditService/EditServiceModal.tsx
index 063f0a53b..576dff849 100644
--- a/src/components/Dashboard/Modals/EditService/EditServiceModal.tsx
+++ b/src/components/Dashboard/Modals/EditService/EditServiceModal.tsx
@@ -1,8 +1,15 @@
-import { Alert, Button, createStyles, Group, Stack, Tabs, Text } from '@mantine/core';
+import { Alert, Button, createStyles, Group, Stack, Tabs, Text, ThemeIcon } from '@mantine/core';
import { useForm } from '@mantine/form';
import { ContextModalProps } from '@mantine/modals';
import { hideNotification, showNotification } from '@mantine/notifications';
-import { IconAccessPoint, IconAdjustments, IconBrush, IconClick, IconPlug } from '@tabler/icons';
+import {
+ IconAccessPoint,
+ IconAdjustments,
+ IconAlertTriangle,
+ IconBrush,
+ IconClick,
+ IconPlug,
+} from '@tabler/icons';
import { useTranslation } from 'next-i18next';
import Image from 'next/image';
import { useState } from 'react';
@@ -44,17 +51,27 @@ export const EditServiceModal = ({
return null;
},
- appearance: (appearance) => (!appearance.iconUrl ? 'Icon is required' : null),
- behaviour: (behaviour) => {
- if (behaviour.onClickUrl === undefined || behaviour.onClickUrl.length < 1) {
+ appearance: {
+ iconUrl: (url: string) => {
+ if (url.length < 1) {
+ return 'This field is required';
+ }
+
return null;
- }
+ },
+ },
+ behaviour: {
+ onClickUrl: (url: string) => {
+ if (url === undefined || url.length < 1) {
+ return null;
+ }
- if (!behaviour.onClickUrl?.match(serviceUrlRegex)) {
- return 'Uri override is not a valid uri';
- }
+ if (!url.match(serviceUrlRegex)) {
+ return 'Uri override is not a valid uri';
+ }
- return null;
+ return null;
+ },
},
},
validateInputOnChange: true,
@@ -102,6 +119,18 @@ export const EditServiceModal = ({
context.closeModal(id);
};
+ const validationErrors = Object.keys(form.errors);
+
+ const ValidationErrorIndicator = ({ keys }: { keys: string[] }) => {
+ const relevantErrors = validationErrors.filter((x) => keys.includes(x));
+
+ return (
+