-
Notifications
You must be signed in to change notification settings - Fork 0
/
AmisDebugger.gs
42 lines (32 loc) · 1.32 KB
/
AmisDebugger.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Debugging utilities class
* @return {object}
*/
var AmisDebugger=new function(){
/**
* show a dialog with the info of a cell
* @return {void}
*/
this.cellInfo=function(){
var cell, cellA1, cellIndex, cellValue,fbValue,fblink;
var userToken=FirebaseConnector.getToken();
var fbData, baseOfSaveNode= JSON.parse(SyncMasterSheet.getAbsoluteDataSheetPath(userToken))+ '/'+ JSON.parse(SyncMasterSheet.getNodeToWriteData(userToken)).dataSheetNode+ '/' + FirebaseConnector.getCommodityName();
fbData=FirebaseConnector.getFireBaseDataParsed(baseOfSaveNode, userToken);
cell=SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getActiveRange();
cellA1=cell.getA1Notation();
cellIndex=ConvertA1.cellA1ToIndex(cellA1);
cellValue=cell.getValue();
fbValue=fbData[cellIndex.row][cellIndex.col];
fblink=Utility.interpolate(
"https://console.firebase.google.com/project/{{dbName}}/database/{{dbName}}/data/dataAmisSheet/countries/mexicoData/{{commodity}}/{{row}}/{{col}}",
{
dbName:Config.dbName,
country:FirebaseConnector.getCountryNameFromSheet().toLowerCase(),
commodity:FirebaseConnector.getCommodityName(),
row:cellIndex.row,
col:cellIndex.col
}
);
Browser.msgBox("colnum="+(cellIndex.col+1)+"\\nfbValue="+fbValue+"\\ncellValue="+cellValue+"\\nfblink="+fblink);
};
};