Fixed that can't select a different sheet #2307 (#2390)

This commit is contained in:
Bűn Tamás 2020-03-17 12:00:27 +01:00 committed by GitHub
parent a91691cb6b
commit 9c911275f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -128,6 +128,7 @@ Refine.GDataImportingController.prototype.getOptions = function() {
this._parsingPanelElmts.sheetRecordContainer.find('input').each(function() { this._parsingPanelElmts.sheetRecordContainer.find('input').each(function() {
if (this.checked) { if (this.checked) {
options.sheetUrl = this.getAttribute('sheetUrl'); options.sheetUrl = this.getAttribute('sheetUrl');
options.worksheetIndex = this.getAttribute('worksheetIndex');
} }
}); });
@ -243,6 +244,7 @@ Refine.GDataImportingController.prototype._showParsingPanel = function() {
.attr('type', 'radio') .attr('type', 'radio')
.attr('name', 'gdata-importing-parsing-worksheet') .attr('name', 'gdata-importing-parsing-worksheet')
.attr('sheetUrl', this.link) .attr('sheetUrl', this.link)
.attr('worksheetIndex', this.worksheetIndex)
.appendTo(td0); .appendTo(td0);
if (i === 0) { if (i === 0) {
checkbox.prop("checked", true); checkbox.prop("checked", true);

View File

@ -161,12 +161,14 @@ public class GDataImportingController implements ImportingController {
List<Sheet> worksheetEntries = List<Sheet> worksheetEntries =
getWorksheetEntriesForDoc(token, spreadSheetId); getWorksheetEntriesForDoc(token, spreadSheetId);
int workSheetIndex = 0;
for (Sheet sheet : worksheetEntries) { for (Sheet sheet : worksheetEntries) {
ObjectNode worksheetO = ParsingUtilities.mapper.createObjectNode(); ObjectNode worksheetO = ParsingUtilities.mapper.createObjectNode();
JSONUtilities.safePut(worksheetO, "name", sheet.getProperties().getTitle()); JSONUtilities.safePut(worksheetO, "name", sheet.getProperties().getTitle());
JSONUtilities.safePut(worksheetO, "rows", sheet.getProperties().getGridProperties().getRowCount()); JSONUtilities.safePut(worksheetO, "rows", sheet.getProperties().getGridProperties().getRowCount());
JSONUtilities.safePut(worksheetO, "link", JSONUtilities.safePut(worksheetO, "link",
"https://sheets.googleapis.com/v4/spreadsheets/" + spreadSheetId + "/values/" + sheet.getProperties().getTitle()); "https://sheets.googleapis.com/v4/spreadsheets/" + spreadSheetId + "/values/" + sheet.getProperties().getTitle());
JSONUtilities.safePut(worksheetO, "worksheetIndex", workSheetIndex++);
JSONUtilities.append(worksheets, worksheetO); JSONUtilities.append(worksheets, worksheetO);
} }