From e9f7ea4da166c10691fe92ef47fd538dec06228e Mon Sep 17 00:00:00 2001 From: Miroslav Lisik Date: Tue, 25 Jan 2022 15:19:13 +0100 Subject: [PATCH] Resolves: rhbz#2044409 - Fixed cluster destroy in web ui - Fixed covscan issue in web ui --- ...end-parameter-all-in-cluster-destroy.patch | 23 ++++++++++++++++ pcs.spec | 11 +++++++- simplify-ternar-expression.patch | 26 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 bz2044409-01-fix-backend-parameter-all-in-cluster-destroy.patch create mode 100644 simplify-ternar-expression.patch diff --git a/bz2044409-01-fix-backend-parameter-all-in-cluster-destroy.patch b/bz2044409-01-fix-backend-parameter-all-in-cluster-destroy.patch new file mode 100644 index 0000000..1131d7f --- /dev/null +++ b/bz2044409-01-fix-backend-parameter-all-in-cluster-destroy.patch @@ -0,0 +1,23 @@ +From fa75f40361bc39cbd645b8014713e4c0ad0cda18 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Mon, 24 Jan 2022 14:08:54 +0100 +Subject: [PATCH 2/2] fix backend parameter "all" in cluster destroy + +--- + src/app/backend/calls/destroyCluster.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/app/backend/calls/destroyCluster.ts b/src/app/backend/calls/destroyCluster.ts +index b6e83a41..cf41ea42 100644 +--- a/src/app/backend/calls/destroyCluster.ts ++++ b/src/app/backend/calls/destroyCluster.ts +@@ -4,5 +4,5 @@ const { url } = endpoints.destroyCluster; + + export const destroyCluster = (clusterName: string): CallResult => + http.post(url({ clusterName }), { +- params: [["--all", "1"]], ++ params: [["all", "1"]], + }); +-- +2.31.1 + diff --git a/pcs.spec b/pcs.spec index d660987..ba4cad1 100644 --- a/pcs.spec +++ b/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.11.1 -Release: 8%{?dist} +Release: 9%{?dist} # https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ # https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses # GPLv2: pcs @@ -122,6 +122,8 @@ Patch1: do-not-support-cluster-setup-with-udp-u-transport.patch # ui patches: >200 # Patch201: bzNUMBER-01-name.patch +Patch201: simplify-ternar-expression.patch +Patch202: bz2044409-01-fix-backend-parameter-all-in-cluster-destroy.patch # git for patches BuildRequires: git-core @@ -297,6 +299,8 @@ update_times_patch(){ %autosetup -D -T -b 100 -a 101 -S git -n %{ui_src_name} -N %autopatch -p1 -m 201 # update_times_patch %%{PATCH201} +update_times_patch %{PATCH201} +update_times_patch %{PATCH202} # patch pcs sources %autosetup -S git -n %{pcs_source_name} -N @@ -549,6 +553,11 @@ run_all_tests %license pyagentx_LICENSE.txt %changelog +* Tue Jan 25 2022 Miroslav Lisik - 0.11.1-9 +- Fixed cluster destroy in web ui +- Fixed covscan issue in web ui +- Resolves: rhbz#2044409 + * Fri Jan 14 2022 Miroslav Lisik - 0.11.1-8 - Fixed 'pcs resource move' command - Fixed removing of unavailable fence-scsi storage device diff --git a/simplify-ternar-expression.patch b/simplify-ternar-expression.patch new file mode 100644 index 0000000..0835fbd --- /dev/null +++ b/simplify-ternar-expression.patch @@ -0,0 +1,26 @@ +From f44cdc871a39da3960bd04565b4d1d5ffa19bd23 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Thu, 20 Jan 2022 13:32:49 +0100 +Subject: [PATCH 1/2] simplify ternar expression + +The motivation for this is that covscan complains about it. +--- + src/app/view/share/useUrlTabs.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/app/view/share/useUrlTabs.ts b/src/app/view/share/useUrlTabs.ts +index 7278dad8..a1136bf3 100644 +--- a/src/app/view/share/useUrlTabs.ts ++++ b/src/app/view/share/useUrlTabs.ts +@@ -13,7 +13,7 @@ export const useUrlTabs = >( + + return { + currentTab, +- matchedContext: tab !== null ? tab.matched : `/${defaultTab}`, ++ matchedContext: tab?.matched ?? `/${defaultTab}`, + tabList, + }; + }; +-- +2.31.1 +