UX: Show first unique letters in invite link (#12434)

This commit is contained in:
Dan Ungureanu 2021-03-18 19:05:38 +02:00 committed by GitHub
parent da210b6d77
commit 5024ea72d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,11 @@ const Invite = EmberObject.extend({
.catch(popupAjaxError);
},
@discourseComputed("invite_key")
shortKey(key) {
return key.substr(0, 4) + "...";
},
@discourseComputed("groups")
groupIds(groups) {
return groups ? groups.map((group) => group.id) : [];

View File

@ -107,7 +107,7 @@
{{#if invite.email}}
{{invite.email}}
{{else}}
{{i18n "user.invited.invited_via_link" count=invite.redemption_count max=invite.max_redemptions_allowed}}
{{i18n "user.invited.invited_via_link" key=invite.shortKey count=invite.redemption_count max=invite.max_redemptions_allowed}}
{{/if}}
</td>
{{#if currentUser.staff}}

View File

@ -2,6 +2,7 @@
class InviteSerializer < ApplicationSerializer
attributes :id,
:invite_key,
:link,
:email,
:emailed,

View File

@ -1448,7 +1448,7 @@ en:
redeemed_tab: "Redeemed"
redeemed_tab_with_count: "Redeemed (%{count})"
invited_via: "Invitation"
invited_via_link: "link (%{count} / %{max} redeemed)"
invited_via_link: "link %{key} (%{count} / %{max} redeemed)"
groups: "Groups"
topic: "Topic"
sent: "Created/Last Sent"