Skip to content

Commit d36999f

Browse files
committed
Merge branch 'Bugfix-3.4.1' into 'master'
Bugfix 3.4.1 Closes nextcloud#73, nextcloud#86, nextcloud#85, and nextcloud#81 See merge request joendres/filelink-nextcloud!48
2 parents 83847df + f19cea2 commit d36999f

15 files changed

Lines changed: 140 additions & 79 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
],
1515
"cSpell.language": "de,en",
1616
"cSpell.allowCompoundWords": true,
17-
"git.alwaysSignOff": true,
1817
"git.fetchOnPull": true,
19-
"git.untrackedChanges": "separate"
18+
"git.untrackedChanges": "separate",
19+
"gitlab.enableExperimentalFeatures": true,
20+
"gitlab.showPipelineUpdateNotifications": true
2021
}

.vscode/tasks.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@
3636
}
3737
},
3838
"problemMatcher": []
39+
},
40+
{
41+
"label": "web-ext: run in thunderbird, keep profile changes",
42+
"type": "shell",
43+
"command": "web-ext run --browser-console --keep-profile-changes -s src",
44+
"windows": {
45+
"options": {
46+
"env": {
47+
"WEB_EXT_FIREFOX": "C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe",
48+
"WEB_EXT_FIREFOX_PROFILE": "${env:APPDATA}\\Thunderbird\\Profiles\\plyesg2i.debug"
49+
}
50+
}
51+
},
52+
"problemMatcher": []
3953
}
4054
]
4155
}

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.4.1 2020-02-21
2+
- Close #81: French translation of new messages
3+
- Close #82: Catalan and spanish translations of new messages
4+
- Close #73: Shows outdated free space info while editing account
5+
- Internal Project optimization & cleanup in davuploader
6+
17
3.4.0 2020-02-18
28
- Close #27: Show Nextcloud/ownCloud flavor and version
39
- Close #70: Show product name instead of account name

src/.jshintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@
1313
"strict": "implied",
1414
"trailingcomma": true,
1515
"undef": true,
16-
"unused": true,
17-
"-W098": true
16+
"unused": true
1817
}

src/_locales/ca/messages.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,18 @@
6666
},
6767
"error_0": {
6868
"message": "Error desconegut"
69+
},
70+
"error_cloud_unreachable": {
71+
"message": "Sense connexió. Comprova la URL del servidor i la connexió de xarxa."
72+
},
73+
"error_no_cloud": {
74+
"message": "No trobo un núvol compatible a la URL donada."
75+
},
76+
"unsupported_cloud": {
77+
"message": "Versió obsoleta de Nextcloud o ownCloud. Pots perdre dades. Contacta el teu administrador per actualitzar."
78+
},
79+
"obsolete_version": {
80+
"description": "This is displayed instead of the icon if the cloud version is not supported, so it should be quite short and contain exactly two lines.",
81+
"message": "Versió<br>obsoleta"
6982
}
7083
}

src/_locales/es/messages.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,18 @@
6666
},
6767
"error_0": {
6868
"message": "Error desconocido"
69+
},
70+
"error_cloud_unreachable": {
71+
"message": "Sin conexión. Comprueba la URL del servidor y la conexión de red."
72+
},
73+
"error_no_cloud": {
74+
"message": "No encuentro una nube compatible en la URL."
75+
},
76+
"unsupported_cloud": {
77+
"message": "Versión obsoleta de Nextcloud o ownCloud. Puedes perder datos. Contacta con tu administrador para actualizar."
78+
},
79+
"obsolete_version": {
80+
"description": "This is displayed instead of the icon if the cloud version is not supported, so it should be quite short and contain exactly two lines.",
81+
"message": "Versión<br>obsoleta"
6982
}
7083
}

src/_locales/fr/messages.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,24 @@
6363
"content": "$2"
6464
}
6565
}
66+
},
67+
"success": {
68+
"message": "Réussi"
69+
},
70+
"error_0": {
71+
"message": "Erreur inconnue"
72+
},
73+
"error_cloud_unreachable": {
74+
"message": "Connexion impossible. Veuillez vérifier votre connexion internet et l'adresse de votre serveur."
75+
},
76+
"error_no_cloud": {
77+
"message": "Aucun serveur Cloud compatible trouvé avec cette adresse."
78+
},
79+
"unsupported_cloud": {
80+
"message": "Attention, la version d'ownCloud ou Nextcloud que vous utilisez est obsolète. Si vous continuez, vous risquez de perdre des données. Contactez l'administrateur de votre serveur pour une mise à jour."
81+
},
82+
"obsolete_version": {
83+
"description": "This is displayed instead of the icon if the cloud version is not supported, so it should be quite short and contain exactly two lines.",
84+
"message": "Version<br>obsolète"
6685
}
67-
}
86+
}

