Merge branch 'staging' into latest-broadcast

pull/1/head
ansuz 4 years ago
commit 57080dd5ca

@ -1,19 +1,34 @@
# 4.3.1 (WIP) # 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
* 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
* 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 This minor release addresses some bugs discovered after deploying and tagging 4.3.0
* better isLoggedIn() check * We found that some browser extensions interfered with checks to determine whether a registered user was correctly logged in, which resulted in some disabled functionality. If you are running extensions that actively delete the tokens that keep you logged your session should now stay alive until you close all its active tabs, after which you will have to log back in.
* fix templates in sheets * Our 4.2.0 update introduced a new internal format for spreadsheets which broke support for spreadsheet templates using the older format. This release implements a compatibility layer.
* include onlyOffice version along with checkpoint hashes * We fixed some minor bugs in our rich text editor. Section links in the table of contents now navigate correctly. Adding a comment to a link no longer prevents clicking on that link.
* send feedback when opening the readme * A race condition that caused poll titles to reset occasionally has been fixed.
* so we can decide whether to remove it * We've added a little bit of telemetry to tell our server when a newly registered user opens the new user guide which is automatically added to their drive. We're considering either rewriting or removing this guide, so it's helpful to be able to determine how often people actually read it.
* handle decryption errors for blobs * An error introduced in 4.3.0 was preventing the creation of new teams. It's been fixed.
* prompted by a badly formed sheet checkpoint * 4.3.0 temporarily broke the sheet editor for iPad users. Migrations to a new internal format that were run while the editor was in a bad state produced some invalid data that prevented sheets from loading correctly. This release improves the platforms ability to recover from bad states like this and improves its ability to detect the kind of errors we observed.
* fix broken team creation
* CKEditor
* broken table of contents scrollTo
* show the link bubble for links inside of comments
* fix title reset in polls
# 4.3.0 (D) # 4.3.0 (D)

