Fix Google Sheets and Google Drive export

This commit is contained in:
Antonin Delpeuch 2020-01-04 15:56:24 +01:00
parent cd18b82ef4
commit a4c4a20767
4 changed files with 6 additions and 12 deletions

View File

@ -37,9 +37,10 @@
"gdata-source/updated": "Updated",
"gdata-exporter/uploading": "Uploading…",
"gdata-exporter/upload-error": "Upload error: ",
"gdata-exporter/upload-success": "Project was uploaded successfully to Google Drive with Id ",
"gdata-exporter/upload-success": "Project was uploaded successfully to Google Drive ",
"gdata-exporter/new-spreadsheet": "A new Google spreadsheet",
"gdata-exporter/enter-spreadsheet": "Enter a name for the new Google spreadsheet",
"gdata-exporter/enter-filename": "Enter a file name for the project export in Google Drive",
"gdata-auth/authorize-label": "OpenRefine - Authorization",
"gdata-auth/authorized-label": "Authorization process completed. Close this window and return to OpenRefine."
}

View File

@ -92,11 +92,4 @@ $.i18n().load(dictionary, lang);
handleUpload(options, exportAllRows, onDone, $.i18n('gdata-exporter/enter-spreadsheet'));
}
});
CustomTabularExporterDialog.uploadTargets.push({
id: 'gdata/fusion-table',
label: $.i18n('gdata-exporter/new-fusion'),
handler: function(options, exportAllRows, onDone) {
handleUpload(options, exportAllRows, onDone, $.i18n('gdata-exporter/enter-fusion'));
}
});
})();

View File

@ -117,7 +117,7 @@ final class SpreadsheetSerializer implements TabularSerializer {
}
public String getUrl() throws UnsupportedEncodingException {
String urlString= "https://docs.google.com/spreadsheets/d/" + spreadsheetId + "/edit#gid=0";
return URLEncoder.encode(urlString, "UTF-8");
String urlString = "https://docs.google.com/spreadsheets/d/" + spreadsheetId + "/edit#gid=0";
return urlString;
}
}

View File

@ -187,7 +187,7 @@ ExporterManager.handlers.exportProject = function() {
// save to google drive
var doExportToGoogleDrive = function() {
var name = window.prompt(prompt, theProject.metadata.name);
var name = window.prompt($.i18n('gdata-exporter/enter-filename'), theProject.metadata.name);
if (name) {
var dismiss = DialogSystem.showBusy($.i18n('gdata-exporter/uploading'));
Refine.postCSRF(
@ -201,7 +201,7 @@ ExporterManager.handlers.exportProject = function() {
dismiss();
if (o.url) {
alert($.i18n('gdata-exporter/upload-success') + o.url);
alert($.i18n('gdata-exporter/upload-success'));
} else {
alert($.i18n('gdata-exporter/upload-error') + o.message)
}