1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
|
import { observable, runInAction, action } from "mobx";
import * as React from "react";
import MainViewModal from "../views/MainViewModal";
import { Doc, Opt, AclAdmin, AclPrivate, DocListCast, DataSym } from "../../fields/Doc";
import { DocServer } from "../DocServer";
import { Cast, StrCast } from "../../fields/Types";
import * as RequestPromise from "request-promise";
import { Utils } from "../../Utils";
import "./SharingManager.scss";
import { observer } from "mobx-react";
import * as fa from '@fortawesome/free-solid-svg-icons';
import { DocumentView } from "../views/nodes/DocumentView";
import { SelectionManager } from "./SelectionManager";
import { DocumentManager } from "./DocumentManager";
import { CollectionView } from "../views/collections/CollectionView";
import { DictationOverlay } from "../views/DictationOverlay";
import GroupManager, { UserOptions } from "./GroupManager";
import GroupMemberView from "./GroupMemberView";
import Select from "react-select";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { List } from "../../fields/List";
import { distributeAcls, SharingPermissions, GetEffectiveAcl } from "../../fields/util";
import { TaskCompletionBox } from "../views/nodes/TaskCompletedBox";
import { library } from "@fortawesome/fontawesome-svg-core";
library.add(fa.faInfoCircle, fa.faCaretUp, fa.faCaretRight, fa.faCaretDown);
export interface User {
email: string;
userDocumentId: string;
}
/**
* Interface for grouped options for the react-select component.
*/
interface GroupedOptions {
label: string;
options: UserOptions[];
}
// const SharingKey = "sharingPermissions";
// const PublicKey = "publicLinkPermissions";
// const DefaultColor = "black";
// used to differentiate between individuals and groups when sharing
const indType = "!indType/";
const groupType = "!groupType/";
const storage = "data";
/**
* A user who also has a notificationDoc.
*/
interface ValidatedUser {
user: User;
notificationDoc: Doc;
}
@observer
export default class SharingManager extends React.Component<{}> {
public static Instance: SharingManager;
@observable private isOpen = false; // whether the SharingManager modal is open or not
@observable private users: ValidatedUser[] = []; // the list of users with notificationDocs
@observable private targetDoc: Doc | undefined; // the document being shared
@observable private targetDocView: DocumentView | undefined; // the DocumentView of the document being shared
// @observable private copied = false;
@observable private dialogueBoxOpacity = 1; // for the modal
@observable private overlayOpacity = 0.4; // for the modal
@observable private selectedUsers: UserOptions[] | null = null; // users (individuals/groups) selected to share with
@observable private permissions: SharingPermissions = SharingPermissions.Edit; // the permission with which to share with other users
@observable private individualSort: "ascending" | "descending" | "none" = "none"; // sorting options for the list of individuals
@observable private groupSort: "ascending" | "descending" | "none" = "none"; // sorting options for the list of groups
private shareDocumentButtonRef: React.RefObject<HTMLButtonElement> = React.createRef(); // ref for the share button, used for the position of the popup
// if both showUserOptions and showGroupOptions are false then both are displayed
@observable private showUserOptions: boolean = false; // whether to show individuals as options when sharing (in the react-select component)
@observable private showGroupOptions: boolean = false; // // whether to show groups as options when sharing (in the react-select component)
private populating: boolean = false; // whether the list of users is populating or not
@observable private layoutDocAcls: boolean = false; // whether the layout doc or data doc's acls are to be used
// private get linkVisible() {
// return this.sharingDoc ? this.sharingDoc[PublicKey] !== SharingPermissions.None : false;
// }
public open = (target?: DocumentView, target_doc?: Doc) => {
runInAction(() => this.users = []);
// SelectionManager.DeselectAll();
this.populateUsers();
runInAction(() => {
this.targetDocView = target;
this.targetDoc = target_doc || target?.props.Document;
DictationOverlay.Instance.hasActiveModal = true;
this.isOpen = this.targetDoc !== undefined;
this.permissions = SharingPermissions.Edit;
});
this.targetDoc!.author === Doc.CurrentUserEmail && !this.targetDoc![`ACL-${Doc.CurrentUserEmail.replace(".", "_")}`] && distributeAcls(`ACL-${Doc.CurrentUserEmail.replace(".", "_")}`, SharingPermissions.Admin, this.targetDoc!);
}
public close = action(() => {
this.isOpen = false;
this.selectedUsers = null; // resets the list of users and seleected users (in the react-select component)
TaskCompletionBox.taskCompleted = false;
setTimeout(action(() => {
// this.copied = false;
DictationOverlay.Instance.hasActiveModal = false;
this.targetDoc = undefined;
}), 500);
});
constructor(props: {}) {
super(props);
SharingManager.Instance = this;
}
/**
* Populates the list of users.
*/
componentDidMount() {
this.populateUsers();
}
/**
* Populates the list of validated users (this.users) by adding registered users which have a sidebar-sharing.
*/
populateUsers = async () => {
if (!this.populating) {
this.populating = true;
runInAction(() => this.users = []);
const userList = await RequestPromise.get(Utils.prepend("/getUsers"));
const raw = JSON.parse(userList) as User[];
const evaluating = raw.map(async user => {
const isCandidate = user.email !== Doc.CurrentUserEmail;
if (isCandidate) {
const userDocument = await DocServer.GetRefField(user.userDocumentId);
if (userDocument instanceof Doc) {
const notificationDoc = await Cast(userDocument["sidebar-sharing"], Doc);
runInAction(() => {
if (notificationDoc instanceof Doc) {
this.users.push({ user, notificationDoc });
}
});
}
}
});
return Promise.all(evaluating).then(() => this.populating = false);
}
}
/**
* Sets the permission on the target for the group.
* @param group
* @param permission
*/
setInternalGroupSharing = (group: Doc, permission: string, targetDoc?: Doc) => {
const members: string[] = JSON.parse(StrCast(group.members));
const users: ValidatedUser[] = this.users.filter(({ user: { email } }) => members.includes(email));
const target = targetDoc || this.targetDoc!;
const key = StrCast(group.groupName).replace(".", "_");
const ACL = `ACL-${key}`;
GetEffectiveAcl(target) === AclAdmin && distributeAcls(ACL, permission as SharingPermissions, target);
// if documents have been shared, add the target to that list if it doesn't already exist, otherwise create a new list with the target
group.docsShared ? Doc.IndexOf(target, DocListCast(group.docsShared)) === -1 && (group.docsShared as List<Doc>).push(target) : group.docsShared = new List<Doc>([target]);
users.forEach(({ user, notificationDoc }) => {
if (permission !== SharingPermissions.None) Doc.IndexOf(target, DocListCast(notificationDoc[storage])) === -1 && Doc.AddDocToList(notificationDoc, storage, target); // add the target to the notificationDoc if it hasn't already been added
else GetEffectiveAcl(target, undefined, user.email) === AclPrivate && Doc.IndexOf((target.aliasOf as Doc || target), DocListCast(notificationDoc[storage])) !== -1 && Doc.RemoveDocFromList(notificationDoc, storage, (target.aliasOf as Doc || target)); // remove the target from the list if it already exists
});
}
/**
* Shares the documents shared with a group with a new user who has been added to that group.
* @param group
* @param emailId
*/
shareWithAddedMember = (group: Doc, emailId: string) => {
const user: ValidatedUser = this.users.find(({ user: { email } }) => email === emailId)!;
if (group.docsShared) DocListCast(group.docsShared).forEach(doc => Doc.IndexOf(doc, DocListCast(user.notificationDoc[storage])) === -1 && Doc.AddDocToList(user.notificationDoc, storage, doc));
}
/**
* Called from the properties sidebar to change permissions of a user.
*/
shareFromPropertiesSidebar = (shareWith: string, permission: SharingPermissions, target: Doc) => {
if (shareWith !== "Public") {
const user = this.users.find(({ user: { email } }) => email === (shareWith === "Me" ? Doc.CurrentUserEmail : shareWith));
if (user) this.setInternalSharing(user, permission, target);
else this.setInternalGroupSharing(GroupManager.Instance.getGroup(shareWith)!, permission, target);
}
else if (GetEffectiveAcl(target) === AclAdmin) distributeAcls("ACL-Public", permission, target);
}
/**
* Removes the documents shared with a user through a group when the user is removed from the group.
* @param group
* @param emailId
*/
removeMember = (group: Doc, emailId: string) => {
const user: ValidatedUser = this.users.find(({ user: { email } }) => email === emailId)!;
if (group.docsShared) {
DocListCast(group.docsShared).forEach(doc => {
Doc.IndexOf(doc, DocListCast(user.notificationDoc[storage])) !== -1 && Doc.RemoveDocFromList(user.notificationDoc, storage, doc); // remove the doc only if it is in the list
});
}
}
/**
* Removes a group's permissions from documents that have been shared with it.
* @param group
*/
removeGroup = (group: Doc) => {
if (group.docsShared) {
DocListCast(group.docsShared).forEach(doc => {
const ACL = `ACL-${StrCast(group.groupName)}`;
distributeAcls(ACL, SharingPermissions.None, doc);
const members: string[] = JSON.parse(StrCast(group.members));
const users: ValidatedUser[] = this.users.filter(({ user: { email } }) => members.includes(email));
users.forEach(({ notificationDoc }) => Doc.RemoveDocFromList(notificationDoc, storage, doc));
});
}
}
/**
* Shares the document with a user.
*/
setInternalSharing = (recipient: ValidatedUser, permission: string, targetDoc?: Doc) => {
const { user, notificationDoc } = recipient;
const target = targetDoc || this.targetDoc!;
const key = user.email.replace('.', '_');
const ACL = `ACL-${key}`;
GetEffectiveAcl(target) === AclAdmin && distributeAcls(ACL, permission as SharingPermissions, target);
if (permission !== SharingPermissions.None) Doc.IndexOf(target, DocListCast(notificationDoc[storage])) === -1 && Doc.AddDocToList(notificationDoc, storage, target);
else GetEffectiveAcl(target, undefined, user.email) === AclPrivate && Doc.IndexOf((target.aliasOf as Doc || target), DocListCast(notificationDoc[storage])) !== -1 && Doc.RemoveDocFromList(notificationDoc, storage, (target.aliasOf as Doc || target));
}
// private setExternalSharing = (permission: string) => {
// const sharingDoc = this.sharingDoc;
// if (!sharingDoc) {
// return;
// }
// sharingDoc[PublicKey] = permission;
// }
// private get sharingUrl() {
// if (!this.targetDoc) {
// return undefined;
// }
// const baseUrl = Utils.prepend("/doc/" + this.targetDoc[Id]);
// return `${baseUrl}?sharing=true`;
// }
// copy = action(() => {
// if (this.sharingUrl) {
// Utils.CopyText(this.sharingUrl);
// this.copied = true;
// }
// });
/**
* Returns the SharingPermissions (Admin, Can Edit etc) access that's used to share
*/
private get sharingOptions() {
return Object.values(SharingPermissions).map(permission =>
(
<option key={permission} value={permission}>
{permission}
</option>
)
);
}
private focusOn = (contents: string) => {
const title = this.targetDoc ? StrCast(this.targetDoc.title) : "";
return (
<span
className={"focus-span"}
title={title}
onClick={() => {
let context: Opt<CollectionView>;
if (this.targetDoc && this.targetDocView && (context = this.targetDocView.props.ContainingCollectionView)) {
DocumentManager.Instance.jumpToDocument(this.targetDoc, true, undefined, context.props.Document);
}
}}
onPointerEnter={action(() => {
if (this.targetDoc) {
Doc.BrushDoc(this.targetDoc);
this.dialogueBoxOpacity = 0.1;
this.overlayOpacity = 0.1;
}
})}
onPointerLeave={action(() => {
this.targetDoc && Doc.UnBrushDoc(this.targetDoc);
this.dialogueBoxOpacity = 1;
this.overlayOpacity = 0.4;
})}
>
{contents}
</span>
);
}
/**
* Handles changes in the users selected in react-select
*/
@action
handleUsersChange = (selectedOptions: any) => {
this.selectedUsers = selectedOptions as UserOptions[];
}
/**
* Handles changes in the permission chosen to share with someone with
*/
@action
handlePermissionsChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
this.permissions = event.currentTarget.value as SharingPermissions;
}
/**
* Calls the relevant method for sharing, displays the popup, and resets the relevant variables.
*/
@action
share = () => {
if (this.selectedUsers) {
this.selectedUsers.forEach(user => {
if (user.value.includes(indType)) {
this.setInternalSharing(this.users.find(u => u.user.email === user.label)!, this.permissions);
}
else {
this.setInternalGroupSharing(GroupManager.Instance.getGroup(user.label)!, this.permissions);
}
});
const { left, width, top, height } = this.shareDocumentButtonRef.current!.getBoundingClientRect();
TaskCompletionBox.popupX = left - 1.5 * width;
TaskCompletionBox.popupY = top - 1.5 * height;
TaskCompletionBox.textDisplayed = "Document shared!";
TaskCompletionBox.taskCompleted = true;
setTimeout(action(() => TaskCompletionBox.taskCompleted = false), 2000);
this.selectedUsers = null;
}
}
/**
* Sorting algorithm to sort users.
*/
sortUsers = (u1: ValidatedUser, u2: ValidatedUser) => {
const { email: e1 } = u1.user;
const { email: e2 } = u2.user;
return e1 < e2 ? -1 : e1 === e2 ? 0 : 1;
}
/**
* Sorting algorithm to sort groups.
*/
sortGroups = (group1: Doc, group2: Doc) => {
const g1 = StrCast(group1.groupName);
const g2 = StrCast(group2.groupName);
return g1 < g2 ? -1 : g1 === g2 ? 0 : 1;
}
/**
* @returns the main interface of the SharingManager.
*/
private get sharingInterface() {
const groupList = GroupManager.Instance?.getAllGroups() || [];
const sortedUsers = this.users.slice().sort(this.sortUsers)
.map(({ user: { email } }) => ({ label: email, value: indType + email }));
const sortedGroups = groupList.slice().sort(this.sortGroups)
.map(({ groupName }) => ({ label: StrCast(groupName), value: groupType + StrCast(groupName) }));
// the next block handles the users shown (individuals/groups/both)
const options: GroupedOptions[] = [];
if (GroupManager.Instance) {
if ((this.showUserOptions && this.showGroupOptions) || (!this.showUserOptions && !this.showGroupOptions)) {
options.push({
label: 'Individuals',
options: sortedUsers
},
{
label: 'Groups',
options: sortedGroups
});
}
else if (this.showUserOptions) {
options.push({
label: 'Individuals',
options: sortedUsers
});
}
else {
options.push({
label: 'Groups',
options: sortedGroups
});
}
}
const users = this.individualSort === "ascending" ? this.users.slice().sort(this.sortUsers) : this.individualSort === "descending" ? this.users.slice().sort(this.sortUsers).reverse() : this.users;
const groups = this.groupSort === "ascending" ? groupList.slice().sort(this.sortGroups) : this.groupSort === "descending" ? groupList.slice().sort(this.sortGroups).reverse() : groupList;
const targetDoc = this.layoutDocAcls ? this.targetDoc : this.targetDoc?.[DataSym];
const effectiveAcl = targetDoc ? GetEffectiveAcl(targetDoc) : AclPrivate;
// the list of users shared with
const userListContents: (JSX.Element | null)[] = users.map(({ user, notificationDoc }) => {
const userKey = user.email.replace('.', '_');
const permissions = StrCast(targetDoc?.[`ACL-${userKey}`]);
return !permissions || user.email === targetDoc?.author ? (null) : (
<div
key={userKey}
className={"container"}
>
<span className={"padding"}>{user.email}</span>
<div className="edit-actions">
{effectiveAcl === AclAdmin ? (
<select
className={"permissions-dropdown"}
value={permissions}
onChange={e => this.setInternalSharing({ user, notificationDoc }, e.currentTarget.value)}
>
{this.sharingOptions}
</select>
) : (
<div className={"permissions-dropdown"}>
{permissions}
</div>
)}
</div>
</div>
);
});
// the owner of the doc and the current user are placed at the top of the user list.
userListContents.unshift(
(
<div
key={"owner"}
className={"container"}
>
<span className={"padding"}>{targetDoc?.author === Doc.CurrentUserEmail ? "Me" : targetDoc?.author}</span>
<div className="edit-actions">
<div className={"permissions-dropdown"}>
Owner
</div>
</div>
</div>
),
targetDoc?.author !== Doc.CurrentUserEmail ?
(
<div
key={"me"}
className={"container"}
>
<span className={"padding"}>Me</span>
<div className="edit-actions">
<div className={"permissions-dropdown"}>
{targetDoc?.[`ACL-${Doc.CurrentUserEmail.replace(".", "_")}`]}
</div>
</div>
</div>
) : null
);
// the list of groups shared with
const groupListContents = groups.map(group => {
const permissions = StrCast(targetDoc?.[`ACL-${StrCast(group.groupName)}`]);
return !permissions ? null : (
<div
key={StrCast(group.groupName)}
className={"container"}
>
<div className={"padding"}>{group.groupName}</div>
<div className="group-info" onClick={action(() => GroupManager.Instance.currentGroup = group)}>
<FontAwesomeIcon icon={fa.faInfoCircle} color={"#e8e8e8"} size={"sm"} style={{ backgroundColor: "#1e89d7", borderRadius: "100%", border: "1px solid #1e89d7" }} />
</div>
<div className="edit-actions">
<select
className={"permissions-dropdown"}
value={permissions}
onChange={e => this.setInternalGroupSharing(group, e.currentTarget.value)}
>
{this.sharingOptions}
</select>
</div>
</div>
);
});
// don't display the group list if all groups are null
const displayGroupList = !groupListContents?.every(group => group === null);
return (
<div className={"sharing-interface"}>
{GroupManager.Instance?.currentGroup ?
<GroupMemberView
group={GroupManager.Instance.currentGroup}
onCloseButtonClick={action(() => GroupManager.Instance.currentGroup = undefined)}
/> :
null}
{/* <p className={"share-link"}>Manage the public link to {this.focusOn("this document...")}</p>
{!this.linkVisible ? (null) :
<div className={"link-container"}>
<div className={"link-box"} onClick={this.copy}>{this.sharingUrl}</div>
<div
title={"Copy link to clipboard"}
className={"copy"}
style={{ backgroundColor: this.copied ? "lawngreen" : "gainsboro" }}
onClick={this.copy}
>
<FontAwesomeIcon icon={fa.faCopy} />
</div>
</div>
}
<div className={"people-with-container"}>
{!this.linkVisible ? (null) : <p className={"people-with"}>People with this link</p>}
<select
className={"people-with-select"}
value={this.sharingDoc ? StrCast(this.sharingDoc[PublicKey], SharingPermissions.None) : SharingPermissions.None}
style={{
marginLeft: this.linkVisible ? 10 : 0,
color: this.sharingDoc ? ColorMapping.get(StrCast(this.sharingDoc[PublicKey], SharingPermissions.None)) : DefaultColor,
borderColor: this.sharingDoc ? ColorMapping.get(StrCast(this.sharingDoc[PublicKey], SharingPermissions.None)) : DefaultColor
}}
onChange={e => this.setExternalSharing(e.currentTarget.value)}
>
{this.sharingOptions}
</select>
</div>
<div className={"hr-substitute"} /> */}
<div className="sharing-contents">
<p className={"share-title"}><b>Share </b>{this.focusOn(StrCast(targetDoc?.title, "this document"))}</p>
<div className={"close-button"} onClick={this.close}>
<FontAwesomeIcon icon={"times"} color={"black"} size={"lg"} />
</div>
{<div className="share-container">
<div className="share-setup">
<Select
className={"user-search"}
placeholder={"Enter user or group name..."}
isMulti
closeMenuOnSelect={false}
options={options}
onChange={this.handleUsersChange}
value={this.selectedUsers}
styles={{
indicatorSeparator: () => ({
visibility: "hidden"
})
}}
/>
<select className="permissions-select" onChange={this.handlePermissionsChange} value={this.permissions}>
{this.sharingOptions}
</select>
<button ref={this.shareDocumentButtonRef} className="share-button" onClick={this.share}>
Share
</button>
</div>
<div className="sort-checkboxes">
<input type="checkbox" onChange={action(() => this.showUserOptions = !this.showUserOptions)} /> <label style={{ marginRight: 10 }}>Individuals</label>
<input type="checkbox" onChange={action(() => this.showGroupOptions = !this.showGroupOptions)} /> <label>Groups</label>
</div>
<div className="layoutDoc-acls">
<input type="checkbox" onChange={action(() => this.layoutDocAcls = !this.layoutDocAcls)} checked={this.layoutDocAcls} /> <label>Layout</label>
</div>
</div>
}
<div className="main-container">
<div className={"individual-container"}>
<div
className="user-sort"
onClick={action(() => this.individualSort = this.individualSort === "ascending" ? "descending" : this.individualSort === "descending" ? "none" : "ascending")}>
Individuals {this.individualSort === "ascending" ? <FontAwesomeIcon icon={fa.faCaretUp} size={"xs"} />
: this.individualSort === "descending" ? <FontAwesomeIcon icon={fa.faCaretDown} size={"xs"} />
: <FontAwesomeIcon icon={fa.faCaretRight} size={"xs"} />}
</div>
<div className={"users-list"} style={{ display: "block" }}>{/*200*/}
{userListContents}
</div>
</div>
<div className={"group-container"}>
<div
className="user-sort"
onClick={action(() => this.groupSort = this.groupSort === "ascending" ? "descending" : this.groupSort === "descending" ? "none" : "ascending")}>
Groups {this.groupSort === "ascending" ? <FontAwesomeIcon icon={fa.faCaretUp} size={"xs"} />
: this.groupSort === "descending" ? <FontAwesomeIcon icon={fa.faCaretDown} size={"xs"} />
: <FontAwesomeIcon icon={fa.faCaretRight} size={"xs"} />}
</div>
<div className={"groups-list"} style={{ display: !displayGroupList ? "flex" : "block" }}>{/*200*/}
{
!displayGroupList ?
<div
className={"none"}
>
There are no groups this document has been shared with.
</div>
:
groupListContents
}
</div>
</div>
</div>
</div>
</div>
);
}
render() {
return (
<MainViewModal
contents={this.sharingInterface}
isDisplayed={this.isOpen}
interactive={true}
dialogueBoxDisplayedOpacity={this.dialogueBoxOpacity}
overlayDisplayedOpacity={this.overlayOpacity}
closeOnExternalClick={this.close}
/>
);
}
}
|