Created
September 12, 2018 16:30
-
-
Save cmpham/fe84e1a101764238e7056c9603fd2324 to your computer and use it in GitHub Desktop.
Wiring &
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wiring & | |
Invitation | |
coInvestorAdded -> Wiring wire info | |
coInvestorRemoved -> Wiring wire info | |
Wiring bank info | |
CompanyToShareBankInfo | |
shareBankInfo -> BankInfoDone | |
BankInfoDone | |
Wiring wire info | |
CompanyToShareWireInfo | |
shareWireInfo -> SharedWireInfo | |
SharedWireInfo | |
updateWireInfo -> SharedWireInfo | |
Update status & | |
InvestorFundStatus | |
CompanyToMarkFundReceived | |
companyMarkFundReceived -> DoneFund | |
DoneFund | |
undoCompanyMarkFundReceived -> CompanyToMarkFundReceived | |
InvestorStockCertificateStatus | |
CompanyToMarkStockCertSent | |
companyMarkStockCertificateSent -> DoneStockCert | |
DoneStockCert | |
undoCompanyMarkStockCertificateSent -> CompanyToMarkStockCertSent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init(model) { | |
initialStates = ['CompanyToShareBankInfo', 'CompanyToShareWireInfo', '']; | |
for (var i = 0; i < model.states.length; i++) { | |
if (initialStates.indexOf(model.states[i].name) >= 0) { | |
model.states[i].is_active = true; | |
} | |
} | |
} | |
function turnText(name) { | |
switch (name) { | |
case "CompanyToShareBankInfo": | |
return "Company To Share Bank Info"; | |
break; | |
case "CompanyToShareWireInfo": | |
return "Company To Share Wire Info"; | |
break; | |
case "CompanyToMarkStockCertSent": | |
return "Company To Mark Stock Certificates Sent"; | |
break; | |
case "CompanyToMarkFundReceived": | |
return "Company To Mark Fund Received"; | |
break; | |
default: | |
return ""; | |
break; | |
} | |
} | |
function render(model) { | |
let turnsText = []; | |
for (var i = 0; i < model.active_states.length; i++) { | |
var text = turnText(model.active_states[i].name); | |
if (text != "") turnsText.push(text); | |
console.log(model.active_states[i]); | |
} | |
return $(h1, "The current turns:", | |
$("ul", | |
{style: {color: "darkBlue"}}, | |
turnsText.map(txt =><li><p>{txt}</p></li>) | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment