diff --git a/packages/main/src/components/VariantManagement/ManageViewsDialog.tsx b/packages/main/src/components/VariantManagement/ManageViewsDialog.tsx
index e6ff040790b..36586fd8b5f 100644
--- a/packages/main/src/components/VariantManagement/ManageViewsDialog.tsx
+++ b/packages/main/src/components/VariantManagement/ManageViewsDialog.tsx
@@ -23,9 +23,11 @@ import { Bar } from '../../webComponents/Bar/index.js';
import { Button } from '../../webComponents/Button/index.js';
import type { DialogPropTypes } from '../../webComponents/Dialog/index.js';
import { Dialog } from '../../webComponents/Dialog/index.js';
-import type { InputDomRef } from '../../webComponents/index.js';
-import { Icon, Input } from '../../webComponents/index.js';
+import { Icon } from '../../webComponents/Icon/index.js';
+import type { InputDomRef } from '../../webComponents/Input/index.js';
+import { Input } from '../../webComponents/Input/index.js';
import { Table } from '../../webComponents/Table/index.js';
+import type { TablePropTypes } from '../../webComponents/Table/index.js';
import { TableHeaderCell } from '../../webComponents/TableHeaderCell/index.js';
import { TableHeaderRow } from '../../webComponents/TableHeaderRow/index.js';
import { FlexBox } from '../FlexBox/index.js';
@@ -90,7 +92,7 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
const headerRow = (
{showOnlyFavorites && }
-
+
{viewHeaderText}
{showShare && (
@@ -104,12 +106,11 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
)}
{showApplyAutomatically && (
-
+
{applyAutomaticallyHeaderText}
)}
- {showCreatedBy && {createdByHeaderText}}
-
+ {showCreatedBy && {createdByHeaderText}}
);
@@ -155,11 +156,12 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
}
};
const deletedTableRows = useRef(new Set([]));
- const handleDelete = (e) => {
- deletedTableRows.current.add(e.target.dataset.children);
+ const handleDelete: TablePropTypes['onRowActionClick'] = (e) => {
+ const variantChild = e.detail.row.dataset.id;
+ deletedTableRows.current.add(variantChild);
setChildrenProps((prev) =>
prev
- .filter((item) => item.children !== e.target.dataset.children)
+ .filter((item) => item.children !== variantChild)
.map((item) => {
if (Object.prototype.hasOwnProperty.call(changedTableRows.current, item.children)) {
return { ...item, ...changedTableRows.current[item.children] };
@@ -260,7 +262,12 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
/>
}
>
-
+
{filteredProps.map((itemProps) => {
return (
{
changedVariantNames={changedVariantNames}
variantNames={variantNames}
handleRowChange={handleTableRowChange}
- handleDelete={handleDelete}
defaultView={defaultView}
setDefaultView={setDefaultView}
showShare={showShare}
diff --git a/packages/main/src/components/VariantManagement/ManageViewsTableRows.tsx b/packages/main/src/components/VariantManagement/ManageViewsTableRows.tsx
index dcd92324c86..a536691dc37 100644
--- a/packages/main/src/components/VariantManagement/ManageViewsTableRows.tsx
+++ b/packages/main/src/components/VariantManagement/ManageViewsTableRows.tsx
@@ -1,4 +1,3 @@
-import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
import IconMode from '@ui5/webcomponents/dist/types/IconMode.js';
import ValueState from '@ui5/webcomponents-base/dist/types/ValueState.js';
import declineIcon from '@ui5/webcomponents-icons/dist/decline.js';
@@ -20,14 +19,19 @@ import {
VIEW,
} from '../../i18n/i18n-defaults.js';
import { trimAndRemoveSpaces } from '../../internal/utils.js';
-import { Button, CheckBox, Icon, Input, RadioButton, TableCell, TableRow } from '../../webComponents/index.js';
+import { CheckBox } from '../../webComponents/CheckBox/index.js';
+import { Icon } from '../../webComponents/Icon/index.js';
+import { Input } from '../../webComponents/Input/index.js';
+import { RadioButton } from '../../webComponents/RadioButton/index.js';
+import { TableCell } from '../../webComponents/TableCell/index.js';
+import { TableRow } from '../../webComponents/TableRow/index.js';
+import { TableRowAction } from '../../webComponents/TableRowAction/index.js';
import { Text } from '../../webComponents/Text/index.js';
import type { VariantItemPropTypes } from './VariantItem.js';
interface ManageViewsTableRowsProps extends Partial {
variantNames: string[];
handleRowChange: (e: Event, payload: any) => void;
- handleDelete: (e: any) => void;
defaultView: string;
setDefaultView: (view: string) => void;
showShare: boolean;
@@ -46,7 +50,6 @@ export const ManageViewsTableRows = (props: ManageViewsTableRowsProps) => {
changedVariantNames,
setChangedVariantNames,
handleRowChange,
- handleDelete,
defaultView,
setDefaultView,
showShare,
@@ -170,7 +173,11 @@ export const ManageViewsTableRows = (props: ManageViewsTableRowsProps) => {
);
};
return (
-
+ }
+ >
{showOnlyFavorites && (
{isDefault ? (
@@ -213,18 +220,6 @@ export const ManageViewsTableRows = (props: ManageViewsTableRowsProps) => {
{author}
)}
-
- {!(hideDelete ?? global) && (
-
- )}
-
);
};
diff --git a/packages/main/src/components/VariantManagement/VariantManagement.cy.tsx b/packages/main/src/components/VariantManagement/VariantManagement.cy.tsx
index be212091eb2..38c0d222205 100644
--- a/packages/main/src/components/VariantManagement/VariantManagement.cy.tsx
+++ b/packages/main/src/components/VariantManagement/VariantManagement.cy.tsx
@@ -659,11 +659,12 @@ describe('VariantManagement', () => {
cy.get('[icon="navigation-down-arrow"]').click();
cy.findByText('Manage').click();
- cy.get('[ui5-button][tooltip="Delete View"]').each(($btn) => {
- if ($btn[0].getAttribute('data-children') !== 'VariantItem 3') {
- cy.wrap($btn).click();
+ cy.get('[ui5-table-row-action][text="Delete View"]').each(($action) => {
+ if ($action.parent().attr('data-id') !== 'VariantItem 3') {
+ cy.wrap($action).click();
}
});
+
cy.findByText('Save').click();
cy.get('@saveView').should('have.been.calledOnce');
cy.findByText(
diff --git a/packages/main/src/components/VariantManagement/index.tsx b/packages/main/src/components/VariantManagement/index.tsx
index e1c88757446..dd6ca6874e7 100644
--- a/packages/main/src/components/VariantManagement/index.tsx
+++ b/packages/main/src/components/VariantManagement/index.tsx
@@ -244,6 +244,7 @@ const VariantManagement = forwardRef
}
if (deletedRows.has(castChild.props.children)) {
callbackProperties.deletedVariants.push(castChild.props);
+ deletedRows.delete(castChild.props.children);
return false;
}
if (Object.keys(updatedProps).length > 0) {
diff --git a/packages/main/src/webComponents/Table/Table.stories.tsx b/packages/main/src/webComponents/Table/Table.stories.tsx
index a0605419d2b..e3e1246cc32 100644
--- a/packages/main/src/webComponents/Table/Table.stories.tsx
+++ b/packages/main/src/webComponents/Table/Table.stories.tsx
@@ -297,8 +297,8 @@ export const withRowActions: Story = {
key={`${row.name}-${row.age}`}
actions={
<>
- Edit
- Save
+
+
>
}