Skip to content

Commit 30db09a

Browse files
UX: Change from legacy d-admin-table CSS to d-table classes (#305)
c.f. discourse/discourse#38048
1 parent 17e7e9a commit 30db09a

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

admin/assets/javascripts/discourse/components/repo-status.gjs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,20 @@ export default class RepoStatus extends Component {
4444
}
4545

4646
<template>
47-
<tr
48-
class="d-admin-row__content repo {{if @repo.hasNewVersion 'has-update'}}"
49-
>
50-
<td class="d-admin-row__overview">
51-
<div class="d-admin-row__overview-name">
47+
<tr class="d-table__row repo {{if @repo.hasNewVersion 'has-update'}}">
48+
<td class="d-table__cell --overview">
49+
<div class="d-table__overview-name">
5250
{{@repo.nameTitleized}}
5351
</div>
5452

5553
{{#if @repo.author}}
56-
<div class="d-admin-row__overview-author">
54+
<div class="d-table__overview-author">
5755
{{@repo.author}}
5856
</div>
5957
{{/if}}
6058

6159
{{#if @repo.plugin}}
62-
<div class="d-admin-row__overview-about">
60+
<div class="d-table__overview-about">
6361
{{@repo.plugin.about}}
6462

6563
{{#if @repo.linkUrl}}
@@ -82,22 +80,22 @@ export default class RepoStatus extends Component {
8280
{{/if}}
8381
</td>
8482

85-
<td class="d-admin-row__detail">
86-
<div class="d-admin-row__mobile-label">
83+
<td class="d-table__cell --detail">
84+
<div class="d-table__mobile-label">
8785
{{i18n "admin.docker.repo.commit_hash"}}
8886
</div>
8987
{{commitUrl "current" @repo.version @repo.prettyVersion @repo.url}}
9088
</td>
9189

92-
<td class="d-admin-row__detail">
93-
<div class="d-admin-row__mobile-label">
90+
<td class="d-table__cell --detail">
91+
<div class="d-table__mobile-label">
9492
{{i18n "admin.docker.repo.last_updated"}}
9593
</div>
9694
{{formatDate @repo.latest.date leaveAgo="true"}}
9795
</td>
9896

99-
<td class="d-admin-row__detail">
100-
<div class="d-admin-row__mobile-label">
97+
<td class="d-table__cell --detail">
98+
<div class="d-table__mobile-label">
10199
{{i18n "admin.docker.repo.latest_version"}}
102100
</div>
103101
<div class="repo__latest-version">
@@ -120,7 +118,7 @@ export default class RepoStatus extends Component {
120118
</div>
121119
</td>
122120

123-
<td class="d-admin-row__controls">
121+
<td class="d-table__cell --controls">
124122
{{#if @repo.checkingStatus}}
125123
<div class="status-label --loading">
126124
{{i18n "admin.docker.checking"}}

admin/assets/javascripts/discourse/templates/update/index.gjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export default RouteTemplate(
4242
</p>
4343
{{else}}
4444

45-
<table class="d-admin-table" id="repos">
46-
<thead>
45+
<table class="d-table" id="repos">
46+
<thead class="d-table__header">
4747
<th>{{i18n "admin.docker.repo.name"}}</th>
4848
<th>{{i18n "admin.docker.repo.commit_hash"}}</th>
4949
<th>{{i18n "admin.docker.repo.last_updated"}}</th>

assets/stylesheets/common/docker-manager.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@
110110
}
111111
}
112112

113-
.d-admin-table {
113+
.d-table {
114114
margin-bottom: var(--space-6);
115115
}
116116

117-
.d-admin-row__content.repo {
118-
.d-admin-row__overview {
117+
.d-table__row.repo {
118+
.d-table__cell.--overview {
119119
width: 45%;
120120

121121
@include breakpoint("tablet") {
122122
width: auto;
123123
}
124124
}
125125

126-
.d-admin-row__controls {
126+
.d-table__cell.--controls {
127127
width: 12%; // set width to minimize layout shift
128128
text-align: left;
129129

spec/system/admin_update_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
visit("/admin/update")
1313

1414
expect(page).to have_css("h3", exact_text: I18n.t("js.admin.docker.update_title"))
15-
expect(page).to have_css("tr.repo .d-admin-row__overview-name", exact_text: "Discourse")
16-
expect(page).to have_css("tr.repo .d-admin-row__overview-name", exact_text: "Docker Manager")
15+
expect(page).to have_css("tr.repo .d-table__overview-name", exact_text: "Discourse")
16+
expect(page).to have_css("tr.repo .d-table__overview-name", exact_text: "Docker Manager")
1717
expect(page).to have_css(
18-
"tr.repo .d-admin-row__overview-about a[href='https://meta.discourse.org/t/12655']",
18+
"tr.repo .d-table__overview-about a[href='https://meta.discourse.org/t/12655']",
1919
)
2020
ensure
2121
puts page.html if ENV["CI"]

test/javascripts/integration/components/repo-status-test.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module("Integration | Component | RepoStatus", function (hooks) {
104104
);
105105

106106
assert
107-
.dom("div.d-admin-row__overview-author")
107+
.dom("div.d-table__overview-author")
108108
.hasText("By Discourse", "shows plugin author");
109109
});
110110

0 commit comments

Comments
 (0)