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-source/updated": "Updated",
"gdata-exporter/uploading": "Uploading…", "gdata-exporter/uploading": "Uploading…",
"gdata-exporter/upload-error": "Upload error: ", "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/new-spreadsheet": "A new Google spreadsheet",
"gdata-exporter/enter-spreadsheet": "Enter a name for the 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/authorize-label": "OpenRefine - Authorization",
"gdata-auth/authorized-label": "Authorization process completed. Close this window and return to OpenRefine." "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')); 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

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

View File

@ -187,7 +187,7 @@ ExporterManager.handlers.exportProject = function() {
// save to google drive // save to google drive
var doExportToGoogleDrive = function() { 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) { if (name) {
var dismiss = DialogSystem.showBusy($.i18n('gdata-exporter/uploading')); var dismiss = DialogSystem.showBusy($.i18n('gdata-exporter/uploading'));
Refine.postCSRF( Refine.postCSRF(
@ -201,7 +201,7 @@ ExporterManager.handlers.exportProject = function() {
dismiss(); dismiss();
if (o.url) { if (o.url) {
alert($.i18n('gdata-exporter/upload-success') + o.url); alert($.i18n('gdata-exporter/upload-success'));
} else { } else {
alert($.i18n('gdata-exporter/upload-error') + o.message) alert($.i18n('gdata-exporter/upload-error') + o.message)
} }