aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-08-05 13:23:47 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-08-05 13:23:47 +0530
commit2b8fd3bbc922fdb9b82ed5cabe6308b37077fb9e (patch)
treedf582c3e910444684b0891352846e7c5ac4c72c9 /src/client/views/collections
parent0566852022c17a12d521ebf1f280f748fe34c602 (diff)
comments and minor changes
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionFreeForm/PropertiesView.tsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
index f5e0cd077..31962837c 100644
--- a/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
+++ b/src/client/views/collections/collectionFreeForm/PropertiesView.tsx
@@ -266,11 +266,17 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
}
+ /**
+ * Handles the changing of a user's permissions from the permissions panel.
+ */
@undoBatch
changePermissions = (e: any, user: string) => {
SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, this.selectedDoc!);
}
+ /**
+ * @returns the options for the permissions dropdown.
+ */
getPermissionsSelect(user: string) {
return <select className="permissions-select"
onChange={e => this.changePermissions(e, user)}>
@@ -283,6 +289,9 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</select>;
}
+ /**
+ * @returns the notification icon. On clicking, it should notify someone of a document been shared with them.
+ */
@computed get notifyIcon() {
return <Tooltip title={<><div className="dash-tooltip">Notify with message</div></>}>
<div className="notify-button">
@@ -291,6 +300,9 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</Tooltip>;
}
+ /**
+ * ... next to the owner that opens the main SharingManager interface on click.
+ */
@computed get expansionIcon() {
return <Tooltip title={<><div className="dash-tooltip">{"Show more permissions"}</div></>}>
<div className="expansion-button" onPointerDown={() => {
@@ -303,6 +315,9 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</Tooltip>;
}
+ /**
+ * @returns a row of the permissions panel
+ */
sharingItem(name: string, effectiveAcl: symbol, permission?: string) {
return <div className="propertiesView-sharingTable-item">
<div className="propertiesView-sharingTable-item-name" style={{ width: name !== "Me" ? "85px" : "80px" }}> {name} </div>
@@ -314,6 +329,9 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</div>;
}
+ /**
+ * @returns the sharing and permissiosn panel.
+ */
@computed get sharingTable() {
const AclMap = new Map<symbol, string>([
[AclPrivate, SharingPermissions.None],
@@ -333,6 +351,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
}
}
+ // shifts the current user and the owner to the top of the doc.
tableEntries.unshift(this.sharingItem("Me", effectiveAcl, Doc.CurrentUserEmail === this.selectedDoc!.author ? "Owner" : StrCast(this.selectedDoc![`ACL-${Doc.CurrentUserEmail.replace(".", "_")}`])));
if (Doc.CurrentUserEmail !== this.selectedDoc!.author) tableEntries.unshift(this.sharingItem(StrCast(this.selectedDoc!.author), effectiveAcl, "Owner"));