From 9ecf454074284536831c7c97283245abb3b4afc6 Mon Sep 17 00:00:00 2001 From: Jordan Vidrine <30537603+jordanvidrine@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:18:11 -0600 Subject: [PATCH] DEV: Invite page changes (#15175) --- .../discourse/app/controllers/user-invited-show.js | 13 ++++++++++--- .../discourse/app/templates/user-invited-show.hbs | 12 ++++++------ app/assets/stylesheets/common/base/user.scss | 2 +- app/assets/stylesheets/desktop/user.scss | 5 ++++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js index 50c36460c10..866ddebd955 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-invited-show.js +++ b/app/assets/javascripts/discourse/app/controllers/user-invited-show.js @@ -45,6 +45,13 @@ export default Controller.extend({ inviteExpired: equal("filter", "expired"), invitePending: equal("filter", "pending"), + @discourseComputed("model") + hasEmailInvites(model) { + return model.invites.some((invite) => { + return invite.email; + }); + }, + @discourseComputed("filter") showBulkActionButtons(filter) { return ( @@ -57,9 +64,9 @@ export default Controller.extend({ canInviteToForum: reads("currentUser.can_invite_to_forum"), canBulkInvite: reads("currentUser.admin"), - @discourseComputed("invitesCount.total") - showSearch(invitesCountTotal) { - return invitesCountTotal > 0; + @discourseComputed("invitesCount", "filter") + showSearch(invitesCount, filter) { + return invitesCount[filter] > 5; }, @action diff --git a/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs b/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs index a3b616b4770..73eb1be6668 100644 --- a/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs +++ b/app/assets/javascripts/discourse/app/templates/user-invited-show.hbs @@ -17,9 +17,9 @@ {{#if showBulkActionButtons}} {{#if inviteExpired}} {{#if removedAll}} -
  • + {{i18n "user.invited.removed_all"}} -
  • + {{else}} {{d-button icon="times" action=(action "destroyAllExpired") label="user.invited.remove_all"}} {{/if}} @@ -27,10 +27,10 @@ {{#if invitePending}} {{#if reinvitedAll}} -
  • - {{i18n "user.invited.reinvited_all"}} -
  • - {{else}} + + {{d-button icon="check" disabled=true label="user.invited.reinvited_all"}} + + {{else if hasEmailInvites}} {{d-button class="btn-default" icon="sync" action=(action "reinviteAll") label="user.invited.reinvite_all"}} {{/if}} {{/if}} diff --git a/app/assets/stylesheets/common/base/user.scss b/app/assets/stylesheets/common/base/user.scss index 9d87e21fbf8..e6106f08a01 100644 --- a/app/assets/stylesheets/common/base/user.scss +++ b/app/assets/stylesheets/common/base/user.scss @@ -7,7 +7,7 @@ display: grid; grid-template-columns: 1fr 5fr; grid-template-rows: auto auto 1fr auto; - grid-row-gap: 20px; + grid-gap: 20px; .user-primary-navigation { grid-column-start: 1; grid-column-end: 3; diff --git a/app/assets/stylesheets/desktop/user.scss b/app/assets/stylesheets/desktop/user.scss index 09bdd5ed726..9bc4fd2d8db 100644 --- a/app/assets/stylesheets/desktop/user.scss +++ b/app/assets/stylesheets/desktop/user.scss @@ -29,7 +29,10 @@ li { border-bottom: none; - + &:hover, + &.active { + background: var(--primary-very-low); + } &.archive { padding-left: 1.4em; }