Skip to content

Commit 420116c

Browse files
authored
chore: Frontend update sweetalert2 (#4727)
1 parent 50a6583 commit 420116c

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"redux-persist": "^6.0.0",
134134
"redux-query-sync": "^0.1.10",
135135
"sass-loader": "^9.0.2",
136-
"sweetalert2": "^11.4.0, <11.4.9",
136+
"sweetalert2": "^11.22.4",
137137
"sweetalert2-react-content": "^4.2.0",
138138
"timezone-mock": "^1.3.0",
139139
"true-myth": "~5.2.0",

public/app/ui/Modals/index.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,27 @@ const ShowModal = async ({
4848
validationMessage,
4949
inputValidator,
5050
}: ShowModalParams) => {
51-
const { isConfirmed, value } = await Swal.fire({
51+
const baseOptions = {
5252
title,
5353
html,
5454
confirmButtonText,
55-
input,
56-
inputLabel,
57-
inputPlaceholder,
58-
inputValue,
59-
validationMessage,
60-
inputValidator,
6155
confirmButtonColor: getButtonStyleFromType(type),
6256
...defaultParams,
63-
});
57+
};
58+
59+
const options = input
60+
? {
61+
...baseOptions,
62+
input,
63+
inputLabel,
64+
inputPlaceholder,
65+
inputValue,
66+
validationMessage,
67+
inputValidator,
68+
}
69+
: baseOptions;
70+
71+
const { isConfirmed, value } = await Swal.fire(options as SweetAlertOptions);
6472

6573
if (isConfirmed) {
6674
onConfirm(value);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9978,10 +9978,10 @@ sweetalert2-react-content@^4.2.0:
99789978
resolved "https://registry.yarnpkg.com/sweetalert2-react-content/-/sweetalert2-react-content-4.2.0.tgz#ab4a6e02e37150dd0ea34d00179ec76952e3f442"
99799979
integrity sha512-eB324swnq10UJH8nAH2S6GHuAKDgH6GpGU8vI+ulYdmlPzpb0T5QPc7O4RFNRx28GzVZUnfvtpxZbKtZ5/KOnQ==
99809980

9981-
"sweetalert2@^11.4.0, <11.4.9":
9982-
version "11.4.8"
9983-
resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.4.8.tgz#f436eb34107c5637a0278fa7330edc722090ebbb"
9984-
integrity sha512-BDS/+E8RwaekGSxCPUbPnsRAyQ439gtXkTF/s98vY2l9DaVEOMjGj1FaQSorfGREKsbbxGSP7UXboibL5vgTMA==
9981+
sweetalert2@^11.22.4:
9982+
version "11.26.17"
9983+
resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.26.17.tgz#be5dd2a9b8d1c3b2672de4de4d172e62f7be3a6d"
9984+
integrity sha512-kkaySn1IRfwNlf9AkZVqDmBINDWw9NRR6Ij0O5dBRBOD1+mbtZJWxxR9/pA90nce9E5tIIkJ7SWij4rMWXtA1g==
99859985

99869986
synckit@^0.8.5:
99879987
version "0.8.5"

0 commit comments

Comments
 (0)