From 0314bcd5a6442ab4d09ed2baf265ed360978ce8d Mon Sep 17 00:00:00 2001 From: Maciej Wasilewski Date: Wed, 27 Nov 2024 13:59:35 +0100 Subject: [PATCH] [#69247] frontend: Introduce option to specify update policy for an RDFM group --- frontend/src/assets/popup.css | 2 +- frontend/src/common/utils.ts | 1 + frontend/src/components/SimpleDropdown.vue | 106 +++++++++++++ frontend/src/components/groups/GroupsList.vue | 142 +++++++++++++++++- frontend/src/components/groups/groups.ts | 57 +++++++ 5 files changed, 302 insertions(+), 6 deletions(-) create mode 100644 frontend/src/components/SimpleDropdown.vue diff --git a/frontend/src/assets/popup.css b/frontend/src/assets/popup.css index c15c121..494298e 100644 --- a/frontend/src/assets/popup.css +++ b/frontend/src/assets/popup.css @@ -16,7 +16,7 @@ top: 50vh; transform: translate(-50%, -50%); padding: 2em; - width: 35vw; + width: max(35vw, 300px); & > .header { font-family: 'Inter', sans-serif; diff --git a/frontend/src/common/utils.ts b/frontend/src/common/utils.ts index ed7f008..1bc7d8e 100644 --- a/frontend/src/common/utils.ts +++ b/frontend/src/common/utils.ts @@ -39,6 +39,7 @@ export const REGISTER_DEVICE_ENDPOINT = `${SERVER_URL}/api/v1/auth/register`; export const GROUPS_ENDPOINT = `${SERVER_URL}/api/v2/groups`; export const DELETE_GROUP_ENDPOINT = (id: number) => `${GROUPS_ENDPOINT}/${id}`; export const UPDATE_GROUP_PRIORITY_ENDPOINT = (id: number) => `${GROUPS_ENDPOINT}/${id}/priority`; +export const UPDATE_GROUP_POLICY_ENDPOINT = (id: number) => `${GROUPS_ENDPOINT}/${id}/policy`; export const PATCH_DEVICES_IN_GROUP_ENDPOINT = (id: number) => `${GROUPS_ENDPOINT}/${id}/devices`; export const ASSIGN_PACKAGE_IN_GROUP_ENDPOINT = (id: number) => `${GROUPS_ENDPOINT}/${id}/package`; diff --git a/frontend/src/components/SimpleDropdown.vue b/frontend/src/components/SimpleDropdown.vue new file mode 100644 index 0000000..b43fb9f --- /dev/null +++ b/frontend/src/components/SimpleDropdown.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/frontend/src/components/groups/GroupsList.vue b/frontend/src/components/groups/GroupsList.vue index 5139743..ac31aaa 100644 --- a/frontend/src/components/groups/GroupsList.vue +++ b/frontend/src/components/groups/GroupsList.vue @@ -90,10 +90,28 @@ Component wraps functionality for displaying and working with rdfm groups. :columns="packageDropdownColumns" :data="packageList" :select="selectPackage" - :toggleDropdown="() => toggleDropdown(0)" + :toggleDropdown="() => toggleDropdown(DropDownOpen.Packages)" :dropdownOpen="packageDropdownOpen" /> +
+

Update policy

+
+ +

+ The selected update policy will not affect any device in this group +

+
+
+

Devices

@@ -224,6 +242,12 @@ Component wraps functionality for displaying and working with rdfm groups.