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

HMS-5203: Remove template patch banner #398

Merged
merged 3 commits into from
Dec 20, 2024
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
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default [
'react/react-in-jsx-scope': 'off',
camelcase: 'off',
'spaced-comment': 'error',
quotes: ['warn', 'single'],
'prettier/prettier': ['warn', { singleQuote: true }],
'no-duplicate-imports': 'error',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': ['warn'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const SnapshotListModal = () => {
{!checkedSnapshots.size || !rbac?.repoWrite
? 'Remove selected snapshots'
: checkedSnapshots.size == count
? 'Can\'t remove all snapshots'
? `Can't remove all snapshots`
: `Remove ${checkedSnapshots.size} snapshots`}
</Button>
</ConditionalTooltip>
Expand Down Expand Up @@ -398,7 +398,7 @@ const SnapshotListModal = () => {
<ConditionalTooltip
content={
count < 2
? 'You can\'t delete the last snapshot in a repository'
? `You can't delete the last snapshot in a repository`
: 'You do not have the required permissions to perform this action.'
}
show={!isRedHatRepository && (!rbac?.repoWrite || count < 2)}
Expand Down
41 changes: 1 addition & 40 deletions src/Pages/Templates/TemplatesTable/TemplatesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
Alert,
AlertActionCloseButton,
Button,
Flex,
FlexItem,
Expand Down Expand Up @@ -36,12 +34,7 @@ import TemplateFilters from './components/TemplateFilters';
import { formatDateDDMMMYYYY, formatDateUTC } from 'helpers';
import Header from 'components/Header/Header';
import useRootPath from 'Hooks/useRootPath';
import {
DELETE_ROUTE,
DETAILS_ROUTE,
PATCH_SYSTEMS_ROUTE,
TEMPLATES_ROUTE,
} from 'Routes/constants';
import { DELETE_ROUTE, DETAILS_ROUTE, TEMPLATES_ROUTE } from 'Routes/constants';
import useArchVersion from 'Hooks/useArchVersion';
import { useTemplateList } from 'services/Templates/TemplateQueries';
import StatusIcon from './components/StatusIcon';
Expand Down Expand Up @@ -96,15 +89,6 @@ const TemplatesTable = () => {
const [polling, setPolling] = useState(false);
const [pollCount, setPollCount] = useState(0);

const basePath = rootPath.slice(1).replace('content', '');
const storedBannerDismissal = !!sessionStorage.getItem('bannerDismissal');
const [dismissed, setDismissed] = useState(storedBannerDismissal);

const onDismissBanner = () => {
sessionStorage.setItem('bannerDismissal', 'true');
setDismissed(true);
};

const defaultValues: TemplateFilterData = {
arch: '',
version: '',
Expand Down Expand Up @@ -234,29 +218,6 @@ const TemplatesTable = () => {
ouiaId='templates_description'
paragraph='View all content templates within your organization.'
/>
<Hide hide={dismissed}>
<Grid className={classes.bannerContainer}>
<Alert
variant='info'
title='Content templates is currently in preview'
actionClose={<AlertActionCloseButton onClose={onDismissBanner} />}
>
<p>
<b>Note:</b>{' '}
<Button
isInline
variant='link'
component='a'
href={`${basePath}${PATCH_SYSTEMS_ROUTE}`}
>
Systems within Patch
</Button>{' '}
might not properly indicate which template is assigned to a system or which updates
are installable.
</p>
</Alert>
</Grid>
</Hide>
<Grid data-ouia-component-id='content_template_list_page' className={classes.mainContainer}>
<Outlet />
<Flex className={classes.topContainer}>
Expand Down
17 changes: 9 additions & 8 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ export default function Header({ title, ouiaId, paragraph }: Props) {

return (
<PageHeader>
<PageHeaderTitle title={
<>
{title}
<OpenSourceBadge
repositoriesURL='https://github.com/content-services/content-sources-frontend'
/>
</>
} className={classes.remove100percent} />
<PageHeaderTitle
title={
<>
{title}
<OpenSourceBadge repositoriesURL='https://github.com/content-services/content-sources-frontend' />
</>
}
className={classes.remove100percent}
/>
<Text className={classes.subtext} ouiaId={ouiaId}>
{paragraph}
</Text>
Expand Down
Loading