Skip to content

Commit

Permalink
DEV: little cleanup in the notifications-index component (#14464)
Browse files Browse the repository at this point in the history
- There's no need to pass `filter` to `user-notifications-large`. The component doesn't use it.
- Rename css class to avoid confusion (this div has nothing to-do with the Select Kit)
- Remove duplicated declarations in test fixtures
  • Loading branch information
AndrewPrigorshnev committed Sep 29, 2021
1 parent fc432a9 commit 31970bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Expand Up @@ -14,14 +14,14 @@
</div>
</div>
{{else}}
<div class="user-notifications-filter-select-kit">
<div class="user-notifications-filter">
{{notifications-filter value=filter onChange=(action (mut filter))}}
</div>

{{#if nothingFound}}
<div class="alert alert-info">{{i18n "notifications.empty"}}</div>
{{else}}
{{user-notifications-large notifications=model filter=filter}}
{{user-notifications-large notifications=model}}
{{conditional-loading-spinner condition=loading}}
{{/if}}
{{/if}}
Expand Up @@ -50,7 +50,6 @@ acceptance("User Notifications", function (needs) {
id: 42,
user_id: 1,
notification_type: 5,
high_priority: true,
read: false,
high_priority: true,
created_at: "2021-01-01 12:00:00 UTC",
Expand Down Expand Up @@ -99,7 +98,6 @@ acceptance("User Notifications", function (needs) {
id: 43,
user_id: 1,
notification_type: 5,
high_priority: true,
read: true,
high_priority: false,
created_at: "2021-01-01 12:00:00 UTC",
Expand Down Expand Up @@ -150,7 +148,6 @@ acceptance("User Notifications", function (needs) {
id: 44,
user_id: 1,
notification_type: 5,
high_priority: true,
read: true,
high_priority: false,
created_at: "2021-01-01 12:00:00 UTC",
Expand Down Expand Up @@ -221,7 +218,7 @@ acceptance(
test("It does not render filter", async function (assert) {
await visit("/u/eviltrout/notifications");

assert.notOk(exists("div.user-notifications-filter-select-kit"));
assert.notOk(exists("div.user-notifications-filter"));
});
}
);
2 changes: 1 addition & 1 deletion app/assets/stylesheets/common/base/user.scss
Expand Up @@ -66,7 +66,7 @@
color: var(--love);
}

.user-notifications-filter-select-kit {
.user-notifications-filter {
display: block;
width: 100%;
border-bottom: 0.5px solid var(--primary-low);
Expand Down

0 comments on commit 31970bd

Please sign in to comment.