Skip to content

A platform for community discussion. Free, open, simple.

UX: refactor admin action logs buttons (#38292)

Krisa1a00dfd419a
diff --git a/app/assets/stylesheets/admin/staff_logs.scss b/app/assets/stylesheets/admin/staff_logs.scss
index 6999211372e..673276e1e76 100644
--- a/app/assets/stylesheets/admin/staff_logs.scss
+++ b/app/assets/stylesheets/admin/staff_logs.scss
@@ -142,11 +142,8 @@
gap: 0.5em;
justify-content: space-between;
margin: 0 0 1em 0;
-
- // for too small screen, we want it to also wrap
- @media (width <= 400px) {
- flex-wrap: wrap;
- }
+ min-width: 0;
+ flex-wrap: wrap;
.staff-action-logs-controls__left {
flex: 1 1 auto;
@@ -155,6 +152,7 @@
display: flex;
flex-wrap: wrap;
gap: 0.5em;
+ min-width: 0;
// we want to put it in one line
.date-filter-container .d-date-time-input-range {
@@ -180,15 +178,16 @@
gap: 0.5em;
align-items: center;
}
+}
- a.filter {
- .label {
- font-weight: bold;
- }
+.staff-action-logs-filters {
+ display: flex;
+ flex-wrap: wrap;
+ gap: var(--space-2);
- .d-icon {
- margin-left: 0.5em;
- }
+ .btn {
+ gap: var(--space-2);
+ text-align: left;
}
}
diff --git a/frontend/discourse/admin/templates/admin-logs/staff-action-logs.gjs b/frontend/discourse/admin/templates/admin-logs/staff-action-logs.gjs
index 0107e18d00e..f99599a7c09 100644
--- a/frontend/discourse/admin/templates/admin-logs/staff-action-logs.gjs
+++ b/frontend/discourse/admin/templates/admin-logs/staff-action-logs.gjs
@@ -1,4 +1,4 @@
-import { fn, hash } from "@ember/helper";
+import { concat, fn, hash } from "@ember/helper";
import { on } from "@ember/modifier";
import { LinkTo } from "@ember/routing";
import { htmlSafe } from "@ember/template";
@@ -18,64 +18,58 @@ export default <template>
<div class="staff-action-logs-controls__left">
{{#if @controller.filtersExists}}
<div class="staff-action-logs-filters">
- <a
- href
- {{on "click" @controller.clearAllFilters}}
- class="clear-filters filter btn"
- >
- <span class="label">{{i18n
- "admin.logs.staff_actions.clear_filters"
- }}</span>
- </a>
+ <DButton
+ @action={{@controller.clearAllFilters}}
+ @label="admin.logs.staff_actions.clear_filters"
+ class="clear-filters filter btn-default"
+ />
{{#if @controller.actionFilter}}
- <a
- href
- {{on "click" (fn @controller.clearFilter "actionFilter")}}
- class="filter btn"
- >
- <span class="label">{{i18n "admin.logs.action"}}</span>:
- {{@controller.actionFilter}}
- {{icon "circle-xmark"}}
- </a>
+ <DButton
+ @action={{fn @controller.clearFilter "actionFilter"}}
+ @translatedLabel={{concat
+ (i18n "admin.logs.action")
+ ": "
+ @controller.actionFilter
+ }}
+ @suffixIcon="xmark"
+ class="filter btn-default"
+ />
{{/if}}
{{#if @controller.filters.acting_user}}
- <a
- href
- {{on "click" (fn @controller.clearFilter "acting_user")}}
- class="filter btn"
- >
- <span class="label">{{i18n
- "admin.logs.staff_actions.staff_user"
- }}</span>:
- {{@controller.filters.acting_user}}
- {{icon "circle-xmark"}}
- </a>
+ <DButton
+ @action={{fn @controller.clearFilter "acting_user"}}
+ @translatedLabel={{concat
+ (i18n "admin.logs.staff_actions.staff_user")
+ ": "
+ @controller.filters.acting_user
+ }}
+ @suffixIcon="xmark"
+ class="filter btn-default"
+ />
{{/if}}
{{#if @controller.filters.target_user}}
- <a
- href
- {{on "click" (fn @controller.clearFilter "target_user")}}
- class="filter btn"
- >
- <span class="label">{{i18n
- "admin.logs.staff_actions.target_user"
- }}</span>:
- {{@controller.filters.target_user}}
- {{icon "circle-xmark"}}
- </a>
+ <DButton
+ @action={{fn @controller.clearFilter "target_user"}}
+ @translatedLabel={{concat
+ (i18n "admin.logs.staff_actions.target_user")
+ ": "
+ @controller.filters.target_user
+ }}
+ @suffixIcon="xmark"
+ class="filter btn-default"
+ />
{{/if}}
{{#if @controller.filters.subject}}
- <a
- href
- {{on "click" (fn @controller.clearFilter "subject")}}
- class="filter btn"
- >
- <span class="label">{{i18n
- "admin.logs.staff_actions.subject"
- }}</span>:
- {{@controller.filters.subject}}
- {{icon "circle-xmark"}}
- </a>
+ <DButton
+ @action={{fn @controller.clearFilter "subject"}}
+ @translatedLabel={{concat
+ (i18n "admin.logs.staff_actions.subject")
+ ": "
+ @controller.filters.subject
+ }}
+ @suffixIcon="xmark"
+ class="filter btn-default"
+ />
{{/if}}
</div>
{{else}}