Skip to content

Commit 53ac6b7

Browse files
committed
accounts: Move overview layout to PF6
1 parent 9c6e296 commit 53ac6b7

File tree

5 files changed

+38
-27
lines changed

5 files changed

+38
-27
lines changed

pkg/users/account-details.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export const AccountGroupsSelect = ({ name, loggedIn, groups }) => {
400400
{(selected || []).map((currentLabel, index) => {
401401
return (
402402
<Label key={currentLabel}
403-
color={groups.find(group => group.name === currentLabel).isAdmin ? "gold" : "cyan"}
403+
color={groups.find(group => group.name === currentLabel).isAdmin ? "yellow" : "blue"}
404404
>
405405
{currentLabel}
406406
</Label>
@@ -427,7 +427,7 @@ export const AccountGroupsSelect = ({ name, loggedIn, groups }) => {
427427
return {
428428
value: option.name,
429429
content: option.name,
430-
color: option.isAdmin ? "gold" : "cyan",
430+
color: option.isAdmin ? "yellow" : "blue",
431431
isDisabled: option.name == primaryGroupName,
432432
};
433433
})}

pkg/users/accounts-list.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ const UserActions = ({ account, current }) => {
8787
const getGroupRow = (group, accounts) => {
8888
let groupColorClass;
8989
if (group.isAdmin)
90-
groupColorClass = "group-gold";
90+
groupColorClass = "group-yellow";
9191
else if (group.members > 0)
92-
groupColorClass = "group-cyan";
92+
groupColorClass = "group-blue";
9393
else
9494
groupColorClass = "group-grey";
9595

@@ -147,7 +147,7 @@ const getGroupRow = (group, accounts) => {
147147
const getAccountRow = (account, current, groups) => {
148148
const userGroups = groups.filter(group => group.gid === account.gid || group.userlist.find(accountName => accountName === account.name));
149149
const userGroupLabels = userGroups.map(group => {
150-
const color = group.isAdmin ? "gold" : "cyan";
150+
const color = group.isAdmin ? "yellow" : "blue";
151151
return (
152152
<Label key={group.name} variant="filled" color={color}>
153153
{!group.isAdmin ? group.name : ("admin" + " (" + group.name + ")") }
@@ -319,7 +319,7 @@ const GroupsList = ({ groups, accounts, isExpanded, setIsExpanded, min_gid, max_
319319
{(!isExpanded && filtered_groups.length > 0) && <>
320320
{filtered_groups.slice(0, 3)
321321
.map(group => {
322-
const color = group.isAdmin ? "gold" : "cyan";
322+
const color = group.isAdmin ? "yellow" : "blue";
323323
return (
324324
<Label key={group.name} variant="filled" color={color}>
325325
{group.name + ": " + (group.userlistPrimary.length + group.userlist.length)}
@@ -471,7 +471,7 @@ export const AccountsMain = ({ accountsInfo, current_user, groups, isGroupsExpan
471471
});
472472

473473
return (
474-
<Page id="accounts">
474+
<Page id="accounts" className='no-masthead-sidebar'>
475475
<PageSection hasBodyWrapper={false}>
476476
<Stack hasGutter>
477477
<GroupsList accounts={accounts} groups={groups} isExpanded={isGroupsExpanded} setIsExpanded={setIsGroupsExpanded} min_gid={min_gid} max_gid={max_gid} />

pkg/users/rename-group-dialog.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { HelperText, HelperTextItem } from "@patternfly/react-core/dist/esm/comp
2424
import { TextInput } from "@patternfly/react-core/dist/esm/components/TextInput/index.js";
2525

2626
import { apply_modal_dialog, show_modal_dialog } from "cockpit-components-dialog.jsx";
27+
import { Alert } from '@patternfly/react-core';
2728

2829
const _ = cockpit.gettext;
2930

@@ -60,7 +61,6 @@ export function rename_group_dialog(group) {
6061
title: cockpit.format(_("Rename group $0"), group),
6162
body: <RenameGroupDialogBody state={state} change={change} />,
6263
variant: 'small',
63-
titleIconVariant: 'warning',
6464
};
6565

6666
const footer = {

pkg/users/users.scss

+23-12
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424

2525
.delete-resource-red {
26-
color: var(--pf-v5-global--danger-color--200);
26+
color: var(--pf-t--global--icon--color--status--danger--default);
2727
}
2828

2929
#account-details div.checkbox:first-child {
@@ -82,39 +82,50 @@
8282
}
8383

8484
// Iterate through supported PF color names for light and dark modes
85-
@each $color in cyan gold {
85+
@each $color in blue yellow {
8686
.group-#{"" + $color} {
87-
background-color: var(--pf-v5-global--palette--#{$color}-100);
87+
background-color: var(--pf-t--color--#{$color}--30);
8888

8989
.pf-v6-theme-dark & {
90-
background-color: var(--pf-v5-global--palette--#{$color}-300);
90+
background-color: var(--pf-t--color--#{$color}--40);
9191
}
9292
}
9393
}
94-
// PF adapts this color properly across light and dark
94+
.group-blue {
95+
background-color: var(--pf-t--global--color--nonstatus--blue--default);
96+
}
97+
98+
.group-yellow {
99+
background-color: var(--pf-t--global--color--nonstatus--yellow--default);
100+
}
101+
95102
.group-grey {
96-
background-color: var(--pf-v5-global--BorderColor--100);
103+
background-color: var(--pf-t--global--color--nonstatus--gray--default);
97104
}
98105

99106
.group-more-btn {
100-
font-size: var(--pf-v5-global--FontSize--sm);
107+
font-size: var(--pf-t--global--font--size--body--default);
101108
}
102109

103110
#groups-list td:first-child {
104111
vertical-align: middle;
105112
}
106113

107-
#groups-create, #account-create {
114+
// Create new group and Create new account are
115+
// different characters and different lengths
116+
// This makes buttons the same size.
117+
#groups-create, #accounts-create {
108118
min-inline-size: 11rem;
109119
}
110120

111-
#group-confirm-delete-dialog .list-item {
112-
margin-inline-end: var(--pf-v5-global--spacer--lg);
113-
}
121+
// @Venefilyn: Seemingly does nothing atm
122+
// #group-confirm-delete-dialog .list-item {
123+
// margin-inline-end: var(--pf-v5-global--spacer--lg);
124+
// }
114125

115126
// We cannot use the PF helper pf-v6-u-ml-lg here, as it doesn't support RTL yet
116127
#current-account-badge {
117-
margin-inline-start: var(--pf-v5-global--spacer--lg);
128+
margin-inline-start: var(--pf-t--global--spacer--lg);
118129
}
119130

120131
// Pretty sure paths are LTR, even in an RTL display

test/verify/check-users

+7-7
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ class TestAccounts(testlib.MachineCase):
371371
b.wait_not_present("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label:contains(users)")
372372
if not m.ostree_image: # Users group does not exist in coreos image
373373
m.execute("/usr/bin/gpasswd -a robert users")
374-
b.wait_in_text("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label.pf-m-cyan:contains(users)", "users")
374+
b.wait_in_text("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label.pf-m-blue:contains(users)", "users")
375375
m.execute(f"/usr/bin/gpasswd -a robert {m.get_admin_group()}")
376-
b.wait_in_text("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label.pf-m-gold", m.get_admin_group())
376+
b.wait_in_text("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label.pf-m-yellow", m.get_admin_group())
377377
m.execute(f"/usr/bin/gpasswd -d robert {m.get_admin_group()}")
378-
b.wait_not_present("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label.pf-m-gold")
378+
b.wait_not_present("#accounts-list tbody tr:contains(robert) td[data-label='Group'] .pf-v6-c-label.pf-m-yellow")
379379

380380
# test filters
381381
b.set_input_text("#accounts-filter input", "root")
@@ -1190,8 +1190,8 @@ class TestAccounts(testlib.MachineCase):
11901190

11911191
# Delete it
11921192
performGroupAction(b, 'testgroup0', 'Delete group')
1193-
b.wait_text("#group-confirm-delete-dialog footer .pf-v5-c-button.apply", "Delete")
1194-
b.click("#group-confirm-delete-dialog footer .pf-v5-c-button.apply")
1193+
b.wait_text("#group-confirm-delete-dialog footer .pf-v6-c-button.apply", "Delete")
1194+
b.click("#group-confirm-delete-dialog footer .pf-v6-c-button.apply")
11951195
b.wait_not_present('#group-confirm-delete-dialog')
11961196
b.wait_not_in_text('#groups-list', "testgroup0")
11971197

@@ -1200,9 +1200,9 @@ class TestAccounts(testlib.MachineCase):
12001200

12011201
# Groups used as primary need force deletion
12021202
performGroupAction(b, 'anton', 'Delete group')
1203-
b.wait_text("#group-confirm-delete-dialog footer .pf-v5-c-button.apply", "Force delete")
1203+
b.wait_text("#group-confirm-delete-dialog footer .pf-v6-c-button.apply", "Force delete")
12041204
b.assert_pixels("#group-confirm-delete-dialog", "group-delete-dialog")
1205-
b.click("#group-confirm-delete-dialog footer .pf-v5-c-button.apply")
1205+
b.click("#group-confirm-delete-dialog footer .pf-v6-c-button.apply")
12061206
b.wait_not_present('#account-confirm-delete-dialog')
12071207
b.wait(lambda: "#/" == b.eval_js('window.location.hash'))
12081208
b.wait_not_in_text('#groups-list', "anton")

0 commit comments

Comments
 (0)