Skip to content
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

web: add Result section to Storage page #1088

Merged
merged 39 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e200250
web: Add component for adding visual prominence
dgdavid Mar 11, 2024
25a6445
web: Add core/TreeTable component
dgdavid Mar 11, 2024
232096b
web: Add a Result section to Storage/ProposalPage
dgdavid Mar 11, 2024
f7b92fa
web: Move storage proposal actions to a dialog
dgdavid Mar 11, 2024
62b099a
web: adapt storage/ProposalActionsDialog tests
dgdavid Mar 11, 2024
5fe6044
web: Undo undesired changes from a git rebase
dgdavid Mar 11, 2024
b3462d8
web: Fix storage/ProposalResultSection
dgdavid Mar 11, 2024
d9ad7f2
web: remove not needed hack
dgdavid Mar 11, 2024
82e6773
web: please ESlint
dgdavid Mar 11, 2024
66ad402
web: Fix state initialization
joseivanlopez Mar 11, 2024
fb7d752
web: Improve content of result section
joseivanlopez Mar 11, 2024
630cd2c
web: Add DevicesManager
joseivanlopez Mar 12, 2024
fa89d9d
web: add tests for storage proposal result section
dgdavid Mar 12, 2024
6e9afbc
web: Add #uniq and #compact utils
joseivanlopez Feb 28, 2024
77fb147
web: Change detection of used devices
joseivanlopez Mar 12, 2024
ad1e4d2
web: Move warning about deletions
dgdavid Mar 12, 2024
b16a477
web: Drop no needed comments
dgdavid Mar 12, 2024
4551ef3
web: Extend DevicesManager
joseivanlopez Mar 13, 2024
64a4234
web: Move method to get device children
joseivanlopez Mar 13, 2024
2281b79
web: Adapt components
joseivanlopez Mar 13, 2024
64638a9
web: Fix typo in tests
joseivanlopez Mar 13, 2024
655aca3
web: Do not consider subvol for delete actions
joseivanlopez Mar 13, 2024
bbdd6e5
service: Export SID of the file system to D-Bus
joseivanlopez Mar 13, 2024
49a71f2
web: Adapt storage client
joseivanlopez Mar 13, 2024
57dcc37
web: Fix types
joseivanlopez Mar 13, 2024
f11b86e
web: change warning content in storage result
dgdavid Mar 13, 2024
db04816
web: Fix tests
joseivanlopez Mar 13, 2024
8f98663
web: Add methods to DevicesManager
joseivanlopez Mar 13, 2024
042a96b
web: Add a new core/Reminder variant
dgdavid Mar 13, 2024
50e4a35
web: Render deletion actions summary in a reminder
dgdavid Mar 13, 2024
47fd870
web: adapt code to changes made in DevicesManager
dgdavid Mar 13, 2024
5ad2b50
web: Fixt type
joseivanlopez Mar 14, 2024
6b6fe0e
web: Reorder Result section content
dgdavid Mar 14, 2024
cacaec2
web: Display section description only if not loading
dgdavid Mar 14, 2024
ed6f01c
web: CSS hacks and adjustments
dgdavid Mar 14, 2024
436ea21
service: Fix tests
joseivanlopez Mar 15, 2024
e0731fd
web: Improve detection of deleted devices and systems
joseivanlopez Mar 15, 2024
195e962
web: Fixes and adjustments
dgdavid Mar 15, 2024
f7cb0e4
web: improve comments for translators
dgdavid Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion service/lib/agama/dbus/storage/interfaces/device/filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def self.apply?(storage_device)
FILESYSTEM_INTERFACE = "org.opensuse.Agama.Storage1.Filesystem"
private_constant :FILESYSTEM_INTERFACE

# SID of the file system.
#
# It is useful to detect whether a file system is new.
#
# @return [Integer]
def filesystem_sid
storage_device.filesystem.sid
end

# File system type.
#
# @return [String] e.g., "ext4"
Expand All @@ -68,7 +77,8 @@ def filesystem_label

