merge staging to soon

pull/1/head
ansuz 4 years ago
commit a936bb7b16

@ -40,6 +40,11 @@ To update from 3.19.1 to 3.20.0:
* Remote changes in the Kanban app removed pending text in new cards, effectively making it impossible (and very frustrating) to create new cards while anyone else was editing existing content or submitting their own new cards. * Remote changes in the Kanban app removed pending text in new cards, effectively making it impossible (and very frustrating) to create new cards while anyone else was editing existing content or submitting their own new cards.
* Dropping an image directly into a spreadsheet no longer puts the UI into an unrecoverable state, though we still don't support image drop. To insert images, use the "Insert" menu. This was actually fixed in our 3.19.1 release, but it wasn't documented in the release notes. * Dropping an image directly into a spreadsheet no longer puts the UI into an unrecoverable state, though we still don't support image drop. To insert images, use the "Insert" menu. This was actually fixed in our 3.19.1 release, but it wasn't documented in the release notes.
* When a user attempted to open an automatically expiring document which had passed its expiration date they were shown a general message indicating that the document had been deleted even when they had sufficient information to know that it had been marked for expiration. We now display a message indicating the more likely cause of its deletion.
* We've spent some time working on the usability of comments in our rich text app:
* When a user started adding a first comment to a document then canceled their action it was possible for the document to get stuck in an odd layout. This extra space allocated towards comments now correctly collapses as intended when there are no comments, pending or otherwise.
* The comments UI is now completely disabled whenever the document is in read-only mode, whether due to disconnection or insufficient permissions.
* The _comment_ button in the app toolbar now toggles on and off to indicate the eligibility of the current selection as a new comment.
* We've fixed a number of issues with teams: * We've fixed a number of issues with teams:
* Users no longer send themselves a notification when they remove themself as an owner of a pad from within the _Teams_ UI. * Users no longer send themselves a notification when they remove themself as an owner of a pad from within the _Teams_ UI.
* The _worker_ process which is responsible for managing account rights now correctly upgrades and downgrades its internal state when its role within a team is changed by a remote user instead of requiring a complete worker reload. * The _worker_ process which is responsible for managing account rights now correctly upgrades and downgrades its internal state when its role within a team is changed by a remote user instead of requiring a complete worker reload.

