Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Templates): Update templates page header #960

Merged
merged 2 commits into from
Feb 15, 2023
Merged
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
4 changes: 2 additions & 2 deletions deploy/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ objects:
title: 'Packages'
href: '/insights/patch/packages'
- appId: 'patch'
title: 'Patch Template'
href: '/insights/patch/patch-template'
title: 'Templates'
href: '/insights/patch/templates'
module:
manifestLocation: "/apps/patch/fed-mods.json"
modules:
Expand Down
12 changes: 11 additions & 1 deletion src/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,16 @@ export default defineMessages({
description: 'validation text of the patch template wizard',
defaultMessage: 'At least one system must be selected. Actions must be associated to a system to be added to a playbook.'
},
templatePopoverBody: {
id: 'templatePopoverBody',
description: 'Template page header popover body',
defaultMessage: 'Templates allow you to control the scope of package and advisory updates to be installed on selected systems.'
},
templatePopoverHeader: {
id: 'templatePopoverHeader',
description: 'Template page header popover title',
defaultMessage: 'About Templates'
},
templateReview: {
id: 'templateReview',
description: 'step name of the patch template wizard',
Expand Down Expand Up @@ -670,7 +680,7 @@ export default defineMessages({
titlesTemplate: {
id: 'titlesTemplate',
description: 'page title with capital letter',
defaultMessage: 'Patch template'
defaultMessage: 'Templates'
},
titlesTemplateAssign: {
id: 'titlesTemplateAssign',
Expand Down
49 changes: 43 additions & 6 deletions src/SmartComponents/PatchSet/PatchSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import messages from '../../Messages';
import Header from '../../PresentationalComponents/Header/Header';
import searchFilter from '../../PresentationalComponents/Filters/SearchFilter';
import TableView from '../../PresentationalComponents/TableView/TableView';
import { fetchPatchSetsAction, changePatchSetsParams,
selectPatchSetRow, clearPatchSetsAction } from '../../store/Actions/Actions';
import {
fetchPatchSetsAction, changePatchSetsParams,
selectPatchSetRow, clearPatchSetsAction
} from '../../store/Actions/Actions';
import { deletePatchSet } from '../../Utilities/api';
import { createPatchSetRows } from '../../Utilities/DataMappers';
import { createSortBy, decodeQueryparams, encodeURLParams } from '../../Utilities/Helpers';
Expand All @@ -16,14 +18,18 @@ import {
} from '../../Utilities/Hooks';
import { intl } from '../../Utilities/IntlProvider';
import { clearNotifications, addNotification } from '@redhat-cloud-services/frontend-components-notifications/redux';
import { patchSetColumns, CreatePatchSetButton as createPatchSetButton,
patchSetRowActions, CustomActionsToggle } from './PatchSetAssets';
import {
patchSetColumns, CreatePatchSetButton as createPatchSetButton,
patchSetRowActions, CustomActionsToggle
} from './PatchSetAssets';
import PatchSetWizard from '../PatchSetWizard/PatchSetWizard';
import { patchSetDeleteNotifications } from '../../Utilities/constants';
import { patchSetDeleteNotifications, TEMPLATES_DOCS_LINK } from '../../Utilities/constants';
import usePatchSetState from '../../Utilities/usePatchSetState';
import { usePermissionsWithContext } from '@redhat-cloud-services/frontend-components-utilities/RBACHook';
import { useOnSelect, ID_API_ENDPOINTS } from '../../Utilities/useOnSelect';
import { NoSmartManagement } from '../../PresentationalComponents/Snippets/EmptyStates';
import { ExternalLinkAltIcon, OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { Popover } from '@patternfly/react-core';

const PatchSet = () => {
const pageTitle = intl.formatMessage(messages.titlesTemplate);
Expand Down Expand Up @@ -146,7 +152,38 @@ const PatchSet = () => {

return (
<React.Fragment>
<Header title={intl.formatMessage(messages.titlesTemplate)} headerOUIA={'advisories'} />
<Header
headerOUIA={'advisories'}
title={<span>
{intl.formatMessage(messages.titlesTemplate)}
<Popover
id="template-header-title-popover"
aria-describedby="template-header-title-popover"
aria-labelledby="template-header-title-popover"
hasAutoWidth
maxWidth="320px"
position="right"
enableFlip
headerContent={
intl.formatMessage(messages.templatePopoverHeader)
}
bodyContent={
intl.formatMessage(messages.templatePopoverBody)
}
footerContent={
<a href={TEMPLATES_DOCS_LINK} target="__blank" rel="noopener noreferrer">
{intl.formatMessage(messages.linksReadMore)} <ExternalLinkAltIcon />
</a>
}
>
<OutlinedQuestionCircleIcon
color="var(--pf-global--secondary-color--100)"
className="pf-u-ml-sm"
style={{ verticalAlign: '0', fontSize: 16, cursor: 'pointer' }}
/>
</Popover>
</span>}
/>
{patchSetState.isPatchSetWizardOpen &&
<PatchSetWizard
systemsIDs={patchSetState.systemsIDs}
Expand Down
Loading