@ -79,6 +79,7 @@ define([
var toolbar; var toolbar;
var cursor;
var andThen = function (common) { var andThen = function (common) {
@ -871,17 +872,6 @@ define([
return locks; return locks;
}; };
var locksArrayToObject = function (arr) {
var l = {};
if (!Array.isArray(arr)) { return l; }
arr.forEach(function (lock) {
var uid = lock.block;
if (!uid) { return; }
l[uid] = lock;
});
return l;
};
// Update the userlist in onlyoffice // Update the userlist in onlyoffice
var handleNewIds = function (o, n) { var handleNewIds = function (o, n) {
if (stringify(o) === stringify(n)) { return; } if (stringify(o) === stringify(n)) { return; }
@ -1297,7 +1287,6 @@ define([
if (APP.ooconfig && !force) { return void console.error('already started'); } if (APP.ooconfig && !force) { return void console.error('already started'); }
var url = URL.createObjectURL(blob); var url = URL.createObjectURL(blob);
var lock = !APP.history && (APP.migrate); var lock = !APP.history && (APP.migrate);
var type = common.getMetadataMgr().getPrivateData().ooType;
// Starting from version 3, we can use the view mode again // Starting from version 3, we can use the view mode again
// defined but never used // defined but never used
@ -1420,7 +1409,7 @@ define([
// Migration required but read-only: continue... // Migration required but read-only: continue...
if (readOnly) { if (readOnly) {
setEditable(true); setEditable(true);
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
} else { } else {
// No changes after the cp: migrate now // No changes after the cp: migrate now
onMigrateRdy.fire(); onMigrateRdy.fire();
@ -1445,12 +1434,9 @@ define([
return; return;
} }
if (lock) { if (lock || readOnly) {
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
} else if (readOnly) { //getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup
try {
getEditor().asc_setRestriction(true);
} catch (e) {}
} else { } else {
setEditable(true); setEditable(true);
deleteOfflineLocks(); deleteOfflineLocks();
@ -1470,7 +1456,6 @@ define([
} }
} }
if (isLockedModal.modal && force) { if (isLockedModal.modal && force) {
isLockedModal.modal.closeModal(); isLockedModal.modal.closeModal();
delete isLockedModal.modal; delete isLockedModal.modal;
@ -1480,7 +1465,8 @@ define([
} }
if (APP.template) { if (APP.template) {
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
//getEditor().setViewModeDisconnect();
UI.removeLoadingScreen(); UI.removeLoadingScreen();
makeCheckpoint(true); makeCheckpoint(true);
return; return;
@ -1494,7 +1480,7 @@ define([
} catch (e) {} } catch (e) {}
} }
if (APP.migrate && !readOnly) { if (lock && !readOnly) {
onMigrateRdy.fire(); onMigrateRdy.fire();
} }
@ -1605,9 +1591,6 @@ define([
APP.getImageURL = function(name, callback) { APP.getImageURL = function(name, callback) {
if (name && /^data:image/.test(name)) { if (name && /^data:image/.test(name)) {
return void callback(''); return void callback('');
var b = Util.dataURIToBlob(name);
var url = URL.createObjectURL(blob);
return void callback(url);
} }
var mediasSources = getMediasSources(); var mediasSources = getMediasSources();
@ -2079,7 +2062,7 @@ define([
UI.removeModals(); UI.removeModals();
UI.confirm(Messages.oo_uploaded, function (yes) { UI.confirm(Messages.oo_uploaded, function (yes) {
try { try {
getEditor().setViewModeDisconnect(); getEditor().asc_setRestriction(true);
} catch (e) {} } catch (e) {}
if (!yes) { return; } if (!yes) { return; }
common.gotoURL(); common.gotoURL();
@ -2246,7 +2229,9 @@ define([
APP.history = true; APP.history = true;
APP.template = true; APP.template = true;
var editor = getEditor(); var editor = getEditor();
if (editor) { editor.setViewModeDisconnect(); } if (editor) {
try { getEditor().asc_setRestriction(true); } catch (e) {}
}
var content = parsed.content; var content = parsed.content;
// Get checkpoint // Get checkpoint
@ -2386,7 +2371,7 @@ define([
var setHistoryMode = function (bool) { var setHistoryMode = function (bool) {
if (bool) { if (bool) {
APP.history = true; APP.history = true;
getEditor().setViewModeDisconnect(); try { getEditor().asc_setRestriction(true); } catch (e) {}
return; return;
} }
// Cancel button: redraw from lastCp // Cancel button: redraw from lastCp
@ -2593,7 +2578,11 @@ define([
APP.onLocal(); APP.onLocal();
} else { } else {
msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor); 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; readOnly = true;
} }
} else if (content && content.version <= 3) { // V2 or V3 } else if (content && content.version <= 3) { // V2 or V3
@ -2605,7 +2594,11 @@ define([
APP.onLocal(); APP.onLocal();
} else { } else {
msg = h('div.alert.alert-warning.cp-burn-after-reading', Messages.oo_sheetMigration_anonymousEditor); 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; readOnly = true;
} }
} }
@ -2673,7 +2666,7 @@ define([
// Cursor update // Cursor update
if (!data || !data.cursor) { return; } if (!data || !data.cursor) { return; }
// Store the new cursor in memory for this user, with their netflux ID // Store the new cursor in memory for this user, with their netflux ID
var ooid = Util.find(data.cursor, ['messages', 0, 'user']) var ooid = Util.find(data.cursor, ['messages', 0, 'user']);
if (ooid) { cursors[ooid] = data.id.slice(0,32); } if (ooid) { cursors[ooid] = data.id.slice(0,32); }
// Update cursor in the UI // Update cursor in the UI
ooChannel.send(data.cursor); ooChannel.send(data.cursor);

@ -31,7 +31,6 @@ define([
cursor: client.cursor cursor: client.cursor
}; };
chan.sendMsg(JSON.stringify(data)); chan.sendMsg(JSON.stringify(data));
console.error(data);
ctx.emit('MESSAGE', data, chan.clients.filter(function (cl) { ctx.emit('MESSAGE', data, chan.clients.filter(function (cl) {
return cl !== clientId; return cl !== clientId;
})); }));

@ -469,6 +469,10 @@ define([
}); });
}, true); }, true);
Messages.settings_deleteWarning = "Warning: it seems you're subscribed to a premium plan (paid or given by another user). Please cancel paid subscriptions before deleting your account as you won't be able to do it yourself once the account is deleted."; // XXX
Messages.settings_deleteContinue = "Delete my account"; // XXX
Messages.settings_deleteSubscription = "Manage my subscription"; // XXX
makeBlock('delete', function(cb) { // Msg.settings_deleteHint, .settings_deleteTitle makeBlock('delete', function(cb) { // Msg.settings_deleteHint, .settings_deleteTitle
if (!common.isLoggedIn()) { return cb(false); } if (!common.isLoggedIn()) { return cb(false); }
@ -488,41 +492,69 @@ define([
classes: 'btn-danger', classes: 'btn-danger',
multiple: true multiple: true
}, function() { }, function() {
$button.prop('disabled', 'disabled'); nThen(function (waitFor) {
var password = $form.find('#cp-settings-delete-account').val(); $button.prop('disabled', 'disabled');
if (!password) { var priv = metadataMgr.getPrivateData();
return void UI.warn(Messages.error); // Check if subscriptions are enabled and you have a premium plan
} if (priv.plan && priv.plan !== "custom" && ApiConfig.allowSubscriptions) {
spinner.spin(); // Also make sure upgradeURL is defined
sframeChan.query("Q_SETTINGS_DELETE_ACCOUNT", { var url = priv.accounts && priv.accounts.upgradeURL;
password: password if (!url) { return; }
}, function(err, data) { url += '#mysubs';
if (data && data.error) { var a = h('a', { href:url }, Messages.settings_deleteSubscription);
spinner.hide(); $(a).click(function (e) {
$button.prop('disabled', ''); e.preventDefault();
if (data.error === 'INVALID_PASSWORD') { common.openUnsafeURL(url);
return void UI.warn(Messages.drive_sfPasswordError); });
} UI.confirm(h('div', [
console.error(data.error); Messages.settings_deleteWarning, h('p', a)
return void UI.warn(Messages.error); ]), waitFor(function (yes) {
} if (!yes) {
// Owned drive $button.prop('disabled', '');
if (data.state === true) { waitFor.abort();
sframeChan.query('Q_SETTINGS_LOGOUT', null, function() {}); }
UI.alert(Messages.settings_deleted, function() { }), {
common.gotoURL('/'); ok: Messages.settings_deleteContinue,
okClass: 'btn.btn-danger',
cancelClass: 'btn.btn-primary'
}); });
spinner.done();
return;
} }
// Not owned drive }).nThen(function () {
var msg = h('div.cp-app-settings-delete-alert', [ var password = $form.find('#cp-settings-delete-account').val();
h('p', Messages.settings_deleteModal), if (!password) {
h('pre', JSON.stringify(data, 0, 2)) return void UI.warn(Messages.error);
]); }
UI.alert(msg); spinner.spin();
spinner.hide(); sframeChan.query("Q_SETTINGS_DELETE_ACCOUNT", {
$button.prop('disabled', ''); password: password
}, function(err, data) {
if (data && data.error) {
spinner.hide();
$button.prop('disabled', '');
if (data.error === 'INVALID_PASSWORD') {
return void UI.warn(Messages.drive_sfPasswordError);
}
console.error(data.error);
return void UI.warn(Messages.error);
}
// Owned drive
if (data.state === true) {
sframeChan.query('Q_SETTINGS_LOGOUT', null, function() {});
UI.alert(Messages.settings_deleted, function() {
common.gotoURL('/');
});
spinner.done();
return;
}
// Not owned drive
var msg = h('div.cp-app-settings-delete-alert', [
h('p', Messages.settings_deleteModal),
h('pre', JSON.stringify(data, 0, 2))
]);
UI.alert(msg);
spinner.hide();
$button.prop('disabled', '');
});
}); });
}); });

Loading…
Cancel
Save