def self.included(base)
base.class_eval do
dbus_interface FILESYSTEM_INTERFACE do
dbus_interface FILESYSTEM_INTERFACE do
dbus_reader :filesystem_sid, "u", dbus_name: "SID"
dbus_reader :filesystem_type, "s", dbus_name: "Type"
dbus_reader :filesystem_mount_path, "s", dbus_name: "MountPath"
dbus_reader :filesystem_label, "s", dbus_name: "Label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

let(:device) { devicegraph.find_by_name("/dev/mapper/0QEMU_QEMU_HARDDISK_mpath1") }

describe "#filesystem_sid" do
it "returns the file system SID" do
expect(subject.filesystem_sid).to eq(45)
end
end

describe "#filesystem_type" do
it "returns the file system type" do
expect(subject.filesystem_type).to eq("ext4")
Expand Down
1 change: 1 addition & 0 deletions web/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/*
src/lib/*
src/**/test-data/*
3 changes: 2 additions & 1 deletion web/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"ignorePaths": [
"src/lib/cockpit.js",
"src/lib/cockpit-po-plugin.js",
"src/manifest.json"
"src/manifest.json",
"src/**/test-data/*"
],
"import": [
"@cspell/dict-css/cspell-ext.json",
Expand Down
107 changes: 106 additions & 1 deletion web/src/assets/styles/blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,94 @@ ul[data-type="agama/list"][role="grid"] {
}
}

[data-type="agama/tag"] {
font-size: var(--fs-small);

&[data-variant="teal"] {
color: var(--color-teal);
}

&[data-variant="orange"] {
color: var(--color-orange);
}

&[data-variant="gray-highlight"] {
padding: var(--spacer-smaller);
color: var(--color-gray-darkest);
background: var(--color-gray);
border: 1px solid var(--color-gray-dark);
border-radius: 5px;
margin-inline-start: var(--spacer-smaller);
}
}

table[data-type="agama/tree-table"] {
th:first-child {
width: 1%;
padding-inline-end: var(--spacer-normal);
}

@media (width <= 768px) {
td:empty,
td div:empty {
display: none;
}
}
}

table.proposal-result {
tr.dimmed-row {
background-color: #fff;
opacity: 0.8;
background: repeating-linear-gradient( -45deg, #fcfcff, #fcfcff 3px, #fff 3px, #fff 10px );

td {
color: var(--color-gray-dimmed);
padding-block: 0;
}

}

/** Temporary hack because the collapse/expand callback was not given to the
* tree table **/
th button {
background: red;
display: none;
}

tbody th .pf-v5-c-table__tree-view-main {
padding-inline-start: var(--spacer-normal);
flex-direction: row-reverse;
cursor: auto;
}
/** End of temporary hack */

@media (width > 768px) {
th.details-column {
padding-inline-start: calc(60px + var(--spacer-smaller) * 2);
}

td.details-column {
display: grid;
gap: var(--spacer-smaller);
grid-template-columns: 60px 1fr;

:first-child {
text-align: end;
}
}

th.sizes-column,
td.sizes-column {
text-align: end;

div.split {
justify-content: flex-end;
}
}
}
}

// compact lists in popover
.pf-v5-c-popover li + li {
margin: 0;
Expand Down Expand Up @@ -486,7 +574,24 @@ ul[data-type="agama/list"][role="grid"] {

h4 {
color: var(--accent-color);
margin-block-end: var(--spacer-smaller);
}

h4 ~ * {
margin-block-start: var(--spacer-small);
}
}

section [data-type="agama/reminder"] {
margin-inline: 0;
}

[data-type="agama/reminder"][data-variant="subtle"] {
--accent-color: var(--color-primary);
padding-block: 0;
border-inline-start-width: 1px;

h4 {
font-size: var(--fs-normal);
}
}

Expand Down
4 changes: 4 additions & 0 deletions web/src/assets/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@
--color-gray: #f2f2f2;
--color-gray-dark: #efefef; // Fog
--color-gray-darker: #999;
--color-gray-darkest: #333;
--color-gray-dimmed: #888;
--color-gray-dimmest: #666;
--color-teal: #279c9c;
--color-blue: #0d4ea6;
--color-orange: #e86427;

--color-link: #0c322c;
--color-link-hover: #30ba78;
Expand Down
Loading
Loading