Skip to content

Commit 835fc27

Browse files
committed
Redesign the User Groups form page
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 514d536 commit 835fc27

9 files changed

Lines changed: 52 additions & 48 deletions

File tree

‎ChangeLog‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ phpMyAdmin - ChangeLog
77
- issue #17632 Improve tab keypress to text fields on the login form
88
- issue Make database and web server info separately configurable on `$cfg['ShowServerInfo']`
99
- issue Add a configuration option to (dis)allow shared bookmarks: `$cfg['AllowSharedBookmarks'] = true;`
10+
- issue Redesign the User Groups form page
1011

1112
5.2.2 (not yet released)
1213
- issue #17028 Fix total count of rows in not accurate

‎public/themes/bootstrap/scss/_common.scss‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,7 @@ div#tablestatistics table {
589589
}
590590
}
591591

592-
#fieldset_user_global_rights .pma-fieldset,
593-
#fieldset_user_group_rights .pma-fieldset {
592+
#fieldset_user_global_rights .pma-fieldset {
594593
float: left;
595594
}
596595

‎public/themes/metro/scss/_common.scss‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,7 @@ div#tablestatistics table {
802802
}
803803
}
804804

805-
#fieldset_user_global_rights .pma-fieldset,
806-
#fieldset_user_group_rights .pma-fieldset {
805+
#fieldset_user_global_rights .pma-fieldset {
807806
float: left;
808807
}
809808

‎public/themes/original/scss/_common.scss‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,7 @@ div#tablestatistics table {
623623
}
624624
}
625625

626-
#fieldset_user_global_rights .pma-fieldset,
627-
#fieldset_user_group_rights .pma-fieldset {
626+
#fieldset_user_global_rights .pma-fieldset {
628627
float: left;
629628
}
630629

‎public/themes/pmahomme/scss/_common.scss‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,7 @@ div#tablestatistics table {
762762
}
763763
}
764764

765-
#fieldset_user_global_rights .pma-fieldset,
766-
#fieldset_user_group_rights .pma-fieldset {
765+
#fieldset_user_global_rights .pma-fieldset {
767766
float: left;
768767
}
769768

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1-
{% if user_group == null %}
2-
<h2>{% trans 'Add user group' %}</h2>
3-
{% else %}
1+
<div class="container">
2+
{% if user_group == null %}
3+
<h2>{{ 'Add user group'|trans }}</h2>
4+
{% else %}
45
<h2>{{ 'Edit user group: \'%s\''|trans|format(edit_user_group_special_chars) }}</h2>
5-
{% endif %}
6-
<form name="userGroupForm" id="userGroupForm" action="{{ user_group_url|raw }}" method="post">
6+
{% endif %}
7+
8+
<form action="{{ user_group_url|raw }}" method="post" class="card disableAjax">
79
{{ hidden_inputs|raw }}
8-
<fieldset class="pma-fieldset" id="fieldset_user_group_rights">
9-
<legend>{% trans 'User group menu assignments' %} &nbsp;&nbsp;&nbsp;
10-
<input type="checkbox" id="addUsersForm_checkall" class="checkall_box" title="Check all">
11-
<label for="addUsersForm_checkall">{% trans 'Check all' %}</label>
12-
</legend>
13-
{% if user_group == null %}
14-
<label for="userGroup">{% trans 'Group name:' %}</label>
15-
<input type="text" name="userGroup" maxlength="64" autocomplete="off" required="required">
16-
<div class="clearfloat"></div>
17-
{% endif %}
10+
<div class="card-header">{{ 'User group menu assignments'|trans }}</div>
11+
12+
<div class="card-body">
13+
{% if user_group == null %}
14+
<div class="mb-3">
15+
<label class="form-label" for="userGroup">{{ 'Group name:'|trans }}</label>
16+
<input class="form-control" type="text" name="userGroup" id="userGroup" maxlength="64" autocomplete="off" required>
17+
</div>
18+
{% endif %}
19+
20+
<div class="form-check mb-3">
21+
<input class="form-check-input checkall_box" type="checkbox" id="addUsersForm_checkall" title="{{ 'Check all'|trans }}">
22+
<label class="form-check-label" for="addUsersForm_checkall">{{ 'Check all'|trans }}</label>
23+
</div>
24+
25+
<div class="row">
1826
{{ tab_list|raw }}
19-
</fieldset>
20-
<fieldset id="fieldset_user_group_rights_footer" class="pma-fieldset tblFooters">
21-
<input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
22-
</fieldset>
23-
</form>
27+
</div>
28+
</div>
29+
30+
<div class="card-footer">
31+
<input class="btn btn-primary" type="submit" value="{{ user_group == null ? 'Add user group'|trans : 'Edit user group'|trans }}">
32+
</div>
33+
</form>
34+
</div>
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
<fieldset class="pma-fieldset">
2-
<legend>
3-
{{ title }}
4-
</legend>
5-
{% for tab_detail in tab_details %}
6-
<div class="item">
7-
<input type="checkbox" class="checkall"{{ tab_detail.in_array|raw }} name="{{ level }}_{{ tab_detail.tab }}" value="Y">
8-
<label for="{{ level }}_{{ tab_detail.tab }}">
9-
<code>{{ tab_detail.tab_name }}</code>
10-
</label>
11-
</div>
12-
{% endfor %}
1+
<fieldset class="mb-3 col">
2+
<legend>{{ title }}</legend>
3+
{% for tab_detail in tab_details %}
4+
<div class="form-check">
5+
<input class="form-check-input checkall" type="checkbox"{{ tab_detail.in_array|raw }} name="{{ level }}_{{ tab_detail.tab }}" id="{{ level }}_{{ tab_detail.tab }}" value="Y">
6+
<label class="form-check-label" for="{{ level }}_{{ tab_detail.tab }}">{{ tab_detail.tab_name }}</label>
7+
</div>
8+
{% endfor %}
139
</fieldset>

