From eea168fc8be8af990e545eb886a8e3b5e2e7f958 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Fri, 19 Jul 2024 16:57:28 -0400 Subject: [PATCH 01/16] #28 adding space for fringe columns in personnel table, but found an issue in the detail sheet --- src/js/views/04_personnel/helpers.js | 7 +++++-- src/js/views/08_summary/helpers.js | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/views/04_personnel/helpers.js b/src/js/views/04_personnel/helpers.js index 9291b79..5bf21e1 100644 --- a/src/js/views/04_personnel/helpers.js +++ b/src/js/views/04_personnel/helpers.js @@ -38,9 +38,12 @@ function assignClasses() { { title: 'Account String', className: 'string' }, { title: 'Service', className: 'service' }, { title: `FY${FISCAL_YEAR} Requested FTE`, className: 'baseline-ftes' }, - { title: `FY${FISCAL_YEAR} Average Projected Salary/Wage`, className: 'avg-salary', isCost: true }, + { title: `FY${FISCAL_YEAR-1} Average Projected Salary/Wage`, className: 'avg-salary', isCost: true }, { title: 'Total Cost', className: 'total-baseline', isCost: true }, - { title: 'Edit', className: 'edit' } + { title: 'Edit', className: 'edit' }, + // calculation columns + // { title: 'Salary/Wage Final Request', className: 'final-salary-pre-fringe' }, + // { title: 'Fringe Benefits Final Request', className: 'fringe'} ]; // assign cost classes diff --git a/src/js/views/08_summary/helpers.js b/src/js/views/08_summary/helpers.js index 21dd1ea..4c07102 100644 --- a/src/js/views/08_summary/helpers.js +++ b/src/js/views/08_summary/helpers.js @@ -21,14 +21,13 @@ export function summaryView(){ // prompt buttons Prompt.Buttons.Right.updateText('Download Excel'); - Prompt.Buttons.Left.updateText('Start over'); + Prompt.Buttons.Left.updateText('Start over with new Excel upload'); // add button links Prompt.Buttons.Left.addAction(returnToWelcome); Prompt.Buttons.Right.addAction(downloadXLSX); // update page text Subtitle.update('Summary'); - compareToTarget() } From 2c2f058635a0dd3884bc71bd3aa6908f00722746 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Fri, 19 Jul 2024 17:03:02 -0400 Subject: [PATCH 02/16] #15 changed object name to obj category in np table --- src/js/views/06_nonpersonnel/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/views/06_nonpersonnel/helpers.js b/src/js/views/06_nonpersonnel/helpers.js index a24a960..830eadc 100644 --- a/src/js/views/06_nonpersonnel/helpers.js +++ b/src/js/views/06_nonpersonnel/helpers.js @@ -16,7 +16,7 @@ const nonPersonnelColumns = [ { title : 'CPA #', className : 'cpa'}, { title : 'Contract End Date', className : 'contract-end'}, { title: 'Recurring or One-Time', className: 'recurring'}, - { title: 'Object Name', className: 'object'} + { title: 'Object Catgory', className: 'object'} ]; export function preparePageView(){ From c7b0335542e55fc33d92a8aa1e6caef40829f56c Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Mon, 22 Jul 2024 13:44:06 -0400 Subject: [PATCH 03/16] #28 added FICA rates from Excel --- src/js/views/04_personnel/helpers.js | 16 +++++----------- src/js/views/05_overtime/helpers.js | 8 +++++--- src/js/views/06_nonpersonnel/helpers.js | 4 +--- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/js/views/04_personnel/helpers.js b/src/js/views/04_personnel/helpers.js index 5bf21e1..7ecd77a 100644 --- a/src/js/views/04_personnel/helpers.js +++ b/src/js/views/04_personnel/helpers.js @@ -1,5 +1,5 @@ -import { FISCAL_YEAR, fringe, cola, merit } from "../../init.js" +import { FISCAL_YEAR } from "../../init.js" import Body from "../../components/body/body.js"; import NavButtons from "../../components/nav_buttons/nav_buttons.js"; import Subtitle from "../../components/header/header.js"; @@ -9,9 +9,7 @@ import Prompt from "../../components/prompt/prompt.js"; import Table from '../../components/table/table.js' import Sidebar from "../../components/sidebar/sidebar.js"; import { Services } from "../../utils/data_utils/budget_data_handlers.js"; -import { convertToJSON } from "../../utils/data_utils/JSON_data_handlers.js"; -import { Baseline, loadTableData } from "../../utils/data_utils/local_storage_handlers.js"; export function preparePageView(){ // prepare page view @@ -38,12 +36,11 @@ function assignClasses() { { title: 'Account String', className: 'string' }, { title: 'Service', className: 'service' }, { title: `FY${FISCAL_YEAR} Requested FTE`, className: 'baseline-ftes' }, - { title: `FY${FISCAL_YEAR-1} Average Projected Salary/Wage`, className: 'avg-salary', isCost: true }, + { title: `FY${FISCAL_YEAR} Average Projected Salary/Wage`, className: 'avg-salary', isCost: true }, { title: 'Total Cost', className: 'total-baseline', isCost: true }, { title: 'Edit', className: 'edit' }, // calculation columns - // { title: 'Salary/Wage Final Request', className: 'final-salary-pre-fringe' }, - // { title: 'Fringe Benefits Final Request', className: 'fringe'} + { title: 'Fringe Benefits Final Request', className: 'fringe', isCost: true, hide: true} ]; // assign cost classes @@ -77,10 +74,6 @@ function initializeRowAddition(){ Table.Buttons.AddRow.show(); } -function calculateTotalCost(ftes, avg_salary, fringe, cola, merit){ - return ftes * avg_salary * (1 + fringe) * (1 + cola) * (1 + merit); -} - // update sidebar and also cost totals when the FTEs are edited function updateDisplayandTotals(){ // calculate for each row @@ -88,10 +81,11 @@ function updateDisplayandTotals(){ for (let i = 1; i < rows.length; i++){ // fetch values for calculations let avg_salary = Table.Cell.getValue(rows[i], 'avg-salary'); + let fringe = Table.Cell.getValue(rows[i], 'fringe'); let baseline_ftes = Table.Cell.getText(rows[i], 'baseline-ftes'); // calcuate #FTEs x average salary + COLA adjustments + merit adjustments + fringe - let total_baseline_cost = calculateTotalCost(baseline_ftes, avg_salary, fringe, cola, merit); + let total_baseline_cost = (avg_salary + fringe) * baseline_ftes; // update total column Table.Cell.updateValue(rows[i], 'total-baseline', total_baseline_cost); diff --git a/src/js/views/05_overtime/helpers.js b/src/js/views/05_overtime/helpers.js index ac477f0..637c358 100644 --- a/src/js/views/05_overtime/helpers.js +++ b/src/js/views/05_overtime/helpers.js @@ -6,7 +6,6 @@ import Subtitle from '../../components/header/header.js'; import Sidebar from '../../components/sidebar/sidebar.js'; import Table from '../../components/table/table.js'; import { Services } from '../../utils/data_utils/budget_data_handlers.js'; -import { OT_FRINGE } from '../../init.js'; export function preparePageView(){ // prepare page view @@ -36,7 +35,9 @@ function assignClasses() { { title: 'Hourly Employee Overtime (Wages)', className: 'OT-wages', isCost: true }, { title: 'Salaried Employee Overtime (Salary)', className: 'OT-salary', isCost: true }, { title: 'Total Cost (including benefits)', className : 'total', isCost: true}, - { title: 'Edit', className: 'edit'} + { title: 'Edit', className: 'edit'}, + // calc columns + { title: 'FICA Rate', className: 'fica', hide: true} ]; // assign cost classes @@ -80,9 +81,10 @@ function updateDisplayandTotals(){ // fetch values for calculations let OT_salary = Table.Cell.getValue(rows[i], 'OT-salary'); let OT_wages = Table.Cell.getValue(rows[i], 'OT-wages'); + let fringe_rate = Table.Cell.getText(rows[i], 'fringe'); // add salary and wages and fringe benefits (FICA) - let row_total = calculateTotalCost(OT_salary, OT_wages, OT_FRINGE); + let row_total = calculateTotalCost(OT_salary, OT_wages, fringe_rate); // update total Table.Cell.updateValue(rows[i], 'total', row_total); diff --git a/src/js/views/06_nonpersonnel/helpers.js b/src/js/views/06_nonpersonnel/helpers.js index 830eadc..26775ac 100644 --- a/src/js/views/06_nonpersonnel/helpers.js +++ b/src/js/views/06_nonpersonnel/helpers.js @@ -4,8 +4,6 @@ import Table from "../../components/table/table.js"; import Body from "../../components/body/body.js"; import NavButtons from "../../components/nav_buttons/nav_buttons.js"; import Subtitle from "../../components/header/header.js"; -import { FundLookupTable } from "../../utils/data_utils/budget_data_handlers.js"; -import { CurrentFund } from "../../utils/data_utils/local_storage_handlers.js"; const nonPersonnelColumns = [ { title: 'FY26 Request', className: 'request', isCost: true }, @@ -16,7 +14,7 @@ const nonPersonnelColumns = [ { title : 'CPA #', className : 'cpa'}, { title : 'Contract End Date', className : 'contract-end'}, { title: 'Recurring or One-Time', className: 'recurring'}, - { title: 'Object Catgory', className: 'object'} + { title: 'Object Catgory', className: 'object'} ]; export function preparePageView(){ From bfb1297077fff4fa491a0916681ade344a0726d3 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Mon, 22 Jul 2024 13:44:37 -0400 Subject: [PATCH 04/16] #28 remove unnecessary hard coded globals --- src/js/init.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/js/init.js b/src/js/init.js index 5bc282c..ee24013 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -4,20 +4,11 @@ import '../css/common.css'; // import functions import { CurrentPage } from './utils/data_utils/local_storage_handlers.js'; -// path for my laptop -export let DATA_ROOT = '../../../data/law_dept_sample/' -// github path -// export let DATA_ROOT = '../../budget-request-demo/data/law_dept_sample/' - +// temporary hard-coding export let REVENUE = 0; export let TARGET = 14000000; +// Set to equal current fiscal year export var FISCAL_YEAR = '26'; -export var OT_FRINGE = 0.0765; - -// variables on the salary -export var fringe = 0.36 -export var cola = 0.02 -export var merit = 0.02 // sheets to expect on detail sheet export const SHEETS = { From 5c3d68a49707a4dc3a2dbf120d06a98a8941e860 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Mon, 22 Jul 2024 13:45:12 -0400 Subject: [PATCH 05/16] #28 add capacity to hide specified columns when adding classes --- src/js/components/table/subcomponents/columns.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/components/table/subcomponents/columns.js b/src/js/components/table/subcomponents/columns.js index c7746f7..d6caaab 100644 --- a/src/js/components/table/subcomponents/columns.js +++ b/src/js/components/table/subcomponents/columns.js @@ -114,7 +114,9 @@ function assignColumnClasses(columnDefinitions) { } // show the column - showColumnByTitle(column.title); + if (!column.hide){ + showColumnByTitle(column.title); + } }); } From 2ad9f483ebf39aae85f336706ed12f5f078a46ed Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 09:14:51 -0400 Subject: [PATCH 06/16] remove reference to DATA_ROOT --- src/js/utils/data_utils/local_storage_handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/utils/data_utils/local_storage_handlers.js b/src/js/utils/data_utils/local_storage_handlers.js index b92d3ab..6918d89 100644 --- a/src/js/utils/data_utils/local_storage_handlers.js +++ b/src/js/utils/data_utils/local_storage_handlers.js @@ -1,4 +1,4 @@ -import { FISCAL_YEAR, DATA_ROOT } from "../../init.js"; +import { FISCAL_YEAR } from "../../init.js"; import Sidebar from "../../components/sidebar/sidebar.js"; import { PAGES, visitPage } from "../../views/view_logic.js"; import { fetchJSON } from "./JSON_data_handlers.js"; From 97bdb6a3c663e1bcab7ac9b7bd6292c0b42f8ad6 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 09:26:21 -0400 Subject: [PATCH 07/16] edit OT table to pull sal/wage cols from detail sheet --- src/js/components/table/subcomponents/cells.js | 7 ++++++- src/js/views/05_overtime/helpers.js | 12 +++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/js/components/table/subcomponents/cells.js b/src/js/components/table/subcomponents/cells.js index fe061d7..fd388c1 100644 --- a/src/js/components/table/subcomponents/cells.js +++ b/src/js/components/table/subcomponents/cells.js @@ -12,7 +12,12 @@ function getCellValue(row, className) { // return text in cell function getCellText(row, className) { var cell = row.querySelector(`.${className}`); - return cell.textContent; + if (cell) { + return cell.textContent; + } else { + console.log(`Error retrieving cell text for class ${className}`); + return ''; + } } function updateTableCell(row, col_class, new_value){ diff --git a/src/js/views/05_overtime/helpers.js b/src/js/views/05_overtime/helpers.js index 637c358..37869da 100644 --- a/src/js/views/05_overtime/helpers.js +++ b/src/js/views/05_overtime/helpers.js @@ -55,9 +55,6 @@ export async function initializeOTTable(){ if(await Table.Data.load()) { //after table is loaded, fill it Table.show(); - Table.Columns.addAtEnd( '0', 'Hourly Employee Overtime (Wages)'); - Table.Columns.addAtEnd( '0', 'Salaried Employee Overtime (Salary)'); - // Table.Columns.addAtEnd( '0', 'Total Cost (including benefits)'); Table.Columns.addAtEnd(Table.Buttons.edit_confirm_btns, 'Edit');; assignClasses(); // add up the baseline costs and update sidebar @@ -69,8 +66,9 @@ export async function initializeOTTable(){ } } -function calculateTotalCost(wages, salary, fringe){ - return (wages + salary) * (1 + fringe) ; +function calculateTotalCost(salary, wages, fica_rate){ + fica_rate = parseFloat(fica_rate); + return (wages + salary) * (1 + fica_rate) ; } // update sidebar and also cost totals when the FTEs are edited @@ -81,10 +79,10 @@ function updateDisplayandTotals(){ // fetch values for calculations let OT_salary = Table.Cell.getValue(rows[i], 'OT-salary'); let OT_wages = Table.Cell.getValue(rows[i], 'OT-wages'); - let fringe_rate = Table.Cell.getText(rows[i], 'fringe'); + let fica_rate = Table.Cell.getText(rows[i], 'fica'); // add salary and wages and fringe benefits (FICA) - let row_total = calculateTotalCost(OT_salary, OT_wages, fringe_rate); + let row_total = calculateTotalCost(OT_salary, OT_wages, fica_rate); // update total Table.Cell.updateValue(rows[i], 'total', row_total); From cee84f9a9e7385bd0ead1241f385065d082f9790 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 10:04:55 -0400 Subject: [PATCH 08/16] remove redundant css imports; add tooltip placeholder --- index.html | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/index.html b/index.html index 15327c2..9647a59 100644 --- a/index.html +++ b/index.html @@ -10,20 +10,6 @@ - - - - - - - - - - - - - - From 271da58300bff30657d1bb1ff1824599ff7d88f6 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 10:05:56 -0400 Subject: [PATCH 09/16] remove extra file --- index.html | 180 ----------------------------------------------------- 1 file changed, 180 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index 9647a59..0000000 --- a/index.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - -Demo Budget Form - - - - - - - - - - - - - - - - - - - - - -
- - - -

