Skip to content

Commit

Permalink
Merge pull request #965 from RedHatInsights/patch-detail-page
Browse files Browse the repository at this point in the history
feat: Template detail page
  • Loading branch information
leSamo authored Feb 28, 2023
2 parents 3ef909f + faf274d commit ddf4ea9
Show file tree
Hide file tree
Showing 20 changed files with 6,519 additions and 1,115 deletions.
37 changes: 36 additions & 1 deletion src/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default defineMessages({
description: 'regsiter page title',
defaultMessage: 'Patch'
},
labelsActions: {
id: 'labelsActions',
description: 'dropdown with actions label',
defaultMessage: 'Actions'
},
labelsApplicableSystemsCount: {
id: 'labelsApplicableSystemsCount',
description: 'applicable systems number label',
Expand Down Expand Up @@ -44,7 +49,7 @@ export default defineMessages({
labelsButtonRemoveTemplate: {
id: 'labelsButtonRemoveTemplate',
description: 'button label',
defaultMessage: 'Remove template'
defaultMessage: 'Delete template'
},
labelsCancel: {
id: 'labelsCancel',
Expand Down Expand Up @@ -146,6 +151,11 @@ export default defineMessages({
description: 'Label',
defaultMessage: 'Date'
},
labelsDelete: {
id: 'labelsDelete',
description: 'button label',
defaultMessage: 'Delete'
},
labelsDescription: {
id: 'labelsDescription',
description: 'Label',
Expand Down Expand Up @@ -492,6 +502,11 @@ export default defineMessages({
description: 'description of the patch template wizard',
defaultMessage: 'Schedule patch template '
},
templateDetailHeaderBreadcrumb: {
id: 'templateDetailHeaderBreadcrumb',
description: 'breadcrumb for template detail header',
defaultMessage: 'Content templates'
},
templateEdit: {
id: 'templateEdit',
description: 'step name of the patch template wizard',
Expand Down Expand Up @@ -692,6 +707,26 @@ export default defineMessages({
description: 'title with capital letters',
defaultMessage: 'Assign to a template'
},
titlesTemplateDeleteModalCheckbox: {
id: 'titlesTemplateDeleteModalCheckbox',
description: 'page title with capital letter',
defaultMessage: 'I understand that this action cannot be undone.'
},
titlesTemplateDeleteModalText: {
id: 'titlesTemplateDeleteModalText',
description: 'page title with capital letter',
defaultMessage: '<b>{templateName}</b> and all its data will be permanently deleted. Associated systems will be removed from the template but will not be deleted.'
},
titlesTemplateDeleteModalTitle: {
id: 'titlesTemplateDeleteModalTitle',
description: 'page title with capital letter',
defaultMessage: 'Delete template?'
},
titlesTemplateNoDescription: {
id: 'titlesTemplateNoDescription',
description: 'title with capital letters',
defaultMessage: 'No description available'
},
titlesTemplateRemoveMultipleButton: {
id: 'titlesTemplateRemoveMultipleButton',
description: 'title with capital letters',
Expand Down
18 changes: 14 additions & 4 deletions src/PresentationalComponents/Header/Header.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Split, SplitItem } from '@patternfly/react-core';
import {
PageHeader,
PageHeaderTitle
Expand All @@ -7,17 +8,25 @@ import React from 'react';
import HeaderBreadcrumbs from './HeaderBreadcrumbs';
import HeaderTabs from './HeaderTabs';

const Header = ({ title, showTabs, breadcrumbs, children, headerOUIA }) => {
const Header = ({ title, showTabs, breadcrumbs, children, headerOUIA, actions }) => {
return (
<React.Fragment>
<PageHeader
data-ouia-component-type={`${headerOUIA}-page-header`}
>
{breadcrumbs && <HeaderBreadcrumbs items={breadcrumbs} headerOUIA={headerOUIA} />}
<PageHeaderTitle title={title} />
<Split>
<SplitItem>
<PageHeaderTitle title={title} />
</SplitItem>
<SplitItem isFilled />
<SplitItem>
{actions}
</SplitItem>
</Split>
{children}
</PageHeader>
{showTabs && <HeaderTabs headerOUIA = {headerOUIA}/>}
{showTabs && <HeaderTabs headerOUIA={headerOUIA} />}
</React.Fragment>
);
};
Expand All @@ -27,7 +36,8 @@ Header.propTypes = {
showTabs: PropTypes.bool,
breadcrumbs: PropTypes.array,
children: PropTypes.any,
headerOUIA: PropTypes.string
headerOUIA: PropTypes.string,
actions: PropTypes.node
};

export default Header;
Loading

0 comments on commit ddf4ea9

Please sign in to comment.