‎templates/server/user_groups/user_groups.twig‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
</div>
6060
</div>
6161
{% endif %}
62-
<div class="row">
63-
<fieldset class="pma-fieldset" id="fieldset_add_user_group">
64-
<a href="{{ add_user_url|raw }}">{{ add_user_icon|raw }}{% trans 'Add user group' %}</a>
65-
</fieldset>
62+
<div>
63+
<a class="btn btn-primary" href="{{ add_user_url|raw }}">{{ add_user_icon|raw }}{% trans 'Add user group' %}</a>
6664
</div>

‎test/classes/ConfigStorage/UserGroupsTest.php‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testGetHtmlForUserGroupsTableWithNoUserGroups(): void
6565

6666
$html = UserGroups::getHtmlForUserGroupsTable($this->configurableMenusFeature);
6767
$this->assertStringNotContainsString('<table id="userGroupsTable">', $html);
68-
$urlTag = '<a href="' . Url::getFromRoute('/server/user-groups', ['addUserGroup' => 1]);
68+
$urlTag = '<a class="btn btn-primary" href="' . Url::getFromRoute('/server/user-groups', ['addUserGroup' => 1]);
6969
$this->assertStringContainsString($urlTag, $html);
7070
}
7171

@@ -117,7 +117,7 @@ public function testGetHtmlToEditUserGroup(): void
117117
// adding a user group
118118
$html = UserGroups::getHtmlToEditUserGroup($this->configurableMenusFeature);
119119
$this->assertStringContainsString('<input type="hidden" name="addUserGroupSubmit" value="1"', $html);
120-
$this->assertStringContainsString('<input type="text" name="userGroup"', $html);
120+
$this->assertStringContainsString('<input class="form-control" type="text" name="userGroup"', $html);
121121

122122
$resultStub = $this->createMock(DummyResult::class);
123123

@@ -145,11 +145,13 @@ public function testGetHtmlToEditUserGroup(): void
145145
$this->assertStringContainsString('<input type="hidden" name="editUserGroupSubmit" value="1"', $html);
146146
$this->assertStringContainsString('<input type="hidden" name="editUserGroupSubmit" value="1"', $html);
147147
$this->assertStringContainsString(
148-
'<input type="checkbox" class="checkall" checked="checked" name="server_sql" value="Y">',
148+
'<input class="form-check-input checkall" type="checkbox"'
149+
. ' checked="checked" name="server_sql" id="server_sql" value="Y">',
149150
$html,
150151
);
151152
$this->assertStringContainsString(
152-
'<input type="checkbox" class="checkall" name="server_databases" value="Y">',
153+
'<input class="form-check-input checkall" type="checkbox"'
154+
. ' name="server_databases" id="server_databases" value="Y">',
153155
$html,
154156
);
155157
}

0 commit comments

Comments
 (0)