Bugs Fixed:
Fixed: Duplicates of sheetList and personList display after sign out and sign in.
Fixed: The new log entered displayed in 2nd row instead of 1st row
Fixed: Input fields not reseting after Entering a log
This commit is contained in:
sairajzero 2020-03-30 16:03:48 +05:30
parent bf31d2d91c
commit 42f4e584cb

View File

@ -738,8 +738,13 @@
</script> </script>
<script id="onLoadStartUp"> <script id="onLoadStartUp">
function onLoadStartUp() { function onLoadStartUp() {
//display loading screen
document.getElementById("loading-screen").classList.remove("hide") document.getElementById("loading-screen").classList.remove("hide")
//clear Rendered Elements
clearElement(document.getElementById("startup-load-msg")) clearElement(document.getElementById("startup-load-msg"))
clearElement(document.getElementById('person-list'))
clearElement(document.getElementById('sheet-list'))
//set the custom Privkey input
floDapps.setCustomPrivKeyInput( () => { floDapps.setCustomPrivKeyInput( () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let signInBox = document.getElementById("sign-in-box") let signInBox = document.getElementById("sign-in-box")
@ -763,16 +768,21 @@
} }
}) })
}) })
//invoke the startup functions
floDapps.launchStartUp().then(result => { floDapps.launchStartUp().then(result => {
console.log(result) console.log(result)
document.getElementById("greet-tag").textContent = `Hi, ${myFloID}` document.getElementById("greet-tag").textContent = `Hi, ${myFloID}`
showMessage("SignIn Successful") showMessage("SignIn Successful")
reactor.dispatchEvent("startUpSuccessLog",`Downloading objectData! Please Wait...`) reactor.dispatchEvent("startUpSuccessLog",`Downloading objectData! Please Wait...`)
//request object data from Supernode
logSheet.init().then(result => { logSheet.init().then(result => {
console.log(result) console.log(result)
//Render the personList and sheetList
renderPersonList(logSheet.listPersons()) renderPersonList(logSheet.listPersons())
renderSheetList(Object.keys(logSheet.listSheets())) renderSheetList(Object.keys(logSheet.listSheets()))
//hide loading screen
document.getElementById("loading-screen").classList.add("hide") document.getElementById("loading-screen").classList.add("hide")
//display add buttons if subAdmin, else hide
if(floGlobals.subAdmins.includes(myFloID)){ if(floGlobals.subAdmins.includes(myFloID)){
document.getElementById("add-person").classList.remove('hide') document.getElementById("add-person").classList.remove('hide')
document.getElementById("new-sheet").classList.remove('hide') document.getElementById("new-sheet").classList.remove('hide')
@ -1170,8 +1180,9 @@
for(let i=1;i<form.length-1;i++) for(let i=1;i<form.length-1;i++)
log.push(form[i].value) log.push(form[i].value)
logSheet.enterLog(title, floID, log).then(result => { logSheet.enterLog(title, floID, log).then(result => {
form.reset();
showMessage('Log Entry Successful') showMessage('Log Entry Successful')
let row = document.getElementById("sheet-view").getElementsByTagName("tbody")[0].insertRow(2) let row = document.getElementById("sheet-view").getElementsByTagName("tbody")[0].insertRow(1)
row.insertCell(0).textContent = floID row.insertCell(0).textContent = floID
for(let k = 0; k < log.length; k++) for(let k = 0; k < log.length; k++)
row.insertCell(k+1).textContent = log[k] row.insertCell(k+1).textContent = log[k]
@ -1234,7 +1245,6 @@
//Create and add the sheet table //Create and add the sheet table
let table = document.createElement("table") let table = document.createElement("table")
let thead = table.createTHead() let thead = table.createTHead()
thead.setAttribute('data-title', 'click to groupBy')
let head = thead.insertRow(0) let head = thead.insertRow(0)
head.insertCell(0).textContent = "FLO ID" head.insertCell(0).textContent = "FLO ID"
attributes.forEach(a => head.insertCell().textContent = a) attributes.forEach(a => head.insertCell().textContent = a)