From 125c981dbc0f9a96aecd6bc17c10651a9ed59d89 Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Mon, 29 Jul 2024 15:40:19 -0400 Subject: [PATCH] create index.js for models/ to consolidate imports --- src/js/components/accordion/accordion.js | 7 ++----- src/js/components/modal/modal.js | 1 - src/js/components/sidebar/sidebar.js | 4 ++-- src/js/models/index.js | 11 +++++++++++ src/js/views/04_personnel.js | 3 +-- src/js/views/05_overtime.js | 4 +--- src/js/views/06_nonpersonnel.js | 3 +-- src/js/views/08_summary.js | 2 ++ src/js/views/view_class.js | 3 +-- src/js/views/view_logic.js | 4 +--- 10 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 src/js/models/index.js diff --git a/src/js/components/accordion/accordion.js b/src/js/components/accordion/accordion.js index 93b9074..5b9c7f0 100644 --- a/src/js/components/accordion/accordion.js +++ b/src/js/components/accordion/accordion.js @@ -1,12 +1,9 @@ import './accordion.css' -import Baseline from '../../models/baseline.js'; -import CurrentFund from '../../models/current_fund.js'; -import Fund from '../../models/fund.js'; -import Supplemental from '../../models/supplemental.js'; + +import {Baseline, CurrentFund, Fund, Supplemental, FundLookupTable} from '../../models' import { formatCurrency, cleanString } from "../../utils/common_utils.js"; import Table from "../table/table.js"; -import FundLookupTable from '../../models/fund_lookup_table.js'; import { visitPage } from '../../views/view_logic.js'; import { TARGET } from '../../init.js'; diff --git a/src/js/components/modal/modal.js b/src/js/components/modal/modal.js index 3099ca3..14fd47b 100644 --- a/src/js/components/modal/modal.js +++ b/src/js/components/modal/modal.js @@ -4,7 +4,6 @@ import './modal.css'; function clearModal(){ updateModalTitle(''); document.getElementById('modal-body').innerHTML = ''; - //removeAllModalLinks() } function hideModal(modal_id) { diff --git a/src/js/components/sidebar/sidebar.js b/src/js/components/sidebar/sidebar.js index a867a78..057b518 100644 --- a/src/js/components/sidebar/sidebar.js +++ b/src/js/components/sidebar/sidebar.js @@ -2,8 +2,8 @@ import './sidebar.css' import { formatCurrency } from "../../utils/common_utils.js"; import { TARGET } from "../../init.js"; -import Baseline from '../../models/baseline.js' -import Supplemental from '../../models/supplemental.js' +import {Baseline, Supplemental} from '../../models/'; + // Assuming you have a CSS variable --main-color defined on the :root const root = document.documentElement; diff --git a/src/js/models/index.js b/src/js/models/index.js new file mode 100644 index 0000000..f2025bf --- /dev/null +++ b/src/js/models/index.js @@ -0,0 +1,11 @@ +// models/index.js + +export { default as AccountString } from './account_string.js'; +export { default as Baseline } from './baseline.js'; +export { default as CurrentFund } from './current_fund.js'; +export { default as CurrentPage } from './current_page.js'; +export { default as Fund } from './fund.js'; +export { default as FundLookupTable } from './fund_lookup_table.js'; +export { default as Initiative } from './initiative.js'; +export { default as Services } from './services.js'; +export { default as Supplemental } from './supplemental.js'; diff --git a/src/js/views/04_personnel.js b/src/js/views/04_personnel.js index a93f4b0..00deb60 100644 --- a/src/js/views/04_personnel.js +++ b/src/js/views/04_personnel.js @@ -3,8 +3,7 @@ import { View, ViewTable } from './view_class.js' import Table from "../components/table/table.js"; import Form from "../components/form/form.js"; -import Services from '../models/services.js'; -import FundLookupTable from '../models/fund_lookup_table.js'; +import { Services, FundLookupTable } from '../models/'; import { unformatCurrency } from "../utils/common_utils.js"; export class PersonnelView extends View { diff --git a/src/js/views/05_overtime.js b/src/js/views/05_overtime.js index 82816b0..44a9237 100644 --- a/src/js/views/05_overtime.js +++ b/src/js/views/05_overtime.js @@ -4,9 +4,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 Services from '../models/services.js'; +import { FundLookupTable, Services } from '../models/'; import { unformatCurrency } from '../utils/common_utils.js'; export class OvertimeView extends View { diff --git a/src/js/views/06_nonpersonnel.js b/src/js/views/06_nonpersonnel.js index dc44be2..6c055d0 100644 --- a/src/js/views/06_nonpersonnel.js +++ b/src/js/views/06_nonpersonnel.js @@ -1,10 +1,9 @@ import { View, ViewTable } from './view_class.js' import Form from '../components/form/form.js'; import Table from '../components/table/table.js'; -import FundLookupTable from '../models/fund_lookup_table.js'; +import { FundLookupTable, Services } from '../models/'; import { unformatCurrency } from '../utils/common_utils.js'; import { ObjectCategories } from '../init.js'; -import Services from '../models/services.js'; export class NonPersonnelView extends View { diff --git a/src/js/views/08_summary.js b/src/js/views/08_summary.js index 7ecce7e..05825fa 100644 --- a/src/js/views/08_summary.js +++ b/src/js/views/08_summary.js @@ -25,6 +25,8 @@ export function compareToTarget(){ function returnToWelcome() { const welcome = new WelcomeView(); + const left = document.getElementById('option1'); + console.log(left.l) welcome.visit(); }; diff --git a/src/js/views/view_class.js b/src/js/views/view_class.js index 813dd43..6a4b0d3 100644 --- a/src/js/views/view_class.js +++ b/src/js/views/view_class.js @@ -7,8 +7,7 @@ import Table from "../components/table/table.js"; import Form from "../components/form/form.js"; import Modal from "../components/modal/modal.js"; -import CurrentPage from "../models/current_page.js"; -import AccountString from '../models/account_string.js' +import { CurrentPage, AccountString } from '../models/' export class View { diff --git a/src/js/views/view_logic.js b/src/js/views/view_logic.js index ad34088..d81304d 100644 --- a/src/js/views/view_logic.js +++ b/src/js/views/view_logic.js @@ -8,9 +8,7 @@ import NonPersonnelView from './06_nonpersonnel.js'; import InitiativesView from './07_new_initiatives.js'; import SummaryView from './08_summary.js'; -import FundLookupTable from '../models/fund_lookup_table.js'; -import CurrentFund from '../models/current_fund.js'; -import CurrentPage from '../models/current_page.js'; +import { FundLookupTable, CurrentFund, CurrentPage } from '../models/'; import { FISCAL_YEAR } from '../init.js'; export function initializePages() {