Skip to content

Commit

Permalink
Change text from 'Regular CV' to CV
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 authored and quba42 committed Jan 10, 2025
1 parent 8d68c30 commit 2cfe5b5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
14 changes: 10 additions & 4 deletions webpack/scenes/ContentViews/Create/CreateContentViewForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { LabelDependencies, LabelAutoPublish } from './ContentViewFormComponents
import ContentViewIcon from '../components/ContentViewIcon';
import './CreateContentViewForm.scss';

export const contentViewDescriptions = {
CV: 'Contains repositories. Versions are published and optionally filtered.',
CCV: 'Contains content views. You must choose the version to use for each content view.',
RCV: 'Contains repositories. Always serves the latest synced content, without the need to publish versions.',
};

const CreateContentViewForm = ({ setModalOpen }) => {
const dispatch = useDispatch();
const [name, setName] = useState('');
Expand Down Expand Up @@ -140,11 +146,11 @@ const CreateContentViewForm = ({ setModalOpen }) => {
aria-label="component_tile"
icon={<ContentViewIcon composite={false} rolling={false} />}
id="component"
title={__('Regular content view')}
title={__('Content view')}
onClick={() => { setComponent(true); setComposite(false); setRolling(false); }}
isSelected={component}
>
{__('Contains a set of versioned and optionally filtered repositories')}
{__(contentViewDescriptions.CV)}
</Tile>
</GridItem>
<GridItem span={4}>
Expand All @@ -158,7 +164,7 @@ const CreateContentViewForm = ({ setModalOpen }) => {
onClick={() => { setComposite(true); setComponent(false); setRolling(false); }}
isSelected={composite}
>
{__('Contains a set of regular content views')}
{__(contentViewDescriptions.CCV)}
</Tile>
</GridItem>
<GridItem span={4}>
Expand All @@ -172,7 +178,7 @@ const CreateContentViewForm = ({ setModalOpen }) => {
onClick={() => { setComposite(false); setComponent(false); setRolling(true); }}
isSelected={rolling}
>
{__('Contains a set of repositories that always contain the latest synced content')}
{__(contentViewDescriptions.RCV)}
</Tile>
</GridItem>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test('Displays dependent fields correctly', () => {
expect(getByText('Name')).toBeInTheDocument();
expect(getByText('Label')).toBeInTheDocument();
expect(getByText('Composite content view')).toBeInTheDocument();
expect(getByText('Regular content view')).toBeInTheDocument();
expect(getByText('Content view')).toBeInTheDocument();
expect(getByText('Rolling content view')).toBeInTheDocument();
expect(getByText('Solve dependencies')).toBeInTheDocument();
expect(queryByText('Auto publish')).not.toBeInTheDocument();
Expand Down
4 changes: 2 additions & 2 deletions webpack/scenes/ContentViews/Details/ContentViewInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const ContentViewInfo = ({ cvId, details }) => {
if (val === details[attribute]) return;
dispatch(updateContentView(cvId, { [attribute]: val }));
};
let iconText = __('Regular');
if (composite) { iconText = __('Composite'); } else if (rolling) { iconText = __('Rolling'); }
let iconText = __('Content view');
if (composite) { iconText = __('Composite content view'); } else if (rolling) { iconText = __('Rolling content view'); }

return (
<TextContent className="margin-0-24">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test('Can edit text details such as name', async (done) => {
act(done);
});

test('Page contains Regular CV type', async (done) => {
test('Page contains CV type', async (done) => {
const getscope = nockInstance
.get(cvDetailsPath)
.query(true)
Expand All @@ -99,9 +99,9 @@ test('Page contains Regular CV type', async (done) => {

// Wait for page to load
await patientlyWaitFor(() => {
expect(queryByText('Regular')).toBeInTheDocument();
expect(queryByText('Rolling')).not.toBeInTheDocument();
expect(queryByText('Composite')).not.toBeInTheDocument();
expect(queryByText('Content view')).toBeInTheDocument();
expect(queryByText('Rolling content view')).not.toBeInTheDocument();
expect(queryByText('Composite content view')).not.toBeInTheDocument();
expect(queryByText('Versions')).toBeInTheDocument();
expect(queryByText('Filters')).toBeInTheDocument();
expect(queryByText('History')).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ test('Page contains Rolling CV type', async (done) => {

// Wait for page to load
await patientlyWaitFor(() => {
expect(queryByText('Regular')).not.toBeInTheDocument();
expect(queryByText('Rolling')).toBeInTheDocument();
expect(queryByText('Composite')).not.toBeInTheDocument();
expect(queryByText('Content view')).not.toBeInTheDocument();
expect(queryByText('Rolling content view')).toBeInTheDocument();
expect(queryByText('Composite content view')).not.toBeInTheDocument();
expect(queryByText('Versions')).not.toBeInTheDocument();
expect(queryByText('Filters')).not.toBeInTheDocument();
expect(queryByText('History')).not.toBeInTheDocument();
Expand Down
6 changes: 3 additions & 3 deletions webpack/scenes/ContentViews/__tests__/contentViewPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ test('Can expand cv and show activation keys and hosts', async (done) => {
// Displays hosts link with count
expect(queryByLabelText('host_link_2')).toHaveAttribute('href', '/hosts?search=content_view_id+%3D+2');
expect(queryByLabelText('host_link_2').textContent).toEqual('1');
// Regular content views can be part of a composite content view
// Content views can be part of a composite content view
expect(queryByText(/Related composite content views:/)).toBeVisible();
});

Expand Down Expand Up @@ -174,7 +174,7 @@ test('Can show the correct options in CV kebap menu', async (done) => {
} = renderWithRedux(<ContentViewsPage />, renderOptions);

await patientlyWaitFor(() => {
// open kebap menu of regular content view, should contain all available action options
// open kebap menu of content view, should contain all available action options
getAllByLabelText('Actions')[0].click();
expect(getAllByLabelText('Actions')[0]).toHaveAttribute('aria-expanded', 'true');
expect(queryByText('Publish')).toBeVisible();
Expand Down Expand Up @@ -415,7 +415,7 @@ test('Displays Create Content View and opens modal with Form', async () => {
expect(getByText('Label')).toBeInTheDocument();
expect(getByText('Composite content view')).toBeInTheDocument();
expect(getByText('Rolling content view')).toBeInTheDocument();
expect(getByText('Regular content view')).toBeInTheDocument();
expect(getByText('Content view')).toBeInTheDocument();
expect(getByText('Solve dependencies')).toBeInTheDocument();
expect(queryByText('Auto publish')).not.toBeInTheDocument();
});
Expand Down
15 changes: 5 additions & 10 deletions webpack/scenes/ContentViews/components/ContentViewsCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Grid, GridItem, Flex, FlexItem, Tooltip } from '@patternfly/react-core'
import { InProgressIcon, OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import ContentViewIcon from './ContentViewIcon';
import { selectOrganizationState } from '../../Organizations/OrganizationSelectors';
import { contentViewDescriptions } from '../Create/CreateContentViewForm';

const ContentViewsCounter = () => {
const organization = useSelector(selectOrganizationState);
Expand All @@ -23,16 +24,14 @@ const ContentViewsCounter = () => {
<ContentViewIcon
composite={false}
rolling={false}
description={__('Regular content views')}
description={__('Content views')}
count={(component || component === 0) ? component : <InProgressIcon />}
/>
</FlexItem>
<FlexItem>
<Tooltip
position="top"
content={
__('Contains a set of versioned and optionally filtered repositories')
}
content={__(contentViewDescriptions.CV)}
>
<OutlinedQuestionCircleIcon />
</Tooltip>
Expand All @@ -53,9 +52,7 @@ const ContentViewsCounter = () => {
<FlexItem>
<Tooltip
position="top"
content={
__('Contains a set of regular content views')
}
content={__(contentViewDescriptions.CCV)}
>
<OutlinedQuestionCircleIcon />
</Tooltip>
Expand All @@ -76,9 +73,7 @@ const ContentViewsCounter = () => {
<FlexItem>
<Tooltip
position="top"
content={
__('Contains a set of repositories that always contain the latest synced content')
}
content={__(contentViewDescriptions.RCV)}
>
<OutlinedQuestionCircleIcon />
</Tooltip>
Expand Down

0 comments on commit 2cfe5b5

Please sign in to comment.