DEV: Invite page changes (#15175)

This commit is contained in:
Jordan Vidrine 2021-12-02 13:18:11 -06:00 committed by GitHub
parent 7456a59022
commit 9ecf454074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 11 deletions

View File

@ -45,6 +45,13 @@ export default Controller.extend({
inviteExpired: equal("filter", "expired"), inviteExpired: equal("filter", "expired"),
invitePending: equal("filter", "pending"), invitePending: equal("filter", "pending"),
@discourseComputed("model")
hasEmailInvites(model) {
return model.invites.some((invite) => {
return invite.email;
});
},
@discourseComputed("filter") @discourseComputed("filter")
showBulkActionButtons(filter) { showBulkActionButtons(filter) {
return ( return (
@ -57,9 +64,9 @@ export default Controller.extend({
canInviteToForum: reads("currentUser.can_invite_to_forum"), canInviteToForum: reads("currentUser.can_invite_to_forum"),
canBulkInvite: reads("currentUser.admin"), canBulkInvite: reads("currentUser.admin"),
@discourseComputed("invitesCount.total") @discourseComputed("invitesCount", "filter")
showSearch(invitesCountTotal) { showSearch(invitesCount, filter) {
return invitesCountTotal > 0; return invitesCount[filter] > 5;
}, },
@action @action

View File

@ -17,9 +17,9 @@
{{#if showBulkActionButtons}} {{#if showBulkActionButtons}}
{{#if inviteExpired}} {{#if inviteExpired}}
{{#if removedAll}} {{#if removedAll}}
<li> <span class="removed-all">
{{i18n "user.invited.removed_all"}} {{i18n "user.invited.removed_all"}}
</li> </span>
{{else}} {{else}}
{{d-button icon="times" action=(action "destroyAllExpired") label="user.invited.remove_all"}} {{d-button icon="times" action=(action "destroyAllExpired") label="user.invited.remove_all"}}
{{/if}} {{/if}}
@ -27,10 +27,10 @@
{{#if invitePending}} {{#if invitePending}}
{{#if reinvitedAll}} {{#if reinvitedAll}}
<li> <span class="reinvited-all">
{{i18n "user.invited.reinvited_all"}} {{d-button icon="check" disabled=true label="user.invited.reinvited_all"}}
</li> </span>
{{else}} {{else if hasEmailInvites}}
{{d-button class="btn-default" icon="sync" action=(action "reinviteAll") label="user.invited.reinvite_all"}} {{d-button class="btn-default" icon="sync" action=(action "reinviteAll") label="user.invited.reinvite_all"}}
{{/if}} {{/if}}
{{/if}} {{/if}}

View File

@ -7,7 +7,7 @@
display: grid; display: grid;
grid-template-columns: 1fr 5fr; grid-template-columns: 1fr 5fr;
grid-template-rows: auto auto 1fr auto; grid-template-rows: auto auto 1fr auto;
grid-row-gap: 20px; grid-gap: 20px;
.user-primary-navigation { .user-primary-navigation {
grid-column-start: 1; grid-column-start: 1;
grid-column-end: 3; grid-column-end: 3;

View File

@ -29,7 +29,10 @@
li { li {
border-bottom: none; border-bottom: none;
&:hover,
&.active {
background: var(--primary-very-low);
}
&.archive { &.archive {
padding-left: 1.4em; padding-left: 1.4em;
} }