Skip to content

Commit

Permalink
Refs #37752 - Patternfly 5 review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga committed Jan 6, 2025
1 parent 439a75c commit 858ab2f
Show file tree
Hide file tree
Showing 27 changed files with 104 additions and 92 deletions.
2 changes: 1 addition & 1 deletion webpack/ForemanColumnExtensions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const hostsIndexColumnExtensions = [
>
<FontAwesomeImageModeIcon title={__('Image mode')} />
</Popover>
: <span style={{ color: 'var(--pf-global--palette--black-600)' }}><RepoIcon type="yum" customTooltip={__('Package mode')} /></span>
: <span style={{ color: 'var(--pf-v5-global--palette--black-600)' }}><RepoIcon type="yum" customTooltip={__('Package mode')} /></span>
}
</span>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
}

.textInput-placeholder {
color: var(--pf-global--disabled-color--100);
color: var(--pf-v5-global--disabled-color--100);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.host-collection-card-body {
.pf-l-bullseye {
.pf-v5-l-bullseye {
position: relative;
top: -20px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { renderWithRedux, patientlyWaitFor, fireEvent,act } from 'react-testing-lib-wrapper';
import { renderWithRedux, patientlyWaitFor, fireEvent, act } from 'react-testing-lib-wrapper';
import mockAvailableHostCollections from './availableHostCollections.fixtures.json';
import mockRemovableHostCollections from './removableHostCollections.fixtures.json';
import { REMOVABLE_HOST_COLLECTIONS_KEY } from '../HostCollectionsConstants';
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('HostCollectionsAddModal', () => {
expect(getAllByText(firstHostCollection.name)[0]).toBeInTheDocument());
assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done(); // Pass jest callback to confirm test is done
done(); // Pass jest callback to confirm test is done
});

test('Calls alterHostCollections with combined list of existing and new host collections', async (done) => {
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('HostCollectionsAddModal', () => {
assertNockRequest(scope);
assertNockRequest(alterScope);
assertNockRequest(hostDetailsScope);
done();
done();
});
test('Host collections whose host limit is exceeded are disabled', async (done) => {
const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('HostCollectionsAddModal', () => {

assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done(); // Pass jest callback to confirm test is done
done(); // Pass jest callback to confirm test is done
});
});

Expand Down Expand Up @@ -176,7 +176,7 @@ describe('HostCollectionsRemoveModal', () => {
// Assert request was made and completed, see helper function
assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done(); // Pass jest callback to confirm test is done
done(); // Pass jest callback to confirm test is done
});

test('Calls alterHostCollections with host collections being removed filtered out from the list', async (done) => {
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('HostCollectionsRemoveModal', () => {
assertNockRequest(scope);
assertNockRequest(alterScope);
assertNockRequest(hostDetailsScope);
done();
done();
});
});

Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import {
FormSelectOption,
} from '@patternfly/react-core';

import {
Select,
SelectOption,
SelectVariant,
} from '@patternfly/react-core/deprecated';
import { FormattedMessage } from 'react-intl';
import { translate as __ } from 'foremanReact/common/I18n';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('SystemPurposeEditModal', () => {

assertNockRequest(orgScope);
assertNockRequest(availableReleaseVersionsScope);
done();
done();
});

test('Shows blank options as (unset)', () => {
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('SystemPurposeEditModal', () => {
assertNockRequest(scope);
});
assertNockRequest(hostDetailsScope);
done();
done();
});
test('Calls API and changes syspurpose values for activation key', async (done) => {
const orgScope = nockInstance
Expand Down Expand Up @@ -226,7 +226,7 @@ describe('SystemPurposeEditModal', () => {
assertNockRequest(scope);
});
assertNockRequest(akDetailsScope);
done();
done();
});
test('Retrieves available release versions for host', async (done) => {
const orgScope = nockInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export const ErrataTab = () => {
pfSortParams={pfSortParams}
columnsToSortParams={COLUMNS_TO_SORT_PARAMS}
/>
<Th key="action-menu" aria-label="action menu table header"/>
<Th key="action-menu" aria-label="action menu table header" />
</Tr>
</Thead>
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
SelectOption,
SelectVariant,
} from '@patternfly/react-core/deprecated';
import { TableVariant, Thead, Tbody, Tr, Th, Td, TableText, ActionsColumn} from '@patternfly/react-table';
import { TableVariant, Thead, Tbody, Tr, Th, Td, TableText, ActionsColumn } from '@patternfly/react-table';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';
import { HOST_DETAILS_KEY } from 'foremanReact/components/HostDetails/consts';
Expand Down Expand Up @@ -552,13 +552,19 @@ export const PackagesTab = () => {
isDisabled: actionInProgress,
},
{
title: <a href={katelloPackageUpdateUrl({
hostname,
packageName: selectedPackageUpgradeVersion({
packageName,
upgradableVersions,
}),
})}>{__('Upgrade via customized remote execution')}</a>,
title: (
<a
href={katelloPackageUpdateUrl({
hostname,
packageName: selectedPackageUpgradeVersion({
packageName,
upgradableVersions,
}),
})}
>
{__('Upgrade via customized remote execution')}
</a>
),
},
);
}
Expand Down Expand Up @@ -603,7 +609,8 @@ export const PackagesTab = () => {
items: rowActions,
}}
><ActionsColumn
actions={rowActions} />
actions={rowActions}
/>
</Td>
) : null}
</Tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const TracesTab = () => {
pfSortParams={pfSortParams}
columnsToSortParams={COLUMNS_TO_SORT_PARAMS}
/>
<Th key="action_menu" aria-label="action menu table header" />
<Th key="action_menu" aria-label="action menu table header" />
</Tr>
</Thead>
<Tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ test('Can apply a single erratum to the host via remote execution', async (done)
await act(async () => {
erratumActionMenu.click();
});

let viaRexAction;
await patientlyWaitFor(() => {
viaRexAction = getByText('Apply via remote execution');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { renderWithRedux, patientlyWaitFor, fireEvent, act, screen } from 'react-testing-lib-wrapper';
import { renderWithRedux, patientlyWaitFor, fireEvent, act } from 'react-testing-lib-wrapper';
import * as hooks from 'foremanReact/components/PF4/TableIndexPage/Table/TableHooks';
import { nockInstance, assertNockRequest, mockForemanAutocomplete } from '../../../../../test-utils/nockWrapper';
import { foremanApi } from '../../../../../services/api';
Expand Down Expand Up @@ -201,7 +201,7 @@ test('Can upgrade a package via remote execution', async (done) => {
await patientlyWaitFor(() => {
expect(getByText('coreutils')).toBeInTheDocument();
});

const kebabDropdown = getByLabelText('Kebab toggle');
await act(async () => {
kebabDropdown.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('With tracer installed', () => {
// Assert request was made and completed, see helper function
assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});

test('Can handle no traces being present', async (done) => {
Expand All @@ -101,7 +101,7 @@ describe('With tracer installed', () => {
// Assert request was made and completed, see helper function
assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});

test('Can bulk restart traces via Restart App button', async (done) => {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('With tracer installed', () => {
assertNockRequest(autocompleteScope);
assertNockRequest(resolveTracesScope);
assertNockRequest(scope);
done();
done();
});

test('Warns you when one of the selected traces requires reboot', async (done) => {
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('With tracer installed', () => {
});
assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});

test('Warns about reboot when using select all', async (done) => {
Expand Down Expand Up @@ -202,7 +202,7 @@ describe('With tracer installed', () => {
});
assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});

test('Can bulk restart traces via remote execution', async (done) => {
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('With tracer installed', () => {
fireEvent.click(traceCheckbox);
expect(traceCheckbox.checked).toEqual(true);
const actionMenu = getByLabelText('bulk_actions');

await act(async () => {
actionMenu.click();
});
Expand All @@ -243,7 +243,7 @@ describe('With tracer installed', () => {
assertNockRequest(autocompleteScope);
assertNockRequest(resolveTracesScope);
assertNockRequest(scope);
done();
done();
});

test('Can select all, exclude and bulk restart traces via remote execution', async (done) => {
Expand Down Expand Up @@ -277,23 +277,23 @@ describe('With tracer installed', () => {


const selectAllCheckbox = getByLabelText('Select all');
await act(async () => {

await act(async () => {
fireEvent.click(selectAllCheckbox);
});
expect(traceCheckbox.checked).toEqual(true);

fireEvent.click(getByLabelText('Select row 0')); // de select
fireEvent.click(getByLabelText('Select row 2')); // de select

await act(async () => {
await act(async () => {
fireEvent.click(getByText('Reboot host'));
});

assertNockRequest(autocompleteScope);
assertNockRequest(resolveTracesScope);
assertNockRequest(scope);
done();
done();
});

test('Can restart a single trace via remote execution', async (done) => {
Expand Down Expand Up @@ -332,7 +332,7 @@ describe('With tracer installed', () => {
assertNockRequest(autocompleteScope);
assertNockRequest(resolveTracesScope);
assertNockRequest(scope);
done();
done();
});

test('Can restart a single trace via customized remote execution', async (done) => {
Expand Down Expand Up @@ -369,7 +369,7 @@ describe('With tracer installed', () => {

assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});

test('Can bulk restart traces via customized remote execution', async (done) => {
Expand Down Expand Up @@ -405,7 +405,7 @@ describe('With tracer installed', () => {

assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});

describe('Remote execution URL helper logic', () => {
Expand Down Expand Up @@ -434,7 +434,7 @@ describe('With tracer installed', () => {

assertNockRequest(autocompleteScope);
assertNockRequest(scope);
done();
done();
});
});
});
Expand Down Expand Up @@ -478,7 +478,7 @@ describe('Without tracer installed', () => {
expect(queryByText('via remote execution')).not.toBeInTheDocument();

assertNockRequest(jobInvocationScope);
done();
done();
});

test('Detects if tracer package is not available to install', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ FontAwesomeImageModeIcon.propTypes = {
};

FontAwesomeImageModeIcon.defaultProps = {
fill: 'var(--pf-global--palette--black-600)',
fill: 'var(--pf-v5-global--palette--black-600)',
margin: '-2px',
title: __('Image mode'),
};
Expand Down
6 changes: 3 additions & 3 deletions webpack/containers/Application/overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ html .pagination-pf-pagesize.btn-group {
}

// Modal sizing fix
.pf-l-bullseye .pf-v5-c-modal-box {
.pf-v5-l-bullseye .pf-v5-c-modal-box {
margin-top: 76px;
max-height: calc(100vh - 76px);

Expand All @@ -137,11 +137,11 @@ html .pagination-pf-pagesize.btn-group {
margin: 0 8px;

svg {
color: var(--pf-global--Color--200)
color: var(--pf-v5-global--Color--200)
}

svg:hover {
color: var(--pf-global--Color--100)
color: var(--pf-v5-global--Color--100)
}
}

Expand Down
Loading

0 comments on commit 858ab2f

Please sign in to comment.