From 42d0c48b583762875a90491f2e915ee20d2317e3 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 2 Jan 2024 11:42:01 -0500 Subject: [PATCH 1/6] [WIFI-13259] Fixed potential crash in field explanations Signed-off-by: Charles --- package-lock.json | 4 +- package.json | 2 +- .../ConfigurationFieldExplanation/index.jsx | 42 --------------- .../ConfigurationFieldExplanation/index.tsx | 51 +++++++++++++++++++ 4 files changed, 54 insertions(+), 45 deletions(-) delete mode 100644 src/components/FormFields/ConfigurationFieldExplanation/index.jsx create mode 100644 src/components/FormFields/ConfigurationFieldExplanation/index.tsx diff --git a/package-lock.json b/package-lock.json index c94eee88..320360ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(5)", + "version": "3.0.0(6)", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(5)", + "version": "3.0.0(6)", "license": "ISC", "dependencies": { "@chakra-ui/anatomy": "^2.1.1", diff --git a/package.json b/package.json index ee580009..b1033449 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(5)", + "version": "3.0.0(6)", "description": "", "main": "index.tsx", "scripts": { diff --git a/src/components/FormFields/ConfigurationFieldExplanation/index.jsx b/src/components/FormFields/ConfigurationFieldExplanation/index.jsx deleted file mode 100644 index 18e090c6..00000000 --- a/src/components/FormFields/ConfigurationFieldExplanation/index.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { useMemo } from 'react'; -import { InfoIcon } from '@chakra-ui/icons'; -import { Tooltip } from '@chakra-ui/react'; -import PropTypes from 'prop-types'; -import { useAuth } from 'contexts/AuthProvider'; - -const findDefinition = (definitionKey, CONFIGURATION_DESCRIPTIONS) => { - if (!definitionKey || !CONFIGURATION_DESCRIPTIONS) return null; - const split = definitionKey.split('.'); - const { length } = split; - if (length < 2) return null; - const start = split.slice(0, length - 1); - const end = split[length - 1]; - return CONFIGURATION_DESCRIPTIONS[start.slice(0, length - 1).join('.')]?.properties[end]?.description ?? null; -}; - -const propTypes = { - definitionKey: PropTypes.string, -}; - -const defaultProps = { - definitionKey: null, -}; - -const ConfigurationFieldExplanation = ({ definitionKey }) => { - const { configurationDescriptions } = useAuth(); - const definition = useMemo( - () => findDefinition(definitionKey, configurationDescriptions), - [configurationDescriptions], - ); - if (!definition) return null; - - return ( - - - - ); -}; - -ConfigurationFieldExplanation.propTypes = propTypes; -ConfigurationFieldExplanation.defaultProps = defaultProps; -export default React.memo(ConfigurationFieldExplanation); diff --git a/src/components/FormFields/ConfigurationFieldExplanation/index.tsx b/src/components/FormFields/ConfigurationFieldExplanation/index.tsx new file mode 100644 index 00000000..112cd3d1 --- /dev/null +++ b/src/components/FormFields/ConfigurationFieldExplanation/index.tsx @@ -0,0 +1,51 @@ +import React, { useMemo } from 'react'; +import { InfoIcon } from '@chakra-ui/icons'; +import { Tooltip } from '@chakra-ui/react'; +import { useAuth } from 'contexts/AuthProvider'; + +const findDefinition = ( + definitionKey?: string, + CONFIGURATION_DESCRIPTIONS?: { + [key: string]: { properties?: { [key: string]: { description: string } } }; + }, +) => { + try { + if (!definitionKey || !CONFIGURATION_DESCRIPTIONS) return null; + const split = definitionKey.split('.'); + const { length } = split; + if (length < 2) return null; + const start = split.slice(0, length - 1); + const end = split[length - 1]; + return ( + CONFIGURATION_DESCRIPTIONS[start.slice(0, length - 1).join('.')]?.properties?.[end ?? '']?.description ?? null + ); + } catch (e) { + return null; + } +}; + +interface ConfigurationFieldExplanationProps { + definitionKey?: string; +} +const ConfigurationFieldExplanation: React.FC = ({ definitionKey }) => { + const { configurationDescriptions } = useAuth(); + const definition = useMemo( + () => + findDefinition( + definitionKey, + configurationDescriptions as { + [key: string]: { properties: { [key: string]: { description: string } } }; + }, + ), + [configurationDescriptions], + ); + if (!definition) return null; + + return ( + + + + ); +}; + +export default React.memo(ConfigurationFieldExplanation); From 198a335ad3ff654fd993c6609749166aed6b5388 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 15 Jan 2024 15:47:28 +0100 Subject: [PATCH 2/6] [WIFI-13303] Fixing device type list when FMS does not include it Signed-off-by: Charles --- package-lock.json | 16 ++++++++-------- package.json | 2 +- .../Tables/InventoryTable/EditTagModal/Form.jsx | 11 ++++++++++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 320360ec..5b5dba4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(6)", + "version": "3.0.0(7)", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(6)", + "version": "3.0.0(7)", "license": "ISC", "dependencies": { "@chakra-ui/anatomy": "^2.1.1", @@ -7311,9 +7311,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -17169,9 +17169,9 @@ } }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" }, "formik": { "version": "2.2.9", diff --git a/package.json b/package.json index b1033449..0fe5a3f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(6)", + "version": "3.0.0(7)", "description": "", "main": "index.tsx", "scripts": { diff --git a/src/components/Tables/InventoryTable/EditTagModal/Form.jsx b/src/components/Tables/InventoryTable/EditTagModal/Form.jsx index adae32b1..30e2b34b 100644 --- a/src/components/Tables/InventoryTable/EditTagModal/Form.jsx +++ b/src/components/Tables/InventoryTable/EditTagModal/Form.jsx @@ -68,6 +68,15 @@ const EditTagForm = ({ return ''; }; + const deviceListWithType = React.useMemo(() => { + const { deviceType } = tag; + if (deviceTypesList.includes(deviceType)) return deviceTypesList; + + const newList = [...deviceTypesList, deviceType]; + + return newList.sort((a, b) => a.localeCompare(b)); + }, [deviceTypesList]); + useEffect(() => { setFormKey(uuid()); setIsDeleted(false); @@ -288,7 +297,7 @@ const EditTagForm = ({ ({ + options={deviceListWithType.map((deviceType) => ({ value: deviceType, label: deviceType, }))} From 49263aca698037d8fbb9081502de319a55b0b8db Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 22 Jan 2024 16:34:24 +0100 Subject: [PATCH 3/6] [WIFI-13259] Fixing issue related to captive section Signed-off-by: Charles --- package-lock.json | 4 ++-- package.json | 2 +- .../ServicesSection/Captive/index.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b5dba4f..1b0cdba6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(7)", + "version": "3.0.1(1)", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(7)", + "version": "3.0.1(1)", "license": "ISC", "dependencies": { "@chakra-ui/anatomy": "^2.1.1", diff --git a/package.json b/package.json index 0fe5a3f4..2f9b180b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.0(7)", + "version": "3.0.1(1)", "description": "", "main": "index.tsx", "scripts": { diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/ServicesSection/Captive/index.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/ServicesSection/Captive/index.tsx index c04efa03..2958f79a 100644 --- a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/ServicesSection/Captive/index.tsx +++ b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/ServicesSection/Captive/index.tsx @@ -101,7 +101,7 @@ const CaptiveConfiguration = ({ editing }: { editing: boolean }) => { - From e78906dc4d706697d1dc82b303f9aab32b708187 Mon Sep 17 00:00:00 2001 From: Carsten Schafer Date: Fri, 9 Feb 2024 15:33:11 -0500 Subject: [PATCH 4/6] Set ingress class name if requested Signed-off-by: Carsten Schafer --- helm/templates/ingress.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helm/templates/ingress.yaml b/helm/templates/ingress.yaml index 986ec040..8b1028ab 100644 --- a/helm/templates/ingress.yaml +++ b/helm/templates/ingress.yaml @@ -17,7 +17,9 @@ metadata: {{- end }} spec: - +{{- if $ingressValue.className }} + ingressClassName: {{ $ingressValue.className }} +{{- end }} {{- if $ingressValue.tls }} tls: {{- range $ingressValue.tls }} From bc46011f74174da3d5e5fb44110fb9b23eff113a Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 20 Mar 2024 10:33:08 +0100 Subject: [PATCH 5/6] [WIFI-13530] Fixing file input button Signed-off-by: Charles --- package-lock.json | 425 +++++++++--------- package.json | 2 +- .../Buttons/FileInputButton/index.tsx | 60 +-- .../GoogleOrionPage/CaCertificateField.tsx | 4 +- 4 files changed, 239 insertions(+), 252 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b0cdba6..9e645ba3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.1(1)", + "version": "3.0.2(1)", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wlan-cloud-owprov-ui", - "version": "3.0.1(1)", + "version": "3.0.2(1)", "license": "ISC", "dependencies": { "@chakra-ui/anatomy": "^2.1.1", @@ -3091,9 +3091,9 @@ "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" }, "node_modules/@esbuild/android-arm": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.18.tgz", - "integrity": "sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], @@ -3106,9 +3106,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.18.tgz", - "integrity": "sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], @@ -3121,9 +3121,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.18.tgz", - "integrity": "sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], @@ -3136,9 +3136,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.18.tgz", - "integrity": "sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -3151,9 +3151,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz", - "integrity": "sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], @@ -3166,9 +3166,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.18.tgz", - "integrity": "sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], @@ -3181,9 +3181,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.18.tgz", - "integrity": "sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], @@ -3196,9 +3196,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.18.tgz", - "integrity": "sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], @@ -3211,9 +3211,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.18.tgz", - "integrity": "sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], @@ -3226,9 +3226,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.18.tgz", - "integrity": "sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], @@ -3241,9 +3241,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.18.tgz", - "integrity": "sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], @@ -3256,9 +3256,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.18.tgz", - "integrity": "sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], @@ -3271,9 +3271,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.18.tgz", - "integrity": "sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], @@ -3286,9 +3286,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.18.tgz", - "integrity": "sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], @@ -3301,9 +3301,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.18.tgz", - "integrity": "sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], @@ -3316,9 +3316,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.18.tgz", - "integrity": "sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -3331,9 +3331,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.18.tgz", - "integrity": "sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], @@ -3346,9 +3346,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.18.tgz", - "integrity": "sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], @@ -3361,9 +3361,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.18.tgz", - "integrity": "sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], @@ -3376,9 +3376,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.18.tgz", - "integrity": "sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], @@ -3391,9 +3391,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.18.tgz", - "integrity": "sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], @@ -3406,9 +3406,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.18.tgz", - "integrity": "sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], @@ -6279,9 +6279,9 @@ } }, "node_modules/esbuild": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.18.tgz", - "integrity": "sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -6290,28 +6290,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.17.18", - "@esbuild/android-arm64": "0.17.18", - "@esbuild/android-x64": "0.17.18", - "@esbuild/darwin-arm64": "0.17.18", - "@esbuild/darwin-x64": "0.17.18", - "@esbuild/freebsd-arm64": "0.17.18", - "@esbuild/freebsd-x64": "0.17.18", - "@esbuild/linux-arm": "0.17.18", - "@esbuild/linux-arm64": "0.17.18", - "@esbuild/linux-ia32": "0.17.18", - "@esbuild/linux-loong64": "0.17.18", - "@esbuild/linux-mips64el": "0.17.18", - "@esbuild/linux-ppc64": "0.17.18", - "@esbuild/linux-riscv64": "0.17.18", - "@esbuild/linux-s390x": "0.17.18", - "@esbuild/linux-x64": "0.17.18", - "@esbuild/netbsd-x64": "0.17.18", - "@esbuild/openbsd-x64": "0.17.18", - "@esbuild/sunos-x64": "0.17.18", - "@esbuild/win32-arm64": "0.17.18", - "@esbuild/win32-ia32": "0.17.18", - "@esbuild/win32-x64": "0.17.18" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/escalade": { @@ -7311,9 +7311,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -10230,9 +10230,9 @@ } }, "node_modules/rollup": { - "version": "3.21.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.3.tgz", - "integrity": "sha512-VnPfEG51nIv2xPLnZaekkuN06q9ZbnyDcLkaBdJa/W7UddyhOfMP2yOPziYQfeY7k++fZM8FdQIummFN5y14kA==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "bin": { "rollup": "dist/bin/rollup" }, @@ -11181,13 +11181,13 @@ } }, "node_modules/vite": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", - "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", + "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", "dependencies": { - "esbuild": "^0.17.5", - "postcss": "^8.4.23", - "rollup": "^3.21.0" + "esbuild": "^0.18.10", + "postcss": "^8.4.27", + "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" @@ -11195,12 +11195,16 @@ "engines": { "node": "^14.18.0 || >=16.0.0" }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@types/node": ">= 14", "less": "*", + "lightningcss": "^1.21.0", "sass": "*", "stylus": "*", "sugarss": "*", @@ -11213,6 +11217,9 @@ "less": { "optional": true }, + "lightningcss": { + "optional": true + }, "sass": { "optional": true }, @@ -14133,135 +14140,135 @@ "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" }, "@esbuild/android-arm": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.18.tgz", - "integrity": "sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "optional": true }, "@esbuild/android-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.18.tgz", - "integrity": "sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "optional": true }, "@esbuild/android-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.18.tgz", - "integrity": "sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.18.tgz", - "integrity": "sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "optional": true }, "@esbuild/darwin-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz", - "integrity": "sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.18.tgz", - "integrity": "sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.18.tgz", - "integrity": "sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "optional": true }, "@esbuild/linux-arm": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.18.tgz", - "integrity": "sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "optional": true }, "@esbuild/linux-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.18.tgz", - "integrity": "sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "optional": true }, "@esbuild/linux-ia32": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.18.tgz", - "integrity": "sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "optional": true }, "@esbuild/linux-loong64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.18.tgz", - "integrity": "sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.18.tgz", - "integrity": "sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.18.tgz", - "integrity": "sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.18.tgz", - "integrity": "sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "optional": true }, "@esbuild/linux-s390x": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.18.tgz", - "integrity": "sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "optional": true }, "@esbuild/linux-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.18.tgz", - "integrity": "sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.18.tgz", - "integrity": "sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.18.tgz", - "integrity": "sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "optional": true }, "@esbuild/sunos-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.18.tgz", - "integrity": "sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "optional": true }, "@esbuild/win32-arm64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.18.tgz", - "integrity": "sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "optional": true }, "@esbuild/win32-ia32": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.18.tgz", - "integrity": "sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "optional": true }, "@esbuild/win32-x64": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.18.tgz", - "integrity": "sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "optional": true }, "@eslint-community/eslint-utils": { @@ -16405,32 +16412,32 @@ } }, "esbuild": { - "version": "0.17.18", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.18.tgz", - "integrity": "sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==", - "requires": { - "@esbuild/android-arm": "0.17.18", - "@esbuild/android-arm64": "0.17.18", - "@esbuild/android-x64": "0.17.18", - "@esbuild/darwin-arm64": "0.17.18", - "@esbuild/darwin-x64": "0.17.18", - "@esbuild/freebsd-arm64": "0.17.18", - "@esbuild/freebsd-x64": "0.17.18", - "@esbuild/linux-arm": "0.17.18", - "@esbuild/linux-arm64": "0.17.18", - "@esbuild/linux-ia32": "0.17.18", - "@esbuild/linux-loong64": "0.17.18", - "@esbuild/linux-mips64el": "0.17.18", - "@esbuild/linux-ppc64": "0.17.18", - "@esbuild/linux-riscv64": "0.17.18", - "@esbuild/linux-s390x": "0.17.18", - "@esbuild/linux-x64": "0.17.18", - "@esbuild/netbsd-x64": "0.17.18", - "@esbuild/openbsd-x64": "0.17.18", - "@esbuild/sunos-x64": "0.17.18", - "@esbuild/win32-arm64": "0.17.18", - "@esbuild/win32-ia32": "0.17.18", - "@esbuild/win32-x64": "0.17.18" + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "requires": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "escalade": { @@ -17169,9 +17176,9 @@ } }, "follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, "formik": { "version": "2.2.9", @@ -19194,9 +19201,9 @@ } }, "rollup": { - "version": "3.21.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.21.3.tgz", - "integrity": "sha512-VnPfEG51nIv2xPLnZaekkuN06q9ZbnyDcLkaBdJa/W7UddyhOfMP2yOPziYQfeY7k++fZM8FdQIummFN5y14kA==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "requires": { "fsevents": "~2.3.2" } @@ -19855,14 +19862,14 @@ "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "vite": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", - "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", + "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", "requires": { - "esbuild": "^0.17.5", + "esbuild": "^0.18.10", "fsevents": "~2.3.2", - "postcss": "^8.4.23", - "rollup": "^3.21.0" + "postcss": "^8.4.27", + "rollup": "^3.27.1" } }, "vite-plugin-pwa": { diff --git a/package.json b/package.json index 2f9b180b..23c49326 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.1(1)", + "version": "3.0.2(1)", "description": "", "main": "index.tsx", "scripts": { diff --git a/src/components/Buttons/FileInputButton/index.tsx b/src/components/Buttons/FileInputButton/index.tsx index 436354cd..35c927b7 100644 --- a/src/components/Buttons/FileInputButton/index.tsx +++ b/src/components/Buttons/FileInputButton/index.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import { FormControl, Input, InputGroup } from '@chakra-ui/react'; import { v4 as uuid } from 'uuid'; -interface Props { +interface FileInputButtonProps { value: string; setValue: (v: string, file?: File) => void; setFileName?: (v: string) => void; @@ -10,16 +10,10 @@ interface Props { accept: string; isHidden?: boolean; isStringFile?: boolean; - wantBase64?: boolean; + sizeLimit?: number; } -const defaultProps = { - setFileName: undefined, - isHidden: false, - isStringFile: false, -}; - -const FileInputButton = ({ +const FileInputButton: React.FC = ({ value, setValue, setFileName, @@ -27,28 +21,16 @@ const FileInputButton = ({ accept, isHidden, isStringFile, - wantBase64, -}: Props) => { + sizeLimit, +}) => { const [fileKey, setFileKey] = useState(uuid()); let fileReader: FileReader | undefined; - const handleStringFileRead = () => { + const handleStringFileRead = (file: File) => () => { if (fileReader) { const content = fileReader.result; if (content) { - setValue(content as string); - } - } - }; - - const handleBase64FileRead = () => { - if (fileReader) { - const content = fileReader.result; - if (content && typeof content === 'string') { - const split = content.split('base64,'); - if (split[1]) { - setValue(split[1] as string); - } + setValue(content as string, file); } } }; @@ -56,19 +38,19 @@ const FileInputButton = ({ const changeFile = (e: React.ChangeEvent) => { const file = e.target.files ? e.target.files[0] : undefined; if (file) { - const newVal = URL.createObjectURL(file); - if (wantBase64) { - fileReader = new FileReader(); - fileReader.onloadend = handleBase64FileRead; - fileReader.readAsDataURL(file); - } else if (!isStringFile) { - setValue(newVal, file); - if (setFileName) setFileName(file.name ?? ''); + if (sizeLimit && file.size > sizeLimit) { + setFileKey(uuid()); } else { - fileReader = new FileReader(); - if (setFileName) setFileName(file.name); - fileReader.onloadend = handleStringFileRead; - fileReader.readAsText(file); + const newVal = URL.createObjectURL(file); + if (!isStringFile) { + setValue(newVal, file); + if (setFileName) setFileName(file.name ?? ''); + } else { + fileReader = new FileReader(); + if (setFileName) setFileName(file.name); + fileReader.onloadend = handleStringFileRead(file); + fileReader.readAsText(file); + } } } }; @@ -94,6 +76,4 @@ const FileInputButton = ({ ); }; -FileInputButton.defaultProps = defaultProps; - -export default FileInputButton; +export default React.memo(FileInputButton); diff --git a/src/pages/OpenRoamingPage/GoogleOrionPage/CaCertificateField.tsx b/src/pages/OpenRoamingPage/GoogleOrionPage/CaCertificateField.tsx index 6943cdbf..33a8e71a 100644 --- a/src/pages/OpenRoamingPage/GoogleOrionPage/CaCertificateField.tsx +++ b/src/pages/OpenRoamingPage/GoogleOrionPage/CaCertificateField.tsx @@ -33,7 +33,7 @@ const GoogleOrionCaCertificateField = ({ name, isDisabled }: Props) => { }; const onRemove = (index: number) => { - field.onChange(field.value.filter((_: unknown, i: number) => i !== index)); + field.onChange((field.value as { value: string; filename: string }[]).filter((_, i) => i !== index)); setRefreshId(uuid()); }; @@ -52,7 +52,7 @@ const GoogleOrionCaCertificateField = ({ name, isDisabled }: Props) => { You need to upload at least one file to CA Certs - {field.value.map((v: { filename: string }, i: number) => ( + {(field.value as { value: string; filename: string }[]).map((v, i) => ( {v.filename} From 65f48321dc8a0a79b8b05029dc2f73b3a86282c6 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 21 Mar 2024 13:36:07 +0100 Subject: [PATCH 6/6] [WIFI-13534] Captive portal configuration schema fixes Signed-off-by: Charles --- package-lock.json | 4 +- package.json | 2 +- .../Sections/CaptivePortal/index.tsx | 4 +- .../SingleInterface/Captive/Captive.tsx | 102 ------------ .../SingleInterface/Captive/index.tsx | 42 ----- .../SsidList/AdvancedSettings.tsx | 2 + .../SsidList/Captive/Captive.tsx | 152 ++++++++++++++++++ .../{ => SsidList}/Captive/LockedCaptive.tsx | 0 .../SsidList/Captive/index.tsx | 54 +++++++ .../SingleInterface/index.tsx | 2 - .../InterfaceSection/interfacesConstants.js | 142 ++++++++++++++-- 11 files changed, 340 insertions(+), 166 deletions(-) delete mode 100644 src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/Captive.tsx delete mode 100644 src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/index.tsx create mode 100644 src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/Captive.tsx rename src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/{ => SsidList}/Captive/LockedCaptive.tsx (100%) create mode 100644 src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/index.tsx diff --git a/package-lock.json b/package-lock.json index 9e645ba3..ce53593b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.2(1)", + "version": "3.0.2(2)", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wlan-cloud-owprov-ui", - "version": "3.0.2(1)", + "version": "3.0.2(2)", "license": "ISC", "dependencies": { "@chakra-ui/anatomy": "^2.1.1", diff --git a/package.json b/package.json index 23c49326..4a8200f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wlan-cloud-owprov-ui", - "version": "3.0.2(1)", + "version": "3.0.2(2)", "description": "", "main": "index.tsx", "scripts": { diff --git a/src/components/Modals/Resources/Sections/CaptivePortal/index.tsx b/src/components/Modals/Resources/Sections/CaptivePortal/index.tsx index b648cf6a..a9080c6d 100644 --- a/src/components/Modals/Resources/Sections/CaptivePortal/index.tsx +++ b/src/components/Modals/Resources/Sections/CaptivePortal/index.tsx @@ -11,7 +11,7 @@ import { useCreateResource, useUpdateResource } from 'hooks/Network/Resources'; import { Note } from 'models/Note'; import { Resource } from 'models/Resource'; import { INTERFACE_CAPTIVE_SCHEMA } from 'pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/interfacesConstants'; -import Captive from 'pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/Captive'; +import Captive from 'pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/Captive'; export const EDIT_SCHEMA = (t: (str: string) => string) => object().shape({ @@ -211,7 +211,7 @@ const InterfaceCaptiveResource = ({ - + diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/Captive.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/Captive.tsx deleted file mode 100644 index dcf53d03..00000000 --- a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/Captive.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import React from 'react'; -import { Heading, SimpleGrid, Switch, Text } from '@chakra-ui/react'; -import { INTERFACE_CAPTIVE_SCHEMA } from '../../interfacesConstants'; -import LockedCaptive from './LockedCaptive'; -import ConfigurationResourcePicker from 'components/CustomFields/ConfigurationResourcePicker'; -import NumberField from 'components/FormFields/NumberField'; -import StringField from 'components/FormFields/StringField'; - -interface Props { - isDisabled?: boolean; - isActive: boolean; - namePrefix: string; - onToggle?: (e: React.ChangeEvent) => void; - variableBlockId?: string; -} - -const CaptiveForm = ( - { - isDisabled, - namePrefix, - isActive, - onToggle, - variableBlockId - }: Props -) => (<> - - Captive Portal - {onToggle !== undefined && ( - - )} - {onToggle !== undefined && isActive && ( - - )} - - {variableBlockId !== undefined && } - {variableBlockId === undefined && isActive && ( - - - - - - - - - - )} -); - -export default React.memo(CaptiveForm); diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/index.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/index.tsx deleted file mode 100644 index 01a1a3aa..00000000 --- a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/index.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { useCallback, useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; -import { INTERFACE_CAPTIVE_SCHEMA } from '../../interfacesConstants'; -import CaptiveForm from './Captive'; -import useFastField from 'hooks/useFastField'; - -const Captive = ({ editing, index }: { editing: boolean; index: number }) => { - const { t } = useTranslation(); - const { value, onChange } = useFastField({ name: `configuration[${index}].captive` }); - - const { isActive, variableBlock } = useMemo( - () => ({ - isActive: value !== undefined, - isUsingCustom: value !== undefined && value.__variableBlock === undefined, - variableBlock: value?.__variableBlock, - }), - [value], - ); - - const onToggle = useCallback( - (e: React.ChangeEvent) => { - if (!e.target.checked) { - onChange(undefined); - } else { - onChange(INTERFACE_CAPTIVE_SCHEMA(t, true).cast()); - } - }, - [onChange], - ); - - return ( - - ); -}; - -export default React.memo(Captive); diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/AdvancedSettings.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/AdvancedSettings.tsx index 3a9b983e..b51311d2 100644 --- a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/AdvancedSettings.tsx +++ b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/AdvancedSettings.tsx @@ -3,6 +3,7 @@ import { Flex, Heading, SimpleGrid } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import { INTERFACE_SSID_MULTIPSK_SCHEMA, NO_MULTI_PROTOS } from '../../interfacesConstants'; import AccessControlList from './AccessControlList'; +import Captive from './Captive'; import RateLimit from './RateLimit'; import Roaming from './Roaming'; import Rrm from './Rrm'; @@ -187,6 +188,7 @@ const AdvancedSettings: React.FC<{ editing: boolean; namePrefix: string }> = ({ + diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/Captive.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/Captive.tsx new file mode 100644 index 00000000..a0939a42 --- /dev/null +++ b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/Captive.tsx @@ -0,0 +1,152 @@ +import React from 'react'; +import { Heading, Select, SimpleGrid, Text } from '@chakra-ui/react'; +import { useTranslation } from 'react-i18next'; +import { object, string } from 'yup'; +import CreatableSelectField from 'components/FormFields/CreatableSelectField'; +import FileInputFieldModal from 'components/FormFields/FileInputFieldModal'; +import NumberField from 'components/FormFields/NumberField'; +import ObjectArrayFieldModal from 'components/FormFields/ObjectArrayFieldModal'; +import SelectField from 'components/FormFields/SelectField'; +import StringField from 'components/FormFields/StringField'; + +const CREDENTIALS_SCHEMA = (t: (str: string) => string, useDefault = false) => { + const shape = object().shape({ + username: string().required(t('form.required')).default(''), + password: string().required(t('form.required')).default(''), + }); + + return useDefault ? shape : shape.nullable().default(undefined); +}; + +interface Props { + isDisabled?: boolean; + namePrefix: string; + onAuthModeChange?: (e: React.ChangeEvent) => void; + authMode?: string; +} + +const CaptiveForm = ({ isDisabled, namePrefix, onAuthModeChange, authMode }: Props) => { + const fieldProps = (suffix: string) => ({ + name: `${namePrefix}.${suffix}`, + label: suffix, + definitionKey: `interface.ssid.pass-point.${suffix}`, + isDisabled, + }); + const { t } = useTranslation(); + + const credFields = React.useMemo( + () => ( + + + + + ), + [], + ); + const credCols = React.useMemo( + () => [ + { + id: 'username', + Header: 'username', + Footer: '', + accessor: 'username', + }, + { + id: 'password', + Header: 'password', + Footer: '', + accessor: 'password', + }, + ], + [], + ); + + return ( + <> + + Captive Portal + + + {authMode !== undefined && ( + + + + true} + acceptedFileTypes=".tar" + isDisabled={isDisabled} + canDelete + isRequired + wantBase64 + /> + + + {authMode === 'credentials' && ( + + )} + {authMode === 'uam' && ( + <> + + + + + + + + + )} + {(authMode === 'radius' || authMode === 'uam') && ( + <> + + + + + + + + + )} + + )} + + ); +}; + +export default React.memo(CaptiveForm); diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/LockedCaptive.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/LockedCaptive.tsx similarity index 100% rename from src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/Captive/LockedCaptive.tsx rename to src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/LockedCaptive.tsx diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/index.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/index.tsx new file mode 100644 index 00000000..e81d72c2 --- /dev/null +++ b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/SsidList/Captive/index.tsx @@ -0,0 +1,54 @@ +import React from 'react'; +import CaptiveForm from './Captive'; +import useFastField from 'hooks/useFastField'; + +type Props = { + editing: boolean; + namePrefix: string; +}; + +const Captive = ({ editing, namePrefix }: Props) => { + const { value, onChange } = useFastField({ name: namePrefix }); + + const handleAuthModeChange = (e: React.ChangeEvent) => { + if (e.target.value === 'radius') { + onChange({ + 'idle-timeout': 600, + 'auth-mode': e.target.value, + 'auth-server': '192.168.1.10', + 'auth-secret': 'secret', + 'aut-port': 1812, + }); + } else if (e.target.value === 'uam') { + onChange({ + 'walled-garden-fqdn': [], + 'idle-timeout': 600, + 'auth-mode': e.target.value, + 'auth-server': '192.168.1.10', + 'auth-secret': 'secret', + 'aut-port': 1812, + 'uam-port': 3990, + 'uam-secret': 'secret', + 'uam-server': 'https://YOUR-LOGIN-ADDRESS.YOURS', + nasid: 'TestLab', + }); + } else if (e.target.value === 'none') { + onChange(undefined); + } else { + onChange({ 'idle-timeout': 600, 'auth-mode': e.target.value }); + } + }; + + const mode = value?.['auth-mode'] as string | undefined; + + return ( + + ); +}; + +export default React.memo(Captive); diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/index.tsx b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/index.tsx index a0945576..9281f57f 100644 --- a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/index.tsx +++ b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/SingleInterface/index.tsx @@ -2,7 +2,6 @@ import React, { useMemo } from 'react'; import { Box, Flex, Heading, SimpleGrid, Spacer } from '@chakra-ui/react'; import { FieldArray } from 'formik'; import { useTranslation } from 'react-i18next'; -import Captive from './Captive'; import InterfaceSelectPortsField from './InterfaceSelectPortsField'; import IpV4 from './IpV4'; import IpV6 from './IpV6'; @@ -140,7 +139,6 @@ const SingleInterface: React.FC = ({ editing, index, remove }) => { - {(arrayHelpers) => ( diff --git a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/interfacesConstants.js b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/interfacesConstants.js index b814b53f..8aa0bf4d 100644 --- a/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/interfacesConstants.js +++ b/src/pages/ConfigurationPage/ConfigurationCard/ConfigurationSectionsCard/InterfaceSection/interfacesConstants.js @@ -392,6 +392,132 @@ export const INTERFACE_SSID_RRM_SCHEMA = (t, useDefault = false) => { return useDefault ? shape : shape.nullable().default(undefined); }; +export const INTERFACE_CAPTIVE_SCHEMA = (t, useDefault = false) => { + const shape = object() + .shape({ + 'auto-mode': string().required(t('form.required')).default('click'), + 'walled-garden-fqdn': array() + .when('auth-mode', { + is: 'uam', + then: (schema) => schema.of(string()).min(1, t('form.required')), + }) + .default(undefined), + 'walled-garden-ipaddr': array().of(string()).default(undefined), + 'web-root': string().default(undefined), + 'idle-timeout': number().required(t('form.required')).positive().lessThan(65535).integer().default(600), + 'session-timeout': number().positive().lessThan(65535).integer().default(undefined), + // Only if auto-mode is "credentials" + credentials: array() + .when('auth-mode', { + is: 'credentials', + then: (schema) => + schema + .of( + object().shape({ + username: string().required(t('form.required')).default(''), + password: string().required(t('form.required')).default(''), + }), + ) + .min(1, t('form.required')), + }) + .default(undefined), + // Radius && UAM values + 'auth-server': string() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.required(t('form.required')).default(''), + }) + .default(undefined), + 'auth-secret': string() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.required(t('form.required')).default(''), + else: (schema) => schema.default(undefined), + }) + .default(undefined), + 'auth-port': number() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.required(t('form.required')).moreThan(1023).lessThan(65535).integer().default(1812), + else: (schema) => schema.default(undefined), + }) + .default(undefined), + 'acct-server': string() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.default(undefined), + else: (schema) => schema.default(undefined), + }) + .default(undefined), + 'acct-secret': string() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.default(undefined), + else: (schema) => schema.default(undefined), + }) + .default(undefined), + 'acct-port': number() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.moreThan(1023).lessThan(65535).integer().default(undefined), + else: (schema) => schema.default(undefined), + }) + .default(undefined), + 'acct-interval': number() + .when('auth-mode', { + is: (authMode) => authMode === 'radius' || authMode === 'uam', + then: (schema) => schema.positive().lessThan(65535).integer().default(undefined), + }) + .default(undefined), + // Only UAM fields + 'uam-server': string() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.required(t('form.required')).default(''), + }) + .default(undefined), + 'uam-secret': string() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.required(t('form.required')).default(''), + }) + .default(undefined), + 'uam-port': number() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.required(t('form.required')).moreThan(1023).lessThan(65535).integer().default(3990), + }) + .default(undefined), + ssid: string() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.default(undefined), + }) + .default(undefined), + 'mac-format': string() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.required(t('form.required')).default('aabbccddeeff'), + }) + .default(undefined), + nasid: string() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.required(t('form.required')).default(''), + }) + .default(undefined), + nasmac: string() + .when('auth-mode', { + is: (authMode) => authMode === 'uam', + then: (schema) => schema.default(undefined), + }) + .default(undefined), + }) + .default({}); + + return useDefault ? shape : shape.nullable().default(undefined); +}; + export const INTERFACE_SSID_SCHEMA = (t, useDefault = false) => { const shape = object().shape({ name: string() @@ -434,6 +560,7 @@ export const INTERFACE_SSID_SCHEMA = (t, useDefault = false) => { encryption: INTERFACE_SSID_ENCRYPTION_SCHEMA(t, useDefault), 'rate-limit': INTERFACE_SSID_RATE_LIMIT_SCHEMA(t), rrm: INTERFACE_SSID_RRM_SCHEMA(t), + captive: useDefault ? object().shape().nullable().default(undefined) : INTERFACE_CAPTIVE_SCHEMA(t, useDefault), 'access-control-list': INTERFACE_SSID_ACCESS_CONTROL_LIST_SCHEMA(t), roaming: INTERFACE_SSID_ROAMING_SCHEMA(t), radius: INTERFACE_SSID_RADIUS_SCHEMA(t), @@ -488,20 +615,6 @@ export const INTERFACE_IPV4_DHCP_LEASE_SCHEMA = (t, useDefault = false) => { return useDefault ? shape : shape.nullable().default(undefined); }; -export const INTERFACE_CAPTIVE_SCHEMA = (t, useDefault = false) => { - const shape = object().shape({ - 'gateway-name': string().default('uCentral - Captive Portal'), - 'gateway-fqdn': string().default('ucentral.splash'), - 'max-clients': number().moreThan(0).lessThan(65535).integer().default(32), - 'upload-rate': number().moreThan(-1).lessThan(65535).integer().default(0), - 'download-rate': number().moreThan(-1).lessThan(65535).integer().default(0), - 'upload-quota': number().moreThan(-1).lessThan(65535).integer().default(0), - 'download-quota': number().moreThan(-1).lessThan(65535).integer().default(0), - }); - - return useDefault ? shape : shape.nullable().default(undefined); -}; - export const INTERFACE_BRIDGE_SCHEMA = (t, useDefault = false) => { const shape = object() .shape({ @@ -756,7 +869,6 @@ export const SINGLE_INTERFACE_SCHEMA = ( : object().shape({ id: number().required(t('form.required')).moreThan(0).lessThan(4051).default(1080), }), - captive: initialCreation ? object().shape().nullable().default(undefined) : INTERFACE_CAPTIVE_SCHEMA(t, useDefault), ipv4: initialCreation ? object() .shape({ addressing: string().required(t('form.required')) })