FY2026 Budget Form

-

-
- - -
- - -
- - - - -
- - -
-
-

Baseline

-
-
-
-

Suplemental

-
-
-
- - -
-

-
- - - - - -
- - -
- - - - -
- -
- - -
-
- -
-
- - -
-
- -
-
- -
- - - - - - - - - \ No newline at end of file From 00ad8ba342a81ddff20d553aa26c9e0b8a42c0b6 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 10:16:57 -0400 Subject: [PATCH 10/16] #38 add tooltip component --- src/index.html | 8 ++++---- src/js/components/body/body.js | 2 ++ src/js/components/tooltip/tooltip.css | 16 ++++++++++++++++ src/js/components/tooltip/tooltip.js | 21 +++++++++++++++++++++ 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 src/js/components/tooltip/tooltip.css create mode 100644 src/js/components/tooltip/tooltip.js diff --git a/src/index.html b/src/index.html index 8e1d261..028589c 100644 --- a/src/index.html +++ b/src/index.html @@ -15,11 +15,10 @@ - - + @@ -71,6 +70,9 @@

+ +
+
@@ -78,7 +80,6 @@

-
@@ -100,7 +101,6 @@

-
diff --git a/src/js/components/body/body.js b/src/js/components/body/body.js index 83df631..674b95a 100644 --- a/src/js/components/body/body.js +++ b/src/js/components/body/body.js @@ -8,6 +8,7 @@ import NavButtons from '../nav_buttons/nav_buttons.js'; import Prompt from '../prompt/prompt.js'; import Sidebar from '../sidebar/sidebar.js'; import Table from '../table/table.js'; +import Tooltip from '../tooltip/tooltip.js'; function resetPage() { // hide everything in the body @@ -20,6 +21,7 @@ function resetPage() { Sidebar.hide(); Accordion.hide(); FileUpload.hide(); + Tooltip.hide(); // disable next button NavButtons.Next.disable(); Prompt.Buttons.reset(); diff --git a/src/js/components/tooltip/tooltip.css b/src/js/components/tooltip/tooltip.css new file mode 100644 index 0000000..352050b --- /dev/null +++ b/src/js/components/tooltip/tooltip.css @@ -0,0 +1,16 @@ +#tooltip { + position: absolute; + background-color: black; + color: white; + padding: 5px; + border-radius: 3px; + visibility: hidden; + white-space: nowrap; + font-size: 14px; + z-index: 1000; +} + +.tooltip-cell { + color: blue; + text-decoration: underline; +} \ No newline at end of file diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js new file mode 100644 index 0000000..84ce840 --- /dev/null +++ b/src/js/components/tooltip/tooltip.js @@ -0,0 +1,21 @@ +import './tooltip.css' + +export const Tooltip = { + link : function(element) { + element.addEventListener('mouseover', function () { + this.editText('Tooltip'); + this.show(); + }); + element.addEventListener('mouseout', function () { + this.hide(); + }); + }, + hide : () => {document.getElementById('tooltip').style.visibility = 'hidden';}, + show : () => {document.getElementById('tooltip').style.visibility = 'visible';}, + editText : (newText) => { + const tooltip = document.getElementById('tooltip'); + tooltip.innerText = newText; + } +} + +export default Tooltip \ No newline at end of file From fb3c3ee2f4acf7ea1524f8bd64632ecad96a2ae8 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 10:53:22 -0400 Subject: [PATCH 11/16] #38 add initial implementation of tooltip for account string on personnel view --- src/js/components/body/body.js | 4 +- src/js/components/file_upload/file_upload.js | 4 +- src/js/components/tooltip/tooltip.css | 1 + src/js/components/tooltip/tooltip.js | 57 ++++++++++++++++---- src/js/views/04_personnel/helpers.js | 12 +++-- 5 files changed, 62 insertions(+), 16 deletions(-) diff --git a/src/js/components/body/body.js b/src/js/components/body/body.js index 674b95a..028bd84 100644 --- a/src/js/components/body/body.js +++ b/src/js/components/body/body.js @@ -1,8 +1,8 @@ import './body.css'; import Welcome from '../../components/welcome/welcome.js' -import { Accordion } from '../accordion/accordion.js'; -import { FileUpload } from '../file_upload/file_upload.js'; +import Accordion from '../accordion/accordion.js'; +import FileUpload from '../file_upload/file_upload.js'; import Modal from '../modal/modal.js'; import NavButtons from '../nav_buttons/nav_buttons.js'; import Prompt from '../prompt/prompt.js'; diff --git a/src/js/components/file_upload/file_upload.js b/src/js/components/file_upload/file_upload.js index 7fe2b28..43cc3d4 100644 --- a/src/js/components/file_upload/file_upload.js +++ b/src/js/components/file_upload/file_upload.js @@ -37,4 +37,6 @@ function readXL(event) { }; reader.readAsArrayBuffer(file); // Read the file as an ArrayBuffer } -} \ No newline at end of file +} + +export default FileUpload; \ No newline at end of file diff --git a/src/js/components/tooltip/tooltip.css b/src/js/components/tooltip/tooltip.css index 352050b..fef8bab 100644 --- a/src/js/components/tooltip/tooltip.css +++ b/src/js/components/tooltip/tooltip.css @@ -13,4 +13,5 @@ .tooltip-cell { color: blue; text-decoration: underline; + cursor: pointer; } \ No newline at end of file diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index 84ce840..7564331 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -1,20 +1,59 @@ +import Cell from '../table/subcomponents/cells'; import './tooltip.css' +function hideTooltip() { + document.getElementById('tooltip').style.visibility = 'hidden'; +} + +function showTooltip() { + document.getElementById('tooltip').style.visibility = 'visible'; +} + +function editTooltipText(newText){ + // edit text to display inside tooltip + const tooltip = document.getElementById('tooltip'); + tooltip.innerText = newText; +} + +function showAccountString(event){ + const row = event.target.parentElement; + console.log(row); + const approp = Cell.getText(row, 'approp-name'); + const cc = Cell.getText(row, 'cc-name'); + editTooltipText(`Appropriation: ${approp} + Cost Center: ${cc}`) +} + export const Tooltip = { + + hide : hideTooltip, + show : showTooltip, + link : function(element) { - element.addEventListener('mouseover', function () { - this.editText('Tooltip'); - this.show(); + // add class to show cell with an underline, etc + element.classList.add('tooltip-cell'); + // add event listener to show tooltip on mouseover + element.addEventListener('click', function (event) { + showAccountString(event); + showTooltip(); }); + // and hide when mouse moves off element.addEventListener('mouseout', function () { - this.hide(); + hideTooltip(); + }); + // Update tooltip position on mouse move + element.addEventListener('mousemove', function (event) { + const tooltip = document.getElementById('tooltip'); + tooltip.style.top = (event.clientY + 10) + 'px'; + tooltip.style.left = (event.clientX + 10) + 'px'; }); }, - hide : () => {document.getElementById('tooltip').style.visibility = 'hidden';}, - show : () => {document.getElementById('tooltip').style.visibility = 'visible';}, - editText : (newText) => { - const tooltip = document.getElementById('tooltip'); - tooltip.innerText = newText; + + linkAccountStringCol : function() { + // get all relevant cells + document.querySelectorAll('.account-string').forEach( (cell) => { + this.link(cell); + }) } } diff --git a/src/js/views/04_personnel/helpers.js b/src/js/views/04_personnel/helpers.js index 7ecd77a..1c86478 100644 --- a/src/js/views/04_personnel/helpers.js +++ b/src/js/views/04_personnel/helpers.js @@ -9,6 +9,7 @@ import Prompt from "../../components/prompt/prompt.js"; import Table from '../../components/table/table.js' import Sidebar from "../../components/sidebar/sidebar.js"; import { Services } from "../../utils/data_utils/budget_data_handlers.js"; +import Tooltip from "../../components/tooltip/tooltip.js"; export function preparePageView(){ @@ -33,14 +34,16 @@ function assignClasses() { // record columns and their classes const personnelColumns = [ { title: 'Job Title', className: 'job-name' }, - { title: 'Account String', className: 'string' }, + { title: 'Account String', className: 'account-string' }, { title: 'Service', className: 'service' }, { title: `FY${FISCAL_YEAR} Requested FTE`, className: 'baseline-ftes' }, { title: `FY${FISCAL_YEAR} Average Projected Salary/Wage`, className: 'avg-salary', isCost: true }, { title: 'Total Cost', className: 'total-baseline', isCost: true }, { title: 'Edit', className: 'edit' }, - // calculation columns - { title: 'Fringe Benefits Final Request', className: 'fringe', isCost: true, hide: true} + // hidden columns needed for calculations + { title: 'Fringe Benefits Final Request', className: 'fringe', isCost: true, hide: true }, + { title: 'Appropriation Name', className: 'approp-name', hide: true }, + { title: 'Cost Center Name', className: 'cc-name', hide: true } ]; // assign cost classes @@ -67,6 +70,8 @@ export async function initializePersonnelTable(){ } else { Prompt.Text.update('No personnel expenditures for this fund.') } + // Link up tooltips to display more info on hover + Tooltip.linkAccountStringCol(); } function initializeRowAddition(){ @@ -96,7 +101,6 @@ function updateDisplayandTotals(){ } - export function setUpModal() { // Initialize modal Modal.clear(); From a54ecb24da887f75592bf30e22a624db47c6a4e6 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 11:57:15 -0400 Subject: [PATCH 12/16] #38 change i icon to font-awesome --- src/js/components/tooltip/tooltip.css | 14 ++++++++++++-- src/js/components/tooltip/tooltip.js | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/js/components/tooltip/tooltip.css b/src/js/components/tooltip/tooltip.css index fef8bab..9bfa3cb 100644 --- a/src/js/components/tooltip/tooltip.css +++ b/src/js/components/tooltip/tooltip.css @@ -11,7 +11,17 @@ } .tooltip-cell { - color: blue; - text-decoration: underline; + /* color: blue; */ + /* text-decoration: underline; */ cursor: pointer; +} + +.tooltip-cell .info-icon { + margin-left: 5px; + color: var(--spiritgreen); + font-size: 15px; +} + +.tooltip-cell:hover { + background-color: #f0f0f0; /* Change background on hover */ } \ No newline at end of file diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index 7564331..40e1915 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -17,7 +17,6 @@ function editTooltipText(newText){ function showAccountString(event){ const row = event.target.parentElement; - console.log(row); const approp = Cell.getText(row, 'approp-name'); const cc = Cell.getText(row, 'cc-name'); editTooltipText(`Appropriation: ${approp} @@ -30,8 +29,15 @@ export const Tooltip = { show : showTooltip, link : function(element) { + // add class to show cell with an underline, etc element.classList.add('tooltip-cell'); + + // Create and append the Font Awesome info icon + const infoIcon = document.createElement('i'); + infoIcon.classList.add('fas', 'fa-info-circle', 'info-icon'); + element.appendChild(infoIcon); + // add event listener to show tooltip on mouseover element.addEventListener('click', function (event) { showAccountString(event); From 62608912c16e25e3bc419a0458b3b81f24fc8c34 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 12:08:36 -0400 Subject: [PATCH 13/16] fix type in column name for NP --- src/js/views/06_nonpersonnel/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/views/06_nonpersonnel/helpers.js b/src/js/views/06_nonpersonnel/helpers.js index 26775ac..bd5c26c 100644 --- a/src/js/views/06_nonpersonnel/helpers.js +++ b/src/js/views/06_nonpersonnel/helpers.js @@ -14,7 +14,7 @@ const nonPersonnelColumns = [ { title : 'CPA #', className : 'cpa'}, { title : 'Contract End Date', className : 'contract-end'}, { title: 'Recurring or One-Time', className: 'recurring'}, - { title: 'Object Catgory', className: 'object'} + { title: 'Object Category', className: 'object'} ]; export function preparePageView(){ From e23caa2eb6f01ca7a7bede9257a740371fcc9fc6 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 12:53:50 -0400 Subject: [PATCH 14/16] #38 implement personnel tooltips --- src/js/components/tooltip/tooltip.js | 66 ++++++++++++++++++++++++++-- src/js/utils/common_utils.js | 8 +++- src/js/views/04_personnel/helpers.js | 13 +++--- 3 files changed, 76 insertions(+), 11 deletions(-) diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index 40e1915..aeb6fc1 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -1,4 +1,6 @@ +import { FISCAL_YEAR } from '../../init'; import Cell from '../table/subcomponents/cells'; +import { formatCurrency } from '../../utils/common_utils'; import './tooltip.css' function hideTooltip() { @@ -23,12 +25,48 @@ function showAccountString(event){ Cost Center: ${cc}`) } +function showSalaryProjection(event){ + const row = event.target.parentElement; + const general_increase = Cell.getText(row, 'general-increase-rate'); + const merit_increase = Cell.getText(row, 'merit-increase-rate'); + const current_salary = Cell.getValue(row, 'current-salary'); + const proj_salary = Cell.getValue(row, 'avg-salary'); + if (current_salary){ + var message = `The average salary/wage for this position was + ${formatCurrency(current_salary)} as of September 20${FISCAL_YEAR-2}. With two general + increases of ${general_increase*100}% and a merit increase of ${merit_increase*100}%, the + Budget Office projects that the average annual + salary/wage for this position will be ${formatCurrency(proj_salary)} in FY${FISCAL_YEAR}.`; + } else { + var message = `The average salary/wage for this position was + unknown as of September 20${FISCAL_YEAR-2}, or the position + did not exist. The Budget Office projects that + the average annual salary/wage for this position + will be ${formatCurrency(proj_salary)} in FY2026.` + } + + editTooltipText(message); +} + +function showFinalPersonnelCost(event){ + const row = event.target.parentElement; + const proj_salary = Cell.getValue(row, 'avg-salary'); + const ftes = Cell.getText(row, 'baseline-ftes'); + const fringe = parseFloat(Cell.getText(row, 'fringe')); + const avg_benefits = proj_salary * fringe; + const message = `The total cost captures ${ftes} position(s) at + an annual salary/wage of ${formatCurrency(proj_salary)}, + plus fringe benefits that cost ${formatCurrency(avg_benefits)} + per position per year, on average.` + editTooltipText(message); +} + export const Tooltip = { hide : hideTooltip, show : showTooltip, - link : function(element) { + link : function(element, displayFn) { // add class to show cell with an underline, etc element.classList.add('tooltip-cell'); @@ -37,10 +75,10 @@ export const Tooltip = { const infoIcon = document.createElement('i'); infoIcon.classList.add('fas', 'fa-info-circle', 'info-icon'); element.appendChild(infoIcon); - + // add event listener to show tooltip on mouseover element.addEventListener('click', function (event) { - showAccountString(event); + displayFn(event); showTooltip(); }); // and hide when mouse moves off @@ -58,8 +96,28 @@ export const Tooltip = { linkAccountStringCol : function() { // get all relevant cells document.querySelectorAll('.account-string').forEach( (cell) => { - this.link(cell); + this.link(cell, showAccountString); }) + }, + + linkSalaryCol : function() { + // get all relevant cells + document.querySelectorAll('.avg-salary').forEach( (cell) => { + this.link(cell, showSalaryProjection); + }) + }, + + linkTotalPersonnelCostCol : function() { + // get all relevant cells + document.querySelectorAll('.total-baseline').forEach( (cell) => { + this.link(cell, showFinalPersonnelCost); + }) + }, + + linkAll : function() { + this.linkAccountStringCol(); + this.linkSalaryCol(); + this.linkTotalPersonnelCostCol(); } } diff --git a/src/js/utils/common_utils.js b/src/js/utils/common_utils.js index 3e92ad2..eb154cf 100644 --- a/src/js/utils/common_utils.js +++ b/src/js/utils/common_utils.js @@ -37,6 +37,10 @@ export function cleanString(str){ } export function removeNewLines(str){ - // TODO: ensure there is a space between words on new lines - return str.replaceAll(/[\r\n]+/g, ""); + // replace all new lines with spaces + str = str.replaceAll(/[\r\n]+/g, " "); + // remove any extra spaces or trailing/leading whitespace + str = str.replaceAll(' ', ' '); + str = str.replace(/^\s+|\s+$/g, ''); + return str; } \ No newline at end of file diff --git a/src/js/views/04_personnel/helpers.js b/src/js/views/04_personnel/helpers.js index 1c86478..7a33faf 100644 --- a/src/js/views/04_personnel/helpers.js +++ b/src/js/views/04_personnel/helpers.js @@ -41,9 +41,12 @@ function assignClasses() { { title: 'Total Cost', className: 'total-baseline', isCost: true }, { title: 'Edit', className: 'edit' }, // hidden columns needed for calculations - { title: 'Fringe Benefits Final Request', className: 'fringe', isCost: true, hide: true }, + { title: 'Fringe Benefits Rate', className: 'fringe', hide: true }, { title: 'Appropriation Name', className: 'approp-name', hide: true }, - { title: 'Cost Center Name', className: 'cc-name', hide: true } + { title: 'Cost Center Name', className: 'cc-name', hide: true }, + { title: 'General Increase Rate', className: 'general-increase-rate', hide: true}, + { title: 'Step/Merit Increase Rate', className: 'merit-increase-rate', hide: true}, + { title: `Average Salary/Wage as of 9/1/20${FISCAL_YEAR-2}`, className: 'current-salary', isCost: true, hide: true}, ]; // assign cost classes @@ -71,7 +74,7 @@ export async function initializePersonnelTable(){ Prompt.Text.update('No personnel expenditures for this fund.') } // Link up tooltips to display more info on hover - Tooltip.linkAccountStringCol(); + Tooltip.linkAll(); } function initializeRowAddition(){ @@ -86,11 +89,11 @@ function updateDisplayandTotals(){ for (let i = 1; i < rows.length; i++){ // fetch values for calculations let avg_salary = Table.Cell.getValue(rows[i], 'avg-salary'); - let fringe = Table.Cell.getValue(rows[i], 'fringe'); + let fringe = parseFloat(Table.Cell.getText(rows[i], 'fringe')); let baseline_ftes = Table.Cell.getText(rows[i], 'baseline-ftes'); // calcuate #FTEs x average salary + COLA adjustments + merit adjustments + fringe - let total_baseline_cost = (avg_salary + fringe) * baseline_ftes; + let total_baseline_cost = avg_salary * baseline_ftes * (1 + fringe); // update total column Table.Cell.updateValue(rows[i], 'total-baseline', total_baseline_cost); From 7c47d5f9a04c90bfe591e274fc133a9e7c362ef8 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 14:07:50 -0400 Subject: [PATCH 15/16] #38 added OT tooltip --- src/js/components/tooltip/tooltip.js | 23 ++++++++++++++++++++++- src/js/views/04_personnel/helpers.js | 4 ++-- src/js/views/05_overtime/helpers.js | 10 +++++++--- src/js/views/06_nonpersonnel/helpers.js | 13 +++++++++---- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index aeb6fc1..25cc457 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -61,6 +61,15 @@ function showFinalPersonnelCost(event){ editTooltipText(message); } +function showFICA(event){ + const row = event.target.parentElement; + const fica = parseFloat(Cell.getText(row, 'fica')); + const ficaPercentage = (fica * 100).toFixed(2); + const message = `This total is overtime wages plus overtime salary plus FICA, + which is ${ficaPercentage}% for this cost center.` + editTooltipText(message); +} + export const Tooltip = { hide : hideTooltip, @@ -114,10 +123,22 @@ export const Tooltip = { }) }, - linkAll : function() { + linkTotalNPCol : function() { + // get all relevant cells + document.querySelectorAll('.total').forEach( (cell) => { + this.link(cell, showFICA); + }) + }, + + linkAllPersonnel : function() { this.linkAccountStringCol(); this.linkSalaryCol(); this.linkTotalPersonnelCostCol(); + }, + + linkAllOvertime : function() { + // this.linkAccountStringCol(); + this.linkTotalNPCol(); } } diff --git a/src/js/views/04_personnel/helpers.js b/src/js/views/04_personnel/helpers.js index 7a33faf..5dc5a59 100644 --- a/src/js/views/04_personnel/helpers.js +++ b/src/js/views/04_personnel/helpers.js @@ -70,11 +70,11 @@ export async function initializePersonnelTable(){ // activate edit buttons Table.Buttons.Edit.init(personnelRowOnEdit, updateDisplayandTotals); initializeRowAddition(); + // Link up tooltips to display more info on hover + Tooltip.linkAllPersonnel(); } else { Prompt.Text.update('No personnel expenditures for this fund.') } - // Link up tooltips to display more info on hover - Tooltip.linkAll(); } function initializeRowAddition(){ diff --git a/src/js/views/05_overtime/helpers.js b/src/js/views/05_overtime/helpers.js index 37869da..70b8082 100644 --- a/src/js/views/05_overtime/helpers.js +++ b/src/js/views/05_overtime/helpers.js @@ -6,6 +6,7 @@ import Subtitle from '../../components/header/header.js'; import Sidebar from '../../components/sidebar/sidebar.js'; import Table from '../../components/table/table.js'; import { Services } from '../../utils/data_utils/budget_data_handlers.js'; +import Tooltip from '../../components/tooltip/tooltip.js'; export function preparePageView(){ // prepare page view @@ -28,8 +29,9 @@ export function preparePageView(){ function assignClasses() { // record columns and their classes const OT_cols = [ - { title: 'Account String', className: 'string' }, - { title: `Cost Center Name`, className: 'cc' }, + // { title: 'Account String', className: 'account-string' }, + { title: `Cost Center Name`, className: 'cc-name' }, + { title: 'Appropriation Name', className: 'approp-name'}, { title: 'Service', className: 'service' }, { title: 'Recurring or One-Time', className: 'recurring'}, { title: 'Hourly Employee Overtime (Wages)', className: 'OT-wages', isCost: true }, @@ -37,7 +39,7 @@ function assignClasses() { { title: 'Total Cost (including benefits)', className : 'total', isCost: true}, { title: 'Edit', className: 'edit'}, // calc columns - { title: 'FICA Rate', className: 'fica', hide: true} + { title: 'FICA Rate', className: 'fica', hide: true}, ]; // assign cost classes @@ -61,6 +63,8 @@ export async function initializeOTTable(){ updateDisplayandTotals(); // activate edit buttons Table.Buttons.Edit.init(OTRowOnEdit, updateDisplayandTotals); + // wire up tooltips to show info on click + Tooltip.linkAllOvertime(); } else { Prompt.Text.update('No overtime expenditures for this fund.') } diff --git a/src/js/views/06_nonpersonnel/helpers.js b/src/js/views/06_nonpersonnel/helpers.js index bd5c26c..cf2da78 100644 --- a/src/js/views/06_nonpersonnel/helpers.js +++ b/src/js/views/06_nonpersonnel/helpers.js @@ -7,14 +7,19 @@ import Subtitle from "../../components/header/header.js"; const nonPersonnelColumns = [ { title: 'FY26 Request', className: 'request', isCost: true }, - { title: 'Amount Remaining on Contract', className: 'remaining', isCost: true }, { title: 'Service', className : 'service' }, { title: 'Edit', className : 'edit' }, { title : 'Account String', className : 'account-string'}, - { title : 'CPA #', className : 'cpa'}, - { title : 'Contract End Date', className : 'contract-end'}, { title: 'Recurring or One-Time', className: 'recurring'}, - { title: 'Object Category', className: 'object'} + + { title : 'CPA #', className : 'cpa'}, + { title : 'Contract End Date', className : 'contract-end', hide:true}, + { title: 'Amount Remaining on Contract', className: 'remaining', isCost: true , hide: true}, + + // hidden columns used for calcs and info boxes + { title: 'Object Name', className: 'object-name', hide: true}, + { title: 'Vendor Name', className: 'vendor', hide: true}, + { title: 'Object Category', className: 'object-category', hide: true} ]; export function preparePageView(){ From f151ba403bec337c4cfde44f3028c2baa5a651c9 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Tue, 23 Jul 2024 15:08:05 -0400 Subject: [PATCH 16/16] #38 edit tooltip appearance to be triggered by (detail) instead of info circle --- .../components/table/subcomponents/cells.js | 2 +- src/js/components/tooltip/tooltip.css | 10 +++ src/js/components/tooltip/tooltip.js | 71 ++++++++++++++----- src/js/views/06_nonpersonnel/helpers.js | 12 +++- 4 files changed, 74 insertions(+), 21 deletions(-) diff --git a/src/js/components/table/subcomponents/cells.js b/src/js/components/table/subcomponents/cells.js index fd388c1..50697b1 100644 --- a/src/js/components/table/subcomponents/cells.js +++ b/src/js/components/table/subcomponents/cells.js @@ -15,7 +15,7 @@ function getCellText(row, className) { if (cell) { return cell.textContent; } else { - console.log(`Error retrieving cell text for class ${className}`); + //console.log(`Error retrieving cell text for class ${className}`); return ''; } } diff --git a/src/js/components/tooltip/tooltip.css b/src/js/components/tooltip/tooltip.css index 9bfa3cb..78a4ad8 100644 --- a/src/js/components/tooltip/tooltip.css +++ b/src/js/components/tooltip/tooltip.css @@ -8,6 +8,9 @@ white-space: nowrap; font-size: 14px; z-index: 1000; + max-width: 300px; + word-wrap: break-word; + white-space: normal; } .tooltip-cell { @@ -24,4 +27,11 @@ .tooltip-cell:hover { background-color: #f0f0f0; /* Change background on hover */ +} + +.detail { + color: blue; + color: var(--spiritgreen); + text-decoration: underline; + margin-left: 5px; } \ No newline at end of file diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index 25cc457..8901107 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -14,19 +14,20 @@ function showTooltip() { function editTooltipText(newText){ // edit text to display inside tooltip const tooltip = document.getElementById('tooltip'); - tooltip.innerText = newText; + tooltip.innerHTML = newText; } -function showAccountString(event){ - const row = event.target.parentElement; +function showAccountString(row){ const approp = Cell.getText(row, 'approp-name'); const cc = Cell.getText(row, 'cc-name'); - editTooltipText(`Appropriation: ${approp} - Cost Center: ${cc}`) + const obj = Cell.getText(row, 'object-name'); + var message = `Appropriation: ${approp}
+ Cost Center: ${cc}`; + if (obj) { message += `
Object: ${obj}`} + editTooltipText(message); } -function showSalaryProjection(event){ - const row = event.target.parentElement; +function showSalaryProjection(row){ const general_increase = Cell.getText(row, 'general-increase-rate'); const merit_increase = Cell.getText(row, 'merit-increase-rate'); const current_salary = Cell.getValue(row, 'current-salary'); @@ -48,8 +49,7 @@ function showSalaryProjection(event){ editTooltipText(message); } -function showFinalPersonnelCost(event){ - const row = event.target.parentElement; +function showFinalPersonnelCost(row){ const proj_salary = Cell.getValue(row, 'avg-salary'); const ftes = Cell.getText(row, 'baseline-ftes'); const fringe = parseFloat(Cell.getText(row, 'fringe')); @@ -61,8 +61,7 @@ function showFinalPersonnelCost(event){ editTooltipText(message); } -function showFICA(event){ - const row = event.target.parentElement; +function showFICA(row){ const fica = parseFloat(Cell.getText(row, 'fica')); const ficaPercentage = (fica * 100).toFixed(2); const message = `This total is overtime wages plus overtime salary plus FICA, @@ -70,6 +69,25 @@ function showFICA(event){ editTooltipText(message); } +function showCPA(row){ + const cpa = parseFloat(Cell.getText(row, 'cpa')); + const description = Cell.getText(row, 'cpa-description'); + const vendor = Cell.getText(row, 'vendor'); + const contract_end = Cell.getText(row, 'contract-end'); + const remaining = Cell.getValue(row, 'remaining'); + if (cpa) { + var message = `CPA #${cpa}`; + } else { + var message = `No CPA`; + } + if (vendor) {message += `
Vendor: ${vendor}`}; + if (description) {message += `
Description: ${description}`}; + if (contract_end) {message += `
Contract End Date: ${contract_end}`} + if (remaining) {message += `
Amount Remaining on Contract: ${formatCurrency(remaining)}`} + + editTooltipText(message); +} + export const Tooltip = { hide : hideTooltip, @@ -81,13 +99,20 @@ export const Tooltip = { element.classList.add('tooltip-cell'); // Create and append the Font Awesome info icon - const infoIcon = document.createElement('i'); - infoIcon.classList.add('fas', 'fa-info-circle', 'info-icon'); - element.appendChild(infoIcon); + // const infoIcon = document.createElement('i'); + // infoIcon.classList.add('fas', 'fa-info-circle', 'info-icon'); + // element.appendChild(infoIcon); + + // Create and append (detail) + const detail = document.createElement('span'); + detail.classList.add('detail'); + detail.textContent = '(detail)'; + element.appendChild(detail); // add event listener to show tooltip on mouseover element.addEventListener('click', function (event) { - displayFn(event); + const row = event.target.closest('tr'); + displayFn(row); showTooltip(); }); // and hide when mouse moves off @@ -123,13 +148,20 @@ export const Tooltip = { }) }, - linkTotalNPCol : function() { + linkTotalOTCol : function() { // get all relevant cells document.querySelectorAll('.total').forEach( (cell) => { this.link(cell, showFICA); }) }, + linkCPACol : function() { + // get all relevant cells + document.querySelectorAll('.cpa').forEach( (cell) => { + this.link(cell, showCPA); + }) + }, + linkAllPersonnel : function() { this.linkAccountStringCol(); this.linkSalaryCol(); @@ -138,7 +170,12 @@ export const Tooltip = { linkAllOvertime : function() { // this.linkAccountStringCol(); - this.linkTotalNPCol(); + this.linkTotalOTCol(); + }, + + linkAllNP : function() { + this.linkAccountStringCol(); + this.linkCPACol(); } } diff --git a/src/js/views/06_nonpersonnel/helpers.js b/src/js/views/06_nonpersonnel/helpers.js index cf2da78..e021b60 100644 --- a/src/js/views/06_nonpersonnel/helpers.js +++ b/src/js/views/06_nonpersonnel/helpers.js @@ -4,6 +4,7 @@ import Table from "../../components/table/table.js"; import Body from "../../components/body/body.js"; import NavButtons from "../../components/nav_buttons/nav_buttons.js"; import Subtitle from "../../components/header/header.js"; +import Tooltip from "../../components/tooltip/tooltip.js"; const nonPersonnelColumns = [ { title: 'FY26 Request', className: 'request', isCost: true }, @@ -13,13 +14,16 @@ const nonPersonnelColumns = [ { title: 'Recurring or One-Time', className: 'recurring'}, { title : 'CPA #', className : 'cpa'}, - { title : 'Contract End Date', className : 'contract-end', hide:true}, - { title: 'Amount Remaining on Contract', className: 'remaining', isCost: true , hide: true}, // hidden columns used for calcs and info boxes + { title: 'Appropriation Name', className: 'approp-name', hide: true }, + { title: 'Cost Center Name', className: 'cc-name', hide: true }, + { title : 'Contract End Date', className : 'contract-end', hide:true}, + { title: 'Amount Remaining on Contract', className: 'remaining', isCost: true , hide: true}, { title: 'Object Name', className: 'object-name', hide: true}, { title: 'Vendor Name', className: 'vendor', hide: true}, - { title: 'Object Category', className: 'object-category', hide: true} + { title: 'Object Category', className: 'object-category', hide: true}, + { title: 'BPA/CPA Description', className: 'cpa-description', hide: true} ]; export function preparePageView(){ @@ -44,6 +48,8 @@ export async function initializeNonpersonnelTable(){ Table.Columns.assignClasses(nonPersonnelColumns); // enable editing Table.Buttons.Edit.init(nonPersonnelRowOnEdit, Table.save); + // show info boxes on click + Tooltip.linkAllNP(); } else { Prompt.Text.update('No non-personnel expenditures for this fund.') }