Skip to content

Commit

Permalink
#22 added place to save edit status of funds
Browse files Browse the repository at this point in the history
  • Loading branch information
katrina-cityofdetroit committed Jul 18, 2024
1 parent 6d7f1a3 commit fd2e490
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h3 id="supp-title" class="accordion-title">
<div class="accordion summary-accordion"></div>
</div>
<div class="add-init-btn-div">
<button class="btn btn-add-init">Add another initiative</button>
<button class="btn btn-add-init">Add new initiative</button>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/js/components/table/subcomponents/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function loadFunds(){
for (const key in fundDict) {
if (fundDict.hasOwnProperty(key)) {
resultArray.push({
Fund: fundDict[key] // Use the value directly
Fund: fundDict[key]['name'] // Use the value directly
});
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/js/utils/data_utils/budget_data_handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ export const FundLookupTable = {
update : function(fundData){
const table = this.retrieve();
for (let fund of Object.keys(fundData)){
// fund = toString(fund);
// add to lookup table if not in there already
if (!table[fund]){
// get fund name
const fundName = fundData[fund][0]['Fund Name'];
// add fund to dictionary
table[fund] = fundName;
table[fund] = {};
table[fund]['name'] = fundName;
table[fund]['viewed'] = false;
}
}
// save any updates
Expand All @@ -24,7 +25,8 @@ export const FundLookupTable = {
this.save({});
},
getName : function(number){
return this.retrieve()[number];
if(number == '') { return '' };
return this.retrieve()[number]['name'];
},
listFunds : function(){
return Object.keys(this.retrieve());
Expand Down
4 changes: 2 additions & 2 deletions src/js/views/02_baseline_landing_page/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function allowRowSelection(){
});
}

export async function initializeFundTable(){
await Table.Data.loadFunds();
export function initializeFundTable(){
Table.Data.loadFunds();
Table.adjustWidth('30%');
Table.show();
Table.Columns.assignClasses(fundCols);
Expand Down
3 changes: 2 additions & 1 deletion src/js/views/08_summary/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function summaryView(){

// prompt buttons
Prompt.Buttons.Right.updateText('Download Excel');
Prompt.Buttons.Left.updateText('Go back to home');
Prompt.Buttons.Left.updateText('Start over');
// add button links
Prompt.Buttons.Left.addAction(returnToWelcome);
Prompt.Buttons.Right.addAction(downloadXLSX);
Expand Down Expand Up @@ -47,4 +47,5 @@ const returnToWelcome = () => {visitPage('welcome')}
export function disablePromptButtons(){
Prompt.Buttons.Left.removeAction(returnToWelcome);
Prompt.Buttons.Right.removeAction(downloadXLSX);
Prompt.Buttons.Right.enable();
}

0 comments on commit fd2e490

Please sign in to comment.