-
Notifications
You must be signed in to change notification settings - Fork 74
feat(web): show filesystem labels #2070
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,11 +33,13 @@ import { | |
| FormHelperText, | ||
| HelperText, | ||
| HelperTextItem, | ||
| Label, | ||
| SelectGroup, | ||
| SelectList, | ||
| SelectOption, | ||
| SelectOptionProps, | ||
| Split, | ||
| SplitItem, | ||
| Stack, | ||
| TextInput, | ||
| } from "@patternfly/react-core"; | ||
|
|
@@ -54,7 +56,13 @@ import { | |
| editPartition, | ||
| } from "~/queries/storage/config-model"; | ||
| import { StorageDevice } from "~/types/storage"; | ||
| import { baseName, deviceSize, filesystemLabel, parseToBytes } from "~/components/storage/utils"; | ||
| import { | ||
| baseName, | ||
| deviceSize, | ||
| deviceLabel, | ||
| filesystemLabel, | ||
| parseToBytes, | ||
| } from "~/components/storage/utils"; | ||
| import { _, formatList } from "~/i18n"; | ||
| import { sprintf } from "sprintf-js"; | ||
| import { configModel } from "~/api/storage/types"; | ||
|
|
@@ -491,10 +499,18 @@ type PartitionDescriptionProps = { | |
| }; | ||
|
|
||
| function PartitionDescription({ partition }: PartitionDescriptionProps): React.ReactNode { | ||
| const label = partition.filesystem?.label; | ||
|
|
||
| return ( | ||
| <Split hasGutter> | ||
| <span>{partition.description}</span> | ||
| <span>{deviceSize(partition.size)}</span> | ||
| <SplitItem>{partition.description}</SplitItem> | ||
| {label && ( | ||
| <SplitItem> | ||
| <Label isCompact variant="outline"> | ||
| {label} | ||
| </Label> | ||
| </SplitItem> | ||
|
Comment on lines
505
to
+512
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about still using the Flex with custom size approach?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I like the separation given by Split here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, go ahead. As commented in IRC, it should not be a question of taste but consistence and correct abstractions to improve maintenance and those things that we use to make so important in the backend side 😉 |
||
| )} | ||
| </Split> | ||
| ); | ||
| } | ||
|
|
@@ -515,7 +531,7 @@ function TargetOptions(): React.ReactNode { | |
| value={partition.name} | ||
| description={<PartitionDescription partition={partition} />} | ||
| > | ||
| {partition.name} | ||
| {deviceLabel(partition)} | ||
| </SelectOption> | ||
| ))} | ||
| {partitions.length === 0 && ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.