From 73cddf6da20226184e5248cf07e400a5563361fe Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 26 Oct 2021 10:48:50 +0300 Subject: [PATCH 1/7] Fix bug 53337: open new tab via share twitter --- .../Client/src/components/panels/SharingPanel/SharingRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js index 4dd68173b32..90ca8cccc4b 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js @@ -69,7 +69,7 @@ class SharingRow extends React.Component { text: shareLink, }); - window.open(twitterLink); + window.open(twitterLink, "", "width=1000,height=670"); }; // onShareFacebook = () => { From 361e6bccf5ffc5999aa5193dc4727b251678a6dc Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 27 Oct 2021 21:30:27 +0300 Subject: [PATCH 2/7] Fix bug 53335: disable button in sharing panel --- .../Client/src/components/panels/SharingPanel/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js index 857f4b94e61..6aad73bab01 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js @@ -55,6 +55,7 @@ class SharingPanelComponent extends React.Component { accessOptions: [], filesOwnerId: null, showEmbeddingContent: false, + isUpdated: false, }; this.ref = React.createRef(); @@ -70,7 +71,7 @@ class SharingPanelComponent extends React.Component { }; onToggleLink = (item) => { - const { shareDataItems } = this.state; + const { shareDataItems, isUpdated } = this.state; const { DenyAccess, ReadOnly } = ShareAccessRights; const rights = item.access !== DenyAccess ? DenyAccess : ReadOnly; @@ -80,6 +81,7 @@ class SharingPanelComponent extends React.Component { this.setState({ shareDataItems: newDataItems, showEmbeddingContent: false, + isUpdated: !isUpdated, }); }; @@ -231,6 +233,7 @@ class SharingPanelComponent extends React.Component { if (elem.access !== +access) { elem.access = +access; this.setState({ shareDataItems }); + this.setState({ isUpdated: true }); } }; @@ -434,6 +437,7 @@ class SharingPanelComponent extends React.Component { accessOptions, externalAccessOptions, showEmbeddingContent, + isUpdated, } = this.state; const visible = sharingPanelVisible; @@ -501,7 +505,7 @@ class SharingPanelComponent extends React.Component { size="big" primary onClick={this.onSaveClick} - isDisabled={isLoading} + isDisabled={isLoading || !isUpdated} /> From 71ad551bb850d7a4d3ce719b35887c691b2b311b Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 27 Oct 2021 21:35:46 +0300 Subject: [PATCH 3/7] Web: Files: disable button on mobile panel --- .../Client/src/components/panels/SharingPanel/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js index 6aad73bab01..cca6bb3b0b5 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js @@ -638,7 +638,7 @@ class SharingPanelComponent extends React.Component { minwidth="100px" primary onClick={this.onSaveClick} - isDisabled={isLoading} + isDisabled={isLoading || !isUpdated} /> From c16bfd98a42de2252a4bfe7ba0efff9a29f689b5 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 28 Oct 2021 12:15:35 +0300 Subject: [PATCH 4/7] Fix bug 53336: empty tab when sharing via email --- .../Client/src/components/panels/SharingPanel/SharingRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js index 90ca8cccc4b..f16175acfbb 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js @@ -56,7 +56,7 @@ class SharingRow extends React.Component { body, }); - window.open(mailtoLink); + window.open(mailtoLink, "_self"); }; onShareTwitter = () => { From 42dab36a342ceed258bfb60b547b418608d2e353 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 28 Oct 2021 16:36:58 +0300 Subject: [PATCH 5/7] Web: Files: fix set state --- .../Client/src/components/panels/SharingPanel/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js index cca6bb3b0b5..35f0f50701d 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js @@ -232,8 +232,7 @@ class SharingPanelComponent extends React.Component { if (elem.access !== +access) { elem.access = +access; - this.setState({ shareDataItems }); - this.setState({ isUpdated: true }); + this.setState({ shareDataItems: shareDataItems, isUpdated: true }); } }; From b5c506b7a438aeb0a9a9952c681e20b22e7a570c Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 2 Nov 2021 12:57:17 +0300 Subject: [PATCH 6/7] Web: Files: fix isUpdated sharing panel --- .../src/components/panels/SharingPanel/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js index 35f0f50701d..6711933824b 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js @@ -81,7 +81,7 @@ class SharingPanelComponent extends React.Component { this.setState({ shareDataItems: newDataItems, showEmbeddingContent: false, - isUpdated: !isUpdated, + isUpdated: true, }); }; @@ -215,8 +215,12 @@ class SharingPanelComponent extends React.Component { .catch((err) => toastr.error(err)) .finally(() => setIsLoading(false)); }; + onNotifyUsersChange = () => - this.setState({ isNotifyUsers: !this.state.isNotifyUsers }); + this.setState({ + isNotifyUsers: !this.state.isNotifyUsers, + isUpdated: true, + }); onShowUsersPanel = () => this.setState({ @@ -232,7 +236,7 @@ class SharingPanelComponent extends React.Component { if (elem.access !== +access) { elem.access = +access; - this.setState({ shareDataItems: shareDataItems, isUpdated: true }); + this.setState({ shareDataItems, isUpdated: true }); } }; @@ -243,7 +247,7 @@ class SharingPanelComponent extends React.Component { const index = shareDataItems.findIndex((x) => x.sharedTo.id === id); if (index !== -1) { shareDataItems.splice(index, 1); - this.setState({ shareDataItems }); + this.setState({ shareDataItems, isUpdated: true }); } }; @@ -348,7 +352,8 @@ class SharingPanelComponent extends React.Component { onChangeMessage = (e) => this.setState({ message: e.target.value }); - setShareDataItems = (shareDataItems) => this.setState({ shareDataItems }); + setShareDataItems = (shareDataItems) => + this.setState({ shareDataItems, isUpdated: true }); onClose = () => { const { From 44db3cbb130eba3c8a7cbae0a491d36276ec3860 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 3 Nov 2021 13:58:28 +0300 Subject: [PATCH 7/7] Web: Files: disabled button only for personal --- .../Client/src/components/panels/SharingPanel/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js index 6711933824b..ad2780bab81 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js @@ -81,7 +81,7 @@ class SharingPanelComponent extends React.Component { this.setState({ shareDataItems: newDataItems, showEmbeddingContent: false, - isUpdated: true, + isUpdated: !isUpdated, }); }; @@ -219,7 +219,6 @@ class SharingPanelComponent extends React.Component { onNotifyUsersChange = () => this.setState({ isNotifyUsers: !this.state.isNotifyUsers, - isUpdated: true, }); onShowUsersPanel = () => @@ -247,7 +246,7 @@ class SharingPanelComponent extends React.Component { const index = shareDataItems.findIndex((x) => x.sharedTo.id === id); if (index !== -1) { shareDataItems.splice(index, 1); - this.setState({ shareDataItems, isUpdated: true }); + this.setState({ shareDataItems }); } }; @@ -352,8 +351,7 @@ class SharingPanelComponent extends React.Component { onChangeMessage = (e) => this.setState({ message: e.target.value }); - setShareDataItems = (shareDataItems) => - this.setState({ shareDataItems, isUpdated: true }); + setShareDataItems = (shareDataItems) => this.setState({ shareDataItems }); onClose = () => { const { @@ -642,7 +640,7 @@ class SharingPanelComponent extends React.Component { minwidth="100px" primary onClick={this.onSaveClick} - isDisabled={isLoading || !isUpdated} + isDisabled={isLoading} />