From c04bb35390b3bd06e425dc8cead7cd92df2dd478 Mon Sep 17 00:00:00 2001 From: Miri <122939076+MiriSafra@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:25:38 +0300 Subject: [PATCH 1/5] :sparkles: Update stakeholder groups table to use ActionsColumn (#2095) Addition ActionsColumn to Stakeholder groups table Relates to https://github.com/konveyor/tackle2-ui/issues/1318 UI tests PR: 1222 Signed-off-by: MiriSafra --- .../pages/controls/stakeholder-groups/stakeholder-groups.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/app/pages/controls/stakeholder-groups/stakeholder-groups.tsx b/client/src/app/pages/controls/stakeholder-groups/stakeholder-groups.tsx index 6cae4e9c37..ff8d016298 100644 --- a/client/src/app/pages/controls/stakeholder-groups/stakeholder-groups.tsx +++ b/client/src/app/pages/controls/stakeholder-groups/stakeholder-groups.tsx @@ -39,7 +39,6 @@ import { } from "@app/queries/stakeholdergroups"; import { NotificationsContext } from "@app/components/NotificationsContext"; import { StakeholderGroupForm } from "./components/stakeholder-group-form"; -import { AppTableActionButtons } from "@app/components/AppTableActionButtons"; import { ConditionalRender } from "@app/components/ConditionalRender"; import { AppPlaceholder } from "@app/components/AppPlaceholder"; import { ConfirmDialog } from "@app/components/ConfirmDialog"; @@ -52,6 +51,7 @@ import { import { useLocalTableControls } from "@app/hooks/table-controls"; import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; import CubesIcon from "@patternfly/react-icons/dist/js/icons/cubes-icon"; +import { ControlTableActionButtons } from "../ControlTableActionButtons"; export const StakeholderGroups: React.FC = () => { const { t } = useTranslation(); @@ -284,7 +284,7 @@ export const StakeholderGroups: React.FC = () => { > {stakeholderGroup.stakeholders?.length} - setCreateUpdateModalState(stakeholderGroup) } From 9bd0b3be7a8ffe393fbff8a2c1ebf42dbbedf245 Mon Sep 17 00:00:00 2001 From: Radoslaw Szwajkowski Date: Fri, 4 Oct 2024 10:18:27 +0200 Subject: [PATCH 2/5] :sparkles: Extend filtering in the Set Target step (#2092) Added filters: 1. by name (freetext search) 2. by custom target (yes/no select) 3. by labels (multiselect) Resolves: https://issues.redhat.com/browse/MTA-3702 Signed-off-by: Radoslaw Szwajkowski --- .../analysis-wizard/set-targets.tsx | 54 ++++++++++++++++++- client/src/app/utils/rules-utils.ts | 4 +- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/client/src/app/pages/applications/analysis-wizard/set-targets.tsx b/client/src/app/pages/applications/analysis-wizard/set-targets.tsx index 3b255d375e..2842bbec8e 100644 --- a/client/src/app/pages/applications/analysis-wizard/set-targets.tsx +++ b/client/src/app/pages/applications/analysis-wizard/set-targets.tsx @@ -25,6 +25,8 @@ import { useLocalTableControls } from "@app/hooks/table-controls"; import { useSetting } from "@app/queries/settings"; import { AppPlaceholder } from "@app/components/AppPlaceholder"; import { StateError } from "@app/components/StateError"; +import { universalComparator } from "@app/utils/utils"; +import { toLabelValue } from "@app/utils/rules-utils"; interface SetTargetsProps { applications: Application[]; @@ -177,9 +179,12 @@ const SetTargetsInternal: React.FC = ({ tableName: "target-cards", items: targets, idProperty: "name", - initialFilterValues: { name: applicationProviders }, + initialFilterValues: { provider: applicationProviders }, columnNames: { name: "name", + provider: "provider", + custom: "custom", + labels: "labels", }, isFilterEnabled: true, isPaginationEnabled: false, @@ -200,11 +205,56 @@ const SetTargetsInternal: React.FC = ({ value: language, })), placeholderText: "Filter by language...", - categoryKey: "name", + categoryKey: "provider", title: "Languages", type: FilterType.multiselect, matcher: (filter, target) => !!target.provider?.includes(filter), }, + { + placeholderText: "Filter by name...", + categoryKey: "name", + title: "Name", + type: FilterType.search, + matcher: (filter, target) => + !!target.name?.toLowerCase().includes(filter.toLowerCase()), + }, + { + placeholderText: "Filter by custom target...", + categoryKey: "custom", + title: "Custom target", + type: FilterType.select, + selectOptions: [ + { value: "true", label: "Yes" }, + { value: "false", label: "No" }, + ], + matcher: (filter, target) => String(!!target.custom) === filter, + }, + { + selectOptions: unique( + targets + .flatMap(({ labels }) => labels ?? []) + .map(({ name, label }) => ({ + name, + label: toLabelValue(label), + })), + ({ label }) => label + ) + .map(({ label, name }) => ({ + value: label, + label: name, + chipLabel: label, + })) + .sort((a, b) => universalComparator(a.label, b.label)), + + placeholderText: "Filter by labels...", + categoryKey: "labels", + title: "Labels", + type: FilterType.multiselect, + matcher: (filter, target) => + (target.labels ?? []) + .map(({ label }) => toLabelValue(label)) + .includes(filter), + }, ], }); diff --git a/client/src/app/utils/rules-utils.ts b/client/src/app/utils/rules-utils.ts index e9bdb5f6ea..d133db8bef 100644 --- a/client/src/app/utils/rules-utils.ts +++ b/client/src/app/utils/rules-utils.ts @@ -105,6 +105,8 @@ interface ParsedLabel { labelValue: string; } +export const toLabelValue = (label?: string) => label?.split("=").pop() ?? ""; + export const getParsedLabel = (label: string | null): ParsedLabel => { if (label === null) { return { @@ -116,7 +118,7 @@ export const getParsedLabel = (label: string | null): ParsedLabel => { const char1 = label.indexOf("/") + 1; const char2 = label.lastIndexOf("="); const type = label.substring(char1, char2); - const value = label.split("=").pop(); + const value = toLabelValue(label); return { labelType: type || "", From 7d288bd970cc1834ae2104f05f69d47cdd5653bf Mon Sep 17 00:00:00 2001 From: Shevijacobson <139786296+Shevijacobson@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:43:17 +0300 Subject: [PATCH 3/5] :sparkles: Add edit icon with ActionColumns property in the Archetypes table (#2098) **Changes Made:** - Removed the edit action from the ActionsColumn. - Added a dedicated edit icon outside the ActionsColumn, providing a clearer and more focused user interface. Part of #1318 Before the change: ![Screenshot from 2024-09-29 10-24-26](https://github.com/user-attachments/assets/b0c23db6-a913-4361-9435-6c4ecc296643) After the change: ![Screenshot from 2024-09-29 10-28-03](https://github.com/user-attachments/assets/175e9d03-f1cd-48b9-b523-bb23b95d71be) --------- Signed-off-by: Shevijacobson Co-authored-by: Radoslaw Szwajkowski Co-authored-by: Scott Dickerson --- .../app/pages/archetypes/archetypes-page.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/client/src/app/pages/archetypes/archetypes-page.tsx b/client/src/app/pages/archetypes/archetypes-page.tsx index a6fe66f0d0..895b390230 100644 --- a/client/src/app/pages/archetypes/archetypes-page.tsx +++ b/client/src/app/pages/archetypes/archetypes-page.tsx @@ -17,6 +17,7 @@ import { ToolbarContent, ToolbarGroup, ToolbarItem, + Tooltip, } from "@patternfly/react-core"; import { Table, @@ -27,8 +28,7 @@ import { Td, ActionsColumn, } from "@patternfly/react-table"; -import { CubesIcon } from "@patternfly/react-icons"; - +import { CubesIcon, PencilAltIcon } from "@patternfly/react-icons"; import { AppPlaceholder } from "@app/components/AppPlaceholder"; import { ConditionalRender } from "@app/components/ConditionalRender"; import { FilterToolbar, FilterType } from "@app/components/FilterToolbar"; @@ -473,6 +473,17 @@ const Archetypes: React.FC = () => { } /> + {archetypeWriteAccess && ( + + +