@ -317,6 +317,7 @@
padding: 0 10px; padding: 0 10px;
border: 0; border: 0;
color: lighten(@colortheme_sidebar-left-fg, 40%); color: lighten(@colortheme_sidebar-left-fg, 40%);
height: auto;
} }
& > span.cp-app-drive-element-row { & > span.cp-app-drive-element-row {
overflow: hidden; overflow: hidden;
@ -575,6 +576,7 @@
border-radius: 0; border-radius: 0;
border: 1px solid #ddd; border: 1px solid #ddd;
font-size: 14px; font-size: 14px;
height: auto;
} }
.cp-app-drive-element-state { .cp-app-drive-element-state {
position: absolute; position: absolute;
@ -638,6 +640,7 @@
padding: 0 4px; padding: 0 4px;
flex: 1; flex: 1;
min-width: 0; min-width: 0;
height: auto;
} }
&> span { &> span {

@ -2904,10 +2904,12 @@ define([
var el = useId ? _el : root[_el]; var el = useId ? _el : root[_el];
var sfId = (el && el.root && el.key) ? el.root[el.key] : el; var sfId = (el && el.root && el.key) ? el.root[el.key] : el;
if (folder && el && manager.isSharedFolder(sfId)) { if (folder && el && manager.isSharedFolder(sfId)) {
var title = manager.getSharedFolderData(sfId).title || el; var sfData = manager.getSharedFolderData(sfId);
var title = sfData.title || sfData.lastTitle || el;
return String(title).toLowerCase(); return String(title).toLowerCase();
} else if (folder) { } else if (folder) {
return String((el && el.key) || el).toLowerCase(); console.log(el);
return String((el && el.key) || _el).toLowerCase();
} }
var data = manager.getFileData(el); var data = manager.getFileData(el);
if (!data) { return ''; } if (!data) { return ''; }
@ -2928,6 +2930,7 @@ define([
} }
props[uid] = getProp(k); props[uid] = getProp(k);
}); });
if (folder) { console.error(useId, props); }
keys.sort(function(a, b) { keys.sort(function(a, b) {
var _a = props[(a && a.uid) || a]; var _a = props[(a && a.uid) || a];
var _b = props[(b && b.uid) || b]; var _b = props[(b && b.uid) || b];

@ -898,7 +898,7 @@ define([
} }
} }
if (owned) { if (owned) {
var deleteOwned = h('button.btn.btn-danger-alt', Messages.fc_delete_owned); var deleteOwned = h('button.btn.btn-danger-alt', [h('i.cptools.cptools-destroy'), Messages.fc_delete_owned]);
var spinner = UI.makeSpinner(); var spinner = UI.makeSpinner();
UI.confirmButton(deleteOwned, { UI.confirmButton(deleteOwned, {
classes: 'btn-danger' classes: 'btn-danger'
@ -909,6 +909,7 @@ define([
channel: data.channel channel: data.channel
}, function (err, obj) { }, function (err, obj) {
spinner.done(); spinner.done();
UI.findCancelButton().click();
if (err || (obj && obj.error)) { UI.warn(Messages.error); } if (err || (obj && obj.error)) { UI.warn(Messages.error); }
}); });
}); });

@ -2054,6 +2054,10 @@ define([
var addSharedFolderHandler = function () { var addSharedFolderHandler = function () {
store.sharedFolders = {}; store.sharedFolders = {};
store.handleSharedFolder = function (id, rt) { store.handleSharedFolder = function (id, rt) {
if (!rt) {
delete store.sharedFolders[id];
return;
}
store.sharedFolders[id] = rt; store.sharedFolders[id] = rt;
if (store.driveEvents) { if (store.driveEvents) {
registerProxyEvents(rt.proxy, id); registerProxyEvents(rt.proxy, id);

@ -211,6 +211,9 @@ define([
// We can only hide it // We can only hide it
sf.teams.forEach(function (obj) { sf.teams.forEach(function (obj) {
obj.store.manager.deprecateProxy(obj.id, secret.channel); obj.store.manager.deprecateProxy(obj.id, secret.channel);
if (obj.store.handleSharedFolder) {
obj.store.handleSharedFolder(obj.id, null);
}
}); });
} catch (e) {} } catch (e) {}
delete allSharedFolders[secret.channel]; delete allSharedFolders[secret.channel];
@ -252,9 +255,14 @@ define([
if (!sf) { return; } if (!sf) { return; }
var clients = sf.teams; var clients = sf.teams;
if (!Array.isArray(clients)) { return; } if (!Array.isArray(clients)) { return; }
// Remove the shared folder from the client's store and
// remove the client/team from our list
var idx; var idx;
clients.some(function (obj, i) { clients.some(function (obj, i) {
if (obj.store.id === teamId) { if (obj.store.id === teamId) {
if (obj.store.handleSharedFolder) {
obj.store.handleSharedFolder(obj.id, null);
}
idx = i; idx = i;
return true; return true;
} }

@ -164,6 +164,10 @@ define([
var handleSharedFolder = function (ctx, id, sfId, rt) { var handleSharedFolder = function (ctx, id, sfId, rt) {
var t = ctx.teams[id]; var t = ctx.teams[id];
if (!t) { return; } if (!t) { return; }
if (!rt) {
delete t.sharedFolders[sfId];
return;
}
t.sharedFolders[sfId] = rt; t.sharedFolders[sfId] = rt;
registerChangeEvents(ctx, t, rt.proxy, sfId); registerChangeEvents(ctx, t, rt.proxy, sfId);
}; };

@ -52,6 +52,10 @@ define([
// Password may have changed // Password may have changed
var deprecateProxy = function (Env, id, channel) { var deprecateProxy = function (Env, id, channel) {
if (Env.folders[id] && Env.folders[id].deleting) {
// Folder is being deleted by its owner, don't deprecate it
return;
}
if (Env.user.userObject.readOnly) { if (Env.user.userObject.readOnly) {
// In a read-only team, we can't deprecate a shared folder // In a read-only team, we can't deprecate a shared folder
// Use a empty object with a deprecated flag... // Use a empty object with a deprecated flag...
@ -823,19 +827,38 @@ define([
var data = uo.isFile(el) ? uo.getFileData(el) : getSharedFolderData(Env, el); var data = uo.isFile(el) ? uo.getFileData(el) : getSharedFolderData(Env, el);
chan = data.channel; chan = data.channel;
} }
// If the pad was a shared folder, delete it too and leave it
var fId;
Object.keys(Env.user.proxy[UserObject.SHARED_FOLDERS] || {}).some(function (id) {
var sfData = Env.user.proxy[UserObject.SHARED_FOLDERS][id] || {};
if (sfData.channel === chan) {
fId = Number(id);
Env.folders[id].deleting = true;
return true;
}
});
Env.removeOwnedChannel(chan, function (obj) { Env.removeOwnedChannel(chan, function (obj) {
// If the error is that the file is already removed, nothing to // If the error is that the file is already removed, nothing to
// report, it's a normal behavior (pad expired probably) // report, it's a normal behavior (pad expired probably)
if (obj && obj.error && obj.error.code !== "ENOENT") { if (obj && obj.error && obj.error.code !== "ENOENT") {
// RPC may not be responding // RPC may not be responding
// Send a report that can be handled manually // Send a report that can be handled manually
if (fId && Env.folders[fId] && Env.folders[fId].deleting) {
delete Env.folders[fId].deleting;
}
console.error(obj.error, chan); console.error(obj.error, chan);
Feedback.send('ERROR_DELETING_OWNED_PAD=' + chan + '|' + obj.error, true); Feedback.send('ERROR_DELETING_OWNED_PAD=' + chan + '|' + obj.error, true);
return void cb(); return void cb();
} }
// No error: delete the pads and all its copies from our drive and shared folders // No error: delete the pad and all its copies from our drive and shared folders
var ids = _findChannels(Env, [chan]); var ids = _findChannels(Env, [chan]);
// If the pad was a shared folder, delete it too and leave it
if (fId) {
ids.push(fId);
}
ids.forEach(function (id) { ids.forEach(function (id) {
var paths = findFile(Env, id); var paths = findFile(Env, id);
var _resolved = _resolvePaths(Env, paths); var _resolved = _resolvePaths(Env, paths);
@ -869,6 +892,10 @@ define([
}).nThen(function () { }).nThen(function () {
// Remove deleted pads from the drive // Remove deleted pads from the drive
_delete(Env, { resolved: toDelete }, cb); _delete(Env, { resolved: toDelete }, cb);
// If we were using the access modal, send a refresh command
if (data.channel) {
Env.Store.refreshDriveUI();
}
}); });
}; };
@ -926,9 +953,8 @@ define([
if (!resolved.id) { if (!resolved.id) {
var el = Env.user.userObject.find(resolved.path); var el = Env.user.userObject.find(resolved.path);
if (Env.user.userObject.isSharedFolder(el) && Env.folders[el]) { if (Env.user.userObject.isSharedFolder(el) && Env.folders[el]) {
var oldName = Env.folders[el].proxy.metadata.title;
Env.folders[el].proxy.metadata.title = data.newName; Env.folders[el].proxy.metadata.title = data.newName;
Env.user.proxy[UserObject.SHARED_FOLDERS][el].lastTitle = oldName; Env.user.proxy[UserObject.SHARED_FOLDERS][el].lastTitle = data.newName;
return void cb(); return void cb();
} }
} }

Loading…
Cancel
Save