Skip to content

Commit

Permalink
fix all imports
Browse files Browse the repository at this point in the history
  • Loading branch information
katrina-cityofdetroit committed Jul 29, 2024
1 parent 3ac5db4 commit f166347
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/js/components/file_upload/file_upload.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './file_upload.css';

import { processWorkbook } from "../../utils/data_utils/XLSX_handlers.js";
import { processWorkbook } from "../../utils/XLSX_handlers.js";
import Sidebar from '../sidebar/sidebar.js';

export const FileUpload = {
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/table/subcomponents/cells.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatCurrency, displayWithCommas } from "../../../utils/common_utils.js";
import { Services } from "../../../utils/data_utils/budget_data_handlers.js";
import Services from "../../../models/services.js";
import Dropdown from "../../form/subcomponents/dropdown.js";

// return cell value attribute or 0 if it does not exist
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Header from './subcomponents/headers.js'
import Rows from './subcomponents/rows.js'
import Data from './subcomponents/data.js'
import Tooltip from '../tooltip/tooltip.js';
import { convertToJSON } from "../../utils/data_utils/JSON_data_handlers.js";
import { convertToJSON } from "../../utils/JSON_data_handlers.js";
import Sidebar from '../sidebar/sidebar.js';
import CurrentFund from '../../models/current_fund.js';
import CurrentPage from '../../models/current_page.js';
Expand Down
15 changes: 15 additions & 0 deletions src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ export const SHEETS = {
'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();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@


// data structure to save the possible service options for the department
export const Services = {
save : function(services){
localStorage.setItem('services-list', JSON.stringify(services));
},
list : function(){
return JSON.parse(localStorage.getItem('services-list')) || {};
}
}

export const ObjectCategories = {
list : [
// 'Salaries & Wages',
// 'Employee Benefits',
'Professional & Contractual Services',
'Operating Supplies',
'Operating Services',
'Equipment Acquisition',
'Capital Outlays',
'Fixed Charges',
'Other Expenses'
]
}

export const AccountString = {
getNumber: function(input) {
// isolate the numerical part of a appropriation/cost center/object
Expand Down Expand Up @@ -62,4 +38,6 @@ export const AccountString = {
object : function(account_string) {
return this.getAccountStringSection(account_string, 3)
},
}
}

export default AccountString;
11 changes: 11 additions & 0 deletions src/js/models/services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// data structure to save the possible service options for the department
export const Services = {
save : function(services){
localStorage.setItem('services-list', JSON.stringify(services));
},
list : function(){
return JSON.parse(localStorage.getItem('services-list')) || {};
}
}

export default Services;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@


import { SHEETS } from '../../init.js';
import FundLookupTable from '../../models/fund_lookup_table.js';
import { Services } from './budget_data_handlers.js';
import { removeNewLines } from '../common_utils.js';
import { Baseline } from './local_storage_handlers.js';
import { SHEETS } from '../init.js';
import FundLookupTable from '../models/fund_lookup_table.js';
import { removeNewLines } from './common_utils.js';
import Baseline from '../models/baseline.js';
import Services from '../models/services.js';

function deleteTopRowsUntilFullData(data) {
// function to try to find the top of the usable data
Expand Down
18 changes: 0 additions & 18 deletions src/js/utils/data_utils/local_storage_handlers.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/js/views/04_personnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 { Services } from "../utils/data_utils/budget_data_handlers.js";
import Services from '../models/services.js';
import FundLookupTable from '../models/fund_lookup_table.js';
import { unformatCurrency } from "../utils/common_utils.js";

Expand Down
2 changes: 1 addition & 1 deletion src/js/views/05_overtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Form from '../components/form/form.js';

import FundLookupTable from '../models/fund_lookup_table.js';

import { Services } from '../utils/data_utils/budget_data_handlers.js';
import Services from '../models/services.js';
import { unformatCurrency } from '../utils/common_utils.js';

export class OvertimeView extends View {
Expand Down
3 changes: 2 additions & 1 deletion src/js/views/06_nonpersonnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,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 { ObjectCategories, Services } from '../utils/data_utils/budget_data_handlers.js';
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: 1 addition & 1 deletion src/js/views/08_summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { visitPage } from "./view_logic.js";
import { formatCurrency } from '../utils/common_utils.js';
import { View } from "./view_class.js";
import Prompt from "../components/prompt/prompt.js";
import { downloadXLSX } from "../utils/data_utils/XLSX_handlers.js";
import { downloadXLSX } from "../utils/XLSX_handlers.js";

export function compareToTarget(){
const baseline = new Baseline;
Expand Down
3 changes: 2 additions & 1 deletion src/js/views/view_class.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import Form from "../components/form/form.js";
import Modal from "../components/modal/modal.js";

import CurrentPage from "../models/current_page.js";
import { AccountString } from "../utils/data_utils/budget_data_handlers.js";
import AccountString from '../models/account_string.js'


export class View {

Expand Down

0 comments on commit f166347

Please sign in to comment.