From 8aed4ccfd50fd199a930fdec80d723e4415151fd Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 31 Mar 2021 16:33:16 +0530 Subject: [PATCH 1/5] WIP CHANGELOG --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 324c03785..70160b03c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +# WIP + +* OnlyOffice + * inform OnlyOffice of userlist changes + * rename doc and slide editors + * handle different lock formats for docs and slides + * relative to sheets + * handle some cursor logic outside of sheets + * handle locks when integrating remote checkpoints in strict mode + * OnlyOffice renamed buttons in slides and docs and we need to hardcode CSS that hides them by their randomly generated IDs + * support CryptPad cursor colors in OnlyOffice by adding opacity value + * use the appropriate APIs to detect if the document is modified + * display users cursor colors in the toolbar next to their name +* bad channel IDs stored in your drive or accessed via bad links (corrupted somehow) + * don't try to join invalid channels + * don't try to get their metadata +* prompt premium users to cancel their subscriptions before deleting their accounts + # 4.3.1 This minor release addresses some bugs discovered after deploying and tagging 4.3.0 From b732666ed090aaf089aa3a31d2787fdb8d6268e6 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 1 Apr 2021 10:34:02 +0200 Subject: [PATCH 2/5] Fix OO migration banner in embed mode --- www/common/onlyoffice/inner.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 2fec3682b..6962d0a73 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -2491,7 +2491,11 @@ define([ APP.onLocal(); } else { msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor); - $(APP.helpMenu.menu).after(msg); + if (APP.helpMenu) { + $(APP.helpMenu.menu).after(msg); + } else { + $('#cp-app-oo-editor').prepend(msg); + } readOnly = true; } } else if (content && content.version <= 3) { // V2 or V3 @@ -2503,7 +2507,11 @@ define([ APP.onLocal(); } else { msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor); - $(APP.helpMenu.menu).after(msg); + if (APP.helpMenu) { + $(APP.helpMenu.menu).after(msg); + } else { + $('#cp-app-oo-editor').prepend(msg); + } readOnly = true; } } From b709b7a31bb39f0a177f3d021ad39a800e879b16 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 1 Apr 2021 10:53:55 +0200 Subject: [PATCH 3/5] Fix OO error modal in switch to read-only --- www/common/onlyoffice/inner.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 6962d0a73..6c2d9332f 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1375,12 +1375,11 @@ define([ return; } - if (lock) { - getEditor().setViewModeDisconnect(); - } else if (readOnly) { + if (lock || readOnly) { try { getEditor().asc_setRestriction(true); } catch (e) {} + //getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup } else { setEditable(true); deleteOfflineLocks(); @@ -1400,7 +1399,6 @@ define([ } } - if (isLockedModal.modal && force) { isLockedModal.modal.closeModal(); delete isLockedModal.modal; @@ -1424,7 +1422,7 @@ define([ } catch (e) {} } - if (APP.migrate && !readOnly) { + if (lock && !readOnly) { onMigrateRdy.fire(); } From 657b9e347b6ebc6890a202d1d9d28f38ead591e4 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 1 Apr 2021 10:58:14 +0200 Subject: [PATCH 4/5] Stop using setViewModeDisconnect in OO --- www/common/onlyoffice/inner.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 6c2d9332f..ef43b06b0 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1350,7 +1350,7 @@ define([ // Migration required but read-only: continue... if (readOnly) { setEditable(true); - getEditor().setViewModeDisconnect(); + try { getEditor().asc_setRestriction(true); } catch (e) {} } else { // No changes after the cp: migrate now onMigrateRdy.fire(); @@ -1376,9 +1376,7 @@ define([ } if (lock || readOnly) { - try { - getEditor().asc_setRestriction(true); - } catch (e) {} + try { getEditor().asc_setRestriction(true); } catch (e) {} //getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup } else { setEditable(true); @@ -1408,7 +1406,8 @@ define([ } if (APP.template) { - getEditor().setViewModeDisconnect(); + try { getEditor().asc_setRestriction(true); } catch (e) {} + //getEditor().setViewModeDisconnect(); UI.removeLoadingScreen(); makeCheckpoint(true); return; @@ -1977,7 +1976,7 @@ define([ UI.removeModals(); UI.confirm(Messages.oo_uploaded, function (yes) { try { - getEditor().setViewModeDisconnect(); + getEditor().asc_setRestriction(true); } catch (e) {} if (!yes) { return; } common.gotoURL(); @@ -2143,7 +2142,9 @@ define([ APP.history = true; APP.template = true; var editor = getEditor(); - if (editor) { editor.setViewModeDisconnect(); } + if (editor) { + try { getEditor().asc_setRestriction(true); } catch (e) {} + } var content = parsed.content; // Get checkpoint @@ -2282,7 +2283,7 @@ define([ var setHistoryMode = function (bool) { if (bool) { APP.history = true; - getEditor().setViewModeDisconnect(); + try { getEditor().asc_setRestriction(true); } catch (e) {} return; } // Cancel button: redraw from lastCp From 341a704b4cc7b79db27a8a1d5025046d4f01791c Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 1 Apr 2021 14:50:59 +0530 Subject: [PATCH 5/5] WIP changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70160b03c..f7a78c0fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * support CryptPad cursor colors in OnlyOffice by adding opacity value * use the appropriate APIs to detect if the document is modified * display users cursor colors in the toolbar next to their name + * handle errors when migrating in embed mode + * change the method we use to lock the whole sheet since OnlyOffice changed their internal API's behaviour * bad channel IDs stored in your drive or accessed via bad links (corrupted somehow) * don't try to join invalid channels * don't try to get their metadata