Skip to content

Commit

Permalink
Add UI for volumes #1683
Browse files Browse the repository at this point in the history
  • Loading branch information
olgenn committed Oct 7, 2024
1 parent a2a3128 commit d21339b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
4 changes: 3 additions & 1 deletion frontend/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@
"empty_message_text": "No volumes to display.",
"nomatch_message_title": "No matches",
"nomatch_message_text": "We can't find a match.",
"active_only": "Active volumes",

"name": "Name",
"project": "Project name",
Expand All @@ -464,7 +465,8 @@
"failed": "Failed",
"submitted": "Submitted",
"provisioning": "Provisioning",
"active": "Active"
"active": "Active",
"deleted": "Deleted"
}
},

Expand Down
11 changes: 8 additions & 3 deletions frontend/src/pages/Volumes/AdministrationList/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ export const useColumnsDefinitions = () => {
{
id: 'status',
header: t('volume.status'),
cell: (item: IVolume) => (
<StatusIndicator type={getStatusIconType(item.status)}>{t(`volume.statuses.${item.status}`)}</StatusIndicator>
),
cell: (item: IVolume) =>
item.deleted ? (
<StatusIndicator type="error">{t(`volume.statuses.deleted`)}</StatusIndicator>
) : (
<StatusIndicator type={getStatusIconType(item.status)}>
{t(`volume.statuses.${item.status}`)}
</StatusIndicator>
),
},
{
id: 'created_at',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Volumes/AdministrationList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const AdministrationVolumeList: React.FC = () => {

<div className={styles.activeOnly}>
<Toggle onChange={({ detail }) => setOnlyActive(detail.checked)} checked={onlyActive}>
{t('fleets.active_only')}
{t('volume.active_only')}
</Toggle>
</div>

Expand Down
11 changes: 8 additions & 3 deletions frontend/src/pages/Volumes/List/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ export const useColumnsDefinitions = () => {
{
id: 'status',
header: t('volume.status'),
cell: (item: IVolume) => (
<StatusIndicator type={getStatusIconType(item.status)}>{t(`volume.statuses.${item.status}`)}</StatusIndicator>
),
cell: (item: IVolume) =>
item.deleted ? (
<StatusIndicator type="error">{t(`volume.statuses.deleted`)}</StatusIndicator>
) : (
<StatusIndicator type={getStatusIconType(item.status)}>
{t(`volume.statuses.${item.status}`)}
</StatusIndicator>
),
},
{
id: 'created_at',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/Volumes/List/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useTranslation } from 'react-i18next';

import { Button, Header, Pagination, SpaceBetween, Table, Toggle } from 'components';
import { Button, Header, Pagination, Table, Toggle } from 'components';
import { useProjectDropdown } from 'layouts/AppLayout/hooks';

import { useCollection } from 'hooks';
Expand Down Expand Up @@ -47,7 +47,7 @@ export const VolumeList: React.FC = () => {
<div className={styles.filters}>
<div className={styles.activeOnly}>
<Toggle onChange={({ detail }) => setOnlyActive(detail.checked)} checked={onlyActive}>
{t('fleets.active_only')}
{t('volume.active_only')}
</Toggle>
</div>

Expand Down

0 comments on commit d21339b

Please sign in to comment.