From 3ccca553bc3e1d8cec03cf21fbed5944ff9f7671 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 30 Sep 2019 17:14:11 +0200 Subject: [PATCH 01/13] apparently readline expects a 'close' event listener, not 'end' --- storage/file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/file.js b/storage/file.js index 8ccfae079..0f97527ca 100644 --- a/storage/file.js +++ b/storage/file.js @@ -95,7 +95,7 @@ var getMetadataAtPath = function (Env, path, _cb) { return void cb("INVALID_METADATA"); } }) - .on('end', cb) + .on('close', cb) .on('error', cb); }; From 3a576a7bf0156996da9e82dc6ef35c8e8fa40892 Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 7 Oct 2019 09:20:04 +0000 Subject: [PATCH 02/13] Translated using Weblate (Catalan) Currently translated at 45.1% (507 of 1123 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/ca/ --- www/common/translations/messages.ca.json | 32 +++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/www/common/translations/messages.ca.json b/www/common/translations/messages.ca.json index e409c9449..dd4c9c4ff 100644 --- a/www/common/translations/messages.ca.json +++ b/www/common/translations/messages.ca.json @@ -12,7 +12,8 @@ "media": "Multimèdia", "todo": "Tasques", "contacts": "Contactes", - "sheet": "Full (Beta)" + "sheet": "Full (Beta)", + "teams": "Equips" }, "button_newpad": "Nou document", "button_newcode": "Nova pàgina de codi", @@ -40,7 +41,7 @@ "error": "Error", "saved": "Desat", "synced": "S'ha desat tot", - "deleted": "Document esborrat del vostre CryptDrive", + "deleted": "Esborrat", "deletedFromServer": "Document esborrat del servidor", "mustLogin": "Cal que inicieu la sessió per accedir a aquesta pàgina", "disabledApp": "Aquesta aplicació està dehabilitada. Per a més informació, contacteu l'administració d'aquest CryptPad.", @@ -481,5 +482,30 @@ "settings_importDone": "S'ha acabat la importació", "settings_autostoreTitle": "Emmagatzematge de documents a CryptDrive", "edit": "Edita", - "autostore_sf": "Carpeta" + "autostore_sf": "Carpeta", + "padNotPinnedVariable": "Aquest document caducarà després de {4} dies d'inactivitat, {0}inicieu una sessió{1} o {2}registreu-vos{3} per conservar-lo.", + "uploadFolderButton": "Carregar una carpeta", + "fm_morePads": "Més", + "fc_color": "Canvia el color", + "fc_openInCode": "Obrir a l'editor de codi", + "fc_expandAll": "Desplega-ho tot", + "fc_collapseAll": "Plega-ho tot", + "register_emailWarning0": "Sembla que heu introduït la vostra adreça electrònica com identificador.", + "register_emailWarning1": "Podeu continuar, però aquestes dades no són necessàries i no s'enviaran al nostre servidor.", + "register_emailWarning2": "No podreu restablir la vostra contrasenya utilitzant la vostra adreça electrònica, com en molts altres serveis.", + "register_emailWarning3": "Si això us ha quedat clar i voleu seguir utilitzant la vostra adreça electrònica com identificador, cliqueu D'acord.", + "settings_autostoreHint": "L'emmagatzematge Automàtic dels documents permet de desar tots els documents que visiteu dins el vostre CryptDrive, sense que hàgiu de fer res de la vostra part.
L'emmagatzematge Manual (sense preguntar) permet que no es desin els documents automàticament. Sempre hi haurà l'opció de desar-los, però restarà oculta.", + "settings_autostoreYes": "Automàtic", + "settings_autostoreNo": "Manual (sense preguntar)", + "settings_autostoreMaybe": "Manual (preguntar sempre)", + "settings_userFeedbackTitle": "Retroacció", + "settings_userFeedbackHint1": "CryptPad pot enviar retroaccions molt limitades al servidor, de forma que ens permeti millorar l'experiència dels usuaris. ", + "settings_userFeedbackHint2": "El contingut dels vostres documents i les claus de desxifrat no es compartiran mai amb el servidor.", + "settings_userFeedback": "Activar l'enviament de retroaccions", + "settings_deleteTitle": "Supressió del compte", + "settings_deleteHint": "La supressió del vostre compte és permanent. El vostre CryptDrive i la vostra llista de documents seran suprimits del servidor. La resta de documents serà suprimida després de 90 dies d'inactivitat si ningú els ha desat al seu CryptDrive.", + "settings_deleteButton": "Suprimir el vostre compte", + "settings_deleteModal": "Envieu la següent informació a qui administri el vostre CryptPad per tal que les vostres dades siguin esborrades del servidor.", + "settings_deleteConfirm": "Segur que voleu suprimir el vostre compte? Aquesta acció és irreversible.", + "settings_deleted": "El vostre compte ha estat suprimit. Premeu D'acord per tornar a la pàgina inicial." } From fe3b94f6b56cb65b1529dd0b9ba5f3dc26bade8e Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 7 Oct 2019 09:20:05 +0000 Subject: [PATCH 03/13] Translated using Weblate (German) Currently translated at 100.0% (1123 of 1123 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/de/ --- www/common/translations/messages.de.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index 5060a2d9f..dd4315e7e 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -1215,5 +1215,7 @@ "team_deleteConfirm": "Du bist gerade dabei, alle Daten eines Teams zu löschen. Andere Teammitglieder können dann möglicherweise nicht mehr auf ihre Daten zugreifen. Dies kann nicht rückgängig gemacht werden. Bist du sicher, dass du fortfahren möchtest?", "team_pendingOwner": "(ausstehend)", "team_pendingOwnerTitle": "Dieser Administrator hat dein Angebot auf Eigentümerschaft noch nicht akzeptiert.", - "team_demoteMeConfirm": "Du bist gerade dabei, deine Rechte aufzugeben. Dies kann nicht rückgängig gemacht werden. Bist du sicher?" + "team_demoteMeConfirm": "Du bist gerade dabei, deine Rechte aufzugeben. Dies kann nicht rückgängig gemacht werden. Bist du sicher?", + "crowdfunding_button2": "CryptPad unterstützen", + "survey": "CryptPad-Umfrage" } From 7f3aacefd4f6ad587c9d1db3d80bd31481da6665 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 7 Oct 2019 14:37:00 +0200 Subject: [PATCH 04/13] Fix undefined range_requests in messenger --- www/common/outer/messenger.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/outer/messenger.js b/www/common/outer/messenger.js index 133614494..8a97b7dc0 100644 --- a/www/common/outer/messenger.js +++ b/www/common/outer/messenger.js @@ -906,7 +906,8 @@ define([ emit: emit, friendsClients: [], channels: {}, - validateKeys: {} + validateKeys: {}, + range_requests: {} }; From 2a4eca1e2e98ff78d54b66ab9406067f82813e2a Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 7 Oct 2019 15:00:26 +0200 Subject: [PATCH 05/13] Remove download button for sheets --- www/common/drive-ui.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index d0ae3910f..1561db904 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -1138,6 +1138,9 @@ define([ //hide.push('download'); hide.push('openincode'); } + if ($element.is('.cp-border-color-sheet')) { + hide.push('download'); + } if ($element.is('.cp-app-drive-element-file')) { // No folder in files hide.push('color'); From 98336ccf9c5cfd0e52051b9bda0f6c4ad1fd99ac Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 8 Oct 2019 08:25:10 +0000 Subject: [PATCH 06/13] Translated using Weblate (German) Currently translated at 100.0% (1126 of 1126 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/de/ --- www/common/translations/messages.de.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index dd4315e7e..62be310eb 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -1217,5 +1217,8 @@ "team_pendingOwnerTitle": "Dieser Administrator hat dein Angebot auf Eigentümerschaft noch nicht akzeptiert.", "team_demoteMeConfirm": "Du bist gerade dabei, deine Rechte aufzugeben. Dies kann nicht rückgängig gemacht werden. Bist du sicher?", "crowdfunding_button2": "CryptPad unterstützen", - "survey": "CryptPad-Umfrage" + "survey": "CryptPad-Umfrage", + "team_title": "Team: {0}", + "team_quota": "Speicherplatzbegrenzung deines Teams", + "drive_quota": "Deine Speicherplatzbegrenzung" } From e5deffe21f37954446b9e33f491497a9e65f25ce Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 11:10:03 +0200 Subject: [PATCH 07/13] Fix team deletion --- www/common/common-ui-elements.js | 10 ++++++++-- www/common/outer/async-store.js | 2 +- www/common/outer/team.js | 17 ++++++++++++----- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b13353d0e..d1e5a87b3 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1343,7 +1343,6 @@ define([ }]; var content = h('div', [ - h('h4', 'Invite friends to your team: '+ team.name), list.div ]); @@ -4020,8 +4019,15 @@ define([ module.execCommand('JOIN_TEAM', { team: msg.content.team }, function (obj) { - if (obj && obj.error) { return void UI.warn(Messages.error); } + if (obj && obj.error) { + if (obj.error === 'ENOENT') { + common.mailbox.dismiss(data, function () {}); + return void UI.alert(Messages.deletedError); + } + return void UI.warn(Messages.error); + } answer(true); + if (priv.app !== 'teams') { common.openURL('/teams/'); } }); return; } diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 9ff329335..a80ca9f9c 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -679,7 +679,7 @@ define([ give(); return void _w.abort(); } - otherOwners = md.owners.some(function (ed) { return void ed !== edPublic; }); + otherOwners = md.owners.some(function (ed) { return ed !== edPublic; }); })); }).nThen(function (_w) { if (otherOwners) { diff --git a/www/common/outer/team.js b/www/common/outer/team.js index ef5960121..d99f169d3 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -562,6 +562,7 @@ define([ if (!me || me.role !== "OWNER") { return cb({ error: "EFORBIDDEN"}); } var edPublic = Util.find(ctx, ['store', 'proxy', 'edPublic']); + var teamEdPublic = Util.find(teamData, ['keys', 'drive', 'edPublic']); nThen(function (waitFor) { ctx.Store.anonRpcMsg(null, { @@ -597,18 +598,24 @@ define([ msg: 'GET_METADATA', data: c }, _w(function (obj) { - if (obj && obj.error) { return void _w.abort(); } + if (obj && obj.error) { + give(); + return void _w.abort(); + } var md = obj[0]; - var isOwner = md && Array.isArray(md.owners) && md.owners.indexOf(edPublic) !== -1; - if (!isOwner) { return void _w.abort(); } - otherOwners = md.owners.some(function (ed) { return void ed !== edPublic; }); + var isOwner = md && Array.isArray(md.owners) && md.owners.indexOf(teamEdPublic) !== -1; + if (!isOwner) { + give(); + return void _w.abort(); + } + otherOwners = md.owners.some(function (ed) { return ed !== teamEdPublic; }); })); }).nThen(function (_w) { if (otherOwners) { ctx.Store.setPadMetadata(null, { channel: c, command: 'RM_OWNERS', - value: [edPublic], + value: [teamEdPublic], }, _w()); return; } From 78bd5441964c2a2574fb9ade2d72810914b469c3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 13:54:48 +0200 Subject: [PATCH 08/13] bump version --- customize.dist/pages.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 43702f7cd..b1b36d029 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -103,7 +103,7 @@ define([ ])*/ ]) ]), - h('div.cp-version-footer', "CryptPad v3.2.0 (Chilihueque)") + h('div.cp-version-footer', "CryptPad v3.3.0 (Dodo)") ]); }; diff --git a/package.json b/package.json index d47aa5a2e..20500a960 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cryptpad", "description": "realtime collaborative visual editor with zero knowlege server", - "version": "3.2.0", + "version": "3.3.0", "license": "AGPL-3.0+", "repository": { "type": "git", From 190f20665a3231070c7e47db6e9a2723da5631f3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 14:08:44 +0200 Subject: [PATCH 09/13] Update CHANGELOG --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af83d148f..b485f257c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,48 @@ +# Dodo release (v3.3.0) + +## Goals + +We've continued to prioritize the development of team-centric features in CryptPad. This release was focused on stabilizing the code for Teams and making them available to the users. + +## Update notes + +This is a pretty basic release: + +1. stop your server +2. pull the latest source code +3. install the latest serverside dependencies with `npm install` +4. install the latest clientside dependencies with `bower update` +5. restart your server + +Note: we've updated our Nginx configuration to fix any missing trailing slash in the URL for the newest applications: https://github.com/xwiki-labs/cryptpad/commit/d4e5b98c140c28417e008379ec7af7cdc235792b + +## Features + +* You can now create _Teams_ in CryptPad. They're available from a new _Teams_ application and provide a full CryptDrive that can be shared between multiple users. + * Each team has a list of members. There are currently 3 different access level for team members: + * Members: can add, delete and edit pads from the team + * Admins: can also invite their CryptPad friends to the team, kick members and promote members as "Admin" + * Owners: can also promote admins as "Owner", change the team name or avatar and delete the team + * Each team has its own storage limit (50 MB by default, the same as user accounts). + * A chat is available to all the team members + * Pads created from the team's drive will be stored in this drive. If they are created as _owned_ pads, they will be ownedcc by the team. + * You can share pads or folders from your drive with one of your teams and you can store pads or folders from your team to your personal drive. + * Each user can be a member of up to 3 teams. A user can't create a new Team if they are already _Owner_ of another one. +* We've done some server improvements to save CPU usage. +* We've also improved to the messenger module to save CPU and memory in the client. +* The support panel (administrator side) now provides more debugging information about the users who ask for help +* A link to the new CryptPad survey (https://survey.cryptpad.fr/index.php/672782?lang=en) has been added to the user menu + * This link can be changed or removed using the "surveyURL" key in `/customize/application_config.js`. An empty value will remove the link from the menu. + +## Bug fixes + +* We've fixed an issue preventing users to remove owned empty channels from the server +* Adding and editing new items to the kanban boards will now update the correct item from the board +* We've fixed an issue with shared folders loaded by unregistered users +* The default title is now always set in newly created polls +* Desktop notifications will now be displayed only once per connection to the server and not once per CryptPad tab in the browser +* The button to download a spreadsheet from the drive has been removed. This feature is not available yet and the button was doing nothing. + # Chilihueque release (v3.2.0) ## Goals From 67c71ce4d109df3cbde4aca392836072efe169e3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 15:02:30 +0200 Subject: [PATCH 10/13] Fix UI issues in teams --- customize.dist/src/less2/include/sidebar-layout.less | 1 - www/teams/app-team.less | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/customize.dist/src/less2/include/sidebar-layout.less b/customize.dist/src/less2/include/sidebar-layout.less index c9e2fdb03..24228cfaf 100644 --- a/customize.dist/src/less2/include/sidebar-layout.less +++ b/customize.dist/src/less2/include/sidebar-layout.less @@ -48,7 +48,6 @@ flex: 0; } span.cp-sidebarlayout-category-name { - //margin-left: 5px; padding-left: 5px; white-space: nowrap; overflow: hidden; diff --git a/www/teams/app-team.less b/www/teams/app-team.less index 042d75a49..e357d504d 100644 --- a/www/teams/app-team.less +++ b/www/teams/app-team.less @@ -82,6 +82,9 @@ &:hover { background-color: transparent !important; } + span.cp-sidebarlayout-category-name { + padding-left: 5px; + } } .cp-team-cat-chat { span.cp-team-chat-notification { @@ -132,6 +135,10 @@ } .cp-team-avatar { .avatar_main(300px); + .cp-avatar img { + max-width: 100%; + max-height: 100%; + } } .cp-team-roster { .avatar_main(50px); From 8d99e811f1e49825c139b61ba03e463c79082d2f Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 15:10:10 +0200 Subject: [PATCH 11/13] Teams UI --- www/teams/app-team.less | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/www/teams/app-team.less b/www/teams/app-team.less index e357d504d..863aec1a9 100644 --- a/www/teams/app-team.less +++ b/www/teams/app-team.less @@ -58,12 +58,6 @@ .cp-leftside-narrow { .cp-avatar { overflow: visible; - media-tag { - margin-right: 0; - } - span.cp-sidebarlayout-category-name { - margin-left: 3px; - } } } .cp-team-cat-header { @@ -73,9 +67,11 @@ justify-content: center; font-size: 20px; } + media-tag, .cp-avatar-default { + margin-right: 3px; + } media-tag { order: -1; - margin-right: 3px; } cursor: default !important; font-size: 18px; From 50d0abd1937a6fb8086892ed49bd7ad8a32d1867 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 15:25:19 +0200 Subject: [PATCH 12/13] Fix team creation UI issue --- www/common/outer/team.js | 2 +- www/teams/inner.js | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index d99f169d3..2b395c8f9 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -649,8 +649,8 @@ define([ if (err) { console.error(err); } })); }).nThen(function () { - cb(); closeTeam(ctx, teamId); + cb(); }); }; diff --git a/www/teams/inner.js b/www/teams/inner.js index bb5422f3a..b31da7911 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -367,7 +367,7 @@ define([ refreshList(common, cb); }); - makeBlock('create', function (common, cb) { + var refreshCreate = function (common, cb) { var metadataMgr = common.getMetadataMgr(); var privateData = metadataMgr.getPrivateData(); var content = []; @@ -395,17 +395,21 @@ define([ content.push(h('br')); content.push(h('br')); content.push(button); + var $spinner = $('', {'class': 'fa fa-spinner fa-pulse'}).hide(); + content.push($spinner[0]); var state = false; $(button).click(function () { if (state) { return; } var name = $(input).val(); if (!name.trim()) { return; } state = true; + $spinner.show(); APP.module.execCommand('CREATE_TEAM', { name: name }, function (obj) { if (obj && obj.error) { console.error(obj.error); + $spinner.hide(); return void UI.warn(Messages.error); } // Redraw the create block @@ -417,15 +421,15 @@ define([ refreshList(common, function (content) { state = false; $div.append(content); + $spinner.hide(); $('div.cp-team-cat-list').click(); }); }); }); cb(content); - }); - - makeBlock('back', function (common, cb) { - refreshList(common, cb); + }; + makeBlock('create', function (common, cb) { + refreshCreate(common, cb); }); makeBlock('drive', function (common, cb) { @@ -956,10 +960,17 @@ define([ metadataMgr.onChange(function () { var $div = $('div.cp-team-list'); - if (!$div.length) { return; } - refreshList(common, function (content) { - $div.empty().append(content); - }); + if ($div.length) { + refreshList(common, function (content) { + $div.empty().append(content); + }); + } + var $divCreate = $('div.cp-team-create'); + if ($divCreate.length) { + refreshCreate(common, function (content) { + $divCreate.empty().append(content); + }); + } }); var onDisconnect = function (noAlert) { From d9e7fc24fec8f4f3993984ed5173d599f0add2fe Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Oct 2019 16:25:03 +0200 Subject: [PATCH 13/13] Focus the tab when clicking on a notification --- www/common/notify.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/common/notify.js b/www/common/notify.js index 77a1e6815..a3c8cd2b8 100644 --- a/www/common/notify.js +++ b/www/common/notify.js @@ -30,10 +30,19 @@ define(['/api/config'], function (ApiConfig) { icon = DEFAULT_ALT; } - return new Notification(title,{ + var n = new Notification(title,{ icon: icon, body: msg, }); + n.onclick = function () { + if (!document) { return; } + try { + parent.focus(); + window.focus(); //just in case, older browsers + this.close(); + } catch (e) {} + }; + return n; }; Module.system = function (msg, title, icon) {