Skip to content

Commit

Permalink
chore(RHINENG-9387): update page titles (#1180)
Browse files Browse the repository at this point in the history
* chore(RHINENG-9387): update page titles

* chore: disable default title prefix
  • Loading branch information
mkholjuraev authored Apr 27, 2024
1 parent 42e843c commit 934544f
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/SmartComponents/Advisories/Advisories.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { intl } from '../../Utilities/IntlProvider';
import { clearNotifications } from '@redhat-cloud-services/frontend-components-notifications/redux';
import AdvisoriesStatusReport from '../../PresentationalComponents/StatusReports/AdvisoriesStatusReport';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import { DEFAULT_PATCH_TITLE } from '../../Utilities/constants';
import { useNavigate, useSearchParams } from 'react-router-dom';

const Advisories = () => {
Expand All @@ -35,7 +34,7 @@ const Advisories = () => {
const chrome = useChrome();

useEffect(()=>{
chrome.updateDocumentTitle(`${intl.formatMessage(messages.titlesAdvisories)}${DEFAULT_PATCH_TITLE}`);
chrome.updateDocumentTitle(`Advisories - Content | RHEL`, true);
}, [chrome]);

const dispatch = useDispatch();
Expand Down
4 changes: 1 addition & 3 deletions src/SmartComponents/AdvisoryDetail/AdvisoryDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { intl } from '../../Utilities/IntlProvider';
import AdvisorySystems from '../AdvisorySystems/AdvisorySystems';
import { clearNotifications } from '@redhat-cloud-services/frontend-components-notifications/redux';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import { DEFAULT_PATCH_TITLE } from '../../Utilities/constants';

const AdvisoryDetail = () => {
const dispatch = useDispatch();
Expand All @@ -21,8 +20,7 @@ const AdvisoryDetail = () => {

useEffect(()=>{
advisoryName &&
chrome.updateDocumentTitle(`${advisoryName}
- ${intl.formatMessage(messages.titlesAdvisories)} ${DEFAULT_PATCH_TITLE}`);
chrome.updateDocumentTitle(`${advisoryName} - Advisories - Content | RHEL`, true);
}, [chrome, advisoryName]);

const advisoryDetails = useSelector(
Expand Down
4 changes: 1 addition & 3 deletions src/SmartComponents/PackageDetail/PackageDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ import { intl } from '../../Utilities/IntlProvider';
import { clearNotifications } from '@redhat-cloud-services/frontend-components-notifications/redux';
import ErrorHandler from '../../PresentationalComponents/Snippets/ErrorHandler';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import { DEFAULT_PATCH_TITLE } from '../../Utilities/constants';

const PackageDetail = () => {
const dispatch = useDispatch();
const { packageName } = useParams();
const chrome = useChrome();

useEffect(()=>{
packageName && chrome.updateDocumentTitle(`${packageName} - ${intl.formatMessage(messages.titlesPackages)}
${DEFAULT_PATCH_TITLE}`);
packageName && chrome.updateDocumentTitle(`${packageName} - Packages - Content | RHEL`, true);
}, [chrome, packageName]);

const packageDetails = useSelector(
Expand Down
4 changes: 2 additions & 2 deletions src/SmartComponents/Packages/Packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TableView from '../../PresentationalComponents/TableView/TableView';
import { packagesColumns } from '../../PresentationalComponents/TableView/TableViewAssets';
import { changePackagesListParams, fetchPackagesAction } from '../../store/Actions/Actions';
import { exportPackagesCSV, exportPackagesJSON } from '../../Utilities/api';
import { DEFAULT_PATCH_TITLE, packagesListDefaultFilters } from '../../Utilities/constants';
import { packagesListDefaultFilters } from '../../Utilities/constants';
import { createPackagesRows } from '../../Utilities/DataMappers';
import { createSortBy, decodeQueryparams, encodeURLParams } from '../../Utilities/Helpers';
import { useOnExport, usePerPageSelect,
Expand All @@ -23,7 +23,7 @@ const Packages = () => {
const [firstMount, setFirstMount] = React.useState(true);
const chrome = useChrome();
useEffect(()=>{
chrome.updateDocumentTitle(`${intl.formatMessage(messages.titlesPackages)} ${DEFAULT_PATCH_TITLE}`);
chrome.updateDocumentTitle(`Packages - Content | RHEL`, true);
}, [chrome]);

const [searchParams, setSearchParams] = useSearchParams();
Expand Down
4 changes: 2 additions & 2 deletions src/SmartComponents/PatchSet/PatchSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
patchSetRowActions, CustomActionsToggle
} from './PatchSetAssets';
import PatchSetWizard from '../PatchSetWizard/PatchSetWizard';
import { DEFAULT_PATCH_TITLE, patchSetDeleteNotifications } from '../../Utilities/constants';
import { patchSetDeleteNotifications } from '../../Utilities/constants';
import { usePermissionsWithContext } from '@redhat-cloud-services/frontend-components-utilities/RBACHook';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { Icon, Popover } from '@patternfly/react-core';
Expand All @@ -36,7 +36,7 @@ const PatchSet = () => {
const IS_SELECTION_ENABLED = false;
const chrome = useChrome();
useEffect(()=>{
chrome.updateDocumentTitle(`${intl.formatMessage(messages.titlesTemplate)} ${DEFAULT_PATCH_TITLE}`);
chrome.updateDocumentTitle(`Templates - Patch | RHEL`, true);
}, [chrome]);

const dispatch = useDispatch();
Expand Down
5 changes: 2 additions & 3 deletions src/SmartComponents/PatchSetDetail/PatchSetDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import DeleteSetModal from '../Modals/DeleteSetModal';
import { deletePatchSet, fetchPatchSetSystems } from '../../Utilities/api';
import { addNotification } from '@redhat-cloud-services/frontend-components-notifications/redux';
import { DEFAULT_PATCH_TITLE, patchSetDeleteNotifications } from '../../Utilities/constants';
import { patchSetDeleteNotifications } from '../../Utilities/constants';
import ErrorHandler from '../../PresentationalComponents/Snippets/ErrorHandler';
import {
arrayFromObj,
Expand Down Expand Up @@ -132,8 +132,7 @@ const PatchSetDetail = () => {
const patchSetName = templateDetails.data.attributes.name;

useEffect(() => {
patchSetName && chrome.updateDocumentTitle(`${patchSetName} - ${intl.formatMessage(messages.titlesTemplate)}
${DEFAULT_PATCH_TITLE}`);
patchSetName && chrome.updateDocumentTitle(`${patchSetName} - Templates - Patch | RHEL`, true);
}, [chrome, patchSetName]);

const onSelect = useOnSelect(
Expand Down
4 changes: 1 addition & 3 deletions src/SmartComponents/SystemDetail/InventoryDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { usePatchSetState } from '../../Utilities/hooks';
import { useParams } from 'react-router-dom';
import SystemDetail from './SystemDetail';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';
import { DEFAULT_PATCH_TITLE } from '../../Utilities/constants';
import { InsightsLink } from '@redhat-cloud-services/frontend-components/InsightsLink';
import { usePermissionsWithContext } from '@redhat-cloud-services/frontend-components-utilities/RBACHook';

Expand Down Expand Up @@ -51,8 +50,7 @@ const InventoryDetail = () => {

const chrome = useChrome();
useEffect(() => {
displayName && chrome.updateDocumentTitle(`${displayName} - ${intl.formatMessage(messages.titlesSystems)}
${DEFAULT_PATCH_TITLE}`);
displayName && chrome.updateDocumentTitle(`${displayName} - Systems - Patch | RHEL`, true);
}, [chrome, displayName]);

const { hasAccess: hasTemplateAccess } = usePermissionsWithContext([
Expand Down
3 changes: 1 addition & 2 deletions src/SmartComponents/Systems/SystemsPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useEffect } from 'react';
import messages from '../../Messages';
import Header from '../../PresentationalComponents/Header/Header';
import { DEFAULT_PATCH_TITLE } from '../../Utilities/constants';
import { intl } from '../../Utilities/IntlProvider';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';

Expand All @@ -10,7 +9,7 @@ import SystemsMainContent from './SystemsMainContent';
const SystemsPage = () => {
const chrome = useChrome();
useEffect(()=>{
chrome.updateDocumentTitle(`${intl.formatMessage(messages.titlesSystems)}${DEFAULT_PATCH_TITLE}`);
chrome.updateDocumentTitle(`Systems - Patch | RHEL`, true);
}, [chrome, intl]);

return (
Expand Down
1 change: 0 additions & 1 deletion src/Utilities/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { subtractDate } from './Helpers';
export const STATUS_REJECTED = 'rejected';
export const STATUS_LOADING = 'loading';
export const STATUS_RESOLVED = 'resolved';
export const DEFAULT_PATCH_TITLE = ` - Patch | Red Hat Insights`;

export const defaultCompoundSortValues = {
operating_system: {
Expand Down

0 comments on commit 934544f

Please sign in to comment.