forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add popover to storage in overview status card
- The storage dashboard are moved under storage navigation. - For accessibility added a popover on storage section enabling linking to dahboards . - Fixed an issue in control plane component - incorrect usage of `healthStateMessage` as an object. Signed-off-by: Afreen Rahman <[email protected]>
- Loading branch information
Afreen Rahman
committed
May 3, 2021
1 parent
0ec5e48
commit 0130ef3
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
frontend/packages/ceph-storage-plugin/locales/en/dashboard.json
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
frontend/packages/ceph-storage-plugin/src/components/storage-popover.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { WatchK8sResults } from '@console/internal/components/utils/k8s-watch-hook'; | ||
import { | ||
HealthState, | ||
healthStateMapping, | ||
healthStateMessage, | ||
} from '@console/shared/src/components/dashboard/status-card/states'; | ||
import Status, { | ||
StatusPopupSection, | ||
} from '@console/shared/src/components/dashboard/status-card/StatusPopup'; | ||
import { getCephHealthState } from './dashboards/persistent-internal/status-card/utils'; | ||
import { WatchCephResource } from '../types'; | ||
|
||
export const StoragePopover: React.FC<StoragePopoverProps> = ({ ceph }) => { | ||
const { t } = useTranslation(); | ||
|
||
const health = getCephHealthState({ ceph }, t); | ||
const icon = | ||
health.state === HealthState.LOADING ? ( | ||
<div className="skeleton-health" /> | ||
) : ( | ||
healthStateMapping[health.state].icon | ||
); | ||
const value = health.message || healthStateMessage(health.state, t); | ||
|
||
return ( | ||
<> | ||
{t( | ||
"ceph-storage-plugin~Storage status represents the health status of the Openshift Container Storage's storage cluster.", | ||
)} | ||
<StatusPopupSection | ||
firstColumn={t('ceph-storage-plugin~Provider')} | ||
secondColumn={t('ceph-storage-plugin~Health')} | ||
> | ||
<Status key="ocs" value={value} icon={icon}> | ||
<Link to="/ocs-dashboards">{t('ceph-storage-plugin~Openshift Container Storage')}</Link> | ||
</Status> | ||
</StatusPopupSection> | ||
</> | ||
); | ||
}; | ||
|
||
type StoragePopoverProps = WatchK8sResults<WatchCephResource>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters