From 1410392575b411f49601ce039787b6052542b711 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Fri, 3 Jul 2020 21:50:56 +0530 Subject: can now exit modal by clicking outside it --- src/client/apis/GoogleAuthenticationManager.tsx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/client/apis/GoogleAuthenticationManager.tsx') diff --git a/src/client/apis/GoogleAuthenticationManager.tsx b/src/client/apis/GoogleAuthenticationManager.tsx index bf4469aeb..5a2bdb13b 100644 --- a/src/client/apis/GoogleAuthenticationManager.tsx +++ b/src/client/apis/GoogleAuthenticationManager.tsx @@ -157,6 +157,7 @@ export default class GoogleAuthenticationManager extends React.Component<{}> { contents={this.renderPrompt} overlayDisplayedOpacity={0.9} dialogueBoxStyle={this.dialogueBoxStyle} + closeOnExternalClick={() => this.isOpen = false} /> ); } -- cgit v1.2.3-70-g09d2 From 7b7d83f6f7070334fdfc4dd7cca03699b8e21078 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Mon, 20 Jul 2020 19:21:54 +0530 Subject: fixed some addonly stuff + added annotations to playground fields + recursively distributes acls + some modal stuff --- src/client/apis/GoogleAuthenticationManager.tsx | 7 +-- .../apis/HypothesisAuthenticationManager.tsx | 6 ++- src/client/util/GroupManager.scss | 2 +- src/client/util/GroupManager.tsx | 6 +-- src/client/util/SettingsManager.tsx | 4 +- src/client/util/SharingManager.tsx | 58 ++++++++++++++++++---- src/client/views/DocComponent.tsx | 26 ++++++++-- src/client/views/MainView.tsx | 2 +- src/client/views/collections/CollectionView.tsx | 25 +++++++++- src/fields/Doc.ts | 14 +++--- src/fields/util.ts | 21 ++++---- 11 files changed, 128 insertions(+), 43 deletions(-) (limited to 'src/client/apis/GoogleAuthenticationManager.tsx') diff --git a/src/client/apis/GoogleAuthenticationManager.tsx b/src/client/apis/GoogleAuthenticationManager.tsx index 5a2bdb13b..117d1fa1e 100644 --- a/src/client/apis/GoogleAuthenticationManager.tsx +++ b/src/client/apis/GoogleAuthenticationManager.tsx @@ -146,7 +146,7 @@ export default class GoogleAuthenticationManager extends React.Component<{}> { private get dialogueBoxStyle() { const borderColor = this.success === undefined ? "black" : this.success ? "green" : "red"; - return { borderColor, transition: "0.2s borderColor ease" }; + return { borderColor, transition: "0.2s borderColor ease", zIndex: 1002 }; } render() { @@ -155,9 +155,10 @@ export default class GoogleAuthenticationManager extends React.Component<{}> { isDisplayed={this.openState} interactive={true} contents={this.renderPrompt} - overlayDisplayedOpacity={0.9} + // overlayDisplayedOpacity={0.9} dialogueBoxStyle={this.dialogueBoxStyle} - closeOnExternalClick={() => this.isOpen = false} + overlayStyle={{ zIndex: 1001 }} + closeOnExternalClick={action(() => this.isOpen = false)} /> ); } diff --git a/src/client/apis/HypothesisAuthenticationManager.tsx b/src/client/apis/HypothesisAuthenticationManager.tsx index a7fcf86a4..c3e8d2fff 100644 --- a/src/client/apis/HypothesisAuthenticationManager.tsx +++ b/src/client/apis/HypothesisAuthenticationManager.tsx @@ -138,7 +138,7 @@ export default class HypothesisAuthenticationManager extends React.Component<{}> private get dialogueBoxStyle() { const borderColor = this.success === undefined ? "black" : this.success ? "green" : "red"; - return { borderColor, transition: "0.2s borderColor ease" }; + return { borderColor, transition: "0.2s borderColor ease", zIndex: 1002 }; } render() { @@ -147,8 +147,10 @@ export default class HypothesisAuthenticationManager extends React.Component<{}> isDisplayed={this.openState} interactive={true} contents={this.renderPrompt} - overlayDisplayedOpacity={0.9} + // overlayDisplayedOpacity={0.9} dialogueBoxStyle={this.dialogueBoxStyle} + overlayStyle={{ zIndex: 1001 }} + closeOnExternalClick={action(() => this.isOpen = false)} /> ); } diff --git a/src/client/util/GroupManager.scss b/src/client/util/GroupManager.scss index 34d4f40f8..51e4fa9e2 100644 --- a/src/client/util/GroupManager.scss +++ b/src/client/util/GroupManager.scss @@ -1,5 +1,5 @@ .group-interface { - width: 550px; + width: 380px; height: 300px; .dialogue-box { diff --git a/src/client/util/GroupManager.tsx b/src/client/util/GroupManager.tsx index 12951f2ab..2e5ecc543 100644 --- a/src/client/util/GroupManager.tsx +++ b/src/client/util/GroupManager.tsx @@ -354,7 +354,7 @@ export default class GroupManager extends React.Component<{}> { isDisplayed={this.createGroupModalOpen} interactive={true} contents={contents} - dialogueBoxStyle={{ width: "70%", height: "70%" }} + dialogueBoxStyle={{ width: "90%", height: "70%" }} closeOnExternalClick={action(() => this.createGroupModalOpen = false)} /> ); @@ -424,8 +424,8 @@ export default class GroupManager extends React.Component<{}> { contents={this.groupInterface} isDisplayed={this.isOpen} interactive={true} - dialogueBoxDisplayedOpacity={this.dialogueBoxOpacity} - overlayDisplayedOpacity={this.overlayOpacity} + dialogueBoxStyle={{ zIndex: 1002 }} + overlayStyle={{ zIndex: 1001 }} closeOnExternalClick={this.close} /> ); diff --git a/src/client/util/SettingsManager.tsx b/src/client/util/SettingsManager.tsx index fc5fdd869..90d59aa51 100644 --- a/src/client/util/SettingsManager.tsx +++ b/src/client/util/SettingsManager.tsx @@ -119,10 +119,10 @@ export default class SettingsManager extends React.Component<{}> { + - {this.settingsContent === "password" ?
([ + [AclPrivate, SharingPermissions.None], + [AclReadonly, SharingPermissions.View], + [AclAddonly, SharingPermissions.Add], + [AclEdit, SharingPermissions.Edit] + ]); + lookupField = (field: string) => ScriptCast((this.layoutDoc as any).lookupField)?.script.run({ self: this.layoutDoc, data: this.rootDoc, field: field }).result; styleFromLayoutString = (scale: number) => { @@ -139,11 +147,21 @@ export function ViewBoxAnnotatableComponent
!docList.includes(d));
const effectiveAcl = GetEffectiveAcl(this.dataDoc);
+
+ if (this.props.Document[AclSym]) {
+ added.forEach(d => {
+ const dataDoc = d[DataSym];
+ dataDoc[AclSym] = d[AclSym] = this.props.Document[AclSym];
+ for (const [key, value] of Object.entries(this.props.Document[AclSym])) {
+ dataDoc[key] = d[key] = this.AclMap.get(value);
+ }
+ });
+ }
if (added.length) {
- if (effectiveAcl === AclReadonly) {
+ if (effectiveAcl === AclReadonly && !getPlaygroundMode()) {
return false;
} else if (effectiveAcl === AclAddonly) {
- added.map(doc => Doc.AddDocToList(targetDataDoc, this.annotationKey, doc));
+ added.map(doc => console.log(Doc.AddDocToList(targetDataDoc, this.annotationKey, doc)));
} else {
added.map(doc => doc.context = this.props.Document);
targetDataDoc[this.annotationKey] = new List