src/lib/davuploader.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2020
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
2121

2222
/* global encodepath */
23+
/* exported DavUploader */
2324

2425
/** AbortControllers for all active uploads */
2526
var allAbortControllers = new Map();
@@ -59,10 +60,9 @@ class DavUploader {
5960
* @param {number} fileId The id Thunderbird uses to reference the upload
6061
* @param {string} fileName w/o path
6162
* @param {File} fileObject the local file as a File object
63+
* @returns {Promise<Response>}
6264
*/
6365
async uploadFile(fileId, fileName, fileObject) {
64-
let response = {};
65-
6666
const stat = await this._getRemoteFileInfo(fileName);
6767

6868
if (!stat) {
@@ -87,15 +87,15 @@ class DavUploader {
8787
* Create a complete folder path, returns true if that path already exists
8888
*
8989
* @param {string} folder
90-
* @returns {bool} if creation succeeded
90+
* @returns {boolean} if creation succeeded
9191
*/
9292
async _recursivelyCreateFolder(folder) {
9393
// Looks clumsy, but *always* make sure recursion ends
9494
if ("/" === folder) {
9595
return false;
9696
} else {
9797
let response = await this._doDavCall(folder, 'MKCOL')
98-
.catch(e => { return { status: 666, }; });
98+
.catch(() => ({ status: 666, }));
9999
switch (response.status) {
100100
case 405: // Already exists
101101
case 201: // Created successfully
@@ -105,7 +105,7 @@ class DavUploader {
105105
if (await this._recursivelyCreateFolder(folder.split("/").slice(0, -1).join("/"))) {
106106
// Try again to create the initial folder
107107
response = await this._doDavCall(folder, 'MKCOL')
108-
.catch(e => { return { status: 666, }; });
108+
.catch(() => ({ status: 666, }));
109109
return (201 === response.status);
110110
}
111111
break;
@@ -117,7 +117,7 @@ class DavUploader {
117117
/**
118118
* Fetches information about a remote file
119119
* @param {File} file The file to check on the cloud
120-
* @returns {Promise} A promise resolving to an object containing mtime and
120+
* @returns {Promise<?{mtime: Date, size: number}} A promise resolving to an object containing mtime and
121121
* size or an empty object if the file doesn't exit
122122
*/
123123
async _getRemoteFileInfo(fileName) {
@@ -178,7 +178,7 @@ class DavUploader {
178178
* @param {number} fileId Thunderbird's internal file if
179179
* @param {string} fileName The name in the cloud
180180
* @param {File} fileObject The File object to upload
181-
* @returns {Promise} A Promise that resolves to the http response
181+
* @returns {Promise<Response>} A Promise that resolves to the http response
182182
*/
183183
async _doUpload(fileId, fileName, fileObject) {
184184
// Make sure storageFolder exists. Creation implicitly checks for
@@ -218,10 +218,10 @@ class DavUploader {
218218
*
219219
* @param {string} path the full file path of the object
220220
* @param {string} [method=GET] the HTTP METHOD to use, default GET
221-
* @param {*} [body] Body of the request, eg. file contents
222-
* @param {*} [abortController] An AbortController to abort the network
221+
* @param {Array} [body] Body of the request, eg. file contents
222+
* @param {Array} [abortController] An AbortController to abort the network
223223
* transaction
224-
* @returns {*} A Promise that resolves to the Response object
224+
* @returns {Promise<Response>} A Promise that resolves to the Response object
225225
*/
226226
async _doDavCall(path, method, body, abortController, additional_headers) {
227227
let url = this._serverurl;

src/lib/utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1919
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2020
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
2121

22+
/* exported encodepath */
23+
/* exported daysFromTodayIso */
24+
2225
/**
2326
* Encode everything that might need encoding in pathnames, including those
2427
* chars encodeURI leaves as is

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"description": "__MSG_extensionDescription__",
1111
"homepage_url": "https://gitlab.com/joendres/filelink-nextcloud",
1212
"author": "Johannes Endres",
13-
"version": "3.4.0",
13+
"version": "3.4.1",
1414
"icons": {
1515
"48": "icon48.png"
1616
},

0 commit comments

Comments
 (0)