{"version":3,"sources":["components/success-icon.svg","components/Layout.js","components/api-authorization/ApiAuthorizationConstants.js","components/api-authorization/AuthorizeService.js","components/FetchData.js","components/util/Conversions.js","components/category-item/ExpenseCategoryItem.js","components/category-item/IncomeCategoryItem.js","components/BudgetSummary.js","components/SubmissionDetails.js","components/BudgetSubmission.js","components/api-authorization/AuthorizeRoute.js","components/api-authorization/Login.js","components/api-authorization/Logout.js","components/api-authorization/ApiAuthorizationRoutes.js","components/SubmissionSuccess.js","components/manage/ag-grid-cell-renderers/GridCommandsRenderer.js","components/api-authorization/LoginMenu.js","components/manage/HomeLeftMenu.js","components/manage/Submissions.js","components/manage/category-item/ExpenseCategoryItem.js","components/manage/category-item/IncomeCategoryItem.js","components/manage/Details.js","components/manage/SubmissionLeftMenu.js","components/manage/TagExpenses.js","components/manage/Submission.js","App.js","index.js"],"names":["module","exports","Layout","this","props","children","Component","displayName","name","QueryParameterNames","LogoutActions","LoginActions","prefix","ApplicationPaths","DefaultLoginRedirectPath","ApiAuthorizationClientConfigurationUrl","ApiAuthorizationPrefix","Login","LoginFailed","LoginCallback","Register","Profile","LogOut","LoggedOut","LogOutCallback","IdentityRegisterPath","IdentityManagePath","authService","_callbacks","_nextSubscriptionId","_user","_isAuthenticated","_popUpDisabled","getUser","user","profile","ensureUserManagerInitialized","userManager","access_token","state","signinSilent","createArguments","silentUser","updateState","success","console","log","Error","signinPopup","popUpUser","message","error","signinRedirect","redirect","url","signinCallback","signoutPopup","undefined","signoutRedirect","signoutCallback","response","data","notifySubscribers","callback","push","subscription","subscriptionId","subscriptionIndex","map","element","index","found","filter","length","splice","i","useReplaceToNavigate","status","AuthenticationResultStatus","Fail","Success","Redirect","fetch","ok","json","settings","automaticSilentRenew","includeIdTokenInSilentRenew","userStore","WebStorageStateStore","UserManager","events","addUserSignedOut","a","removeUser","FetchData","forecasts","loading","populateWeatherData","contents","renderForecastsTable","id","getAccessToken","token","headers","setState","className","aria-labelledby","forecast","key","date","temperatureC","temperatureF","calcWeekly","fromFrequency","amount","weekly","calcFortnightly","fortnightly","calcMonthly","monthly","calcQuarterly","quarterly","calcAnnually","ExpenseCategoryItem","headerRef","useRef","initialValues","category","expenseItemTypes","forEach","t","code","frequency","useState","itemValues","setItemValues","handleAmountUpdate","event","nam","target","val","value","itemValuesClone","Number","onUpdate","handleFrequencyUpdate","subtotalDisplay","useMemo","total","Object","entries","Math","round","Card","innerRef","CardHeader","onClick","onToggle","style","marginLeft","alt","src","display","isOpen","fontSize","textTransform","Collapse","onEntered","current","scrollIntoView","behavior","onTogglePanelComplete","onExited","CardBody","FormGroup","row","Label","for","sm","xs","size","Col","Input","type","placeholder","bsSize","onChange","defaultValue","IncomeCategoryItem","incomeItemTypes","marginBottom","marginTop","lineHeight","width","COLORS","financial_commitments","home","utilities","education","health","shopping","transport","entertainment","eating_out","BudgetSummary","setFrequency","calcAmount","monthlyAmount","balance","incomeTotal","expenseTotal","balanceBarValue","bal","expenseSummaryData","d","colSpan","paddingTop","textAlign","height","onMouseEnter","cx","cy","innerRadius","outerRadius","fill","paddingAngle","dataKey","entry","padding","r","stroke","strokeWidth","label","Progress","multi","backgroundColor","bar","color","SubmissionDetails","handleUpdate","handleNumberUpdate","Form","onSubmit","preventDefault","md","step","CustomInput","Button","block","BudgetSubmission","handleToggle","catCode","openExpenseCat","handleIncomeItemsUpdate","incomeItems","assign","handleExpenseItemsUpdate","catName","expenseSummaryDataClone","catExpenseSummary","find","x","expenseItemsClone","expenseItems","catExpenseItems","items","newItems","handleDetailsUpdate","detailsClone","details","handleSubmit","submitData","income","expenses","itemTypeCode","history","$","ajax","method","contentType","JSON","stringify","dataType","done","fail","xhr","alert","metadata","loadBudgetSubmissionMetadata","renderLoader","renderSubmissionForm","handleTogglePanelComplete","body","document","html","documentElement","max","scrollHeight","offsetHeight","clientHeight","window","parent","postMessage","postHeightChange","Container","Fragment","incomeCategories","inCat","expenseCategories","expCat","imcomeItems","AuthorizeRoute","ready","authenticated","_subscription","subscribe","authenticationChanged","populateAuthenticationState","unsubscribe","link","createElement","href","path","returnUrl","protocol","host","pathname","search","hash","redirectUrl","encodeURI","component","rest","render","to","isAuthenticated","action","login","getReturnUrl","processLoginCallback","URLSearchParams","location","get","redirectToProfile","redirectToRegister","signIn","result","navigateToReturnUrl","completeSignIn","fromQuery","startsWith","origin","redirectToApiAuthorizationPath","apiAuthorizationPath","replace","Logout","isReady","local","logout","processLogoutCallback","signOut","completeSignOut","ApiAuthorizationRoutes","loginAction","logoutAction","SubmissionSuccess","successIcon","GridCommandsRenderer","invokeParentViewMethod","bind","invokeParentDeleteMethod","invokeParentExportMethod","context","componentParent","handleViewCommmand","node","handleDeleteCommmand","handleExportCommmand","LoginMenu","userName","populateState","Promise","all","profilePath","logoutPath","authenticatedView","registerPath","loginPath","anonymousView","NavItem","NavLink","tag","Link","HomeLeftMenu","Submissions","confirm","me","then","rowData","handleExportAllCommand","columnDefs","headerName","field","sortable","valueFormatter","params","Date","toLocaleString","cellRenderer","fluid","float","Nav","clear","frameworkComponents","gridCommandsRenderer","domLayout","amountMonthly","totalMonthly","Details","email","phone","currentHomeValue","homeLoanBalanceOwing","homeLoanInterestRate","homeLoanType","SubmissionLeftMenu","vertical","pills","active","displayIncome","onSelectIncomeOpen","onSelectExpenseCategory","displayExpenseTags","onSelectTagExpensesOpen","TagExpenses","tagExpenses","tagCode","tagName","Submission","handleIncomeOpen","handleExpenseCatOpen","handleTagExpensesOpen","match","load","submissionId","loadMetadata","loadSubmission","loadTagExpenses","cat","catClone","itemType","axios","expenseCategoryTotals","monthlyTotal","incomeMonthly","expensesMonthly","App","exact","baseUrl","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","basename"],"mappings":"mIAAAA,EAAOC,QAAU,IAA0B,0C,oPCG9BC,EAAb,iLAII,OACI,6BACIC,KAAKC,MAAMC,cANvB,GAA4BC,aAAfJ,EACJK,YAAcL,EAAOM,K,qCCFjBC,EACA,YADAA,EAEF,UAGEC,EACK,kBADLA,EAEH,SAFGA,EA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UrK,SAASsK,qBAAqB,QAAQ,GAAGC,aAAa,QAChEC,GAAcxK,SAASyK,eAAe,QAE5CC,IAASlI,OACP,kBAAC,IAAD,CAAemI,SAAUN,IACvB,kBAAC,GAAD,OAEFG,M","file":"static/js/main.85c56c8e.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/success-icon.a17a26bc.svg\";","import React, { Component } from 'react';\r\nimport { Container } from 'reactstrap';\r\n\r\nexport class Layout extends Component {\r\n static displayName = Layout.name;\r\n\r\n render () {\r\n return (\r\n
\r\n {this.props.children}\r\n
\r\n );\r\n }\r\n}\r\n","export const ApplicationName = 'Netswift.BudgetPlanner.Web';\r\n\r\nexport const QueryParameterNames = {\r\n ReturnUrl: 'returnUrl',\r\n Message: 'message'\r\n};\r\n\r\nexport const LogoutActions = {\r\n LogoutCallback: 'logout-callback',\r\n Logout: 'logout',\r\n LoggedOut: 'logged-out'\r\n};\r\n\r\nexport const LoginActions = {\r\n Login: 'login',\r\n LoginCallback: 'login-callback',\r\n LoginFailed: 'login-failed',\r\n Profile: 'profile',\r\n Register: 'register'\r\n};\r\n\r\nconst prefix = '/authentication';\r\n\r\nexport const ApplicationPaths = {\r\n DefaultLoginRedirectPath: '/',\r\n ApiAuthorizationClientConfigurationUrl: `/_configuration/${ApplicationName}`,\r\n ApiAuthorizationPrefix: prefix,\r\n Login: `${prefix}/${LoginActions.Login}`,\r\n LoginFailed: `${prefix}/${LoginActions.LoginFailed}`,\r\n LoginCallback: `${prefix}/${LoginActions.LoginCallback}`,\r\n Register: `${prefix}/${LoginActions.Register}`,\r\n Profile: `${prefix}/${LoginActions.Profile}`,\r\n LogOut: `${prefix}/${LogoutActions.Logout}`,\r\n LoggedOut: `${prefix}/${LogoutActions.LoggedOut}`,\r\n LogOutCallback: `${prefix}/${LogoutActions.LogoutCallback}`,\r\n IdentityRegisterPath: '/Identity/Account/Register',\r\n IdentityManagePath: '/Identity/Account/Manage'\r\n};\r\n","import { UserManager, WebStorageStateStore } from 'oidc-client';\r\nimport { ApplicationPaths, ApplicationName } from './ApiAuthorizationConstants';\r\n\r\nexport class AuthorizeService {\r\n _callbacks = [];\r\n _nextSubscriptionId = 0;\r\n _user = null;\r\n _isAuthenticated = false;\r\n\r\n // By default pop ups are disabled because they don't work properly on Edge.\r\n // If you want to enable pop up authentication simply set this flag to false.\r\n _popUpDisabled = true;\r\n\r\n async isAuthenticated() {\r\n const user = await this.getUser();\r\n return !!user;\r\n }\r\n\r\n async getUser() {\r\n if (this._user && this._user.profile) {\r\n return this._user.profile;\r\n }\r\n\r\n await this.ensureUserManagerInitialized();\r\n const user = await this.userManager.getUser();\r\n return user && user.profile;\r\n }\r\n\r\n async getAccessToken() {\r\n await this.ensureUserManagerInitialized();\r\n const user = await this.userManager.getUser();\r\n return user && user.access_token;\r\n }\r\n\r\n // We try to authenticate the user in three different ways:\r\n // 1) We try to see if we can authenticate the user silently. This happens\r\n // when the user is already logged in on the IdP and is done using a hidden iframe\r\n // on the client.\r\n // 2) We try to authenticate the user using a PopUp Window. This might fail if there is a\r\n // Pop-Up blocker or the user has disabled PopUps.\r\n // 3) If the two methods above fail, we redirect the browser to the IdP to perform a traditional\r\n // redirect flow.\r\n async signIn(state) {\r\n await this.ensureUserManagerInitialized();\r\n try {\r\n const silentUser = await this.userManager.signinSilent(this.createArguments());\r\n this.updateState(silentUser);\r\n return this.success(state);\r\n } catch (silentError) {\r\n // User might not be authenticated, fallback to popup authentication\r\n console.log(\"Silent authentication error: \", silentError);\r\n\r\n try {\r\n if (this._popUpDisabled) {\r\n throw new Error('Popup disabled. Change \\'AuthorizeService.js:AuthorizeService._popupDisabled\\' to false to enable it.')\r\n }\r\n\r\n const popUpUser = await this.userManager.signinPopup(this.createArguments());\r\n this.updateState(popUpUser);\r\n return this.success(state);\r\n } catch (popUpError) {\r\n if (popUpError.message === \"Popup window closed\") {\r\n // The user explicitly cancelled the login action by closing an opened popup.\r\n return this.error(\"The user closed the window.\");\r\n } else if (!this._popUpDisabled) {\r\n console.log(\"Popup authentication error: \", popUpError);\r\n }\r\n\r\n // PopUps might be blocked by the user, fallback to redirect\r\n try {\r\n await this.userManager.signinRedirect(this.createArguments(state));\r\n return this.redirect();\r\n } catch (redirectError) {\r\n console.log(\"Redirect authentication error: \", redirectError);\r\n return this.error(redirectError);\r\n }\r\n }\r\n }\r\n }\r\n\r\n async completeSignIn(url) {\r\n try {\r\n await this.ensureUserManagerInitialized();\r\n const user = await this.userManager.signinCallback(url);\r\n this.updateState(user);\r\n return this.success(user && user.state);\r\n } catch (error) {\r\n console.log('There was an error signing in: ', error);\r\n return this.error('There was an error signing in.');\r\n }\r\n }\r\n\r\n // We try to sign out the user in two different ways:\r\n // 1) We try to do a sign-out using a PopUp Window. This might fail if there is a\r\n // Pop-Up blocker or the user has disabled PopUps.\r\n // 2) If the method above fails, we redirect the browser to the IdP to perform a traditional\r\n // post logout redirect flow.\r\n async signOut(state) {\r\n await this.ensureUserManagerInitialized();\r\n try {\r\n if (this._popUpDisabled) {\r\n throw new Error('Popup disabled. Change \\'AuthorizeService.js:AuthorizeService._popupDisabled\\' to false to enable it.')\r\n }\r\n\r\n await this.userManager.signoutPopup(this.createArguments());\r\n this.updateState(undefined);\r\n return this.success(state);\r\n } catch (popupSignOutError) {\r\n console.log(\"Popup signout error: \", popupSignOutError);\r\n try {\r\n await this.userManager.signoutRedirect(this.createArguments(state));\r\n return this.redirect();\r\n } catch (redirectSignOutError) {\r\n console.log(\"Redirect signout error: \", redirectSignOutError);\r\n return this.error(redirectSignOutError);\r\n }\r\n }\r\n }\r\n\r\n async completeSignOut(url) {\r\n await this.ensureUserManagerInitialized();\r\n try {\r\n const response = await this.userManager.signoutCallback(url);\r\n this.updateState(null);\r\n return this.success(response && response.data);\r\n } catch (error) {\r\n console.log(`There was an error trying to log out '${error}'.`);\r\n return this.error(error);\r\n }\r\n }\r\n\r\n updateState(user) {\r\n this._user = user;\r\n this._isAuthenticated = !!this._user;\r\n this.notifySubscribers();\r\n }\r\n\r\n subscribe(callback) {\r\n this._callbacks.push({ callback, subscription: this._nextSubscriptionId++ });\r\n return this._nextSubscriptionId - 1;\r\n }\r\n\r\n unsubscribe(subscriptionId) {\r\n const subscriptionIndex = this._callbacks\r\n .map((element, index) => element.subscription === subscriptionId ? { found: true, index } : { found: false })\r\n .filter(element => element.found === true);\r\n if (subscriptionIndex.length !== 1) {\r\n throw new Error(`Found an invalid number of subscriptions ${subscriptionIndex.length}`);\r\n }\r\n\r\n this._callbacks.splice(subscriptionIndex[0].index, 1);\r\n }\r\n\r\n notifySubscribers() {\r\n for (let i = 0; i < this._callbacks.length; i++) {\r\n const callback = this._callbacks[i].callback;\r\n callback();\r\n }\r\n }\r\n\r\n createArguments(state) {\r\n return { useReplaceToNavigate: true, data: state };\r\n }\r\n\r\n error(message) {\r\n return { status: AuthenticationResultStatus.Fail, message };\r\n }\r\n\r\n success(state) {\r\n return { status: AuthenticationResultStatus.Success, state };\r\n }\r\n\r\n redirect() {\r\n return { status: AuthenticationResultStatus.Redirect };\r\n }\r\n\r\n async ensureUserManagerInitialized() {\r\n if (this.userManager !== undefined) {\r\n return;\r\n }\r\n\r\n let response = await fetch(ApplicationPaths.ApiAuthorizationClientConfigurationUrl);\r\n if (!response.ok) {\r\n throw new Error(`Could not load settings for '${ApplicationName}'`);\r\n }\r\n\r\n let settings = await response.json();\r\n settings.automaticSilentRenew = true;\r\n settings.includeIdTokenInSilentRenew = true;\r\n settings.userStore = new WebStorageStateStore({\r\n prefix: ApplicationName\r\n });\r\n\r\n this.userManager = new UserManager(settings);\r\n\r\n this.userManager.events.addUserSignedOut(async () => {\r\n await this.userManager.removeUser();\r\n this.updateState(undefined);\r\n });\r\n }\r\n\r\n static get instance() { return authService }\r\n}\r\n\r\nconst authService = new AuthorizeService();\r\n\r\nexport default authService;\r\n\r\nexport const AuthenticationResultStatus = {\r\n Redirect: 'redirect',\r\n Success: 'success',\r\n Fail: 'fail'\r\n};\r\n","import React, { Component } from 'react';\r\nimport authService from './api-authorization/AuthorizeService'\r\n\r\nexport class FetchData extends Component {\r\n static displayName = FetchData.name;\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { forecasts: [], loading: true };\r\n }\r\n\r\n componentDidMount() {\r\n this.populateWeatherData();\r\n }\r\n\r\n static renderForecastsTable(forecasts) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {forecasts.map(forecast =>\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n
DateTemp. (C)Temp. (F)
{forecast.date}{forecast.temperatureC}{forecast.temperatureF}
\r\n );\r\n }\r\n\r\n render() {\r\n let contents = this.state.loading\r\n ?

Loading...

\r\n : FetchData.renderForecastsTable(this.state.forecasts);\r\n\r\n return (\r\n
\r\n

Weather forecast

\r\n

This component demonstrates fetching data from the server.

\r\n {contents}\r\n
\r\n );\r\n }\r\n\r\n async populateWeatherData() {\r\n const token = await authService.getAccessToken();\r\n const response = await fetch('weatherforecast', {\r\n headers: !token ? {} : { 'Authorization': `Bearer ${token}` }\r\n });\r\n const data = await response.json();\r\n this.setState({ forecasts: data, loading: false });\r\n }\r\n}\r\n","\r\nexport const calcWeekly = (fromFrequency, amount) => {\r\n\r\n let weekly = 0;\r\n\r\n switch (fromFrequency) {\r\n case \"Annually\":\r\n weekly = amount / 52;\r\n break;\r\n case \"Quarterly\": \r\n weekly = amount * 4 / 52;\r\n break;\r\n case \"Monthly\": // Month to Week\r\n weekly = amount * 12 / 52;\r\n break;\r\n case \"Fortnightly\":\r\n weekly = amount * 26 / 52\r\n break;\r\n case \"Weekly\":\r\n weekly = amount;\r\n break;\r\n default:\r\n weekly = amount;\r\n break;\r\n }\r\n\r\n return weekly;\r\n}\r\n\r\n\r\nexport const calcFortnightly = (fromFrequency, amount) => {\r\n\r\n let fortnightly = 0;\r\n\r\n switch (fromFrequency) {\r\n case \"Annually\":\r\n fortnightly = amount / 26;\r\n break;\r\n case \"Quarterly\":\r\n fortnightly = amount * 4 / 26;\r\n break;\r\n case \"Monthly\":\r\n fortnightly = amount * 12 / 26;\r\n break;\r\n case \"Fortnightly\":\r\n fortnightly = amount;\r\n break;\r\n case \"Weekly\":\r\n fortnightly = amount * 52 / 26;\r\n break;\r\n default:\r\n fortnightly = amount;\r\n break;\r\n }\r\n\r\n return fortnightly;\r\n}\r\n\r\n\r\nexport const calcMonthly = (fromFrequency, amount) => {\r\n\r\n let monthly = 0;\r\n\r\n switch (fromFrequency) {\r\n case \"Annually\":\r\n monthly = amount / 12;\r\n break;\r\n case \"Quarterly\":\r\n monthly = amount * 4 / 12;\r\n break;\r\n case \"Monthly\":\r\n monthly = amount;\r\n break;\r\n case \"Fortnightly\":\r\n monthly = amount * 26 / 12;\r\n break;\r\n case \"Weekly\":\r\n monthly = amount * 52 / 12;\r\n break;\r\n default:\r\n monthly = amount;\r\n break;\r\n }\r\n\r\n return monthly;\r\n}\r\n\r\n\r\nexport const calcQuarterly = (fromFrequency, amount) => {\r\n\r\n let quarterly = 0;\r\n\r\n switch (fromFrequency) {\r\n case \"Annually\":\r\n quarterly = amount / 4;\r\n break;\r\n case \"Quarterly\":\r\n quarterly = amount;\r\n break;\r\n case \"Monthly\":\r\n quarterly = amount * 12 / 4;\r\n break;\r\n case \"Fortnightly\":\r\n quarterly = amount * 26 / 4;\r\n break;\r\n case \"Weekly\":\r\n quarterly = amount * 52 / 4;\r\n break;\r\n default:\r\n quarterly = amount;\r\n break;\r\n }\r\n\r\n return quarterly;\r\n}\r\n\r\nexport const calcAnnually = (fromFrequency, amount) => {\r\n\r\n let quarterly = 0;\r\n\r\n switch (fromFrequency) {\r\n case \"Annually\":\r\n quarterly = amount;\r\n break;\r\n case \"Quarterly\":\r\n quarterly = amount * 4;\r\n break;\r\n case \"Monthly\":\r\n quarterly = amount * 12;\r\n break;\r\n case \"Fortnightly\":\r\n quarterly = amount * 26;\r\n break;\r\n case \"Weekly\":\r\n quarterly = amount * 52;\r\n break;\r\n default:\r\n quarterly = amount;\r\n break;\r\n }\r\n\r\n return quarterly;\r\n}\r\n","import React, { useState, useMemo, useRef } from 'react';\r\nimport { Collapse, Card, CardBody, CardHeader, FormGroup, Label, Col, Input } from 'reactstrap';\r\nimport { calcMonthly } from '../util/Conversions';\r\nimport './ExpenseCategoryItem.css';\r\n\r\nexport const ExpenseCategoryItem = (props) => {\r\n\r\n const headerRef = useRef(null);\r\n\r\n const handleClick = () => {\r\n props.onToggle(props.category.code); \r\n }\r\n\r\n let initialValues = {};\r\n props.category.expenseItemTypes.forEach(t => {\r\n initialValues[t.code] = {\r\n amount: 0,\r\n frequency: 'Monthly'\r\n }\r\n });\r\n\r\n\r\n const onEntered = () => {\r\n headerRef.current.scrollIntoView({ behavior: 'smooth' });\r\n props.onTogglePanelComplete();\r\n };\r\n\r\n const onExited = () => {\r\n props.onTogglePanelComplete();\r\n };\r\n\r\n \r\n const [itemValues, setItemValues] = useState(initialValues);\r\n\r\n\r\n const handleAmountUpdate = (event) => {\r\n let nam = event.target.name;\r\n let val = event.target.value;\r\n\r\n const itemValuesClone = { ...itemValues};\r\n itemValuesClone[nam].amount = Number(val);\r\n setItemValues(itemValuesClone);\r\n\r\n props.onUpdate(props.category.code, props.category.name, itemValuesClone);\r\n }\r\n\r\n const handleFrequencyUpdate = (event) => {\r\n let nam = event.target.name;\r\n let val = event.target.value;\r\n\r\n const itemValuesClone = { ...itemValues };\r\n itemValuesClone[nam].frequency = val;\r\n setItemValues(itemValuesClone);\r\n\r\n props.onUpdate(props.category.code, props.category.name, itemValuesClone);\r\n }\r\n\r\n const subtotalDisplay = useMemo(() => {\r\n\r\n let total = 0;\r\n for (const [key, value] of Object.entries(itemValues)) {\r\n total = total + calcMonthly(value.frequency, Number(value.amount));\r\n }\r\n\r\n return `$${Math.round(total)}`;\r\n\r\n }, [itemValues]);\r\n\r\n return (\r\n\r\n \r\n \r\n
\r\n \"\"\r\n {props.category.name}\r\n
\r\n \r\n
\r\n \"\"\r\n \"\"\r\n
\r\n\r\n {subtotalDisplay != '$0' &&\r\n
\r\n {subtotalDisplay} per Month\r\n
\r\n }\r\n \r\n
\r\n \r\n \r\n {props.category.expenseItemTypes.map(t =>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )} \r\n \r\n \r\n
\r\n )\r\n\r\n}\r\n","import React, { useState, useMemo } from 'react';\r\nimport { Collapse, Card, CardBody, CardHeader, FormGroup, Label, Col, Input } from 'reactstrap';\r\nimport { calcMonthly } from '../util/Conversions';\r\nimport './IncomeCategoryItem.css';\r\n\r\nexport const IncomeCategoryItem = (props) => {\r\n\r\n const handleClick = () => {\r\n props.onToggle(props.category.code);\r\n }\r\n\r\n let initialValues = {};\r\n props.category.incomeItemTypes.forEach(t => {\r\n initialValues[t.code] = {\r\n amount: 0,\r\n frequency: 'Monthly'\r\n }\r\n });\r\n\r\n const [itemValues, setItemValues] = useState(initialValues);\r\n \r\n\r\n const onEntered = () => {\r\n props.onTogglePanelComplete();\r\n };\r\n\r\n const onExited = () => {\r\n props.onTogglePanelComplete();\r\n };\r\n\r\n const handleAmountUpdate = (event) => {\r\n let nam = event.target.name;\r\n let val = event.target.value;\r\n\r\n const itemValuesClone = { ...itemValues };\r\n itemValuesClone[nam].amount = Number(val);\r\n setItemValues(itemValuesClone);\r\n\r\n props.onUpdate(props.category.code, itemValuesClone);\r\n }\r\n\r\n const handleFrequencyUpdate = (event) => {\r\n let nam = event.target.name;\r\n let val = event.target.value;\r\n\r\n const itemValuesClone = { ...itemValues };\r\n itemValuesClone[nam].frequency = val;\r\n setItemValues(itemValuesClone);\r\n\r\n props.onUpdate(props.category.code, itemValuesClone);\r\n }\r\n\r\n\r\n const subtotalDisplay = useMemo(() => {\r\n\r\n let total = 0;\r\n for (const [key, value] of Object.entries(itemValues)) {\r\n total = total + calcMonthly(value.frequency, Number(value.amount));\r\n }\r\n\r\n return `$${Math.round(total)}`;\r\n\r\n }, [itemValues]);\r\n\r\n return (\r\n\r\n \r\n \r\n
\r\n

{props.category.name}

\r\n
\r\n
{subtotalDisplay}
\r\n
per month
\r\n
\r\n
\r\n \r\n
\r\n \"\"\r\n \"\"\r\n
\r\n \r\n
\r\n \r\n \r\n {props.category.incomeItemTypes.map(t =>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )} \r\n \r\n \r\n
\r\n )\r\n\r\n}\r\n","import React, { useState, useMemo } from 'react';\r\nimport { Card, CardBody, CardHeader, Progress, Input } from 'reactstrap';\r\nimport { calcWeekly, calcFortnightly, calcQuarterly, calcAnnually } from './util/Conversions';\r\n\r\nimport {\r\n PieChart, Pie, Cell\r\n} from 'recharts';\r\n\r\nconst COLORS = {\r\n financial_commitments: '#12296c',\r\n home: '#f9a127',\r\n utilities: '#00b1ec',\r\n education: '#652f8e',\r\n health: '#ee386c',\r\n shopping: '#84b840',\r\n transport: '#ea1f27',\r\n entertainment: '#1b75ba',\r\n eating_out: '#d5dd26'\r\n}\r\n\r\nexport const BudgetSummary = (props) => {\r\n\r\n const [frequency, setFrequency] = useState('monthly');\r\n\r\n const handleFrequencyUpdate = (event) => {\r\n let val = event.target.value;\r\n setFrequency(val);\r\n }\r\n\r\n const calcAmount = (monthlyAmount) => {\r\n\r\n if (frequency === 'Weekly') {\r\n return Math.round(calcWeekly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Fortnightly') {\r\n return Math.round(calcFortnightly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Quarterly') {\r\n return Math.round(calcQuarterly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Annually') {\r\n return Math.round(calcAnnually('Monthly', monthlyAmount));\r\n } else {\r\n return monthlyAmount;\r\n }\r\n\r\n };\r\n\r\n\r\n const handleOnPieEnter = () => {\r\n \r\n }\r\n\r\n const balance = () => {\r\n return incomeTotal() - expenseTotal;\r\n };\r\n\r\n const balanceBarValue = () => {\r\n let bal = balance();\r\n if (bal < 0) {\r\n return 0;\r\n } else {\r\n return (bal / incomeTotal()) * 100;\r\n }\r\n };\r\n\r\n const isDeficit = () => {\r\n let bal = balance();\r\n return bal < 0;\r\n };\r\n\r\n\r\n const expenseTotal = useMemo(() => {\r\n\r\n let total = 0;\r\n props.expenseSummaryData.forEach(function (d) {\r\n total = total + Number(d.value);\r\n });\r\n\r\n return Math.round(total);\r\n\r\n }, [props.expenseSummaryData]);\r\n\r\n\r\n const incomeTotal = () => {\r\n return Math.round(props.incomeTotal);\r\n };\r\n\r\n return (\r\n \r\n \r\n

Summary

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

Income

${calcAmount(incomeTotal())}
\r\n
\r\n
\r\n
\r\n

Outgoings

\r\n \r\n \r\n {\r\n props.expenseSummaryData.map((entry, index) => )\r\n }\r\n \r\n \r\n\r\n \r\n \r\n {props.expenseSummaryData.map(d =>\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n {d.label}\r\n \r\n ${calcAmount(d.value)}\r\n

Total Outgoings

${calcAmount(expenseTotal)}
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

What's Left

${ calcAmount(balance()) }
\r\n \r\n {`${Math.round(balanceBarValue())}%`}\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n )\r\n\r\n\r\n}","import React from 'react';\r\nimport { Card, CardBody, CardHeader, Form, FormGroup, Label, Col, Input, CustomInput, Button } from 'reactstrap';\r\n\r\nexport const SubmissionDetails = (props) => {\r\n\r\n const handleUpdate = (event) => {\r\n let name = event.target.name;\r\n let value = event.target.value;\r\n\r\n props.onUpdate(name, value);\r\n }\r\n\r\n const handleNumberUpdate = (event) => {\r\n let name = event.target.name;\r\n let value = event.target.value;\r\n\r\n props.onUpdate(name, Number(value));\r\n }\r\n\r\n const handleSubmit = (event) => {\r\n event.preventDefault();\r\n props.onSubmit();\r\n }\r\n\r\n return (\r\n \r\n

Your Details

\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n )\r\n\r\n}","import React, { Component } from 'react';\r\nimport $ from 'jquery';\r\nimport { Form, Container } from 'reactstrap';\r\nimport { ExpenseCategoryItem } from './category-item/ExpenseCategoryItem';\r\nimport { IncomeCategoryItem } from './category-item/IncomeCategoryItem';\r\nimport { BudgetSummary } from './BudgetSummary';\r\nimport { SubmissionDetails } from './SubmissionDetails';\r\nimport { calcMonthly } from './util/Conversions';\r\n\r\nexport class BudgetSubmission extends Component {\r\n static displayName = BudgetSubmission.name;\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n metadata: null,\r\n openExpenseCat: null,\r\n loading: true,\r\n expenseItems: [],\r\n expenseSummaryData: [],\r\n incomeItems: {},\r\n details: {}\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.loadBudgetSubmissionMetadata(); \r\n }\r\n\r\n\r\n handleToggle = (catCode) => {\r\n if (this.state.openExpenseCat != catCode) {\r\n this.setState({ openExpenseCat: catCode });\r\n } else {\r\n this.setState({ openExpenseCat: null });\r\n }\r\n }\r\n\r\n handleIncomeItemsUpdate = (catCode, itemValues) => {\r\n\r\n // Update the collection of all income items\r\n const itemValuesClone = { ...this.state.incomeItems };\r\n var incomeItems = { incomeItems: Object.assign(itemValuesClone, itemValues) };\r\n this.setState(incomeItems);\r\n\r\n };\r\n\r\n handleExpenseItemsUpdate = (catCode,catName, itemValues) => {\r\n\r\n\r\n // Get the total for this category\r\n let total = 0;\r\n for (const [key, value] of Object.entries(itemValues)) {\r\n total = total + calcMonthly(value.frequency, Number(value.amount));\r\n }\r\n\r\n // Update the category summary data\r\n const expenseSummaryDataClone = [...this.state.expenseSummaryData];\r\n\r\n var catExpenseSummary = expenseSummaryDataClone.find(x => x.name === catCode);\r\n if (catExpenseSummary) {\r\n catExpenseSummary.value = Math.round(total);\r\n } else {\r\n expenseSummaryDataClone.push({\r\n name: catCode,\r\n label: catName,\r\n value: Math.round(total)\r\n });\r\n }\r\n\r\n this.setState({ expenseSummaryData: expenseSummaryDataClone });\r\n\r\n\r\n const expenseItemsClone = [...this.state.expenseItems];\r\n\r\n var catExpenseItems = expenseItemsClone.find(x => x.name === catCode);\r\n if (catExpenseItems) {\r\n const itemValuesClone = { ...catExpenseItems.items };\r\n var newItems = Object.assign(itemValuesClone, itemValues) ;\r\n catExpenseItems.items = newItems;\r\n } else {\r\n expenseItemsClone.push({\r\n name: catCode,\r\n items: itemValues\r\n });\r\n }\r\n this.setState({ expenseItems: expenseItemsClone });\r\n\r\n\r\n };\r\n\r\n handleDetailsUpdate = (name, value) => {\r\n var detailsClone = { ...this.state.details };\r\n detailsClone[name] = value;\r\n this.setState({ details: detailsClone });\r\n };\r\n\r\n handleSubmit = () => {\r\n\r\n var submitData = {\r\n income: [],\r\n expenses: [],\r\n details: this.state.details\r\n }\r\n\r\n for (const [key, value] of Object.entries(this.state.incomeItems)) {\r\n submitData.income.push({ code: key, value: value });\r\n }\r\n\r\n this.state.expenseItems.forEach(x => {\r\n let itemTypeCode = x.name;\r\n\r\n for (const [code, value] of Object.entries(x.items)) {\r\n submitData.expenses.push({ itemTypeCode, code: code, value: value });\r\n }\r\n });\r\n\r\n let history = this.props.history;\r\n\r\n $.ajax({\r\n method: \"POST\",\r\n url: 'api/budgetsubmission/new',\r\n contentType: 'application/json; charset=utf-8',\r\n data: JSON.stringify(submitData),\r\n dataType: \"json\"\r\n })\r\n .done(function (data) {\r\n history.push(\"/submission-success\")\r\n })\r\n .fail(function (xhr) {\r\n alert(\"fail\");\r\n });\r\n\r\n };\r\n\r\n static renderSubmissionForm(state, handleToggle, handleExpenseItemsUpdate, handleIncomeItemsUpdate, handleDetailsUpdate, handleSubmit) {\r\n\r\n const incomeTotal = (imcomeItems) => {\r\n let total = 0;\r\n for (const [key, value] of Object.entries(imcomeItems)) {\r\n total = total + calcMonthly(value.frequency, Number(value.amount));\r\n }\r\n return Math.round(total);\r\n };\r\n\r\n const postHeightChange = () => {\r\n var body = document.body,\r\n html = document.documentElement;\r\n\r\n var height = Math.max(body.scrollHeight, body.offsetHeight,\r\n html.clientHeight, html.scrollHeight, html.offsetHeight);\r\n\r\n if (window.parent) {\r\n console.log('Posting height ' + height + ' to parent');\r\n window.parent.postMessage(height, '*');\r\n }\r\n }\r\n\r\n const handleTogglePanelComplete = () => {\r\n postHeightChange();\r\n }\r\n\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {state.metadata.incomeCategories.map(inCat =>\r\n \r\n )}\r\n\r\n
\r\n
\r\n

Outgoings

\r\n {state.metadata.expenseCategories.map(expCat =>\r\n \r\n )}\r\n
\r\n\r\n
\r\n
\r\n
\r\n {state.expenseSummaryData.length > 0 &&\r\n \r\n }\r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n static renderLoader() {\r\n return (\r\n
Loading
\r\n );\r\n }\r\n\r\n\r\n render() {\r\n\r\n let contents = this.state.loading\r\n ? BudgetSubmission.renderLoader()\r\n : BudgetSubmission.renderSubmissionForm(this.state, this.handleToggle, this.handleExpenseItemsUpdate, this.handleIncomeItemsUpdate, this.handleDetailsUpdate, this.handleSubmit);\r\n\r\n return contents;\r\n\r\n }\r\n\r\n async loadBudgetSubmissionMetadata() {\r\n const response = await fetch('api/budgetsubmission/metadata');\r\n const data = await response.json();\r\n\r\n this.setState({ metadata: data, loading: false });\r\n }\r\n\r\n\r\n}\r\n","import React from 'react'\r\nimport { Component } from 'react'\r\nimport { Route, Redirect } from 'react-router-dom'\r\nimport { ApplicationPaths, QueryParameterNames } from './ApiAuthorizationConstants'\r\nimport authService from './AuthorizeService'\r\n\r\nexport default class AuthorizeRoute extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n ready: false,\r\n authenticated: false\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this._subscription = authService.subscribe(() => this.authenticationChanged());\r\n this.populateAuthenticationState();\r\n }\r\n\r\n componentWillUnmount() {\r\n authService.unsubscribe(this._subscription);\r\n }\r\n\r\n render() {\r\n const { ready, authenticated } = this.state;\r\n var link = document.createElement(\"a\");\r\n link.href = this.props.path;\r\n const returnUrl = `${link.protocol}//${link.host}${link.pathname}${link.search}${link.hash}`;\r\n const redirectUrl = `${ApplicationPaths.Login}?${QueryParameterNames.ReturnUrl}=${encodeURI(returnUrl)}`\r\n if (!ready) {\r\n return
;\r\n } else {\r\n const { component: Component, ...rest } = this.props;\r\n return {\r\n if (authenticated) {\r\n return \r\n } else {\r\n return \r\n }\r\n }} />\r\n }\r\n }\r\n\r\n async populateAuthenticationState() {\r\n const authenticated = await authService.isAuthenticated();\r\n this.setState({ ready: true, authenticated });\r\n }\r\n\r\n async authenticationChanged() {\r\n this.setState({ ready: false, authenticated: false });\r\n await this.populateAuthenticationState();\r\n }\r\n}\r\n","import React from 'react'\r\nimport { Component } from 'react';\r\nimport authService from './AuthorizeService';\r\nimport { AuthenticationResultStatus } from './AuthorizeService';\r\nimport { LoginActions, QueryParameterNames, ApplicationPaths } from './ApiAuthorizationConstants';\r\n\r\n// The main responsibility of this component is to handle the user's login process.\r\n// This is the starting point for the login process. Any component that needs to authenticate\r\n// a user can simply perform a redirect to this component with a returnUrl query parameter and\r\n// let the component perform the login and return back to the return url.\r\nexport class Login extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n message: undefined\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const action = this.props.action;\r\n switch (action) {\r\n case LoginActions.Login:\r\n this.login(this.getReturnUrl());\r\n break;\r\n case LoginActions.LoginCallback:\r\n this.processLoginCallback();\r\n break;\r\n case LoginActions.LoginFailed:\r\n const params = new URLSearchParams(window.location.search);\r\n const error = params.get(QueryParameterNames.Message);\r\n this.setState({ message: error });\r\n break;\r\n case LoginActions.Profile:\r\n this.redirectToProfile();\r\n break;\r\n case LoginActions.Register:\r\n this.redirectToRegister();\r\n break;\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n }\r\n\r\n render() {\r\n const action = this.props.action;\r\n const { message } = this.state;\r\n\r\n if (!!message) {\r\n return
{message}
\r\n } else {\r\n switch (action) {\r\n case LoginActions.Login:\r\n return (
Processing login
);\r\n case LoginActions.LoginCallback:\r\n return (
Processing login callback
);\r\n case LoginActions.Profile:\r\n case LoginActions.Register:\r\n return (
);\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n }\r\n }\r\n\r\n async login(returnUrl) {\r\n const state = { returnUrl };\r\n const result = await authService.signIn(state);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n break;\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(returnUrl);\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(`Invalid status result ${result.status}.`);\r\n }\r\n }\r\n\r\n async processLoginCallback() {\r\n const url = window.location.href;\r\n const result = await authService.completeSignIn(url);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n // There should not be any redirects as the only time completeSignIn finishes\r\n // is when we are doing a redirect sign in flow.\r\n throw new Error('Should not redirect.');\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(this.getReturnUrl(result.state));\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(`Invalid authentication result status '${result.status}'.`);\r\n }\r\n }\r\n\r\n getReturnUrl(state) {\r\n const params = new URLSearchParams(window.location.search);\r\n const fromQuery = params.get(QueryParameterNames.ReturnUrl);\r\n if (fromQuery && !fromQuery.startsWith(`${window.location.origin}/`)) {\r\n // This is an extra check to prevent open redirects.\r\n throw new Error(\"Invalid return url. The return url needs to have the same origin as the current page.\")\r\n }\r\n return (state && state.returnUrl) || fromQuery || `${window.location.origin}/`;\r\n }\r\n\r\n redirectToRegister() {\r\n this.redirectToApiAuthorizationPath(`${ApplicationPaths.IdentityRegisterPath}?${QueryParameterNames.ReturnUrl}=${encodeURI(ApplicationPaths.Login)}`);\r\n }\r\n\r\n redirectToProfile() {\r\n this.redirectToApiAuthorizationPath(ApplicationPaths.IdentityManagePath);\r\n }\r\n\r\n redirectToApiAuthorizationPath(apiAuthorizationPath) {\r\n const redirectUrl = `${window.location.origin}${apiAuthorizationPath}`;\r\n // It's important that we do a replace here so that when the user hits the back arrow on the\r\n // browser he gets sent back to where it was on the app instead of to an endpoint on this\r\n // component.\r\n window.location.replace(redirectUrl);\r\n }\r\n\r\n navigateToReturnUrl(returnUrl) {\r\n // It's important that we do a replace here so that we remove the callback uri with the\r\n // fragment containing the tokens from the browser history.\r\n window.location.replace(returnUrl);\r\n }\r\n}\r\n","import React from 'react'\r\nimport { Component } from 'react';\r\nimport authService from './AuthorizeService';\r\nimport { AuthenticationResultStatus } from './AuthorizeService';\r\nimport { QueryParameterNames, LogoutActions, ApplicationPaths } from './ApiAuthorizationConstants';\r\n\r\n// The main responsibility of this component is to handle the user's logout process.\r\n// This is the starting point for the logout process, which is usually initiated when a\r\n// user clicks on the logout button on the LoginMenu component.\r\nexport class Logout extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n message: undefined,\r\n isReady: false,\r\n authenticated: false\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const action = this.props.action;\r\n switch (action) {\r\n case LogoutActions.Logout:\r\n if (!!window.history.state.state.local) {\r\n this.logout(this.getReturnUrl());\r\n } else {\r\n // This prevents regular links to /authentication/logout from triggering a logout\r\n this.setState({ isReady: true, message: \"The logout was not initiated from within the page.\" });\r\n }\r\n break;\r\n case LogoutActions.LogoutCallback:\r\n this.processLogoutCallback();\r\n break;\r\n case LogoutActions.LoggedOut:\r\n this.setState({ isReady: true, message: \"You successfully logged out!\" });\r\n break;\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n\r\n this.populateAuthenticationState();\r\n }\r\n\r\n render() {\r\n const { isReady, message } = this.state;\r\n if (!isReady) {\r\n return
\r\n }\r\n if (!!message) {\r\n return (
{message}
);\r\n } else {\r\n const action = this.props.action;\r\n switch (action) {\r\n case LogoutActions.Logout:\r\n return (
Processing logout
);\r\n case LogoutActions.LogoutCallback:\r\n return (
Processing logout callback
);\r\n case LogoutActions.LoggedOut:\r\n return (
{message}
);\r\n default:\r\n throw new Error(`Invalid action '${action}'`);\r\n }\r\n }\r\n }\r\n\r\n async logout(returnUrl) {\r\n const state = { returnUrl };\r\n const isauthenticated = await authService.isAuthenticated();\r\n if (isauthenticated) {\r\n const result = await authService.signOut(state);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n break;\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(returnUrl);\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(\"Invalid authentication result status.\");\r\n }\r\n } else {\r\n this.setState({ message: \"You successfully logged out!\" });\r\n }\r\n }\r\n\r\n async processLogoutCallback() {\r\n const url = window.location.href;\r\n const result = await authService.completeSignOut(url);\r\n switch (result.status) {\r\n case AuthenticationResultStatus.Redirect:\r\n // There should not be any redirects as the only time completeAuthentication finishes\r\n // is when we are doing a redirect sign in flow.\r\n throw new Error('Should not redirect.');\r\n case AuthenticationResultStatus.Success:\r\n await this.navigateToReturnUrl(this.getReturnUrl(result.state));\r\n break;\r\n case AuthenticationResultStatus.Fail:\r\n this.setState({ message: result.message });\r\n break;\r\n default:\r\n throw new Error(\"Invalid authentication result status.\");\r\n }\r\n }\r\n\r\n async populateAuthenticationState() {\r\n const authenticated = await authService.isAuthenticated();\r\n this.setState({ isReady: true, authenticated });\r\n }\r\n\r\n getReturnUrl(state) {\r\n //const params = new URLSearchParams(window.location.search);\r\n //const fromQuery = params.get(QueryParameterNames.ReturnUrl);\r\n //if (fromQuery && !fromQuery.startsWith(`${window.location.origin}/`)) {\r\n // // This is an extra check to prevent open redirects.\r\n // throw new Error(\"Invalid return url. The return url needs to have the same origin as the current page.\")\r\n //}\r\n //return (state && state.returnUrl) ||\r\n // fromQuery ||\r\n // `${window.location.origin}${ApplicationPaths.LoggedOut}`;\r\n\r\n const redirectUrl = `${ApplicationPaths.Login}`;\r\n return redirectUrl;\r\n }\r\n\r\n navigateToReturnUrl(returnUrl) {\r\n return window.location.replace(returnUrl);\r\n }\r\n}\r\n","import React, { Component, Fragment } from 'react';\r\nimport { Route } from 'react-router';\r\nimport { Login } from './Login'\r\nimport { Logout } from './Logout'\r\nimport { ApplicationPaths, LoginActions, LogoutActions } from './ApiAuthorizationConstants';\r\n\r\nexport default class ApiAuthorizationRoutes extends Component {\r\n\r\n render () {\r\n return(\r\n \r\n loginAction(LoginActions.Login)} />\r\n loginAction(LoginActions.LoginFailed)} />\r\n loginAction(LoginActions.LoginCallback)} />\r\n loginAction(LoginActions.Profile)} />\r\n loginAction(LoginActions.Register)} />\r\n logoutAction(LogoutActions.Logout)} />\r\n logoutAction(LogoutActions.LogoutCallback)} />\r\n logoutAction(LogoutActions.LoggedOut)} />\r\n );\r\n }\r\n}\r\n\r\nfunction loginAction(name){\r\n return ();\r\n}\r\n\r\nfunction logoutAction(name) {\r\n return ();\r\n}\r\n","import React from 'react';\r\nimport { Card, CardBody, Container } from 'reactstrap';\r\n\r\nimport successIcon from './success-icon.svg';\r\n\r\nexport const SubmissionSuccess = (props) => {\r\n\r\n\r\n return (\r\n \r\n \r\n \r\n \"\"\r\n

Thank you!

\r\n

Your details were successfully sent

\r\n

One of our friendly consultants will be in contact with you soon

\r\n
\r\n
\r\n
\r\n )\r\n\r\n}","import React, { Component } from 'react';\r\n\r\nexport default class GridCommandsRenderer extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.invokeParentViewMethod = this.invokeParentViewMethod.bind(this);\r\n this.invokeParentDeleteMethod = this.invokeParentDeleteMethod.bind(this);\r\n this.invokeParentExportMethod = this.invokeParentExportMethod.bind(this);\r\n }\r\n\r\n invokeParentViewMethod() {\r\n this.props.context.componentParent.handleViewCommmand(\r\n this.props.node.data.id\r\n );\r\n }\r\n\r\n invokeParentDeleteMethod() {\r\n this.props.context.componentParent.handleDeleteCommmand(\r\n this.props.node.data.id\r\n );\r\n }\r\n\r\n invokeParentExportMethod() {\r\n this.props.context.componentParent.handleExportCommmand(\r\n this.props.node.data.id\r\n );\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n View\r\n \r\n \r\n Delete\r\n \r\n\r\n \r\n Export\r\n \r\n \r\n );\r\n }\r\n}","import React, { Component, Fragment } from 'react';\r\nimport { NavItem, NavLink } from 'reactstrap';\r\nimport { Link } from 'react-router-dom';\r\nimport authService from './AuthorizeService';\r\nimport { ApplicationPaths } from './ApiAuthorizationConstants';\r\n\r\nexport class LoginMenu extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n isAuthenticated: false,\r\n userName: null\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this._subscription = authService.subscribe(() => this.populateState());\r\n this.populateState();\r\n }\r\n\r\n componentWillUnmount() {\r\n authService.unsubscribe(this._subscription);\r\n }\r\n\r\n async populateState() {\r\n const [isAuthenticated, user] = await Promise.all([authService.isAuthenticated(), authService.getUser()])\r\n this.setState({\r\n isAuthenticated,\r\n userName: user && user.name\r\n });\r\n }\r\n\r\n render() {\r\n const { isAuthenticated, userName } = this.state;\r\n if (!isAuthenticated) {\r\n const registerPath = `${ApplicationPaths.Register}`;\r\n const loginPath = `${ApplicationPaths.Login}`;\r\n return this.anonymousView(registerPath, loginPath);\r\n } else {\r\n const profilePath = `${ApplicationPaths.Profile}`;\r\n const logoutPath = { pathname: `${ApplicationPaths.LogOut}`, state: { local: true } };\r\n return this.authenticatedView(userName, profilePath, logoutPath);\r\n }\r\n }\r\n\r\n authenticatedView(userName, profilePath, logoutPath) {\r\n return (\r\n \r\n Hello {userName}\r\n \r\n \r\n Logout\r\n \r\n );\r\n\r\n }\r\n\r\n anonymousView(registerPath, loginPath) {\r\n return (\r\n \r\n Register\r\n \r\n \r\n Login\r\n \r\n );\r\n }\r\n}\r\n","import React from 'react';\r\nimport { NavItem, NavLink, Nav } from 'reactstrap';\r\n\r\nexport const HomeLeftMenu = (props) => {\r\n\r\n return (\r\n
\r\n \"\"\r\n

Budget Planner

\r\n
\r\n Click on the entries to view customers budget details\r\n
\r\n
\r\n )\r\n\r\n}","import React, { Component } from 'react';\r\nimport { AgGridReact } from 'ag-grid-react';\r\nimport { Nav, Container } from 'reactstrap';\r\nimport $ from 'jquery';\r\nimport 'ag-grid-community/dist/styles/ag-grid.css';\r\nimport 'ag-grid-community/dist/styles/ag-theme-alpine.css';\r\n\r\n\r\nimport GridCommandsRenderer from './ag-grid-cell-renderers/GridCommandsRenderer';\r\nimport { LoginMenu } from '../api-authorization/LoginMenu';\r\n\r\nimport { HomeLeftMenu } from './HomeLeftMenu';\r\n\r\n\r\nexport class Submissions extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n console.log(props);\r\n\r\n this.state = {\r\n columnDefs: [{\r\n headerName: \"Email\", field: \"email\", sortable: true\r\n }, {\r\n headerName: \"Name\", field: \"name\", sortable: true\r\n }, {\r\n headerName: \"Phone\", field: \"phone\", sortable: true\r\n }, {\r\n headerName: \"Date Submitted\", field: \"submissionDate\", sortable: true,\r\n type: ['dateColumn', 'nonEditableColumn'],\r\n valueFormatter: (params) => { return new Date(params.value).toLocaleString(); }\r\n }, {\r\n headerName: \"Actions:\", field: \"id\", cellRenderer: 'gridCommandsRenderer', width: 250\r\n }],\r\n rowData: []\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n fetch('/api/budgetsubmission/list')\r\n .then(result => result.json())\r\n .then(rowData => this.setState({ rowData }))\r\n }\r\n\r\n handleDeleteCommmand = id => {\r\n\r\n if (window.confirm('Delete Submission?')) {\r\n\r\n let me = this;\r\n\r\n $.ajax({\r\n method: \"POST\",\r\n url: `api/budgetsubmission/delete/${id}`,\r\n contentType: 'application/json; charset=utf-8',\r\n dataType: \"json\"\r\n })\r\n .done(function (data) {\r\n fetch('/api/budgetsubmission/list')\r\n .then(result => result.json())\r\n .then(rowData => me.setState({ rowData }))\r\n })\r\n .fail(function (xhr) {\r\n alert(\"fail\");\r\n });\r\n }\r\n\r\n };\r\n\r\n handleViewCommmand = id => {\r\n this.props.history.push(`/manage/submissions/${id}`);\r\n }\r\n\r\n handleExportCommmand = id => {\r\n window.location.href = `api/budgetsubmission/excel/${id}`;\r\n }\r\n\r\n handleExportAllCommand = () => {\r\n window.location.href = `api/budgetsubmission/excel/`;\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n\r\n \r\n
\r\n
\r\n

Website Enquiries

\r\n \r\n
\r\n
\r\n
\r\n Export All\r\n
\r\n \r\n \r\n\r\n \r\n
\r\n \r\n\r\n
\r\n );\r\n }\r\n}\r\n\r\n","import React, { useState } from 'react';\r\nimport { Card, CardBody, CardHeader, FormGroup, Label, Col, Input } from 'reactstrap';\r\nimport { calcWeekly, calcFortnightly, calcQuarterly, calcAnnually } from '../../util/Conversions';\r\n\r\nexport const ExpenseCategoryItem = (props) => {\r\n\r\n const [frequency, setFrequency] = useState('monthly');\r\n\r\n const handleFrequencyUpdate = (event) => {\r\n let val = event.target.value;\r\n setFrequency(val);\r\n }\r\n\r\n const calcAmount = (monthlyAmount) => {\r\n\r\n if (frequency === 'Weekly') {\r\n return Math.round(calcWeekly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Fortnightly') {\r\n return Math.round(calcFortnightly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Quarterly') {\r\n return Math.round(calcQuarterly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Annually') {\r\n return Math.round(calcAnnually('Monthly', monthlyAmount));\r\n } else {\r\n return monthlyAmount;\r\n }\r\n\r\n };\r\n\r\n return (\r\n props.isOpen &&\r\n \r\n \r\n {props.category.name} \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {props.category.expenseItemTypes.map(t =>\r\n\r\n \r\n \r\n \r\n $ {calcAmount(t.amountMonthly)}\r\n \r\n \r\n )} \r\n \r\n \r\n \r\n $ {calcAmount(props.category.totalMonthly)}\r\n \r\n \r\n \r\n \r\n )\r\n\r\n}\r\n","import React, { useState } from 'react';\r\nimport { Card, CardBody, CardHeader, FormGroup, Label, Col, Input } from 'reactstrap';\r\nimport { calcWeekly, calcFortnightly, calcQuarterly, calcAnnually } from '../../util/Conversions';\r\n\r\nexport const IncomeCategoryItem = (props) => {\r\n\r\n const [frequency, setFrequency] = useState('monthly');\r\n\r\n const handleFrequencyUpdate = (event) => {\r\n let val = event.target.value;\r\n setFrequency(val);\r\n }\r\n\r\n const calcAmount = (monthlyAmount) => {\r\n\r\n if (frequency === 'Weekly') {\r\n return Math.round(calcWeekly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Fortnightly') {\r\n return Math.round(calcFortnightly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Quarterly') {\r\n return Math.round(calcQuarterly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Annually') {\r\n return Math.round(calcAnnually('Monthly', monthlyAmount));\r\n } else {\r\n return monthlyAmount;\r\n }\r\n\r\n };\r\n\r\n return (\r\n props.isOpen &&\r\n \r\n \r\n {props.category.name} \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {props.category.incomeItemTypes.map(t =>\r\n\r\n \r\n \r\n \r\n $ {calcAmount(t.amountMonthly)}\r\n \r\n \r\n )} \r\n \r\n \r\n \r\n $ {calcAmount(props.category.totalMonthly)}\r\n \r\n \r\n \r\n \r\n )\r\n\r\n}\r\n","import React from 'react';\r\n\r\nexport const Details = (props) => {\r\n\r\n return (\r\n
\r\n
\r\n

Enquiry From

\r\n
{props.details.name}
\r\n
\r\n
\r\n
{props.details.email}
\r\n
{props.details.phone}
\r\n
${props.details.currentHomeValue}
\r\n
${props.details.homeLoanBalanceOwing}
\r\n
{props.details.homeLoanInterestRate}%
\r\n
{props.details.homeLoanType}
\r\n
\r\n
\r\n )\r\n\r\n}","import React from 'react';\r\nimport { NavItem, NavLink, Nav } from 'reactstrap';\r\n\r\nexport const SubmissionLeftMenu = (props) => {\r\n\r\n return (\r\n
\r\n

Budget Planner

\r\n\r\n

Income

\r\n \r\n\r\n\r\n

Outgoings

\r\n \r\n\r\n\r\n

Accounts

\r\n \r\n
\r\n )\r\n\r\n}","import React, { useState } from 'react';\r\nimport { Card, CardBody, CardHeader, FormGroup, Label, Col, Input } from 'reactstrap';\r\nimport { calcWeekly, calcFortnightly, calcQuarterly, calcAnnually } from '../util/Conversions';\r\n\r\nexport const TagExpenses = (props) => {\r\n\r\n const [frequency, setFrequency] = useState('monthly');\r\n\r\n const handleFrequencyUpdate = (event) => {\r\n let val = event.target.value;\r\n setFrequency(val);\r\n }\r\n\r\n const calcAmount = (monthlyAmount) => {\r\n\r\n if (frequency === 'Weekly') {\r\n return Math.round(calcWeekly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Fortnightly') {\r\n return Math.round(calcFortnightly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Quarterly') {\r\n return Math.round(calcQuarterly('Monthly', monthlyAmount));\r\n } else if (frequency === 'Annually') {\r\n return Math.round(calcAnnually('Monthly', monthlyAmount));\r\n } else {\r\n return monthlyAmount;\r\n }\r\n\r\n };\r\n\r\n return (\r\n \r\n \r\n {props.tagExpenses.tagName} \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {props.tagExpenses.expenses.map(t =>\r\n\r\n \r\n \r\n \r\n $ {calcAmount(t.amountMonthly)}\r\n \r\n \r\n )} \r\n \r\n \r\n \r\n $ {calcAmount(props.tagExpenses.totalMonthly)}\r\n \r\n \r\n \r\n \r\n )\r\n\r\n}\r\n","import React, { Component } from 'react';\r\nimport { Container, NavItem, NavLink, Nav } from 'reactstrap';\r\nimport { Link } from 'react-router-dom';\r\n\r\n\r\nimport axios from 'axios';\r\nimport { BudgetSummary } from '../BudgetSummary';\r\nimport { LoginMenu } from '../api-authorization/LoginMenu';\r\nimport { ExpenseCategoryItem } from './category-item/ExpenseCategoryItem';\r\nimport { IncomeCategoryItem } from './category-item/IncomeCategoryItem';\r\nimport { Details } from './Details';\r\nimport { SubmissionLeftMenu } from './SubmissionLeftMenu';\r\nimport { TagExpenses } from './TagExpenses';\r\n\r\n\r\nexport class Submission extends Component {\r\n static displayName = Submission.name;\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n expenseCategories: null,\r\n incomeCategories: null,\r\n displayIncome: true,\r\n openExpenseCat: null,\r\n displayExpenseTags: false,\r\n loading: true,\r\n expenseItems: {},\r\n expenseSummaryData: [],\r\n incomeItems: {},\r\n details: {},\r\n tagExpenses: []\r\n };\r\n }\r\n\r\n\r\n componentDidMount() {\r\n const { match: { params } } = this.props;\r\n this.load(params.submissionId);\r\n }\r\n\r\n handleIncomeOpen = () => {\r\n this.setState({ displayIncome: true, openExpenseCat: null, displayExpenseTags: false })\r\n }\r\n\r\n handleExpenseCatOpen = (catCode) => {\r\n this.setState({ displayIncome: false, openExpenseCat: catCode, displayExpenseTags: false });\r\n }\r\n\r\n handleTagExpensesOpen = () => {\r\n this.setState({ displayIncome: false, openExpenseCat: null, displayExpenseTags: true });\r\n }\r\n\r\n static renderSubmissionForm(state, handleExpenseCatOpen, handleTagExpensesOpen, handleIncomeOpen) {\r\n\r\n const incomeTotal = (incomeItems) => {\r\n console.log(incomeItems);\r\n let total = 0;\r\n for (const [key, value] of Object.entries(incomeItems)) {\r\n total = total + Number(value);\r\n }\r\n return Math.round(total);\r\n };\r\n\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {(state.displayIncome || state.openExpenseCat) &&\r\n
\r\n {state.displayIncome &&\r\n
\r\n
\r\n {state.incomeCategories.map(inCat =>\r\n \r\n )}\r\n
\r\n
\r\n }\r\n {state.openExpenseCat != null &&\r\n
\r\n
\r\n {state.expenseCategories.map(expCat =>\r\n \r\n )}\r\n
\r\n
\r\n }\r\n
\r\n {state.expenseSummaryData.length > 0 &&\r\n \r\n }\r\n
\r\n \r\n
\r\n }\r\n\r\n {state.displayExpenseTags &&\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n }\r\n
\r\n
\r\n );\r\n }\r\n\r\n static renderLoader() {\r\n return (\r\n
Loading
\r\n );\r\n }\r\n\r\n render() {\r\n\r\n let contents = this.state.loading\r\n ? Submission.renderLoader()\r\n : Submission.renderSubmissionForm(this.state, this.handleExpenseCatOpen, this.handleTagExpensesOpen, this.handleIncomeOpen);\r\n\r\n return contents;\r\n }\r\n\r\n async load(id) {\r\n let metadata = await this.loadMetadata();\r\n await this.loadSubmission(id);\r\n await this.loadTagExpenses(id);\r\n\r\n let expenseCategories = metadata.expenseCategories.map((cat) => {\r\n const catClone = { ...cat };\r\n let totalMonthly = 0;\r\n catClone.expenseItemTypes.forEach((itemType) => {\r\n itemType.amountMonthly = this.state.expenseItems[itemType.code];\r\n if (!itemType.amountMonthly) {\r\n itemType.amountMonthly = 0\r\n }\r\n\r\n totalMonthly = totalMonthly + itemType.amountMonthly;\r\n });\r\n catClone.totalMonthly = totalMonthly;\r\n\r\n return catClone;\r\n });\r\n\r\n let incomeCategories = metadata.incomeCategories.map((cat) => {\r\n const catClone = { ...cat };\r\n let totalMonthly = 0;\r\n catClone.incomeItemTypes.forEach((itemType) => {\r\n itemType.amountMonthly = this.state.incomeItems[itemType.code];\r\n if (!itemType.amountMonthly) {\r\n itemType.amountMonthly = 0\r\n }\r\n\r\n totalMonthly = totalMonthly + itemType.amountMonthly;\r\n });\r\n catClone.totalMonthly = totalMonthly;\r\n\r\n return catClone;\r\n });\r\n\r\n this.setState({\r\n expenseCategories: expenseCategories,\r\n incomeCategories: incomeCategories\r\n });\r\n\r\n this.setState({ loading: false });\r\n }\r\n\r\n async loadSubmission(id) {\r\n\r\n try {\r\n const response = await axios.get(`api/budgetsubmission/details/${id}`);\r\n\r\n let expenseSummaryData = response.data.expenseCategoryTotals.map((d) => {\r\n return {\r\n name: d.code,\r\n label: d.name,\r\n value: d.monthlyTotal\r\n } \r\n });\r\n\r\n let incomeItems = {};\r\n response.data.incomeMonthly.forEach((d) => {\r\n incomeItems[d.code] = d.amountMonthly;\r\n });\r\n\r\n let expenseItems = {};\r\n response.data.expensesMonthly.forEach((d) => {\r\n expenseItems[d.code] = d.amountMonthly;\r\n });\r\n\r\n this.setState({ expenseSummaryData: expenseSummaryData });\r\n\r\n this.setState({\r\n details: response.data.details,\r\n incomeItems: incomeItems,\r\n expenseItems: expenseItems\r\n });\r\n\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n\r\n\r\n async loadTagExpenses(id) {\r\n\r\n try {\r\n const response = await axios.get(`api/budgetsubmission/tag-expenses/${id}`);\r\n\r\n this.setState({\r\n tagExpenses: response.data\r\n });\r\n\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n\r\n async loadMetadata() {\r\n\r\n try {\r\n const response = await axios.get(`api/budgetsubmission/metadata`);\r\n return response.data;\r\n\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n\r\n\r\n}\r\n","import React, { Component } from 'react';\r\nimport { Route, Switch } from 'react-router';\r\nimport { Layout } from './components/Layout';\r\nimport { FetchData } from './components/FetchData';\r\n\r\nimport { BudgetSubmission } from './components/BudgetSubmission'\r\n\r\nimport AuthorizeRoute from './components/api-authorization/AuthorizeRoute';\r\nimport ApiAuthorizationRoutes from './components/api-authorization/ApiAuthorizationRoutes';\r\nimport { ApplicationPaths } from './components/api-authorization/ApiAuthorizationConstants';\r\n\r\nimport { SubmissionSuccess } from './components/SubmissionSuccess';\r\nimport { Submissions } from './components/manage/Submissions';\r\nimport { Submission } from './components/manage/Submission';\r\n\r\nimport './custom.css'\r\n\r\nexport default class App extends Component {\r\n static displayName = App.name;\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import 'bootstrap/dist/css/bootstrap.css';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport App from './App';\r\n//import registerServiceWorker from './registerServiceWorker';\r\n\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nconst rootElement = document.getElementById('root');\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n rootElement);\r\n\r\n// Uncomment the line above that imports the registerServiceWorker function\r\n// and the line below to register the generated service worker.\r\n// By default create-react-app includes a service worker to improve the\r\n// performance of the application by caching static assets. This service\r\n// worker can interfere with the Identity UI, so it is\r\n// disabled by default when Identity is being used.\r\n//\r\n//registerServiceWorker();\r\n\r\n"],"sourceRoot":""}