Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions frontend/e2e/tests/console/nodes/node-groups-filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ function filterChips(page: Page) {

async function skipIfGroupsFilterDisabled(page: Page): Promise<void> {
if (!(await groupsFilter(page).isVisible().catch(() => false))) {
test.skip(true, 'FLAG_NODE_MGMT_V1 is not enabled');
test.skip(true, 'FLAG_OPENSHIFT_5 is not enabled');
}
}

async function skipIfEditGroupsButtonHidden(page: Page): Promise<void> {
const editButton = page.getByRole('button', { name: /edit groups/i });
if (!(await editButton.isVisible().catch(() => false))) {
test.skip(true, 'FLAG_NODE_MGMT_V1 is not enabled');
test.skip(true, 'FLAG_OPENSHIFT_5 is not enabled');
}
}

Expand All @@ -48,7 +48,7 @@ test.describe('Node Groups Filter', () => {
await gotoNodesPage(page);
});

test('should display the Groups filter when FLAG_NODE_MGMT_V1 is enabled', async ({ page }) => {
test('should display the Groups filter when FLAG_OPENSHIFT_5 is enabled', async ({ page }) => {
await skipIfGroupsFilterDisabled(page);

const groupsFilterButton = groupsFilter(page);
Expand Down Expand Up @@ -225,7 +225,7 @@ test.describe('Edit Groups Button', () => {
await gotoNodesPage(page);
});

test('should display Edit groups button in page header when FLAG_NODE_MGMT_V1 is enabled', async ({ page }) => {
test('should display Edit groups button in page header when FLAG_OPENSHIFT_5 is enabled', async ({ page }) => {
await skipIfEditGroupsButtonHidden(page);

const editButton = page.getByRole('button', { name: /edit groups/i });
Expand Down
39 changes: 0 additions & 39 deletions frontend/packages/console-app/console-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,6 @@
"handler": { "$codeRef": "usePerspectivesAvailable.usePerspectivesAvailable" }
}
},
{
"type": "console.flag/hookProvider",
"properties": {
"handler": { "$codeRef": "useNodeMgmtV1FlagProvider" }
},
"flags": {
"required": ["TECH_PREVIEW"]
}
},
{
"type": "console.user-preference/group",
"properties": {
Expand Down Expand Up @@ -733,36 +724,6 @@
"label": "%console-app~Applications%"
}
},
{
"type": "console.user-preference/group",
"properties": {
"id": "node-mgmt-v1",
"label": "%console-app~Node management%"
},
"flags": {
"required": ["TECH_PREVIEW"]
}
},
{
"type": "console.user-preference/item",
"properties": {
"id": "console.nodeMgmtV1.enabled",
"label": "%console-app~Node management%",
"groupId": "node-mgmt-v1",
"description": "%console-app~Enable node management enhancements. This is a technology preview feature.%",
"field": {
"type": "checkbox",
"userSettingsKey": "console.nodeMgmtV1.enabled",
"label": "%console-app~Enable node management enhancements%",
"trueValue": true,
"falseValue": false,
"defaultValue": true
}
},
"flags": {
"required": ["TECH_PREVIEW"]
}
},
{
"type": "console.user-preference/item",
"properties": {
Expand Down
3 changes: 0 additions & 3 deletions frontend/packages/console-app/locales/en/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@
"Edit YAML": "Edit YAML",
"Enable exact string match": "Enable exact string match",
"Enable exact string match filtering on resources.": "Enable exact string match filtering on resources.",
"Enable node management enhancements": "Enable node management enhancements",
"Enable node management enhancements. This is a technology preview feature.": "Enable node management enhancements. This is a technology preview feature.",
"Enabled": "Enabled",
"Encrypted": "Encrypted",
"Enhances contrast between interface elements for readability.": "Enhances contrast between interface elements for readability.",
Expand Down Expand Up @@ -490,7 +488,6 @@
"Node addresses": "Node addresses",
"Node conditions": "Node conditions",
"Node details": "Node details",
"Node management": "Node management",
"Node name": "Node name",
"Node remediation agents": "Node remediation agents",
"Node role {{role}}": "Node role {{role}}",
Expand Down
3 changes: 0 additions & 3 deletions frontend/packages/console-app/locales/es/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Language": "Idioma",
"Notifications": "Notificaciones",
"Applications": "Aplicaciones",
"Node management": "Gestión de nodos",
"Enable node management enhancements. This is a technology preview feature.": "Habilitar mejoras en la administración de nodos. Esta es una función en fase de vista previa tecnológica.",
"Enable node management enhancements": "Habilitar mejoras en la gestión de nodos",
"Theme": "Tema",
"Console will appear as per the selected theme.": "La consola aparecerá según el tema seleccionado.",
"System default": "Sistema por defecto",
Expand Down
3 changes: 0 additions & 3 deletions frontend/packages/console-app/locales/fr/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Language": "Langue",
"Notifications": "Notifications",
"Applications": "Applications",
"Node management": "Gestion des nœuds",
"Enable node management enhancements. This is a technology preview feature.": "Activer les améliorations de la gestion des nœuds. Il s'agit d'une fonctionnalité en avant-première.",
"Enable node management enhancements": "Activer les améliorations de la gestion des nœuds",
"Theme": "Thème",
"Console will appear as per the selected theme.": "L’apparence de la console dépendra du thème sélectionné.",
"System default": "Valeur par défaut du système",
Expand Down
3 changes: 0 additions & 3 deletions frontend/packages/console-app/locales/ja/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Language": "言語",
"Notifications": "通知",
"Applications": "アプリケーション",
"Node management": "ノード管理",
"Enable node management enhancements. This is a technology preview feature.": "ノード管理の機能拡張を有効にします。これはテクノロジープレビュー機能です。",
"Enable node management enhancements": "ノード管理の機能拡張を有効にする",
"Theme": "テーマ",
"Console will appear as per the selected theme.": "選択したテーマに従ってコンソールが表示されます。",
"System default": "システムのデフォルト",
Expand Down
3 changes: 0 additions & 3 deletions frontend/packages/console-app/locales/ko/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Language": "언어",
"Notifications": "알림",
"Applications": "애플리케이션",
"Node management": "노드 관리",
"Enable node management enhancements. This is a technology preview feature.": "노드 관리 기능을 활성화합니다. 이 기능은 기술 프리뷰 기능입니다.",
"Enable node management enhancements": "노드 관리 개선 사항 활성화",
"Theme": "테마",
"Console will appear as per the selected theme.": "선택한 테마에 따라 콘솔이 나타납니다.",
"System default": "시스템 기본값",
Expand Down
3 changes: 0 additions & 3 deletions frontend/packages/console-app/locales/zh/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Language": "语言",
"Notifications": "通知",
"Applications": "应用程序",
"Node management": "节点管理",
"Enable node management enhancements. This is a technology preview feature.": "启用节点管理增强功能。这是一个技术预览功能。",
"Enable node management enhancements": "启用节点管理增强",
"Theme": "主题",
"Console will appear as per the selected theme.": "控制台将根据所选主题显示。",
"System default": "系统默认",
Expand Down
1 change: 0 additions & 1 deletion frontend/packages/console-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"getConsoleOperatorConfigFlag": "src/hooks/useCanGetConsoleOperatorConfig.ts",
"techPreviewFlag": "src/features/tech-preview.ts",
"usePerspectivesAvailable": "src/components/user-preferences/perspective/usePerspectivesAvailable.ts",
"useNodeMgmtV1FlagProvider": "src/hooks/useNodeMgmtV1FlagProvider.ts",
"defaultProvider": "src/actions/providers/default-provider.ts",
"OperatorStatus": "src/components/dashboards-page/OperatorStatus.tsx",
"dashboardsActivity": "src/components/dashboards-page/activity.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC, ComponentProps } from 'react';
import { useCallback } from 'react';
import { FLAG_NODE_MGMT_V1 } from '@console/app/src/consts';
import { FLAG_OPENSHIFT_5 } from '@console/app/src/consts';
import { ResourceEventStream } from '@console/internal/components/events';
import { DetailsPage } from '@console/internal/components/factory';
import { PodsPage } from '@console/internal/components/pod-list';
Expand Down Expand Up @@ -72,19 +72,19 @@ const eventsTab = navFactory.events(ResourceEventStream);
const terminalTab = navFactory.terminal(NodeTerminal);

export const NodeDetailsPage: FC<ComponentProps<typeof DetailsPage>> = (props) => {
const nodeMgmtV1Enabled = useFlag(FLAG_NODE_MGMT_V1);
const isOpenShift5 = useFlag(FLAG_OPENSHIFT_5);

const pagesFor = useCallback(
(node: NodeKind) => {
const tabs = nodeMgmtV1Enabled
const tabs = isOpenShift5
? [overviewTab, detailsTab, configurationTab, healthTab, workloadTab, yamlTab]
: [overviewTab, detailsTab, yamlTab, podsTab, logsTab, eventsTab];
if (!isWindowsNode(node)) {
tabs.push(terminalTab);
}
return tabs;
},
[nodeMgmtV1Enabled],
[isOpenShift5],
);

const customActionMenu = (kindObj: K8sModel, obj: NodeKind) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, ButtonVariant, Tooltip } from '@patternfly/react-core';
import { useTranslation } from 'react-i18next';
import GroupsEditorModal from '@console/app/src/components/nodes/modals/GroupsEditorModal';
import NodeGroupsEditorModal from '@console/app/src/components/nodes/modals/NodeGroupsEditorModal';
import { FLAG_NODE_MGMT_V1 } from '@console/app/src/consts';
import { FLAG_OPENSHIFT_5 } from '@console/app/src/consts';
import { useAccessReview } from '@console/dynamic-plugin-sdk/src';
import { useOverlay } from '@console/dynamic-plugin-sdk/src/app/modal-support/useOverlay';
import { useFlag } from '@console/dynamic-plugin-sdk/src/utils/flags';
Expand All @@ -17,15 +17,15 @@ type NodeGroupEditButtonProps = {
const NodeGroupEditButton: FC<NodeGroupEditButtonProps> = ({ node }) => {
const { t } = useTranslation('console-app');
const launchOverlay = useOverlay();
const nodeMgmtV1Enabled = useFlag(FLAG_NODE_MGMT_V1);
const isOpenShift5 = useFlag(FLAG_OPENSHIFT_5);

const [canEdit, isEditLoading] = useAccessReview({
group: NodeModel.apiGroup || '',
resource: NodeModel.plural,
verb: 'patch',
});

if (!nodeMgmtV1Enabled) {
if (!isOpenShift5) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { LogViewer, LogViewerSearch } from '@patternfly/react-log-viewer';
import { css } from '@patternfly/react-styles';
import { Trans, useTranslation } from 'react-i18next';
import { FLAG_NODE_MGMT_V1 } from '@console/app/src/consts';
import { FLAG_OPENSHIFT_5 } from '@console/app/src/consts';
import { useFlag } from '@console/dynamic-plugin-sdk/src/utils/flags';
import { useTheme } from '@console/internal/components/ThemeProvider';
import { SectionHeading } from '@console/internal/components/utils';
Expand Down Expand Up @@ -179,7 +179,7 @@ const HeaderBanner: FC<{ lineCount: number }> = ({ lineCount }) => {

const NodeLogs: FC<NodeLogsProps> = ({ obj: node }) => {
const { getQueryArgument, setQueryArgument, removeQueryArgument } = useQueryParamsMutator();
const nodeMgmtV1Enabled = useFlag(FLAG_NODE_MGMT_V1);
const isOpenShift5 = useFlag(FLAG_OPENSHIFT_5);

const {
kind,
Expand Down Expand Up @@ -373,7 +373,7 @@ const NodeLogs: FC<NodeLogsProps> = ({ obj: node }) => {

return (
<PaneBody fullHeight>
{nodeMgmtV1Enabled ? <SectionHeading text={t('Logs')} /> : null}
{isOpenShift5 ? <SectionHeading text={t('Logs')} /> : null}
<div className="log-window-wrapper">
{(isLoadingLog || errorExists) && logControls}
{(lineCount >= MAX_LINE_COUNT || trimmedContent?.length > 0) && !isLoadingLog && (
Expand Down
22 changes: 11 additions & 11 deletions frontend/packages/console-app/src/components/nodes/NodesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type {
} from '@console/app/src/components/data-view/types';
import { useDataViewSelection } from '@console/app/src/components/data-view/useDataViewSelection';
import { useColumnWidthSettings } from '@console/app/src/components/data-view/useResizableColumnProps';
import { FLAG_NODE_MGMT_V1 } from '@console/app/src/consts';
import { FLAG_OPENSHIFT_5 } from '@console/app/src/consts';
import type { K8sModel } from '@console/dynamic-plugin-sdk/src/api/core-api';
import {
getGroupVersionKindForResource,
Expand Down Expand Up @@ -176,7 +176,7 @@ const kind = 'Node';

const useNodesColumns = (
vmsEnabled: boolean,
nodeMgmtV1Enabled: boolean,
isOpenShift5: boolean,
): { columns: TableColumn<NodeRowItem>[]; resetAllColumnWidths: () => void } => {
const { t } = useTranslation('console-app');
const { getResizableProps, getWidth, resetAllColumnWidths } = useColumnWidthSettings(NodeModel);
Expand Down Expand Up @@ -204,7 +204,7 @@ const useNodesColumns = (
modifier: 'nowrap',
},
},
...(nodeMgmtV1Enabled
...(isOpenShift5
? [
{
title: t('Groups'),
Expand Down Expand Up @@ -385,7 +385,7 @@ const useNodesColumns = (
},
},
];
}, [t, getResizableProps, nodeMgmtV1Enabled, vmsEnabled, isAdmin, getWidth]);
}, [t, getResizableProps, isOpenShift5, vmsEnabled, isAdmin, getWidth]);

return { columns, resetAllColumnWidths };
};
Expand Down Expand Up @@ -679,7 +679,7 @@ type NodeListProps = {
hideLabelFilter?: boolean;
hideColumnManagement?: boolean;
selectedColumns?: TableColumnsType;
nodeMgmtV1Enabled?: boolean;
isOpenShift5?: boolean;
};

const NodeList: FC<NodeListProps> = ({
Expand All @@ -694,10 +694,10 @@ const NodeList: FC<NodeListProps> = ({
hideLabelFilter,
hideColumnManagement,
selectedColumns,
nodeMgmtV1Enabled = false,
isOpenShift5 = false,
}) => {
const { t } = useTranslation('console-app');
const { columns, resetAllColumnWidths } = useNodesColumns(vmsEnabled, nodeMgmtV1Enabled);
const { columns, resetAllColumnWidths } = useNodesColumns(vmsEnabled, isOpenShift5);
const nodeMetrics = useConsoleSelector<NodeMetrics>(({ UI }) => UI.getIn(['metrics', 'node']));
const columnManagementID = referenceForModel(NodeModel);
const statusExtensions = useNodeStatusExtensions();
Expand Down Expand Up @@ -864,7 +864,7 @@ const NodeList: FC<NodeListProps> = ({
placeholder={t('Filter by roles')}
options={nodeRoleFilterOptions}
/>,
...(nodeMgmtV1Enabled
...(isOpenShift5
? [
<DataViewCheckboxFilter
key="groups"
Expand Down Expand Up @@ -905,7 +905,7 @@ const NodeList: FC<NodeListProps> = ({
nodeArchitectureFilterOptions,
machineSetFilterOptions,
machineConfigPoolFilterOptions,
nodeMgmtV1Enabled,
isOpenShift5,
],
);

Expand Down Expand Up @@ -1042,7 +1042,7 @@ const useWatchResourcesIfAllowed = <R extends K8sResourceCommon[]>(
export const NodesPage: FC<NodesPageProps> = ({ selector }) => {
const dispatch = useConsoleDispatch();
const { t } = useTranslation('console-app');
const nodeMgmtV1Enabled = useFlag(FLAG_NODE_MGMT_V1);
const isOpenShift5 = useFlag(FLAG_OPENSHIFT_5);

const [selectedColumns, , columnPreferenceLoaded] = useUserPreference<TableColumnsType>(
COLUMN_MANAGEMENT_USER_PREFERENCE_KEY,
Expand Down Expand Up @@ -1185,7 +1185,7 @@ export const NodesPage: FC<NodesPageProps> = ({ selector }) => {
machineConfigPools={machineConfigPools}
vmsEnabled={isKubevirtPluginActive}
selectedColumns={selectedColumns}
nodeMgmtV1Enabled={nodeMgmtV1Enabled}
isOpenShift5={isOpenShift5}
/>
</ListPageBody>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('NodeDetailsPage', () => {
jest.clearAllMocks();
});

it('should include health tab when FLAG_NODE_MGMT_V1 is enabled', () => {
it('should include health tab when FLAG_OPENSHIFT_5 is enabled', () => {
useFlag.mockReturnValue(true);
isWindowsNode.mockReturnValue(false);

Expand All @@ -108,7 +108,7 @@ describe('NodeDetailsPage', () => {
expect(healthTab.nameKey).toBe('console-app~Health');
});

it('should not include health tab when FLAG_NODE_MGMT_V1 is disabled', () => {
it('should not include health tab when FLAG_OPENSHIFT_5 is disabled', () => {
useFlag.mockReturnValue(false);
isWindowsNode.mockReturnValue(false);

Expand Down Expand Up @@ -147,7 +147,7 @@ describe('NodeDetailsPage', () => {
expect(terminalTab).toBeUndefined();
});

it('should include configuration and workload tabs when FLAG_NODE_MGMT_V1 enabled', () => {
it('should include configuration and workload tabs when FLAG_OPENSHIFT_5 enabled', () => {
useFlag.mockReturnValue(true);
isWindowsNode.mockReturnValue(false);

Expand All @@ -168,7 +168,7 @@ describe('NodeDetailsPage', () => {
expect(logsTab).toBeUndefined();
});

it('should include events and logs tabs when FLAG_NODE_MGMT_V1 disabled', () => {
it('should include events and logs tabs when FLAG_OPENSHIFT_5 disabled', () => {
useFlag.mockReturnValue(false);
isWindowsNode.mockReturnValue(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('NodeLogs', () => {
jest.clearAllMocks();
});

it('should render SectionHeading when FLAG_NODE_MGMT_V1 is enabled', async () => {
it('should render SectionHeading when FLAG_OPENSHIFT_5 is enabled', async () => {
useFlag.mockReturnValue(true);

render(<NodeLogs obj={mockNode} />);
Expand All @@ -94,7 +94,7 @@ describe('NodeLogs', () => {
expect(heading).toHaveTextContent('Logs');
});

it('should not render SectionHeading when FLAG_NODE_MGMT_V1 is disabled', async () => {
it('should not render SectionHeading when FLAG_OPENSHIFT_5 is disabled', async () => {
useFlag.mockReturnValue(false);

render(<NodeLogs obj={mockNode} />);
Expand Down
Loading