diff --git a/frontend/cypress/integration/common/graph_display.ts b/frontend/cypress/integration/common/graph_display.ts index d5ab658d85..87629a63fe 100644 --- a/frontend/cypress/integration/common/graph_display.ts +++ b/frontend/cypress/integration/common/graph_display.ts @@ -131,7 +131,6 @@ Then('the display menu has default settings', () => { cy.get(`input#trafficRate`).should('exist').should('not.be.checked'); cy.get(`input#boxByCluster`).should('exist').should('be.checked'); cy.get(`input#boxByNamespace`).should('exist').should('be.checked'); - cy.get(`input#filterHide`).should('exist').should('be.checked'); cy.get(`input#filterIdleEdges`).should('exist').should('not.be.checked'); cy.get(`input#filterIdleNodes`).should('exist').should('not.be.checked'); cy.get(`input#filterOperationNodes`).should('exist').should('not.be.checked'); diff --git a/frontend/cypress/integration/featureFiles/graph_display.feature b/frontend/cypress/integration/featureFiles/graph_display.feature index fe61ee63ca..b41118e0e9 100644 --- a/frontend/cypress/integration/featureFiles/graph_display.feature +++ b/frontend/cypress/integration/featureFiles/graph_display.feature @@ -8,7 +8,7 @@ Feature: Kiali Graph page - Display menu Background: Given user is at administrator perspective - # NOTE: Graph Find/Hide (compressOnHide) has its own test script + # NOTE: Graph Find/Hide has its own test script # NOTE: Operation nodes has its own test script # NOTE: Traffic animation, missing sidecars, virtual service, and idle edge options are nominally tested @@ -221,11 +221,11 @@ Feature: Kiali Graph page - Display menu Then user sees the "bookinfo" namespace And only a single cluster box should be visible Examples: - | type | - | APP | - | SERVICE | - | VERSIONED_APP| - | WORKLOAD | + | type | + | APP | + | SERVICE | + | VERSIONED_APP | + | WORKLOAD | @skip @multi-cluster @@ -243,8 +243,8 @@ Feature: Kiali Graph page - Display menu @multi-cluster Scenario: Remote nodes should be restricted if user does not have access rights to a remote namespace When user graphs "sleep" namespaces - And user "is" given access rights to a "sleep" namespace located in the "east" cluster - And user "is not" given access rights to a "sleep" namespace located in the "west" cluster + And user "is" given access rights to a "sleep" namespace located in the "east" cluster + And user "is not" given access rights to a "sleep" namespace located in the "west" cluster And user is at the details page for the "app" "sleep/east" located in the "east" cluster Then the nodes located in the "west" cluster should be restricted @@ -257,4 +257,3 @@ Feature: Kiali Graph page - Display menu And there is an Istio object in the "bookinfo" namespace for "east" cluster And there is an Istio object in the "bookinfo" namespace for "west" cluster Then the Istio objects for "bookinfo" should be grouped together in the panel - \ No newline at end of file diff --git a/frontend/src/actions/ActionKeys.ts b/frontend/src/actions/ActionKeys.ts index 0abb8db663..fb7f712127 100644 --- a/frontend/src/actions/ActionKeys.ts +++ b/frontend/src/actions/ActionKeys.ts @@ -26,7 +26,6 @@ export enum ActionKeys { // Toggle Actions GRAPH_TOOLBAR_TOGGLE_BOX_BY_CLUSTER = 'GRAPH_TOOLBAR_TOGGLE_BOX_BY_CLUSTER', GRAPH_TOOLBAR_TOGGLE_BOX_BY_NAMESPACE = 'GRAPH_TOOLBAR_TOGGLE_BOX_BY_NAMESPACE', - GRAPH_TOOLBAR_TOGGLE_COMPRESS_ON_HIDE = 'GRAPH_TOOLBAR_TOGGLE_COMPRESS_ON_HIDE', GRAPH_TOOLBAR_TOGGLE_GRAPH_VIRTUAL_SERVICES = 'GRAPH_TOOLBAR_TOGGLE_GRAPH_VIRTUAL_SERVICES', GRAPH_TOOLBAR_TOGGLE_GRAPH_MISSING_SIDECARS = 'GRAPH_TOOLBAR_TOGGLE_GRAPH_MISSING_SIDECARS', GRAPH_TOOLBAR_TOGGLE_GRAPH_SECURITY = 'GRAPH_TOOLBAR_TOGGLE_GRAPH_SECURITY', diff --git a/frontend/src/actions/GraphToolbarActions.ts b/frontend/src/actions/GraphToolbarActions.ts index 533414466f..a97f5dd358 100644 --- a/frontend/src/actions/GraphToolbarActions.ts +++ b/frontend/src/actions/GraphToolbarActions.ts @@ -15,7 +15,6 @@ export const GraphToolbarActions = { // Toggle actions toggleBoxByCluster: createAction(ActionKeys.GRAPH_TOOLBAR_TOGGLE_BOX_BY_CLUSTER), toggleBoxByNamespace: createAction(ActionKeys.GRAPH_TOOLBAR_TOGGLE_BOX_BY_NAMESPACE), - toggleCompressOnHide: createAction(ActionKeys.GRAPH_TOOLBAR_TOGGLE_COMPRESS_ON_HIDE), toggleLegend: createAction(ActionKeys.GRAPH_TOOLBAR_TOGGLE_LEGEND), toggleGraphVirtualServices: createAction(ActionKeys.GRAPH_TOOLBAR_TOGGLE_GRAPH_VIRTUAL_SERVICES), toggleGraphMissingSidecars: createAction(ActionKeys.GRAPH_TOOLBAR_TOGGLE_GRAPH_MISSING_SIDECARS), diff --git a/frontend/src/app/History.ts b/frontend/src/app/History.ts index 19f9b0a107..70d9bf21d6 100644 --- a/frontend/src/app/History.ts +++ b/frontend/src/app/History.ts @@ -42,7 +42,6 @@ export enum URLParam { GRAPH_BADGE_VS = 'badgeVS', GRAPH_BOX_CLUSTER = 'boxCluster', GRAPH_BOX_NAMESPACE = 'boxNamespace', - GRAPH_COMPRESS_ON_HIDE = 'graphCompressOnHide', GRAPH_EDGE_LABEL = 'edges', GRAPH_EDGE_MODE = 'edgeMode', GRAPH_FIND = 'graphFind', diff --git a/frontend/src/components/CytoscapeGraph/CytoscapeGraph.tsx b/frontend/src/components/CytoscapeGraph/CytoscapeGraph.tsx index f74cd8b983..5d0ca371a4 100644 --- a/frontend/src/components/CytoscapeGraph/CytoscapeGraph.tsx +++ b/frontend/src/components/CytoscapeGraph/CytoscapeGraph.tsx @@ -48,7 +48,6 @@ import { PeerAuthentication } from 'types/IstioObjects'; import { ServiceDetailsInfo } from 'types/ServiceInfo'; type CytoscapeGraphProps = { - compressOnHide: boolean; containerClassName?: string; contextMenuEdgeComponent?: EdgeContextMenuComponentType; contextMenuNodeComponent?: NodeContextMenuComponentType; @@ -204,7 +203,6 @@ export class CytoscapeGraph extends React.Component
{ dataSource.on('fetchSuccess', () => { const wrapper = shallow( = (props: GraphHelpFind const preface = 'You can use the Find and Hide fields to highlight or hide graph edges and nodes. Each field accepts ' + 'expressions using the language described below. Preset expressions are available via the dropdown. ' + - 'Hide takes precedence when using Find and Hide together. Uncheck the "Compressed Hide" Display ' + - 'option for hidden elements to retain their space.'; + 'Hide takes precedence when using Find and Hide together. '; const edgeColumns: ThProps[] = [{ title: 'Expression' }, { title: 'Notes' }]; diff --git a/frontend/src/pages/Graph/GraphPage.tsx b/frontend/src/pages/Graph/GraphPage.tsx index 17f1dc502f..b862273d45 100644 --- a/frontend/src/pages/Graph/GraphPage.tsx +++ b/frontend/src/pages/Graph/GraphPage.tsx @@ -114,7 +114,6 @@ type ReduxStateProps = { activeTour?: TourInfo; boxByCluster: boolean; boxByNamespace: boolean; - compressOnHide: boolean; duration: DurationInSeconds; // current duration (dropdown) setting edgeLabels: EdgeLabelMode[]; edgeMode: EdgeMode; @@ -882,7 +881,6 @@ const mapStateToProps = (state: KialiAppState): ReduxStateProps => ({ activeTour: state.tourState.activeTour, boxByCluster: state.graph.toolbarState.boxByCluster, boxByNamespace: state.graph.toolbarState.boxByNamespace, - compressOnHide: state.graph.toolbarState.compressOnHide, duration: durationSelector(state), edgeLabels: edgeLabelsSelector(state), edgeMode: edgeModeSelector(state), diff --git a/frontend/src/pages/Graph/GraphToolbar/GraphFind.tsx b/frontend/src/pages/Graph/GraphToolbar/GraphFind.tsx index c2ec518601..305fca0efd 100644 --- a/frontend/src/pages/Graph/GraphToolbar/GraphFind.tsx +++ b/frontend/src/pages/Graph/GraphToolbar/GraphFind.tsx @@ -35,7 +35,6 @@ import { isValid } from 'utils/Common'; import { serverConfig } from '../../../config'; type ReduxProps = { - compressOnHide: boolean; edgeLabels: EdgeLabelMode[]; edgeMode: EdgeMode; findValue: string; @@ -209,8 +208,8 @@ export class GraphFindComponent extends React.Component { const selector = this.parseValue(this.props.hideValue, false); const checkRemovals = selector || this.props.edgeMode !== EdgeMode.ALL; @@ -595,32 +585,18 @@ export class GraphFindComponent extends React.Component :inside')); - if (emptyBoxes.length > 0) { - this.removedElements = this.removedElements.add(cy.remove(emptyBoxes)); - } else { - done = true; - } - } - } else { - // set the remaining hide-hits hidden - this.hiddenElements = hiddenElements; - this.hiddenElements.kialiStyle({ visibility: 'hidden' }); - // now subtract any visible boxes that don't have any visible children - let done = false; - while (!done) { - const emptyBoxes = cy.$('$node[isBox]:visible').subtract(cy.$('$node[isBox] > :visible')); - if (emptyBoxes.length > 0) { - emptyBoxes.kialiStyle({ visibility: 'hidden' }); - this.hiddenElements = this.hiddenElements.add(emptyBoxes); - } else { - done = true; - } + // set the remaining hide-hits hidden + this.hiddenElements = hiddenElements; + this.hiddenElements.kialiStyle({ visibility: 'hidden' }); + // now subtract any visible boxes that don't have any visible children + let done = false; + while (!done) { + const emptyBoxes = cy.$('$node[isBox]:visible').subtract(cy.$('$node[isBox] > :visible')); + if (emptyBoxes.length > 0) { + emptyBoxes.kialiStyle({ visibility: 'hidden' }); + this.hiddenElements = this.hiddenElements.add(emptyBoxes); + } else { + done = true; } } } @@ -628,12 +604,7 @@ export class GraphFindComponent extends React.Component 0; - if ( - hideChanged || - (compressOnHideChanged && checkRemovals) || - (hasRemovedElements && graphElementsChanged) || - edgeModeChanged - ) { + if (hideChanged || (hasRemovedElements && graphElementsChanged) || edgeModeChanged) { cy.emit('kiali-zoomignore', [true]); CytoscapeGraphUtils.runLayout(cy, this.props.layout, this.props.namespaceLayout).then(() => { // do nothing, defer to CytoscapeGraph.tsx 'onlayout' event handler @@ -1121,7 +1092,6 @@ export class GraphFindComponent extends React.Component ({ - compressOnHide: state.graph.toolbarState.compressOnHide, edgeLabels: edgeLabelsSelector(state), edgeMode: edgeModeSelector(state), findValue: findValueSelector(state), diff --git a/frontend/src/pages/Graph/GraphToolbar/GraphSettings.tsx b/frontend/src/pages/Graph/GraphToolbar/GraphSettings.tsx index 1cc7e86279..13f567ecd6 100644 --- a/frontend/src/pages/Graph/GraphToolbar/GraphSettings.tsx +++ b/frontend/src/pages/Graph/GraphToolbar/GraphSettings.tsx @@ -40,7 +40,6 @@ import { serverConfig } from '../../../config'; type ReduxStateProps = { boxByCluster: boolean; boxByNamespace: boolean; - compressOnHide: boolean; edgeLabels: EdgeLabelMode[]; rankBy: RankMode[]; showIdleEdges: boolean; @@ -60,7 +59,6 @@ type ReduxDispatchProps = { setRankBy: (rankBy: RankMode[]) => void; toggleBoxByCluster(): void; toggleBoxByNamespace(): void; - toggleCompressOnHide(): void; toggleGraphMissingSidecars(): void; toggleGraphSecurity(): void; toggleGraphVirtualServices(): void; @@ -143,13 +141,6 @@ class GraphSettingsComponent extends React.PureComponent ) }, - { - id: 'filterHide', - isChecked: compressOnHide, - labelText: 'Compressed Hide', - onChange: toggleCompressOnHide, - tooltip: ( -
- Compress the graph after graph-hide removes matching elements. Otherwise the graph maintains the space - consumed by the hidden elements. -
- ) - }, { id: 'filterIdleEdges', isChecked: showIdleEdges, @@ -1029,7 +999,6 @@ class GraphSettingsComponent extends React.PureComponent ({ boxByCluster: state.graph.toolbarState.boxByCluster, boxByNamespace: state.graph.toolbarState.boxByNamespace, - compressOnHide: state.graph.toolbarState.compressOnHide, edgeLabels: edgeLabelsSelector(state), showIdleEdges: state.graph.toolbarState.showIdleEdges, showIdleNodes: state.graph.toolbarState.showIdleNodes, @@ -1051,7 +1020,6 @@ const mapDispatchToProps = (dispatch: KialiDispatch): ReduxDispatchProps => { setRankBy: bindActionCreators(GraphToolbarActions.setRankBy, dispatch), toggleBoxByCluster: bindActionCreators(GraphToolbarActions.toggleBoxByCluster, dispatch), toggleBoxByNamespace: bindActionCreators(GraphToolbarActions.toggleBoxByNamespace, dispatch), - toggleCompressOnHide: bindActionCreators(GraphToolbarActions.toggleCompressOnHide, dispatch), toggleGraphMissingSidecars: bindActionCreators(GraphToolbarActions.toggleGraphMissingSidecars, dispatch), toggleGraphSecurity: bindActionCreators(GraphToolbarActions.toggleGraphSecurity, dispatch), toggleGraphVirtualServices: bindActionCreators(GraphToolbarActions.toggleGraphVirtualServices, dispatch), diff --git a/frontend/src/pages/Graph/GraphToolbar/__tests__/GraphFind.test.tsx b/frontend/src/pages/Graph/GraphToolbar/__tests__/GraphFind.test.tsx index df9f8dc0c6..f5c4ef610e 100644 --- a/frontend/src/pages/Graph/GraphToolbar/__tests__/GraphFind.test.tsx +++ b/frontend/src/pages/Graph/GraphToolbar/__tests__/GraphFind.test.tsx @@ -28,7 +28,6 @@ describe('Parse find value test', () => { toggleGraphSecurity={testHandler} toggleIdleNodes={testHandler} toggleRank={testHandler} - compressOnHide={false} layout={{ name: '' }} namespaceLayout={{ name: '' }} updateTime={0} diff --git a/frontend/src/pages/GraphPF/GraphPagePF.tsx b/frontend/src/pages/GraphPF/GraphPagePF.tsx index c315a00dbb..8e39d9fb4c 100644 --- a/frontend/src/pages/GraphPF/GraphPagePF.tsx +++ b/frontend/src/pages/GraphPF/GraphPagePF.tsx @@ -107,7 +107,6 @@ type ReduxStateProps = { activeTour?: TourInfo; boxByCluster: boolean; boxByNamespace: boolean; - compressOnHide: boolean; duration: DurationInSeconds; // current duration (dropdown) setting edgeLabels: EdgeLabelMode[]; edgeMode: EdgeMode; @@ -729,7 +728,6 @@ const mapStateToProps = (state: KialiAppState): ReduxStateProps => ({ activeTour: state.tourState.activeTour, boxByCluster: state.graph.toolbarState.boxByCluster, boxByNamespace: state.graph.toolbarState.boxByNamespace, - compressOnHide: state.graph.toolbarState.compressOnHide, duration: durationSelector(state), edgeLabels: edgeLabelsSelector(state), edgeMode: edgeModeSelector(state), diff --git a/frontend/src/reducers/GraphDataState.ts b/frontend/src/reducers/GraphDataState.ts index 0b53b113c3..588bca0ab6 100644 --- a/frontend/src/reducers/GraphDataState.ts +++ b/frontend/src/reducers/GraphDataState.ts @@ -20,7 +20,6 @@ export const INITIAL_GRAPH_STATE: GraphState = { toolbarState: { boxByCluster: true, boxByNamespace: true, - compressOnHide: true, edgeLabels: [], findValue: '', graphType: GraphType.VERSIONED_APP, @@ -148,12 +147,6 @@ export const GraphDataStateReducer = (state: GraphState = INITIAL_GRAPH_STATE, a boxByNamespace: !state.toolbarState.boxByNamespace }) }); - case getType(GraphToolbarActions.toggleCompressOnHide): - return updateState(state, { - toolbarState: updateState(state.toolbarState, { - compressOnHide: !state.toolbarState.compressOnHide - }) - }); case getType(GraphToolbarActions.toggleFindHelp): return updateState(state, { toolbarState: updateState(state.toolbarState, { diff --git a/frontend/src/reducers/__tests__/GraphDataState.test.ts b/frontend/src/reducers/__tests__/GraphDataState.test.ts index 7ef2598192..047e1cba0d 100644 --- a/frontend/src/reducers/__tests__/GraphDataState.test.ts +++ b/frontend/src/reducers/__tests__/GraphDataState.test.ts @@ -18,7 +18,6 @@ describe('GraphDataState', () => { toolbarState: { boxByCluster: true, boxByNamespace: true, - compressOnHide: true, edgeLabels: [], findValue: '', graphType: GraphType.VERSIONED_APP, diff --git a/frontend/src/store/Store.ts b/frontend/src/store/Store.ts index d674170324..10631ac772 100644 --- a/frontend/src/store/Store.ts +++ b/frontend/src/store/Store.ts @@ -57,7 +57,6 @@ export interface GraphToolbarState { // Toggle props boxByCluster: boolean; boxByNamespace: boolean; - compressOnHide: boolean; // dropdown props edgeLabels: EdgeLabelMode[]; // find props