Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#1535] improve(web): remove sweetalert2 (#1671)

CHEYNE946df5b67037
diff --git a/web/LICENSE.bin b/web/LICENSE.bin
index 3060f5efc9..0dbe39238f 100644
--- a/web/LICENSE.bin
+++ b/web/LICENSE.bin
@@ -362,7 +362,6 @@
stylis
supports-color
supports-preserve-symlinks-flag
- sweetalert2
throttle-debounce
tiny-case
to-fast-properties
diff --git a/web/lib/utils/axios/checkStatus.ts b/web/lib/utils/axios/checkStatus.ts
index 0c55d39de2..dc656353c9 100644
--- a/web/lib/utils/axios/checkStatus.ts
+++ b/web/lib/utils/axios/checkStatus.ts
@@ -28,7 +28,6 @@ SOFTWARE.
import type { ErrorMessageMode } from '@/types/axios'
import toast from 'react-hot-toast'
-import Swal from 'sweetalert2'
import { useRouter as Router } from 'next/navigation'
export function checkStatus(status: number, msg: string, errorMessageMode: ErrorMessageMode = 'message'): void {
@@ -97,7 +96,7 @@ export function checkStatus(status: number, msg: string, errorMessageMode: Error
if (errMessage) {
if (errorMessageMode === 'modal') {
- Swal.fire({ title: 'Error Tip', text: errMessage, icon: 'error' })
+ console.log({ title: 'Error Tip', text: errMessage, icon: 'error' })
} else if (errorMessageMode === 'message') {
toast.error(errMessage, { id: `global_error_message_status_${status}` })
}
diff --git a/web/lib/utils/axios/index.ts b/web/lib/utils/axios/index.ts
index a9d91abb59..3fd432c8e7 100644
--- a/web/lib/utils/axios/index.ts
+++ b/web/lib/utils/axios/index.ts
@@ -35,7 +35,6 @@ import type { AxiosTransform, CreateAxiosOptions } from './axiosTransform'
import { NextAxios } from './Axios'
import { checkStatus } from './checkStatus'
import toast from 'react-hot-toast'
-import Swal from 'sweetalert2'
import { RequestEnum, ResultEnum, ContentTypeEnum } from '@/lib/enums/httpEnum'
import { isString, isUndefined, isNull, isEmpty } from '@/lib/utils/is'
import { setObjToUrlParams, deepMerge } from '@/lib/utils'
@@ -82,7 +81,7 @@ const transform: AxiosTransform = {
}
if (options.successMessageMode === 'modal') {
- Swal.fire({ title: 'Success Tip', text: successMsg, icon: 'success' })
+ console.log({ title: 'Success Tip', text: successMsg, icon: 'success' })
} else if (options.successMessageMode === 'message') {
toast.success(successMsg)
}
@@ -104,7 +103,7 @@ const transform: AxiosTransform = {
}
if (options.errorMessageMode === 'modal') {
- timeoutMsg && Swal.fire({ title: 'Error Tip', text: timeoutMsg, icon: 'error' })
+ timeoutMsg && console.log({ title: 'Error Tip', text: timeoutMsg, icon: 'error' })
} else if (options.errorMessageMode === 'message') {
timeoutMsg && toast.error(timeoutMsg)
}
@@ -211,7 +210,7 @@ const transform: AxiosTransform = {
if (errMessage) {
if (errorMessageMode === 'modal') {
- Swal.fire({ title: 'Error Tip', text: errMessage, icon: 'error' })
+ console.log({ title: 'Error Tip', text: errMessage, icon: 'error' })
} else if (errorMessageMode === 'message') {
toast.error(errMessage)
}
diff --git a/web/licenses/sweetalert2.txt b/web/licenses/sweetalert2.txt
deleted file mode 100644
index 388ef23743..0000000000
--- a/web/licenses/sweetalert2.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Tristan Edwards & Limon Monte
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/web/package.json b/web/package.json
index e6d4a4782f..3c4ce973c6 100644
--- a/web/package.json
+++ b/web/package.json
@@ -42,7 +42,6 @@
"react-hot-toast": "^2.4.1",
"react-redux": "^8.1.3",
"react-use": "^17.4.1",
- "sweetalert2": "^11.10.2",
"yup": "^1.3.2"
},
"devDependencies": {
diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml
index 43f366e20a..84e4a21aa1 100644
--- a/web/pnpm-lock.yaml
+++ b/web/pnpm-lock.yaml
@@ -74,9 +74,6 @@ dependencies:
react-use:
specifier: ^17.4.1
- sweetalert2:
- specifier: ^11.10.2
- version: 11.10.2
yup:
specifier: ^1.3.2
version: 1.3.3
@@ -3625,10 +3622,6 @@ packages:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
- resolution: {integrity: sha512-BYlIxGw6OF9Rw2z1wlnh1U+fvHHkvtg4BGyimV9nZxQRGvCBfx9uonxgwuYpJuYqCtM+2W1KOm8iMIEb/2v7Hg==}
- dev: false
-
resolution: {integrity: sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==}
engines: {node: '>=14.0.0'}