|
1 | 1 | <template> |
2 | 2 | <ModalComponent :show="show && !!wksp" @close="emit('close')"> |
3 | | - <div class="title is-5 mb-4">Invite people to {{ wksp?.metadata.label }}</div> |
| 3 | + <div class="title is-5 mb-4">People & access for {{ wksp?.metadata.label }}</div> |
4 | 4 |
|
5 | | - <p> |
| 5 | + <p v-if="canManageMembers"> |
6 | 6 | Share the public join link for the traditional flow, or add recipients below to generate |
7 | 7 | per-person fast join links. Ownly does not automatically send emails. |
8 | 8 | </p> |
| 9 | + <p v-else> |
| 10 | + Share the public join link for the traditional flow. A master owner device must approve |
| 11 | + access requests and manage per-person fast join links. |
| 12 | + </p> |
9 | 13 |
|
10 | 14 | <div class="invite-link-box mt-3"> |
11 | 15 | <div class="title is-6 mb-2">Public join link</div> |
|
22 | 26 | </div> |
23 | 27 | </div> |
24 | 28 |
|
25 | | - <div class="fast-invite-links mt-3"> |
26 | | - <div class="title is-6 mb-2">Generated fast join links</div> |
27 | | - <template v-if="fastInviteLinks.length > 0"> |
28 | | - <div class="fast-invite-link" v-for="link in fastInviteLinks" :key="link.name"> |
29 | | - <div class="fast-invite-recipient"> |
30 | | - <strong>{{ link.email || link.name }}</strong> |
31 | | - <span v-if="link.email">{{ link.name }}</span> |
| 29 | + <template v-if="canManageMembers"> |
| 30 | + <div class="fast-invite-links mt-3"> |
| 31 | + <div class="title is-6 mb-2">Generated fast join links</div> |
| 32 | + <template v-if="fastInviteLinks.length > 0"> |
| 33 | + <div class="fast-invite-link" v-for="link in fastInviteLinks" :key="link.name"> |
| 34 | + <div class="fast-invite-recipient"> |
| 35 | + <strong>{{ link.email || link.name }}</strong> |
| 36 | + <span v-if="link.email">{{ link.name }}</span> |
| 37 | + </div> |
| 38 | + <code class="select-all">{{ link.href }}</code> |
| 39 | + <button class="button invitee-list-action" @click="copyFastInviteLink(link)" title="Copy invite link"> |
| 40 | + <FontAwesomeIcon :icon="faCopy" /> |
| 41 | + </button> |
32 | 42 | </div> |
33 | | - <code class="select-all">{{ link.href }}</code> |
34 | | - <button class="button invitee-list-action" @click="copyFastInviteLink(link)" title="Copy invite link"> |
35 | | - <FontAwesomeIcon :icon="faCopy" /> |
36 | | - </button> |
37 | | - </div> |
38 | | - </template> |
39 | | - <p v-else class="invite-link-empty">No generated links yet.</p> |
40 | | - </div> |
| 43 | + </template> |
| 44 | + <p v-else class="invite-link-empty">No generated links yet.</p> |
| 45 | + </div> |
41 | 46 |
|
42 | | - <p class="mt-2">Enter an email address or NDN name below</p> |
| 47 | + <p class="mt-2">Enter an email address or NDN name below</p> |
43 | 48 |
|
44 | | - <div class="field has-addons mt-2"> |
45 | | - <div class="control is-expanded"> |
46 | | - <input class="input" type="text" :placeholder="`name@example.com or /ndn/user-name`" v-model="inviteInput" |
47 | | - :disabled="!canManageMembers" @keydown.enter.prevent="addInvitees(inviteInput)" @paste="addInviteesOnPaste" |
48 | | - autofocus /> |
49 | | - </div> |
50 | | - <div class="control"> |
51 | | - <button class="button is-primary" @click="addInvitees(inviteInput)" :disabled="!canManageMembers"> |
52 | | - Add |
53 | | - </button> |
| 49 | + <div class="field has-addons mt-2"> |
| 50 | + <div class="control is-expanded"> |
| 51 | + <input class="input" type="text" :placeholder="`name@example.com or /ndn/user-name`" v-model="inviteInput" |
| 52 | + @keydown.enter.prevent="addInvitees(inviteInput)" @paste="addInviteesOnPaste" autofocus /> |
| 53 | + </div> |
| 54 | + <div class="control"> |
| 55 | + <button class="button is-primary" @click="addInvitees(inviteInput)"> |
| 56 | + Add |
| 57 | + </button> |
| 58 | + </div> |
54 | 59 | </div> |
55 | | - </div> |
| 60 | + </template> |
56 | 61 |
|
57 | 62 | <div class="invitee-management"> |
58 | | - <div class="title is-6 mb-4" v-if="pendingRequests.length > 0"> |
| 63 | + <div class="title is-6 mb-4" v-if="canManageMembers && pendingRequests.length > 0"> |
59 | 64 | Access Requests ({{ pendingRequests.length }}) |
60 | 65 | </div> |
61 | | - <DynamicScroller class="scroller" :items="pendingRequests" :min-item-size="10" key-field="name"> |
| 66 | + <DynamicScroller v-if="canManageMembers && pendingRequests.length > 0" class="scroller" :items="pendingRequests" :min-item-size="10" key-field="name"> |
62 | 67 | <template #default="{ item, index, active }"> |
63 | 68 | <DynamicScrollerItem :item="item" :active="active" :data-index="index" class="invitee-profile"> |
64 | 69 | <div :class="{ |
|
79 | 84 |
|
80 | 85 | <div class="email" v-if="item.email">{{ item.email }}</div> |
81 | 86 | </div> |
82 | | - <button class="button invitee-list-action" :disabled="!canManageMembers" @click="acceptRequest(item)" |
83 | | - title="Accept"> |
| 87 | + <button class="button invitee-list-action" @click="acceptRequest(item)" title="Accept"> |
84 | 88 | <FontAwesomeIcon :icon="faCheck" /> |
85 | 89 | </button> |
86 | | - <button class="button invitee-list-action" :disabled="!canManageMembers" @click="denyRequest(item)" |
87 | | - title="Deny"> |
| 90 | + <button class="button invitee-list-action" @click="denyRequest(item)" title="Deny"> |
88 | 91 | <FontAwesomeIcon :icon="faXmark" /> |
89 | 92 | </button> |
90 | 93 | </div> |
|
95 | 98 | <div class="title is-6 mb-4"> |
96 | 99 | People with Access to this Workspace ({{ invitees.length }}<span v-if="pendingInvitees.length > 0"> + {{ |
97 | 100 | pendingInvitees.length }}</span>) |
98 | | - <button class="button invitee-list-action" :disabled="!canManageMembers" @click="pasteInviteeList" |
| 101 | + <button v-if="canManageMembers" class="button invitee-list-action" @click="pasteInviteeList" |
99 | 102 | title="Import invitee profiles from clipboard"> |
100 | 103 | <FontAwesomeIcon :icon="faClipboard" /> |
101 | 104 | </button> |
|
156 | 159 | </DynamicScroller> |
157 | 160 | </div> |
158 | 161 |
|
159 | | - <p v-if="!canManageMembers" class="has-text-danger has-text-weight-semibold mt-2"> |
160 | | - You must use the master owner device to invite or remove members |
161 | | - </p> |
162 | | - |
163 | 162 | <div class="field has-text-right mt-2"> |
164 | 163 | <div class="control"> |
165 | 164 | <button class="button mr-2" @click="emit('close')"> |
166 | 165 | {{ pendingInvitees.length > 0 ? 'Cancel' : 'Close' }} |
167 | 166 | </button> |
168 | | - <button class="button is-primary soft-if-dark mr-2" @click="send" |
169 | | - :disabled="!canManageMembers || pendingInvitees.length == 0"> |
| 167 | + <button v-if="canManageMembers" class="button is-primary soft-if-dark mr-2" @click="send" |
| 168 | + :disabled="pendingInvitees.length == 0"> |
170 | 169 | Invite |
171 | 170 | </button> |
172 | 171 | </div> |
|
0 commit comments