Skip to content

Commit

Permalink
storage: Remove "Unrmatted Data" and "Locked Data" cards
Browse files Browse the repository at this point in the history
They have no actions anymore.
  • Loading branch information
mvollmer committed Apr 5, 2024
1 parent 7985233 commit 5d6f76b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions pkg/storaged/block/create-pages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ export function make_block_page(parent, block, card) {
card = make_filesystem_card(card, block, null, fstab_config);
} else {
card = make_encryption_card(card, block, false);
card = make_locked_encrypted_data_card(card, block);
}
} else {
const is_filesystem = content_block.IdUsage == 'filesystem';
const block_pvol = client.blocks_pvol[content_block.path];
const block_swap = client.blocks_swap[content_block.path];

if (is_crypto)
card = make_encryption_card(card, block, is_filesystem);
card = make_encryption_card(card, block, is_filesystem && !(block_btrfs_blockdev && !single_device_volume));

if (block_btrfs_blockdev) {
if (single_device_volume)
Expand All @@ -116,7 +115,7 @@ export function make_block_page(parent, block, card) {
(content_block.IdUsage == "other" && content_block.IdType == "swap")) {
card = make_swap_card(card, block, content_block);
} else if (client.blocks_available[content_block.path]) {
card = make_unformatted_data_card(card, block, content_block);
// No card for unformatted data
} else {
card = make_unrecognized_data_card(card, block, content_block);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storaged/crypto/encryption.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function make_encryption_card(next, block, is_filesystem) {
return new_card({
title: _("Encryption"),
next,
type_extra: _("encrypted"),
type_extra: content_block ? _("encrypted") : _("locked"),
component: EncryptionCard,
props: { block },
actions: [
Expand Down
14 changes: 8 additions & 6 deletions pkg/storaged/pages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,22 @@ const ActionButtons = ({ card }) => {
return buttons;
};

function page_type_extra(page) {
function page_type(page) {
let type = null;
const extra = [];

let c = page.card;
while (c) {
if (c.type_extra)
extra.push(c.type_extra);
else if (!type)
type = c.title;
c = c.next;
}
return extra;
}

function page_type(page) {
const type = page.card.title;
const extra = page_type_extra(page);
if (!type)
type = extra.shift();

if (extra.length > 0)
return type + " (" + extra.join(", ") + ")";
else
Expand Down

0 comments on commit 5d6f76b

Please sign in to comment.