Skip to content

Commit

Permalink
create index.js for models/ to consolidate imports
Browse files Browse the repository at this point in the history
  • Loading branch information
katrina-cityofdetroit committed Jul 29, 2024
1 parent 4aea29c commit 125c981
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 20 deletions.
7 changes: 2 additions & 5 deletions src/js/components/accordion/accordion.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
1 change: 0 additions & 1 deletion src/js/components/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import './modal.css';
function clearModal(){
updateModalTitle('');
document.getElementById('modal-body').innerHTML = '';
//removeAllModalLinks()
}

function hideModal(modal_id) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions src/js/models/index.js
Original file line number Diff line number Diff line change
@@ -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';
3 changes: 1 addition & 2 deletions src/js/views/04_personnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions src/js/views/05_overtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions src/js/views/06_nonpersonnel.js
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
2 changes: 2 additions & 0 deletions src/js/views/08_summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function compareToTarget(){

function returnToWelcome() {
const welcome = new WelcomeView();
const left = document.getElementById('option1');
console.log(left.l)
welcome.visit();
};

Expand Down
3 changes: 1 addition & 2 deletions src/js/views/view_class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions src/js/views/view_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 125c981

Please sign in to comment.