diff --git a/src/js/components/accordion/accordion.js b/src/js/components/accordion/accordion.js index 5b9c7f0..a6b7228 100644 --- a/src/js/components/accordion/accordion.js +++ b/src/js/components/accordion/accordion.js @@ -5,7 +5,7 @@ import {Baseline, CurrentFund, Fund, Supplemental, FundLookupTable} from '../../ import { formatCurrency, cleanString } from "../../utils/common_utils.js"; import Table from "../table/table.js"; import { visitPage } from '../../views/view_logic.js'; -import { TARGET } from '../../init.js'; +import { TARGET } from '../../constants/'; function redirectForEdit(){ const row = document.querySelector(`.active-editing`); diff --git a/src/js/components/sidebar/sidebar.js b/src/js/components/sidebar/sidebar.js index 057b518..bc21eef 100644 --- a/src/js/components/sidebar/sidebar.js +++ b/src/js/components/sidebar/sidebar.js @@ -1,7 +1,7 @@ import './sidebar.css' import { formatCurrency } from "../../utils/common_utils.js"; -import { TARGET } from "../../init.js"; +import { TARGET } from '../../constants/'; import {Baseline, Supplemental} from '../../models/'; diff --git a/src/js/components/tooltip/tooltip.js b/src/js/components/tooltip/tooltip.js index 09f0a4c..6967848 100644 --- a/src/js/components/tooltip/tooltip.js +++ b/src/js/components/tooltip/tooltip.js @@ -1,4 +1,4 @@ -import { FISCAL_YEAR } from '../../init'; +import { FISCAL_YEAR } from '../../constants/'; import Cell from '../table/subcomponents/cells'; import { formatCurrency } from '../../utils/common_utils'; import CurrentPage from '../../models/current_page'; diff --git a/src/js/constants/app_constants.js b/src/js/constants/app_constants.js new file mode 100644 index 0000000..225fd4d --- /dev/null +++ b/src/js/constants/app_constants.js @@ -0,0 +1,5 @@ +// temporary hard-coding +export let TARGET = 10000000; + +// Set to equal current fiscal year +export var FISCAL_YEAR = '26'; \ No newline at end of file diff --git a/src/js/constants/excel_constants.js b/src/js/constants/excel_constants.js new file mode 100644 index 0000000..0034e4c --- /dev/null +++ b/src/js/constants/excel_constants.js @@ -0,0 +1,21 @@ +// sheets to expect on detail sheet +export const SHEETS = { + 'FTE, Salary-Wage, & Benefits' : 'personnel' , + 'Overtime & Other Personnel' : 'overtime', + 'Non-Personnel Operating' : 'nonpersonnel', + 'Revenue' : 'revenue' +} + +export const OBJ_CATEGORIES = { + list : [ + // 'Salaries & Wages', + // 'Employee Benefits', + 'Professional & Contractual Services', + 'Operating Supplies', + 'Operating Services', + 'Equipment Acquisition', + 'Capital Outlays', + 'Fixed Charges', + 'Other Expenses' + ] +} \ No newline at end of file diff --git a/src/js/constants/index.js b/src/js/constants/index.js new file mode 100644 index 0000000..06b365c --- /dev/null +++ b/src/js/constants/index.js @@ -0,0 +1,2 @@ +export * from './app_constants'; +export * from './excel_constants'; \ No newline at end of file diff --git a/src/js/init.js b/src/js/init.js index e70d7e2..9e4153f 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -1,37 +1,9 @@ // import styles import '../css/common.css'; -// temporary hard-coding -export let TARGET = 10000000; -// Set to equal current fiscal year -export var FISCAL_YEAR = '26'; - // import functions import CurrentPage from './models/current_page.js'; -// sheets to expect on detail sheet -export const SHEETS = { - 'FTE, Salary-Wage, & Benefits' : 'personnel' , - 'Overtime & Other Personnel' : 'overtime', - 'Non-Personnel Operating' : 'nonpersonnel', - 'Revenue' : 'revenue' -} - -export const ObjectCategories = { - list : [ - // 'Salaries & Wages', - // 'Employee Benefits', - 'Professional & Contractual Services', - 'Operating Supplies', - 'Operating Services', - 'Equipment Acquisition', - 'Capital Outlays', - 'Fixed Charges', - 'Other Expenses' - ] -} - - document.addEventListener('DOMContentLoaded', function () { CurrentPage.visit(); }); diff --git a/src/js/models/fund.js b/src/js/models/fund.js index 4d43df4..848df5a 100644 --- a/src/js/models/fund.js +++ b/src/js/models/fund.js @@ -1,6 +1,6 @@ import { colSum } from "../utils/common_utils"; -import { FISCAL_YEAR } from "../init"; +import { FISCAL_YEAR } from '../constants/'; // Class to hold information on a specific fund and table class StoredTable { diff --git a/src/js/utils/XLSX_handlers.js b/src/js/utils/XLSX_handlers.js index 3548605..405dccb 100644 --- a/src/js/utils/XLSX_handlers.js +++ b/src/js/utils/XLSX_handlers.js @@ -1,6 +1,6 @@ -import { SHEETS } from '../init.js'; +import { SHEETS } from '../constants/'; import FundLookupTable from '../models/fund_lookup_table.js'; import { removeNewLines } from './common_utils.js'; import Baseline from '../models/baseline.js'; diff --git a/src/js/views/06_nonpersonnel.js b/src/js/views/06_nonpersonnel.js index 6c055d0..16bbeab 100644 --- a/src/js/views/06_nonpersonnel.js +++ b/src/js/views/06_nonpersonnel.js @@ -3,7 +3,7 @@ import Form from '../components/form/form.js'; import Table from '../components/table/table.js'; import { FundLookupTable, Services } from '../models/'; import { unformatCurrency } from '../utils/common_utils.js'; -import { ObjectCategories } from '../init.js'; +import { OBJ_CATEGORIES } from '../constants/'; export class NonPersonnelView extends View { @@ -52,7 +52,7 @@ class NonPersonnelTable extends ViewTable { // form questions to add a new row Form.NewField.dropdown('Appropriation:', 'approp-name', FundLookupTable.getApprops(), true); Form.NewField.dropdown('Cost Center:', 'cc-name', FundLookupTable.getCostCenters(), true); - Form.NewField.dropdown('Object Category:', 'object-category', ObjectCategories.list, true); + Form.NewField.dropdown('Object Category:', 'object-category', OBJ_CATEGORIES.list, true); // TODO: maybe give dropdown based on selected obj category Form.NewField.shortText('Object Number (if known):', 'object', false); Form.NewField.dropdown('Service', 'service', Services.list(), true); diff --git a/src/js/views/07_new_initiatives.js b/src/js/views/07_new_initiatives.js index d2720b1..421f1ce 100644 --- a/src/js/views/07_new_initiatives.js +++ b/src/js/views/07_new_initiatives.js @@ -3,7 +3,7 @@ import { View, ViewTable } from './view_class.js' import Table from "../components/table/table.js"; import Form from "../components/form/form.js"; import FundLookupTable from '../models/fund_lookup_table.js'; -import { FISCAL_YEAR } from "../init.js"; +import { FISCAL_YEAR } from '../constants/'; const dropdownOptions = ['N/A', 'One-Time', 'Recurring'] diff --git a/src/js/views/08_summary.js b/src/js/views/08_summary.js index 05825fa..dabcc18 100644 --- a/src/js/views/08_summary.js +++ b/src/js/views/08_summary.js @@ -1,6 +1,5 @@ import CurrentFund from '../models/current_fund.js'; import Baseline from '../models/baseline.js'; -import { TARGET } from '../init.js'; import { Accordion } from "../components/accordion/accordion.js"; import { visitPage } from "./view_logic.js"; import { formatCurrency } from '../utils/common_utils.js'; @@ -8,6 +7,7 @@ import { View } from "./view_class.js"; import Prompt from "../components/prompt/prompt.js"; import { downloadXLSX } from "../utils/XLSX_handlers.js"; import WelcomeView from './00_welcome.js'; +import { TARGET } from '../constants/app_constants.js'; export function compareToTarget(){ const baseline = new Baseline; diff --git a/src/js/views/view_logic.js b/src/js/views/view_logic.js index d81304d..d72d739 100644 --- a/src/js/views/view_logic.js +++ b/src/js/views/view_logic.js @@ -9,7 +9,7 @@ import InitiativesView from './07_new_initiatives.js'; import SummaryView from './08_summary.js'; import { FundLookupTable, CurrentFund, CurrentPage } from '../models/'; -import { FISCAL_YEAR } from '../init.js'; +import { FISCAL_YEAR } from '../constants/'; export function initializePages() { const PAGES = {