react-google-sheets
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -5,4 +5,2 @@ "use strict"; | ||
var _ruucmUtil = require("ruucm-util"); | ||
var fetch = require("isomorphic-fetch"); | ||
@@ -45,10 +43,9 @@ var camelCase = require("camelcase"); | ||
} | ||
this.updateCell = function (column, row, value, successCallback, errorCallback) { | ||
this.updateCell = function (sheetName, column, row, value, successCallback, errorCallback) { | ||
var data = { | ||
spreadsheetId: _this.spreadsheetId, | ||
range: 'sheet02!' + column + row, | ||
range: sheetName + '!' + column + row, | ||
valueInputOption: 'USER_ENTERED', | ||
values: [[value]] | ||
}; | ||
(0, _ruucmUtil.log)('data', data); | ||
gapi.client.sheets.spreadsheets.values.update(data).then(successCallback, errorCallback); | ||
@@ -62,4 +59,2 @@ }; | ||
console.info("Loading data from Spreadsheet"); | ||
(0, _ruucmUtil.log)('this.clientId', this.clientId); | ||
(0, _ruucmUtil.log)('gapi', gapi); | ||
if (this.clientId) { | ||
@@ -149,3 +144,2 @@ return gapi.load("client:auth2", this.initClient.bind(this)); | ||
initClient: function initClient() { | ||
(0, _ruucmUtil.log)('initClient'); | ||
gapi.client.init({ | ||
@@ -156,3 +150,2 @@ discoveryDocs: ["https://sheets.googleapis.com/$discovery/rest?version=v4"], | ||
}).then(function () { | ||
(0, _ruucmUtil.log)('after initClient'); | ||
var authInstance = gapi.auth2.getAuthInstance(); | ||
@@ -159,0 +152,0 @@ if (authInstance.isSignedIn.get()) { |
{ | ||
"name": "react-google-sheets", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Read and Write data using Google Sheets API in react", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -18,4 +18,2 @@ 'use strict'; | ||
var _ruucmUtil = require('ruucm-util'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -69,4 +67,4 @@ | ||
}, | ||
updateCell: function updateCell(column, row, value, successCallback, errorCallback) { | ||
return googleSheet.updateCell(column, row, value, successCallback, errorCallback); | ||
updateCell: function updateCell(sheetName, column, row, value, successCallback, errorCallback) { | ||
return googleSheet.updateCell(sheetName, column, row, value, successCallback, errorCallback); | ||
} | ||
@@ -73,0 +71,0 @@ }; |
@@ -6,3 +6,2 @@ var fetch = require("isomorphic-fetch"); | ||
import { log } from 'ruucm-util' | ||
@@ -39,10 +38,9 @@ function GoogleSheetConnector(options, onLoad) { | ||
} | ||
this.updateCell = (column, row, value, successCallback, errorCallback) => { | ||
this.updateCell = (sheetName, column, row, value, successCallback, errorCallback) => { | ||
var data = { | ||
spreadsheetId: this.spreadsheetId, | ||
range: 'sheet02!' + column + row, | ||
range: sheetName + '!' + column + row, | ||
valueInputOption: 'USER_ENTERED', | ||
values: [ [value] ] | ||
} | ||
log('data', data) | ||
gapi.client.sheets.spreadsheets.values.update(data).then(successCallback, errorCallback); | ||
@@ -56,4 +54,2 @@ } | ||
console.info("Loading data from Spreadsheet"); | ||
log('this.clientId', this.clientId) | ||
log('gapi', gapi) | ||
if (this.clientId) { | ||
@@ -157,3 +153,2 @@ return gapi.load("client:auth2", this.initClient.bind(this)); | ||
initClient: function() { | ||
log('initClient') | ||
gapi.client.init({ | ||
@@ -164,3 +159,2 @@ discoveryDocs: ["https://sheets.googleapis.com/$discovery/rest?version=v4"], | ||
}).then(function () { | ||
log('after initClient') | ||
var authInstance = gapi.auth2.getAuthInstance(); | ||
@@ -167,0 +161,0 @@ if (authInstance.isSignedIn.get()) { |
import React, { Component } from 'react'; | ||
import GoogleSheetConnector from './google-sheet-connector' | ||
import { log } from 'ruucm-util' | ||
@@ -31,4 +30,4 @@ | ||
}, | ||
updateCell: function(column, row, value, successCallback, errorCallback) { | ||
return googleSheet.updateCell(column, row, value, successCallback, errorCallback); | ||
updateCell: function(sheetName, column, row, value, successCallback, errorCallback) { | ||
return googleSheet.updateCell(sheetName, column, row, value, successCallback, errorCallback); | ||
}, | ||
@@ -35,0 +34,0 @@ }; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
116189
864