{"version":3,"sources":["history.js","store/ClientConfiguration.js","FetchWrapper.js","store/Alerts.js","store/SystemControl.js","store/Lifetime.js","store/Authentication.js","store/PrintView.js","store/Sites.js","store/ClientRegistrations.js","store/WorkbillSchedules.js","store/WorkbillActivities.js","components/PrivateRoute.js","components/NavMenu.js","components/TopBar.js","components/DateTime.js","components/PrintView.js","components/AlertPanel.js","components/Layout.js","components/Loading.js","utils/utils.js","pages/Login.js","components/Header.js","pages/Logout.js","pages/Authenticate.js","constants/QuickViewOptions.js","components/NoItems.js","components/CalendarDay.js","components/Calendar.js","pages/QuickView.js","App.js","registerServiceWorker.js","fontawesome.js","index.js","store/configureStore.js"],"names":["history","createBrowserHistory","initialState","config","isLoading","isLoaded","configActions","requestClientConfig","dispatch","getState","a","type","fetch","response","json","reducer","state","action","fetchActions","get","url","ticket","data","__fetch","post","method","requestOptions","mode","headers","body","JSON","stringify","then","handleResponse","text","parse","ok","error","sessionExpired","responseError","responseStatusCode","keys","Object","length","message","toLowerCase","undefined","status","responseText","statusText","toString","getErrorFromResponse","Promise","reject","alerts","alertActions","success","alert","clear","systemControl","localStorage","getItem","configuration","companyName","systemControlActions","clientConfiguration","endpoint","authentication","user","setItem","_success","_failure","getLocal","getStartUp","lifetimeActions","onLogIn","onLogOut","removeItem","loggedIn","isAuthenticationRequired","loggingOut","userActions","login","userCode","password","clientCode","portaltype","_authenticationRequired","push","_loginSuccess","_loginFailure","authenticate","accessCode","loginCompleted","_loginCompleted","logout","_loggedout","_logoutFailure","loggingIn","item","printViewActions","show","hide","items","canRequest","selectedSiteId","sitesActions","getForClientCode","sites","query","refreshQV","canInitialRequest","clientRegistrationsActions","getForQV","clientRegistrations","clientRegistration","find","code","qvWeeks","workbillSchedulesActions","getForSiteId","siteId","year","month","activity","workbillSchedules","firstDayOfTheCal","Date","getDay","setDate","getDate","weeks","nweekNumber","dweekStartDate","getFullYear","getMonth","weekNumber","weekStartDate","dLastDayOfTheCal","encodeURIComponent","scheduleItems","actualMonth","moment","add","today","map","week","i","date","days","clone","format","stateClass","findWorkbillScheduleItemState","isInMonth","isToday","isSame","dateToCheck","itemStateClass","workbillSchedule","dateFrom","_d","mapWeeks","workbillActivitesActions","getActivitiesForSiteId","refresh","PrivateRoute","Component","component","rest","render","props","match","indexOf","to","pathname","from","location","NavMenu","inverse","fixedTop","fluid","collapseOnSelect","Header","Brand","className","src","alt","Toggle","Collapse","Text","exact","TopBar","DateTime","PrintView","handlePrint","event","preventDefault","window","print","handleClose","closeView","expanded","bind","this","bsSize","onClick","icon","subject","typeName","postedDate","note","split","k","connect","AlertPanel","handleClear","hasClear","size","Layout","printViewItem","isNavbarVisible","sm","isEmployeePortalEnabled","index","key","children","utils","truncateDate","pos","substr","getMondayForDate","day","diff","addDays","copy","Number","toDecimal","x","parseFloat","toFixed","formatNumberValue","formatCurrencyValue","value","currencySymbol","detectCompatibleBrowser","ua","navigator","userAgent","msie","parseInt","substring","rv","detectIE","numeric","isNaN","Login","handleChange","setState","target","id","handleLogin","browserError","handleQuickView","smOffset","onSubmit","controlId","autoFocus","onChange","block","disabled","validateForm","isQuickViewEnabled","bindActionCreators","title","handleSubmit","Authenticate","handleAuthenticate","quickViewOptions","name","CalendarDay","Calendar","handlePrev","onMonthYearChange","handleNext","handleWorkbillDateClick","sDate","innerText","oArray","handleGoToThisMonth","activityObject","span","lastWorkbillDate","nextWorkbillDate","lastCompletedQADate","qaScore","QuickView","handleQuickViewSelect","newselectedQuickViewOption","selectedQuickViewOptions","handleClientSelect","newselectedClientCode","applyClientSelect","handleSiteSelect","newselectedSiteId","applySiteSelect","handleActivitySelect","selectedActivityObject","workbillActivities","selectedIndex","newselectedActivity","applyActivitySelect","allowClientSelection","params","sClientCode","decodeURIComponent","nselectedSiteId","sActivity","oActivityObject","quickViewOptionList","registration","description","site","App","rootDefaultPath","Logout","printView","path","withRouter","isLocalhost","Boolean","hostname","registerValidSW","swUrl","serviceWorker","register","onupdatefound","installingWorker","installing","onstatechange","controller","console","log","catch","library","faExclamationCircle","faInfoCircle","faCheck","faClock","faTimes","faPrint","faTimesCircle","faSearch","faFile","faChevronRight","faChevronLeft","faStepForward","faStepBackward","faLock","faLockOpen","faUserPlus","faPlus","faArrowUp","faArrowDown","faMapPin","initialReduxState","store","reducers","ClientConfiguration","Authentication","SystemControl","Alerts","ClientRegistrations","WorkbillSchedules","Sites","WorkbillActivities","middleware","thunk","routerMiddleware","enhancers","appReducer","combineReducers","router","connectRouter","createStore","compose","applyMiddleware","configureStore","rootElement","document","getElementById","ReactDOM","URL","process","origin","addEventListener","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"kfAEaA,EAAUC,c,6DCAjBC,EAAe,CAAEC,OAAQ,GAAIC,WAAW,EAAOC,UAAU,GAElDC,EAAgB,CAC5BC,oBAAqB,yDAAM,WAAOC,EAAUC,GAAjB,iBAAAC,EAAA,0DACtBD,IAAWN,OADW,wDAM1BK,EAAS,CAAEG,KAXmB,0BAalB,sBARc,SASHC,MADX,uBARc,cASpBC,EAToB,gBAULA,EAASC,OAVJ,OAUpBX,EAVoB,OAY1BK,EAAS,CAAEG,KAhBmB,wBAgBYR,WAZhB,4CAAN,0DAgBTY,EAAU,SAACC,EAAOC,GAG9B,OAFAD,EAAQA,GAASd,EAtBc,0BAwB3Be,EAAON,KACH,eACHK,EADJ,CAECZ,WAAW,EACXC,UAAU,IA3BmB,0BA+B3BY,EAAON,KACH,eACHK,EADJ,CAECb,OAAQc,EAAOd,OACfC,WAAW,EACXC,UAAU,IAILW,GCzCKE,EAAe,CAC3BC,IAKD,SAAaC,EAAKC,EAAQC,GACzB,OAAOC,EAAQH,EAAK,MAAOC,EAAQC,IALnCE,KAQD,SAAcJ,EAAKC,EAAQC,GAC1B,OAAOC,EAAQH,EAAK,OAAQC,EAAQC,KAIrC,SAASC,EAAQH,EAAKK,EAAQJ,EAAQC,GACrC,IAAMI,EAAiB,CACtBD,OAAQA,EACRE,KAAM,OACNC,QAAS,CACR,eAAgB,oCAYlB,OARIN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ACP,kBAAC,IAAD,CAAUoM,MAAOA,IACf,kBAAC,IAAD,CAAiB9W,QAASA,GACxB,kBAAC,GAAD,QAGJoY,IF5Ba,WACb,GAA6C,kBAAmB7I,UAAW,CAGzE,GADkB,IAAIiJ,IAAIC,GAAwBnM,OAAOrB,UAC3CyN,SAAWpM,OAAOrB,SAASyN,OAIvC,OAGFpM,OAAOqM,iBAAiB,QAAQ,WAC9B,IAAM9D,EAAK,UAAM4D,GAAN,sBAEPhE,GAwCV,SAAiCI,GAE/BjU,MAAMiU,GACH7S,MAAK,SAAAnB,GAGkB,MAApBA,EAASkC,SACuD,IAAhElC,EAASe,QAAQT,IAAI,gBAAgB0J,QAAQ,cAG7C0E,UAAUuF,cAAc8D,MAAM5W,MAAK,SAAAgS,GACjCA,EAAa6E,aAAa7W,MAAK,WAC7BsK,OAAOrB,SAAS6N,eAKpBlE,GAAgBC,MAGnBU,OAAM,WACLF,QAAQC,IACN,oEA5DAyD,CAAwBlE,GAGxBD,GAAgBC,OEWxBmE,K","file":"static/js/main.b5e1b7a3.chunk.js","sourcesContent":["import { createBrowserHistory } from 'history';\r\n\r\nexport const history = createBrowserHistory();","const requestClientConfigType = 'REQUEST_CLIENT_CONFIG';\r\nconst receiveClientConfigType = 'RECEIVE_CLIENT_CONFIG';\r\nconst initialState = { config: {}, isLoading: false, isLoaded: false };\r\n\r\nexport const configActions = {\r\n\trequestClientConfig: () => async (dispatch, getState) => {\r\n\t\tif (getState().config) {\r\n\t\t\t// Don't issue a duplicate request (we already have or are loading the requested data)\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tdispatch({ type: requestClientConfigType });\r\n\r\n\t\tconst url = \"ClientConfiguration\";\r\n\t\tconst response = await fetch(url);\r\n\t\tconst config = await response.json();\r\n\r\n\t\tdispatch({ type: receiveClientConfigType, config });\r\n\t}\r\n};\r\n\r\nexport const reducer = (state, action) => {\r\n\tstate = state || initialState;\r\n\r\n\tif (action.type === requestClientConfigType) {\r\n\t\treturn {\r\n\t\t\t...state,\r\n\t\t\tisLoading: true,\r\n\t\t\tisLoaded: false\r\n\t\t};\r\n\t}\r\n\r\n\tif (action.type === receiveClientConfigType) {\r\n\t\treturn {\r\n\t\t\t...state,\r\n\t\t\tconfig: action.config,\r\n\t\t\tisLoading: false,\r\n\t\t\tisLoaded: true\r\n\t\t};\r\n\t}\r\n\r\n\treturn state;\r\n};\r\n","export const fetchActions = {\r\n\tget,\r\n\tpost\r\n};\r\n\r\n\r\nfunction get(url, ticket, data) {\r\n\treturn __fetch(url, \"GET\", ticket, data);\r\n}\r\n\r\nfunction post(url, ticket, data) {\r\n\treturn __fetch(url, \"POST\", ticket, data);\r\n}\r\n\r\n\r\nfunction __fetch(url, method, ticket, data) {\r\n\tconst requestOptions = {\r\n\t\tmethod: method,\r\n\t\tmode: \"cors\",\r\n\t\theaders: {\r\n\t\t\t\"Content-Type\": \"application/json; charset=utf-8\"\r\n\t\t}\r\n\t};\r\n\r\n\tif (data) {\r\n\t\trequestOptions.body = JSON.stringify(data);\r\n\t}\r\n\r\n\tif (ticket) {\r\n\t\trequestOptions.headers[\"tcms-ticket\"] = ticket;\r\n\t}\r\n\r\n\treturn fetch(url, requestOptions)\r\n\t\t.then(handleResponse)\r\n\t\t.then(data => {\r\n\t\t\treturn data;\r\n\t\t});\r\n}\r\n\r\nfunction handleResponse(response) {\r\n\treturn response.text().then(text => {\r\n\t\tconst data = text && JSON.parse(text);\r\n\r\n\t\tif (!response.ok) {\r\n const error = getErrorFromResponse(data, response);\r\n\t\t\treturn Promise.reject(error);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tdata: data,\r\n\t\t\theaders: response.headers\r\n\t\t};\r\n\t});\r\n}\r\n\r\nexport function getErrorFromResponse(data, response) {\r\n\r\n\tvar error = { sessionExpired: false, responseError: false, responseStatusCode: 0 };\r\n\tif (typeof data === \"object\") {\r\n\t\tvar keys = Object.keys(data);\r\n\t\tif (keys.length !== 0) {\r\n\t\t\terror.message = data[keys[0]];\r\n\t\t}\r\n\t}\r\n\tif (error.message && error.message.toLowerCase() === \"invalid session\") {\r\n\t\terror.sessionExpired = true;\r\n\t}\r\n\r\n if (error.message === undefined) {\r\n\r\n //if not okay and there's a status\r\n if (response.ok === false && response.status !== undefined) {\r\n //flag as an error and get the status\r\n error.responseError = true;\r\n error.responseStatusCode = response.status;\r\n }\r\n\r\n\r\n var responseText = \"\";\r\n if (typeof response.statusText === \"string\") {\r\n responseText = response.statusText\r\n \r\n } else if (response.statusText.text !== undefined) {\r\n responseText = response.statusText.text();\r\n }\r\n\r\n error.message = data.toString() || responseText;\r\n\t}\r\n\treturn error;\r\n}","const alertSuccessType = 'ALERT_SUCCESS';\r\nconst alertErrorType = 'ALERT_ERROR';\r\nconst alertClearType = 'ALERT_CLEAR';\r\n\r\nconst initialState = {\r\n\talerts: [] \r\n};\r\n\r\nexport const alertActions = {\r\n\tsuccess,\r\n\terror,\r\n\tclear\r\n};\r\n\r\nfunction success(message) {\r\n\treturn { type: alertSuccessType, alert: { type: 'alert-success', message: message } };\r\n}\r\n\r\nfunction error(message) {\r\n\treturn { type: alertErrorType, alert: { type: 'alert-danger', message: message } };\r\n}\r\n\r\nfunction clear() {\r\n\treturn { type: alertClearType };\r\n}\r\n\r\n\r\nexport const reducer = (state, action) => {\r\n\tstate = state || initialState;\r\n\r\n\tif (action.type === alertSuccessType) {\r\n\t\treturn { ...state, alerts: [...state.alerts, action.alert] };\r\n\t}\r\n\r\n\tif (action.type === alertErrorType) {\r\n\t\treturn { ...state, alerts: [...state.alerts, action.alert] };\r\n\t}\r\n\r\n\tif (action.type === alertClearType) {\r\n\t\treturn { ...state, alerts: [] };\r\n\t}\r\n\r\n\treturn state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: SystemControl\r\n// Details: System control : store\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n//-------------------------------------------------------\r\n*/\r\nimport { alertActions } from './Alerts';\r\nimport { fetchActions } from \"../FetchWrapper\";\r\n\r\nconst systemControlRequestType = 'SYSTEMCONTROL_REQUEST';\r\nconst systemControlSuccessType = 'SYSTEMCONTROL_SUCCESS';\r\nconst systemControlFailureType = 'SYSTEMCONTROL_FAILURE';\r\n\r\nlet systemControl = JSON.parse(localStorage.getItem('systemControl'));\r\n\r\nconst initialState = {\r\n configuration: systemControl || { companyName: \" \" },\r\n isLoading: false\r\n};\r\n\r\nexport const systemControlActions = {\r\n get,\r\n getLocal,\r\n getStartUp\r\n};\r\n\r\nfunction get() {\r\n\treturn (dispatch, getState) => {\r\n\t\tif (!getState().clientConfiguration.config.endpoint)\r\n\t\t\treturn;\r\n\r\n\t\tdispatch(_request());\r\n\r\n const url = getState().clientConfiguration.config.endpoint + \"/systemcontrol\";\r\n const ticket = getState().authentication.user.ticket;\r\n\r\n fetchActions.get(url, ticket)\r\n\t\t\t.then(\r\n\t\t\t\tresponse => {\r\n\t\t\t\t\tvar configuration = response.data;\r\n\t\t\t\t\tlocalStorage.setItem('systemControl', JSON.stringify(configuration));\r\n\t\t\t\t\tdispatch(_success(configuration));\r\n\t\t\t\t},\r\n\t\t\t\terror => {\r\n\t\t\t\t\tvar message = `Could not get system control information: ${error}`;\r\n\t\t\t\t\tdispatch(_failure(message));\r\n\t\t\t\t\tdispatch(alertActions.error(message));\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t};\r\n\r\n\tfunction _request(configuration) { return { type: systemControlRequestType, configuration }; }\r\n\tfunction _success(configuration) { return { type: systemControlSuccessType, configuration }; }\r\n\tfunction _failure(error) { return { type: systemControlFailureType, error }; }\r\n}\r\n\r\nfunction getLocal() {\r\n return systemControl;\r\n}\r\n\r\n/*This function will get the startup settings i.e. cut down system control*/\r\nfunction getStartUp() {\r\n return (dispatch, getState) => {\r\n if (!getState().clientConfiguration.config.endpoint)\r\n return;\r\n\r\n dispatch(_request());\r\n\r\n const url = getState().clientConfiguration.config.endpoint + \"/systemcontrol?initLoad=true\";\r\n const ticket = ''; //Ticket will be blank as we have signed in yet\r\n\r\n fetchActions.get(url, ticket)\r\n .then(\r\n response => {\r\n var configuration = response.data;\r\n localStorage.setItem('systemControl', JSON.stringify(configuration));\r\n dispatch(_success(configuration));\r\n },\r\n error => {\r\n var message = `Could not get system control information: ${error}`;\r\n dispatch(_failure(message));\r\n dispatch(alertActions.error(message));\r\n }\r\n );\r\n };\r\n\r\n function _request(configuration) { return { type: systemControlRequestType, configuration }; }\r\n function _success(configuration) { return { type: systemControlSuccessType, configuration }; }\r\n function _failure(error) { return { type: systemControlFailureType, error }; }\r\n}\r\n\r\nexport const reducer = (state, action) => {\r\n\tstate = state || initialState;\r\n\r\n\tif (action.type === systemControlRequestType) {\r\n return { ...state, isLoading: true };\r\n\t}\r\n\r\n\tif (action.type === systemControlSuccessType) {\r\n return { ...state, configuration: action.configuration, isLoading: false };\r\n\t}\r\n\r\n\tif (action.type === systemControlFailureType) {\r\n return { ...state, isLoading: false };\r\n\t}\r\n\treturn state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Lifetime \r\n// Details: Lifetime store\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n//-------------------------------------------------------\r\n*/\r\nimport { systemControlActions } from './SystemControl';\r\n\r\nexport const lifetimeActions = {\r\n\tonLogIn,\r\n\tonLogOut\r\n};\r\n\r\nfunction onLogIn() {\r\n\t// These actions get run when the user successfully logs in as \r\n\t// they require a valid authentication token\r\n\treturn (dispatch) => {\r\n dispatch(systemControlActions.get());\r\n\r\n\t};\r\n}\r\n\r\nfunction onLogOut() {\r\n\tlocalStorage.removeItem('user');\r\n\tlocalStorage.removeItem('systemControl');\r\n}","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Authenticate\r\n// Details: Authenticate store\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n// 106821 13/03/20 AJ M01 Added ClientCode to login\r\n//-------------------------------------------------------\r\n*/\r\nimport { history } from '../history';\r\nimport { fetchActions } from \"../FetchWrapper\";\r\nimport { lifetimeActions } from './Lifetime';\r\n\r\nexport const loginRequestType = 'LOGIN_REQUEST';\r\nexport const loginSuccessType = 'LOGIN_SUCCESS';\r\nexport const loginAuthenticationRequiredType = \"LOGIN_AUTHENTICATION_REQUIRED\";\r\nexport const loginFailureType = 'LOGIN_FAILURE';\r\n\r\nexport const authenticationRequestType = 'AUTHENTICATION_REQUEST';\r\n\r\nexport const logoutRequestType = 'LOGOUT_REQUEST';\r\nexport const logoutSuccessType = 'LOGOUT_SUCCESS';\r\nexport const logoutFailureType = 'LOGOUT_FAILURE';\r\n\r\nlet user = JSON.parse(localStorage.getItem('user'));\r\n\r\nconst initialState = user\r\n\t? {\r\n\t\tloggedIn: !user.isAuthenticationRequired ,\r\n\t\tuser,\r\n\t\tloggingOut: false\r\n\t}\r\n\t: {\r\n\t\tloggedIn: false,\r\n\t\tloggingOut: false\r\n\t};\r\n\r\nexport const userActions = {\r\n\tlogin,\r\n\tauthenticate,\r\n\tloginCompleted,\r\n\tlogout,\r\n\tsessionExpired\r\n};\r\n\r\nfunction login(userCode, password, clientCode) { //M01\r\n\treturn (dispatch, getState) => {\r\n\t\tdispatch(_loginRequest());\r\n\r\n\t\tconst url = getState().clientConfiguration.config.endpoint + \"/sessions/login\";\r\n\t\tconst data = { user: userCode, password: password, portaltype: 3, clientCode: clientCode }; //M01\r\n\r\n\t\tfetchActions.post(url, null, data)\r\n\t\t\t.then(\r\n\t\t\t\tresponse => {\r\n\t\t\t\t\tlet user = response.data;\r\n\t\t\t\t\t// login successful if there's a token in the response\r\n\t\t\t\t\tif (user.ticket) {\r\n\t\t\t\t\t\t// store user details and token in local storage to keep user logged in between page refreshes\r\n\t\t\t\t\t\tlocalStorage.setItem('user', JSON.stringify(user));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (user.isAuthenticationRequired) {\r\n\t\t\t\t\t\tdispatch(_authenticationRequired(user));\r\n\t\t\t\t\t\thistory.push('/authenticate');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatch(_loginSuccess(user));\r\n\t\t\t\t\t\thistory.push('/');\r\n\t\t\t\t\t\tdispatch(lifetimeActions.onLogIn());\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\terror => {\r\n\t\t\t\t\tvar message = `Could not log in: ${error.message}`;\r\n\t\t\t\t\tdispatch(_loginFailure(message));\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t};\r\n}\r\n\r\nfunction authenticate(accessCode) {\r\n\treturn (dispatch, getState) => {\r\n\t\tdispatch(_authenicationRequest());\r\n\r\n\t\tconst url = getState().clientConfiguration.config.endpoint + \"/sessions/authenticate\";\r\n\t\tconst data = { accessCode: accessCode };\r\n\t\tconst ticket = getState().authentication.user.ticket;\r\n\r\n\t\tfetchActions.post(url, ticket, data)\r\n\t\t\t.then(\r\n\t\t\t\tresponse => {\r\n\t\t\t\t\tlet user = response.data;\r\n\t\t\t\t\t// store user details and token in local storage to keep user logged in between page refreshes\r\n\t\t\t\t\tif (user.ticket) {\r\n\t\t\t\t\t\t// store user details and token in local storage to keep user logged in between page refreshes\r\n\t\t\t\t\t\tlocalStorage.setItem('user', JSON.stringify(user));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (user.isAuthenticationRequired) {\r\n\t\t\t\t\t\tdispatch(_authenticationRequired(user));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatch(_loginSuccess(user));\r\n\t\t\t\t\t\thistory.push('/');\r\n\t\t\t\t\t\tdispatch(lifetimeActions.onLogIn());\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\terror => {\r\n\t\t\t\tif (error.sessionExpired) {\r\n\t\t\t\t\tdispatch(sessionExpired());\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar message = `Could not authenticate: ${error.message}`;\r\n\t\t\t\t\tdispatch(_loginFailure(message));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n}\r\n\r\nfunction loginCompleted() {\r\n\treturn (dispatch, getState) => {\r\n\t\tlet user = { ...getState().authentication.user };\r\n\t\tuser.isAuthenticationRequired = false;\r\n\t\tlocalStorage.setItem('user', JSON.stringify(user));\r\n\r\n\t\tdispatch(_loginCompleted(user));\r\n\t\tdispatch(lifetimeActions.onLogIn());\r\n\t};\r\n\r\n\tfunction _loginCompleted(user) { return { type: loginSuccessType, user: user }; }\r\n}\r\n\r\nfunction logout() {\r\n\treturn (dispatch, getState) => {\r\n\t\tdispatch(_logoutRequest());\r\n\r\n\t\tconst url = getState().clientConfiguration.config.endpoint + \"/sessions/logout\";\r\n\t\tconst ticket = getState().authentication.user.ticket;\r\n\r\n\t\tfetchActions.post(url, ticket)\r\n\t\t\t.then(\r\n\t\t\t\t() => {\r\n\t\t\t\t\tdispatch(_loggedout());\r\n\t\t\t\t},\r\n\t\t\t\terror => {\r\n\t\t\t\t\tif (error.sessionExpired) {\r\n\t\t\t\t\t\t// Log out failed as session expired? This is somewhat ironic...\r\n\t\t\t\t\t\t// go ahead and finish log out anyway as session is already invalidated\r\n\t\t\t\t\t\tdispatch(_loggedout());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tvar message = `Could not log out: ${error.message}`;\r\n\t\t\t\t\t\tdispatch(_logoutFailure(message));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t};\r\n}\r\n\r\nfunction sessionExpired() {\r\n\treturn (dispatch) => {\r\n\t\tdispatch(_loggedout());\r\n\t};\r\n\r\n\tfunction _loggedout() { return { type: logoutSuccessType, message: \"Your session has expired. Please log in again to continue\" }; }\r\n}\r\n\r\nfunction _loginRequest() { return { type: loginRequestType }; }\r\nfunction _authenicationRequest() { return { type: authenticationRequestType }; }\r\nfunction _authenticationRequired(user) { return { type: loginAuthenticationRequiredType, user }; }\r\nfunction _loginSuccess(user) { return { type: loginSuccessType, user }; }\r\nfunction _loginFailure(error) { return { type: loginFailureType, error }; }\r\n\r\nfunction _logoutRequest() { return { type: logoutRequestType }; }\r\nfunction _loggedout() { return { type: logoutSuccessType }; }\r\nfunction _logoutFailure(error) { return { type: logoutFailureType, error }; }\r\n\r\nexport const reducer = (state, action) => {\r\n\tstate = state || initialState;\r\n\r\n\t// Login\r\n\r\n\tif (action.type === loginRequestType) {\r\n\t\treturn { loggingIn: true, loggedIn: false, error: undefined };\r\n\t}\r\n\r\n\tif (action.type === loginSuccessType) {\r\n\t\treturn { ...state, loggingIn: false, loggedIn: true, user: action.user, error: undefined };\r\n\t}\r\n\r\n if (action.type === loginFailureType) {\r\n return { ...state, loggingIn: false, error: action.error };\r\n }\r\n\r\n\t// Authentication\r\n\r\n\tif (action.type === authenticationRequestType) {\r\n\t\treturn { ...state, loggingIn: true, loggedIn: false, error: undefined };\r\n\t}\r\n\r\n\tif (action.type === loginAuthenticationRequiredType) {\r\n\t\treturn { ...state, loggingIn: false, loggedIn: false, user: action.user, error: action.error };\r\n\t}\r\n\r\n\t// Logout\r\n\r\n\tif (action.type === logoutRequestType) {\r\n\t\treturn { ...state, loggingOut: true, error: undefined };\r\n\t}\r\n\r\n\tif (action.type === logoutFailureType) {\r\n\t\treturn { ...state, loggingOut: false, error: action.error };\r\n\t}\r\n\r\n\t// Note: The LOGOUT_SUCCESS action is not required to be handled here as it's intercepted by the root reducer in configureStore.js\r\n\t// (It will still make it here but the application state is nerfed by the time we see it so there is no need)\r\n\r\n\treturn state;\r\n};","const printViewShow = 'ALERT_SUCCESS';\r\nconst printViewHide = 'ALERT_CLEAR';\r\n\r\nconst initialState = {\r\n\titem: undefined\r\n};\r\n\r\nexport const printViewActions = {\r\n\tshow,\r\n\thide\r\n};\r\n\r\nfunction show(item) {\r\n\treturn { type: printViewShow, item };\r\n}\r\n\r\nfunction hide() {\r\n\treturn { type: printViewHide };\r\n}\r\n\r\n\r\nexport const reducer = (state, action) => {\r\n\tstate = state || initialState;\r\n\r\n\tif (action.type === printViewShow) {\r\n\t\treturn { ...state, item: action.item };\r\n\t}\r\n\r\n\tif (action.type === printViewHide) {\r\n\t\treturn { ...state, item: undefined };\r\n\t}\r\n\r\n\treturn state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Sites\r\n// Details: Sites store - list of sites as items\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 106821 23/03/20 AJ New\r\n//-------------------------------------------------------\r\n*/\r\nimport { fetchActions } from \"../FetchWrapper\";\r\nimport { userActions } from './Authentication';\r\n\r\nconst sitesRequestType = 'SITES_REQUEST';\r\nconst sitesSuccessType = 'SITES_SUCCESS';\r\nconst sitesFailureType = 'SITES_FAILURE';\r\n\r\nconst initialState = {\r\n items: [],\r\n canRequest: true,\r\n error: undefined,\r\n isLoading: false,\r\n selectedSiteId: 0\r\n};\r\n\r\nexport const sitesActions = {\r\n getForClientCode\r\n};\r\n\r\nfunction getForClientCode(clientCode)\r\n{\r\n return (dispatch, getState) => {\r\n if (!getState().sites.canRequest)\r\n return;\r\n\r\n dispatch(refreshQV(clientCode));\r\n };\r\n}\r\n\r\nfunction refreshQV(clientCode)\r\n{\r\n return (dispatch, getState) => {\r\n\r\n if (!getState().clientConfiguration.isLoaded)\r\n return;\r\n\r\n if (!getState().clientConfiguration.config.endpoint && !getState().authentication.user)\r\n return;\r\n\r\n if (clientCode === '')\r\n return;\r\n\r\n dispatch(_request());\r\n\r\n const url = getState().clientConfiguration.config.endpoint + \"/Sites/GetForQV\";\r\n const query = `?clientCode=${clientCode}`;\r\n\r\n const ticket = getState().authentication.user !== undefined ? getState().authentication.user.ticket : ''; //We may not be logged in, Quick view does not require the user to be logged in\r\n\r\n fetchActions.get(url + query, ticket)\r\n .then(\r\n response => {\r\n\r\n\r\n dispatch(_success(response.data));\r\n \r\n \r\n\r\n },\r\n error => {\r\n if (error.sessionExpired)\r\n {\r\n dispatch(userActions.sessionExpired());\r\n }\r\n else\r\n {\r\n var message = `Could not get sites: ${ error.message}`;\r\n dispatch(_failure(message));\r\n }\r\n }\r\n );\r\n };\r\n\r\n function _request() { return { type: sitesRequestType }; }\r\n function _success(items) { return { type: sitesSuccessType, items}; }\r\n function _failure(error) { return { type: sitesFailureType, error }; }\r\n}\r\n\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n\r\n //get/request\r\n\r\n if (action.type === sitesRequestType)\r\n {\r\n return { ...state, isLoading: true, canInitialRequest: false, error: undefined, items: []};\r\n }\r\n\r\n if (action.type === sitesSuccessType)\r\n {\r\n \r\n return { ...state, isLoading: false, canInitialRequest: false, items: action.items };\r\n }\r\n\r\n if (action.type === sitesFailureType)\r\n {\r\n return { ...state, isLoading: false, error: action.error};\r\n }\r\n\r\n return state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: ClientRegistrations\r\n// Details: Client Registrations store - list of client registrations as items\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 106821 20/03/20 AJ New\r\n//-------------------------------------------------------\r\n*/\r\nimport { fetchActions } from \"../FetchWrapper\";\r\nimport { userActions } from './Authentication';\r\nimport { sitesActions } from './Sites';\r\n\r\nconst clientRegistrationsRequestType = 'CLIENTREGISTRATIONS_REQUEST';\r\nconst clientRegistrationsSuccessType = 'CLIENTREGISTRATIONS_SUCCESS';\r\nconst clientRegistrationsFailureType = 'CLIENTREGISTRATIONS_FAILURE';\r\n\r\nconst initialState = {\r\n items: [],\r\n canRequest: true,\r\n error: undefined,\r\n isLoading: false\r\n};\r\n\r\nexport const clientRegistrationsActions = {\r\n getForQV\r\n};\r\n\r\nfunction getForQV(clientCode)\r\n{\r\n return (dispatch, getState) => {\r\n if (!getState().clientRegistrations.canRequest)\r\n return;\r\n\r\n dispatch(refreshQV(clientCode));\r\n };\r\n}\r\n\r\nfunction refreshQV(clientCode)\r\n{\r\n return (dispatch, getState) => {\r\n\r\n if (!getState().clientConfiguration.isLoaded)\r\n return;\r\n\r\n if (!getState().clientConfiguration.config.endpoint && !getState().authentication.user)\r\n return;\r\n\r\n dispatch(_request());\r\n\r\n const url = getState().clientConfiguration.config.endpoint + \"/ClientRegistrations/GetForQV\";\r\n\r\n const ticket = getState().authentication.user !== undefined ? getState().authentication.user.ticket : ''; //We may not be logged in, Quick view does not require the user to be logged in\r\n\r\n fetchActions.get(url, ticket)\r\n .then(\r\n response => {\r\n dispatch(_success(response.data));\r\n\r\n //Need to see if a clientCode was passed in if it was, need to check that we have the client, if so we then need to get the sites for the client\r\n const clientRegistration = response.data.find(({ code }) => code.toLowerCase() === clientCode.toLowerCase());\r\n if (clientRegistration !== undefined && clientRegistration !== null)\r\n {//Go and get the sites for this client registration\r\n if (getState().sites.canRequest) {\r\n dispatch(sitesActions.getForClientCode(clientCode))\r\n }\r\n }\r\n\r\n },\r\n error => {\r\n if (error.sessionExpired)\r\n {\r\n dispatch(userActions.sessionExpired());\r\n }\r\n else\r\n {\r\n var message = `Could not get client registrations: ${ error.message}`;\r\n dispatch(_failure(message));\r\n }\r\n }\r\n );\r\n };\r\n\r\n function _request() { return { type: clientRegistrationsRequestType }; }\r\n function _success(items) { return { type: clientRegistrationsSuccessType, items}; }\r\n function _failure(error) { return { type: clientRegistrationsFailureType, error }; }\r\n}\r\n\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n\r\n //get/request\r\n\r\n if (action.type === clientRegistrationsRequestType)\r\n {\r\n return { ...state, isLoading: true, canInitialRequest: false, error: undefined, items: []};\r\n }\r\n\r\n if (action.type === clientRegistrationsSuccessType)\r\n {\r\n return { ...state, isLoading: false, canInitialRequest: false, items: action.items};\r\n }\r\n\r\n if (action.type === clientRegistrationsFailureType)\r\n {\r\n return { ...state, isLoading: false, error: action.error};\r\n }\r\n\r\n return state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: WorkbillSchedules\r\n// Details: Workbill Schedules store - list of Workbill Schedules as items\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 106821 20/03/20 AJ New\r\n//-------------------------------------------------------\r\n*/\r\nimport { fetchActions } from \"../FetchWrapper\";\r\nimport { userActions } from './Authentication';\r\nimport moment from 'moment';\r\n\r\nconst WorkbillSchedulesRequestType = 'WORKBILLSCHEDULES_REQUEST';\r\nconst WorkbillSchedulesSuccessType = 'WORKBILLSCHEDULES_SUCCESS';\r\nconst WorkbillSchedulesFailureType = 'WORKBILLSCHEDULES_FAILURE';\r\n\r\nconst initialState = {\r\n qvWeeks: [],\r\n items: [],\r\n canRequest: true,\r\n error: undefined,\r\n isLoading: false\r\n};\r\n\r\nexport const workbillSchedulesActions = {\r\n getForSiteId\r\n};\r\n\r\nfunction getForSiteId(siteId, year, month, activity)\r\n{\r\n return (dispatch, getState) => {\r\n if (!getState().workbillSchedules.canRequest)\r\n return;\r\n\r\n dispatch(refreshQV(siteId, year, month, activity));\r\n };\r\n}\r\n\r\nfunction refreshQV(siteId, year, month, activity)\r\n{\r\n return (dispatch, getState) => {\r\n\r\n if (!getState().clientConfiguration.isLoaded)\r\n return;\r\n\r\n if (!getState().clientConfiguration.config.endpoint && !getState().authentication.user)\r\n return;\r\n\r\n dispatch(_request());\r\n \r\n\r\n //Get the first and last day of the cal, we will start with the first and last day of the month\r\n let firstDayOfTheCal = new Date(year, month, 1);\r\n \r\n\r\n //Need to get the first and last day of the cal, this may not be the actual 1st and last day of the month as we may need to get the preceeding sunday etc\r\n if (firstDayOfTheCal.getDay() !== 1) { //i.e. is not Monday\r\n do {\r\n firstDayOfTheCal.setDate(firstDayOfTheCal.getDate() - 1);\r\n }\r\n while (firstDayOfTheCal.getDay() !== 1);\r\n }\r\n\r\n \r\n\r\n let weeks = [];\r\n let nweekNumber = 0;\r\n let dweekStartDate = new Date(firstDayOfTheCal.getFullYear(), firstDayOfTheCal.getMonth(), firstDayOfTheCal.getDate() - 7); //Remove a week as we will simply add it straight back on in the loop\r\n // construct the weeks (always 6) \r\n do {\r\n\r\n\r\n weeks.push({\r\n weekNumber: nweekNumber++,\r\n weekStartDate: dweekStartDate.setDate(dweekStartDate.getDate() + 7) //Increment a week\r\n })\r\n\r\n }\r\n while (nweekNumber <= 5);\r\n\r\n var dLastDayOfTheCal = new Date();\r\n if (weeks !== undefined && weeks.length === 6) {\r\n //Get the last week start date\r\n dLastDayOfTheCal = new Date(weeks[5].weekStartDate);\r\n //Add 6 days to get the laste date of the last week\r\n dLastDayOfTheCal = new Date(dLastDayOfTheCal.setDate(dLastDayOfTheCal.getDate() + 6));\r\n }\r\n\r\n const url = getState().clientConfiguration.config.endpoint + \"/WorkbillSchedules/GetForQV\";\r\n const query = `?siteId=${siteId}&dateFrom=${firstDayOfTheCal.getFullYear().toString()}/${(firstDayOfTheCal.getMonth() + 1).toString()}/${firstDayOfTheCal.getDate().toString()}&dateTo=${dLastDayOfTheCal.getFullYear().toString()}/${(dLastDayOfTheCal.getMonth() + 1).toString()}/${dLastDayOfTheCal.getDate().toString()}&activity=${encodeURIComponent(activity)}`;\r\n const ticket = getState().authentication.user !== undefined ? getState().authentication.user.ticket : ''; //We may not be logged in, Quick view does not require the user to be logged in\r\n\r\n\r\n fetchActions.get(url + query, ticket)\r\n .then(\r\n response => {\r\n\r\n //This will map the weeks\r\n weeks = mapWeeks(weeks, response.data, activity);\r\n\r\n dispatch(_success(response.data, weeks));\r\n\r\n },\r\n error => {\r\n if (error.sessionExpired)\r\n {\r\n dispatch(userActions.sessionExpired());\r\n }\r\n else\r\n {\r\n var message = `Could not get workbill schedules: ${ error.message}`;\r\n dispatch(_failure(message));\r\n }\r\n }\r\n );\r\n };\r\n\r\n function _request() { return { type: WorkbillSchedulesRequestType }; }\r\n function _success(items, weeks) { return { type: WorkbillSchedulesSuccessType, items, weeks}; }\r\n function _failure(error) { return { type: WorkbillSchedulesFailureType, error }; }\r\n\r\n function mapWeeks(weeks, scheduleItems, activity) {\r\n if (weeks.length !== 0) {\r\n const weekStart = moment(weeks[0].weekStartDate);\r\n const actualMonth = weekStart.add(7, \"days\").month();\r\n const today = moment();\r\n\r\n return weeks.map((week, i) => {\r\n const date = moment(week.weekStartDate);\r\n\r\n var days = [];\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n date.add(1, \"days\");\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n date.add(1, \"days\");\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n date.add(1, \"days\");\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n date.add(1, \"days\");\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n state: { 'backgroundColour': 'red' },\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n date.add(1, \"days\");\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n date.add(1, \"days\");\r\n\r\n days.push({\r\n date: date.clone().format(),\r\n stateClass: findWorkbillScheduleItemState(scheduleItems, date),\r\n isInMonth: date.month() === actualMonth,\r\n isToday: date.isSame(today, 'day')\r\n });\r\n\r\n return {\r\n weekStartDate: week.weekStartDate,\r\n weekNumber: week.weekNumber,\r\n days: days\r\n };\r\n });\r\n }\r\n\r\n function findWorkbillScheduleItemState(scheduleItems, dateToCheck) {\r\n //Find the schedule item state and return it\r\n let itemStateClass = '';\r\n //Find the schedule items for the activity and also the date we are checking\r\n let workbillSchedule = scheduleItems.find(({ dateFrom }) => new Date(new Date(dateFrom).getFullYear(), new Date(dateFrom).getMonth(), new Date(dateFrom).getDate()).toString() === new Date(dateToCheck._d.getFullYear(), dateToCheck._d.getMonth(), dateToCheck._d.getDate()).toString());\r\n if (workbillSchedule !== undefined) {\r\n itemStateClass = workbillSchedule.stateClass;\r\n }\r\n //Return the state class\r\n return itemStateClass;\r\n }\r\n\r\n }\r\n\r\n}\r\n\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n\r\n //get/request\r\n\r\n if (action.type === WorkbillSchedulesRequestType)\r\n {\r\n return { ...state, isLoading: true, canInitialRequest: false, error: undefined, items: []};\r\n }\r\n\r\n if (action.type === WorkbillSchedulesSuccessType)\r\n {\r\n return { ...state, isLoading: false, canInitialRequest: false, items: action.items, qvWeeks: action.weeks};\r\n }\r\n\r\n if (action.type === WorkbillSchedulesFailureType)\r\n {\r\n return { ...state, isLoading: false, error: action.error};\r\n }\r\n\r\n return state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: WorkbillActivities\r\n// Details: Workbill Activities store - list of Workbill Activities as items\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 106821 20/03/20 AJ New\r\n//-------------------------------------------------------\r\n*/\r\nimport { fetchActions } from \"../FetchWrapper\";\r\nimport { userActions } from './Authentication';\r\n\r\n\r\nconst WorkbillActivitiesRequestType = 'WORKBILLACTIVITIES_REQUEST';\r\nconst WorkbillActivitiesSuccessType = 'WORKBILLACTIVITIES_SUCCESS';\r\nconst WorkbillActivitiesFailureType = 'WORKBILLACTIVITIES_FAILURE';\r\n\r\nconst initialState = {\r\n items: [],\r\n canRequest: true,\r\n error: undefined,\r\n isLoading: false\r\n};\r\n\r\nexport const workbillActivitesActions = {\r\n getActivitiesForSiteId\r\n};\r\n\r\nfunction getActivitiesForSiteId(siteId)\r\n{\r\n return (dispatch, getState) => {\r\n if (!getState().workbillSchedules.canRequest)\r\n return;\r\n\r\n dispatch(refresh(siteId));\r\n };\r\n}\r\n\r\nfunction refresh(siteId)\r\n{\r\n return (dispatch, getState) => {\r\n\r\n if (!getState().clientConfiguration.isLoaded)\r\n return;\r\n\r\n if (!getState().clientConfiguration.config.endpoint && !getState().authentication.user)\r\n return;\r\n\r\n dispatch(_request());\r\n\r\n const url = getState().clientConfiguration.config.endpoint + \"/WorkbillActivities/Get\";\r\n const query = `?siteId=${siteId}`;\r\n const ticket = getState().authentication.user !== undefined ? getState().authentication.user.ticket : ''; //We may not be logged in, Quick view does not require the user to be logged in\r\n\r\n fetchActions.get(url + query, ticket)\r\n .then(\r\n response => {\r\n\r\n dispatch(_success(response.data));\r\n\r\n \r\n \r\n\r\n },\r\n error => {\r\n if (error.sessionExpired)\r\n {\r\n dispatch(userActions.sessionExpired());\r\n }\r\n else\r\n {\r\n var message = `Could not get workbill activities: ${ error.message}`;\r\n dispatch(_failure(message));\r\n }\r\n }\r\n );\r\n };\r\n\r\n function _request() { return { type: WorkbillActivitiesRequestType }; }\r\n function _success(items) { return { type: WorkbillActivitiesSuccessType, items}; }\r\n function _failure(error) { return { type: WorkbillActivitiesFailureType, error }; }\r\n}\r\n\r\n\r\nexport const reducer = (state, action) => {\r\n state = state || initialState;\r\n\r\n //get/request\r\n\r\n if (action.type === WorkbillActivitiesRequestType)\r\n {\r\n return { ...state, isLoading: true, canInitialRequest: false, error: undefined, items: []};\r\n }\r\n\r\n if (action.type === WorkbillActivitiesSuccessType)\r\n {\r\n return { ...state, isLoading: false, canInitialRequest: false, items: action.items};\r\n }\r\n\r\n if (action.type === WorkbillActivitiesFailureType)\r\n {\r\n return { ...state, isLoading: false, error: action.error};\r\n }\r\n \r\n\r\n return state;\r\n};","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: ManagerPortal.UI\r\n// Object: PrivateRoute.js\r\n// Details: PrivateRoute component\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 105229 12/03/19 AJ New\r\n// 103839 03/04/20 JC M01 includes method not used in IE11 so would error before even telling user IE11 not compatible!\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Route, Redirect } from 'react-router-dom';\r\n\r\nexport const PrivateRoute = ({ component: Component, ...rest }) =>\r\n\t (\r\n\t\t//M01 localStorage.getItem('user') || props.match.url.includes('/quickview') /*Have the user object in local storage i.e. signed in or we are trying to access the quick view*/\r\n localStorage.getItem('user') || props.match.url.indexOf('/quickview') > -1 /*Have the user object in local storage i.e. signed in or we are trying to access the quick view M01 */\r\n\t\t\t? \r\n\t\t\t: \r\n\t)}\r\n\t/>;\r\n\r\n\r\nPrivateRoute.propTypes = {\r\n\tlocation: PropTypes.string\r\n};\r\n\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Nav Menu\r\n// Details: Nav Menu\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n//-------------------------------------------------------\r\n*/\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Link } from 'react-router-dom';\r\nimport { Nav, Navbar, NavItem } from 'react-bootstrap';\r\nimport { LinkContainer } from 'react-router-bootstrap';\r\nimport './css/NavMenu.css';\r\n\r\nconst NavMenu = props =>\r\n \r\n \r\n \r\n \"Customer\r\n \r\n \r\n \r\n \r\n {props.companyName && {props.companyName} Customer Portal}\r\n \r\n \r\n \r\n ;\r\n\r\nNavMenu.propTypes = {\r\n companyName: PropTypes.string.isRequired,\r\n user: PropTypes.object\r\n};\r\n\r\n\r\n\r\nexport default NavMenu;","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport './css/TopBar.css';\r\n\r\nconst TopBar = props => (\r\n
\r\n\t\t{props.companyName} Customer Portal\r\n
\r\n);\r\n\r\nTopBar.propTypes = {\r\n\tcompanyName: PropTypes.string.isRequired\r\n};\r\n\r\nexport default TopBar;","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Moment from 'react-moment';\r\n\r\nconst DateTime = props => (\r\n\tprops.date\r\n\t\t? \r\n\t\t: []\r\n);\r\n\r\nDateTime.propTypes = {\r\n\tdate: PropTypes.oneOfType([\r\n\t\tPropTypes.string,\r\n\t\tPropTypes.instanceOf(Date)\r\n\t])\r\n};\r\n\r\nexport default DateTime;","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: ManagerPortal.UI\r\n// Object: PrintViews.js\r\n// Details: PrintView component\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 105229 12/03/19 AJ New\r\n// 103839 03/04/20 JC M01 React upgrade\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { connect } from 'react-redux';\r\nimport DateTime from './DateTime';\r\nimport { Button } from 'react-bootstrap';\r\nimport './css/PrintView.css';\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\nclass PrintView extends Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tthis.state = {\r\n\t\t\texpanded: false\r\n\t\t};\r\n\r\n\t\tthis.handlePrint = this.handlePrint.bind(this);\r\n\t\tthis.handleClose = this.handleClose.bind(this);\r\n\t}\r\n\r\n\thandlePrint = event => {\r\n\t\tevent.preventDefault();\r\n\t\twindow.print();\r\n\t}\r\n\r\n\thandleClose = event => {\r\n\t\tevent.preventDefault();\r\n\t\tthis.props.closeView();\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { item } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n Print\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n Close\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t

{item.subject}

\r\n\t\t\t\t

{item.typeName}

\r\n\t\t\t\t

\r\n\r\n {item.note.split('\\n').map((i, k) => {\r\n return {i}
;\r\n })}\r\n\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nPrintView.propTypes = {\r\n\titem: PropTypes.shape({\r\n\t\tsubject: PropTypes.string,\r\n typeName: PropTypes.string.isRequired,\r\n postedDate: PropTypes.instanceOf(Date),//M01\r\n\t\tnote: PropTypes.string,\r\n\t\titemType: PropTypes.oneOf(['noticeType'])\r\n\t}),\r\n\tcloseView: PropTypes.func.isRequired\r\n};\r\n\r\nexport default connect()(PrintView);\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2049 Templa Computer Systems Ltd\r\n//\r\n// App: EmployeePortal.UI\r\n// Object: AlertPanel.js\r\n// Details: AlertPanel.js\r\n//\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 105066 06/01/20 JC M01 Change remove-format icon to times\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { connect } from 'react-redux';\r\nimport './css/AlertPanel.css';\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\n\r\nclass AlertPanel extends Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.handleClear = this.handleClear.bind(this);\r\n\t}\r\n\r\n\thandleClear = event => {\r\n\t\tevent.preventDefault();\r\n\t\tif (typeof this.props.clear === \"function\") {\r\n\t\t\tthis.props.clear();\r\n\t\t}\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { type, message, clear } = this.props;\r\n\t\tconst hasClear = typeof clear === \"function\";\r\n\r\n\t\treturn(\r\n\t\t\t
\r\n {type === \"danger\" ? : []}\r\n {type === \"info\" ? : []}\r\n {type === \"success\" ? : []}\r\n {type === \"pending\" ? : []}\r\n\t\t\t\t

{message}

\r\n\t\t\t\t{hasClear\r\n ? /* M01 */\r\n\t\t\t\t\t: []}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nAlertPanel.propTypes = {\r\n\ttype: PropTypes.oneOf(['danger', 'info', 'success', 'pending']),\r\n\tmessage: PropTypes.string.isRequired,\r\n\tclear: PropTypes.func\r\n};\r\n\r\n\r\nexport default connect(\r\n\tstate => state\r\n)(AlertPanel);\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Layout\r\n// Details: Layout\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n//-------------------------------------------------------\r\n*/\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Col, Grid, Row } from 'react-bootstrap';\r\nimport NavMenu from './NavMenu';\r\nimport TopBar from './TopBar';\r\nimport PrintView from './PrintView';\r\nimport AlertPanel from '../components/AlertPanel';\r\n\r\nconst Layout = props => (\r\n\tprops.printViewItem\r\n\t\t? \r\n\t\t: \r\n\t\t\t{\r\n\t\t\t\tprops.isNavbarVisible\r\n\t\t\t\t\t? \r\n \r\n \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{props.alerts.map((alert, index) =>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{props.children}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t: \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{props.alerts.map((alert, index) =>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{props.children}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n);\r\n\r\nLayout.propTypes = {\r\n\tprintViewItem: PropTypes.any,\r\n\talerts: PropTypes.arrayOf(PropTypes.any),\r\n\tchildren: PropTypes.any,\r\n\tclear: PropTypes.func.isRequired,\r\n\tcloseView: PropTypes.func.isRequired,\r\n companyName: PropTypes.string.isRequired,\r\n user: PropTypes.object\r\n};\r\n\r\nexport default Layout;","import React from 'react';\r\nimport './css/Loading.css';\r\n\r\nexport default () => (\r\n\t
\r\n\t\t
\r\n\t\t\t\"Loading\"/\r\n\t\t\tLoading...\r\n\t\t
\r\n\t
\r\n);\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: utils.js\r\n// Details: utils class\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 24/09/19 JC New\r\n// 106452 04/03/20 JC M01 Added detectCompatibleBrowser, detectIE\r\n//-------------------------------------------------------\r\n*/\r\n\r\n//import { systemControlActions} from '../store/SystemControl';\r\n\r\nexport const utils = {\r\n truncateDate,\r\n getMondayForDate,\r\n addDays,\r\n toDecimal,\r\n formatNumberValue,\r\n formatCurrencyValue,\r\n detectCompatibleBrowser //M01\r\n};\r\n\r\nfunction truncateDate (date) {\r\n\tlet pos = date.indexOf(\"T\");\r\n\tif (pos !== -1)\r\n\t\treturn date.substr(0, pos);\r\n\treturn date;\r\n}\r\n\r\nfunction getMondayForDate(date) {\r\n //get the Monday for this week\r\n var day = date.getDay()\r\n var diff = date.getDate() - day + (day === 0 ? -6 : 1); // adjust when day is sunday\r\n return new Date(date.setDate(diff));\r\n}\r\n\r\nfunction addDays(date, days) {\r\n const copy = new Date(Number(date))\r\n copy.setDate(date.getDate() + days)\r\n return copy\r\n}\r\n\r\nfunction toDecimal(x) {\r\n return Number.parseFloat(x).toFixed(2)\r\n}\r\n\r\nfunction formatNumberValue(value) {\r\n var numeric = parseFloat(value);\r\n return isNaN(numeric)\r\n ? \"\"\r\n : numeric.toFixed(2);\r\n}\r\n\r\nfunction formatCurrencyValue(value) {\r\n\r\n //get system control\r\n let systemControl = JSON.parse(localStorage.getItem('systemControl'));\r\n\r\n //get the currency symbol, defaulting to a blank string if undefined\r\n let currencySymbol = (systemControl && systemControl.currencySymbol ? systemControl.currencySymbol : \"\")\r\n\r\n //return formating, prefixed with currency symbol\r\n return currencySymbol + formatNumberValue(value); \r\n\r\n}\r\n\r\n// M01 detect compatible browser\r\nfunction detectCompatibleBrowser() {\r\n\r\n //any browser that isn't IE is compatible\r\n return !detectIE()\r\n}\r\n\r\n// #region Private functions\r\n\r\n// M01 detect if IE exists (private)\r\nfunction detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n //commented out as Edge is okay \r\n //var edge = ua.indexOf('Edge/');\r\n //if (edge > 0) {\r\n // // Edge (IE 12+) => return version number\r\n // return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n //}\r\n\r\n // other browser\r\n return false;\r\n}\r\n\r\n// #endregion","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Login\r\n// Details: Login page\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n// 106452 04/03/20 JC M01 Ensure a compatible browser is used\r\n// 106821 13/03/20 AJ M02 Added ClientCode\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport React, { Component } from 'react';\r\nimport { Button, FormGroup, FormControl, ControlLabel, Col } from \"react-bootstrap\";\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { userActions } from '../store/Authentication';\r\nimport { systemControlActions } from '../store/SystemControl';\r\nimport Loading from '../components/Loading';\r\nimport AlertPanel from '../components/AlertPanel';\r\nimport { utils } from '../utils/utils'; //M01\r\nimport { history } from '../history';\r\n\r\nclass Login extends Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tuserCode: '',\r\n\t\t\tpassword: '',\r\n accessCode: '',\r\n browserError: !utils.detectCompatibleBrowser(), //M01 detect compatible browser\r\n clientCode: '' //M02\r\n\t\t};\r\n\r\n\t\tthis.handleChange = this.handleChange.bind(this);\r\n this.handleLogin = this.handleLogin.bind(this);\r\n this.handleQuickView = this.handleQuickView.bind(this);\r\n\r\n if (!this.state.browserError) {\r\n //Get the system control\r\n this.props.getStartUp();\r\n }\r\n\r\n }\r\n\r\n\tvalidateForm() {\r\n\t\treturn this.state.userCode.length > 0\r\n && this.state.password.length > 0\r\n && this.state.clientCode.length > 0; //M02\r\n\t}\r\n\r\n\thandleChange = event => {\r\n\t\tthis.setState({\r\n\t\t\t[event.target.id]: event.target.value\r\n\t\t});\r\n\t}\r\n\r\n\thandleLogin = event => {\r\n event.preventDefault();\r\n //M01 not if there's a browser error\r\n if (!this.state.browserError) {\r\n this.props.login(this.state.userCode, this.state.password, this.state.clientCode); //M02\r\n }\r\n }\r\n\r\n handleQuickView = event => {\r\n event.preventDefault();\r\n history.push('/quickview');\r\n }\r\n\r\n\trender() {\r\n const { authentication, systemControl } = this.props;\r\n const { browserError } = this.state; //M01\r\n return (\r\n \r\n this.props.systemControl.isLoading\r\n ? \r\n :\r\n \r\n
\r\n \"Customer\r\n
\r\n

Log In

\r\n
\r\n {/*M01 browser error exists? //M02 */\r\n browserError ? : []}\r\n {authentication.message ? : []}\r\n {authentication.error ? : []}\r\n\r\n {authentication.loggingIn ? : []}\r\n {!authentication.loggingIn ?\r\n
\r\n \r\n Client code\r\n \r\n \r\n \r\n User code\r\n \r\n \r\n \r\n Password\r\n \r\n \r\n\r\n
\r\n \r\n Log In\r\n\t\t\t\t\t\t\t\r\n\r\n
\r\n {systemControl.configuration && systemControl.configuration.isQuickViewEnabled ?\r\n \r\n Quick View\r\n\t\t\t\t\t\t\t \r\n : []}\r\n \r\n\r\n \r\n : []}\r\n
\r\n \r\n \r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default connect(\r\n state => ({ authentication: state.authentication, alerts: state.alerts.alerts, systemControl: state.systemControl }),\r\n dispatch => bindActionCreators({ ...userActions, ...systemControlActions}, dispatch)\r\n)(Login);","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport './css/Header.css';\r\n\r\nconst Header = props => (\r\n\t
\r\n\t\t

{props.title}

\r\n\t\t{props.children}\r\n\t
\r\n);\r\n\r\nHeader.propTypes = {\r\n\ttitle: PropTypes.string.isRequired,\r\n\tchildren: PropTypes.any\r\n};\r\n\r\nexport default Header;","import React, { Component } from 'react';\r\nimport { Col } from 'react-bootstrap';\r\nimport { Button } from \"react-bootstrap\";\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { userActions } from '../store/Authentication';\r\nimport Header from '../components/Header';\r\nimport AlertPanel from '../components/AlertPanel';\r\nimport Loading from '../components/Loading';\r\n\r\nclass Login extends Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.handleSubmit = this.handleSubmit.bind(this);\r\n\t}\r\n\r\n\thandleSubmit = event => {\r\n\t\tevent.preventDefault();\r\n\r\n\t\t// reset login status\r\n\t\tthis.props.logout();\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { error, loggingOut } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{error ? : []}\r\n\t\t\t\t\t

Do you really want to log out?

\r\n\t\t\t\t\t\t{loggingOut\r\n\t\t\t\t\t\t\t? \r\n\t\t\t\t\t\t\t: \r\n\t\t\t\t\t\t\t\tLog Out\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default connect(\r\n\tstate => state.authentication,\r\n\tdispatch => bindActionCreators(userActions, dispatch)\r\n)(Login);","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: Authenticate\r\n// Details: Authenticate page\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n//-------------------------------------------------------\r\n*/\r\nimport React, { Component } from 'react';\r\nimport { Button, FormGroup, FormControl, ControlLabel, Col } from \"react-bootstrap\";\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { userActions } from '../store/Authentication';\r\nimport Loading from '../components/Loading';\r\nimport AlertPanel from '../components/AlertPanel';\r\n\r\nclass Authenticate extends Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tuserCode: '',\r\n\t\t\tpassword: '',\r\n\t\t\taccessCode: ''\r\n\t\t};\r\n\r\n\t\tthis.handleChange = this.handleChange.bind(this);\r\n\t\tthis.handleAuthenticate = this.handleAuthenticate.bind(this);\r\n\t}\r\n\r\n\tvalidateForm() {\r\n\t\treturn this.state.accessCode.length > 0;\r\n\t}\r\n\r\n\thandleChange = event => {\r\n\t\tthis.setState({\r\n\t\t\t[event.target.id]: event.target.value\r\n\t\t});\r\n\t}\r\n\r\n\thandleAuthenticate = event => {\r\n\t\tevent.preventDefault();\r\n\t\tthis.props.authenticate(this.state.accessCode);\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { authentication } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\"Customer\r\n\t\t\t\t
\r\n\t\t\t\t

Log In

\r\n\t\t\t\t
\r\n\t\t\t\t\t{authentication.message ? : []}\r\n\t\t\t\t\t{authentication.error ? : []}\r\n\r\n\t\t\t\t\t{authentication.loggingIn ? : []}\r\n\t\t\t\t\t{!authentication.loggingIn ?\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t \r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tPIN\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tContinue\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t: []}\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default connect(\r\n\tstate => ({ authentication: state.authentication, alerts: state.alerts.alerts }),\r\n\tdispatch => bindActionCreators(userActions, dispatch)\r\n)(Authenticate);","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: QuickViewOptions\r\n// Details: QuickViewOptions constant\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n//106821 19/03/20 AJ New\r\n//-------------------------------------------------------\r\n*/\r\nexport const quickViewOptions = [\r\n { value: 0, name: 'Workbills' }\r\n];\r\n","import React from 'react';\r\nimport './css/NoItems.css';\r\n\r\nexport default () => (\r\n\tNo items to show.\r\n);\r\n","//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: EmployeePortal.UI\r\n// Object: CalendarDay\r\n// Details: CalendarDay component\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 105229 25/03/20 AJ New\r\n//-------------------------------------------------------\r\n\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { connect } from 'react-redux';\r\nimport Moment from 'react-moment';\r\n\r\nclass CalendarDay extends Component {\r\n \r\n\r\n render() {\r\n \r\n return (\r\n \r\n \r\n {this.props.isInMonth ? [] : }\r\n {this.props.isToday ? : []}\r\n \r\n );\r\n }\r\n}\r\n\r\nCalendarDay.propTypes = {\r\n date: PropTypes.string.isRequired,\r\n isInMonth: PropTypes.bool.isRequired,\r\n isToday: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default connect()(CalendarDay);","//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: EmployeePortal.UI\r\n// Object: Calendar\r\n// Details: Calendar component\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n//105229 25/03/20 AJ New\r\n//-------------------------------------------------------\r\n\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { workbillSchedulesActions } from '../store/WorkbillSchedules';\r\nimport Moment from 'react-moment';\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\"; //M03\r\nimport CalendarDay from './CalendarDay';\r\nimport './css/Calendar.css';\r\nimport './css/NextServicesTable.css';\r\n\r\n\r\nclass Calendar extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n today: new Date()\r\n }\r\n\r\n this.handlePrev = this.handlePrev.bind(this);\r\n this.handleNext = this.handleNext.bind(this);\r\n this.handleWorkbillDateClick = this.handleWorkbillDateClick.bind(this);\r\n this.handleGoToThisMonth = this.handleGoToThisMonth.bind(this);\r\n }\r\n\r\n \r\n\r\n handlePrev = event => {\r\n event.preventDefault();\r\n let { year, month } = this.props;\r\n\r\n month--;\r\n if (month < 1) {\r\n month += 12;\r\n year--;\r\n }\r\n\r\n this.props.onMonthYearChange({ year, month });\r\n }\r\n\r\n handleNext = event => {\r\n event.preventDefault();\r\n let { year, month } = this.props;\r\n\r\n month++;\r\n if (month > 12) {\r\n month -= 12;\r\n year++;\r\n }\r\n\r\n this.props.onMonthYearChange({ year, month });\r\n }\r\n\r\n\r\n handleWorkbillDateClick = event => {\r\n event.preventDefault();\r\n\r\n const sDate = event.target.innerText;\r\n if (sDate !== \"none\") {\r\n const oArray = sDate.split(\"/\");\r\n const month = Number(oArray[1]) - 1;\r\n const year = Number(oArray[2]);\r\n\r\n this.props.onMonthYearChange({ year, month });\r\n }\r\n }\r\n\r\n handleGoToThisMonth = event => {\r\n event.preventDefault();\r\n\r\n //Get todays date and extract the year and month\r\n const month = this.state.today.getMonth();\r\n const year = this.state.today.getFullYear();\r\n //Force the cal to re-render\r\n this.props.onMonthYearChange({ year, month });\r\n \r\n }\r\n\r\n \r\n\r\n render() {\r\n const { isLoading, weeks, year, month, activityObject } = this.props;\r\n const { today } = this.state;\r\n const date = new Date(year.toString(), month.toString(), \"1\");// \"\" + (year < 10 ? \"0\" : \"\") + year + \"-\" + (month < 10 ? \"0\" : \"\") + month + \"-01\";\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 {/*M03*/}\r\n {date.getMonth() === today.getMonth() && date.getFullYear() === today.getFullYear() ? [] : } {/*Show the today button if we are on a month year that is not today*/}\r\n
\r\n \r\n
\r\n {/*M03*/}\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
Last service:
Next service:
Last quality audit:
Last score:
{activityObject.lastWorkbillDate === \"0001-01-01T00:00:00\" ? 'none' : }
{activityObject.nextWorkbillDate === \"0001-01-01T00:00:00\" ? 'none' : }
{activityObject.lastCompletedQADate === \"0001-01-01T00:00:00\" ? 'none' : }
{activityObject.qaScore === '' ? 'none' : activityObject.qaScore}
\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 {weeks.map(week => {\r\n return week.days && week.days.length\r\n ? \r\n {week.days.map(day => {\r\n return (\r\n \r\n );\r\n })}\r\n \r\n : [];\r\n })}\r\n \r\n
Mon
Tue
Wed
Thu
Fri
Sat
Sun
\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
Key
\r\n Pending\r\n\t\t\t\t\t\t\t\r\n Planned\r\n\t\t\t\t\t\t\t\r\n Complete\r\n\t\t\t\t\t\t\t\r\n Cancelled\r\n\t\t\t\t\t\t\t
\r\n
\r\n );\r\n }\r\n}\r\n\r\nCalendar.propTypes = {\r\n weeks: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n days: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n date: PropTypes.string.isRequired,\r\n isInMonth: PropTypes.bool.isRequired,\r\n isToday: PropTypes.bool.isRequired\r\n })\r\n )\r\n })\r\n )\r\n};\r\n\r\nexport default connect(\r\n null,\r\n dispatch => bindActionCreators({ ...workbillSchedulesActions }, dispatch)\r\n)(Calendar);\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2020 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: QuickView\r\n// Details: QuickView page\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 106821 18/03/20 AJ New\r\n// 103839 03/04/20 JC M01 React upgrade\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport React, { Component } from 'react';\r\nimport { Col, Row } from \"react-bootstrap\";\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { quickViewOptions } from '../constants/QuickViewOptions';\r\nimport { clientRegistrationsActions } from '../store/ClientRegistrations';\r\nimport { sitesActions } from '../store/Sites';\r\nimport { workbillSchedulesActions } from '../store/WorkbillSchedules';\r\nimport { workbillActivitesActions } from '../store/WorkbillActivities';\r\nimport Loading from '../components/Loading';\r\nimport NoItems from '../components/NoItems';\r\nimport Calendar from '../components/Calendar';\r\nimport AlertPanel from '../components/AlertPanel';\r\nimport moment from 'moment';\r\nimport '../components/css/ItemsList.css';\r\n\r\n\r\nclass QuickView extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n const today = moment();\r\n\r\n this.state = {\r\n clientCode: '',\r\n siteId: 0,\r\n activityObject: undefined,\r\n activity: '',\r\n quickViewOptions: quickViewOptions,\r\n selectedQuickViewOptions: quickViewOptions[0].value, //Pre-select workbills\r\n allowClientSelection: false,\r\n month: today.month(),\r\n year: today.year()\r\n };\r\n\r\n this.handleQuickViewSelect = this.handleQuickViewSelect.bind(this);\r\n this.handleClientSelect = this.handleClientSelect.bind(this);\r\n this.handleSiteSelect = this.handleSiteSelect.bind(this);\r\n this.handleActivitySelect = this.handleActivitySelect.bind(this);\r\n this.onMonthYearChange = this.onMonthYearChange.bind(this);\r\n this.applyClientSelect = this.applyClientSelect.bind(this);\r\n this.applySiteSelect = this.applySiteSelect.bind(this);\r\n this.applyActivitySelect = this.applyActivitySelect.bind(this);\r\n\r\n }\r\n\r\n //this code is called immediately before mounting occurs, including the render()\r\n //M01 componentWillMount\r\n componentDidMount() {\r\n //Get the client code off of the URL (If one set)\r\n const clientCode = this.props.match.params.clientCode;\r\n\r\n var sClientCode = '';\r\n if (clientCode !== undefined) {\r\n sClientCode = decodeURIComponent(clientCode).toLowerCase();\r\n }\r\n\r\n //Set it in state\r\n this.setState({\r\n clientCode: sClientCode,\r\n allowClientSelection: sClientCode !== '' //Allow client selection if it has not been set via the URL\r\n });\r\n\r\n //Get a list of the clients (client registrations) that are enabled for QV\r\n this.props.getForQV(sClientCode);\r\n\r\n }\r\n\r\n componentDidUpdate() {\r\n\r\n //This will check to see if there is only one client if there is it will auto select it\r\n if (this.state.clientCode === '' && this.props.clientRegistrations !== undefined && this.props.clientRegistrations.items !== undefined && this.props.clientRegistrations.items.length === 1) {\r\n const sClientCode = this.props.clientRegistrations.items[0].code.toLowerCase();\r\n this.applyClientSelect(sClientCode);\r\n }\r\n\r\n //This will check to see if there is only one site if there is it will auto select it\r\n if (this.state.siteId === 0 && this.state.clientCode !== '' && this.props.sites !== undefined && this.props.sites.items !== undefined && this.props.sites.items.length === 1) {\r\n const nselectedSiteId = this.props.sites.items[0].id;\r\n this.applySiteSelect(nselectedSiteId);\r\n }\r\n\r\n //This will check to see if there is only one activity if there is it will auto select it\r\n if (this.state.activity === '' && this.state.siteId !== 0 && this.state.clientCode !== '' && this.props.workbillActivities !== undefined && this.props.workbillActivities.items !== undefined && this.props.workbillActivities.items.length === 1) {\r\n const sActivity = this.props.workbillActivities.items[0].title.toLowerCase();\r\n const oActivityObject = this.props.workbillActivities.items[0];\r\n this.applyActivitySelect(sActivity, oActivityObject);\r\n }\r\n \r\n }\r\n\r\n //handle quick view option select\r\n handleQuickViewSelect = event => {\r\n\r\n var newselectedQuickViewOption = Number(event.target.value);\r\n this.setState({\r\n selectedQuickViewOptions: newselectedQuickViewOption,\r\n });\r\n\r\n }\r\n\r\n //Handle client select\r\n handleClientSelect = event => {\r\n\r\n var newselectedClientCode = event.target.value;\r\n\r\n this.applyClientSelect(newselectedClientCode);\r\n }\r\n\r\n handleSiteSelect = event => {\r\n var newselectedSiteId = event.target.value;\r\n //Delegate\r\n this.applySiteSelect(newselectedSiteId);\r\n }\r\n\r\n applyClientSelect = clientCode => {\r\n //Set in state\r\n this.setState({\r\n clientCode: clientCode,\r\n siteId: 0,\r\n activityObject: undefined,\r\n activity: ''\r\n });\r\n\r\n //Get the sites for the selected client\r\n this.props.getForClientCode(clientCode);\r\n }\r\n\r\n applySiteSelect = siteId => {\r\n //Set in state\r\n this.setState({\r\n siteId: siteId,\r\n activityObject: undefined,\r\n activity: ''\r\n });\r\n\r\n //Get the workbill titles for the selected site Id\r\n this.props.getActivitiesForSiteId(siteId);\r\n }\r\n\r\n handleActivitySelect = event => {\r\n\r\n var selectedActivityObject = undefined;\r\n\r\n if (this.props.workbillActivities !== undefined && this.props.workbillActivities.items !== undefined && this.props.workbillActivities.items.length > 0) {\r\n selectedActivityObject = this.props.workbillActivities.items[event.target.selectedIndex - 1];\r\n }\r\n\r\n var newselectedActivity = event.target.value;\r\n\r\n this.applyActivitySelect(newselectedActivity, selectedActivityObject)\r\n }\r\n\r\n applyActivitySelect = (activity, activityObject) => {\r\n this.setState({\r\n activity: activity,\r\n activityObject: activityObject\r\n });\r\n\r\n //Get the intial weeks for the cal\r\n this.props.getForSiteId(this.state.siteId, this.state.year, this.state.month, activity);\r\n }\r\n\r\n onMonthYearChange = event => {\r\n this.setState({\r\n month: event.month,\r\n year: event.year\r\n });\r\n\r\n this.props.getForSiteId(this.state.siteId, event.year, event.month, this.state.activity);\r\n }\r\n \t\r\n render() {\r\n //Get the state\r\n const { clientCode, siteId, activity, quickViewOptions, selectedQuickViewOptions, allowClientSelection, year, month, activityObject } = this.state;\r\n const { clientRegistrations, sites, workbillSchedules, workbillActivities } = this.props;\r\n \r\n const isLoading = clientRegistrations.isLoading || sites.isLoading || workbillSchedules.isLoading || workbillActivities.isLoading;\r\n \r\n\r\n //Build up the quick view options\r\n let quickViewOptionList = quickViewOptions.length > 0\r\n && quickViewOptions.map((item, i) => {\r\n return (\r\n \r\n )\r\n }, this);\r\n\r\n return (\r\n //isLoading\r\n // ? \r\n // :\r\n
\r\n\r\n {/* header section */}\r\n
\r\n
\r\n \r\n \r\n
\r\n \"Customer\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n {quickViewOptionList}\r\n \r\n \r\n \r\n\r\n {selectedQuickViewOptions === 0 ? /*Is workbill selected if so show the client */\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {clientRegistrations.items.map((registration) => )}\r\n \r\n \r\n \r\n\r\n :\r\n []\r\n }\r\n\r\n {selectedQuickViewOptions === 0 ? /*Is workbill selected */\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {sites.items.map((site) => )}\r\n \r\n \r\n \r\n\r\n :\r\n []\r\n }\r\n\r\n {selectedQuickViewOptions === 0 ? /*Is workbill selected */\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {workbillActivities.items.map((activity) => )}\r\n \r\n \r\n \r\n\r\n :\r\n []\r\n }\r\n\r\n
\r\n
\r\n\r\n {/* schedule details */}\r\n
\r\n {this.props.error ? : []}\r\n\r\n {isLoading ? : []}\r\n {(!isLoading && (workbillSchedules.qvWeeks === undefined || workbillSchedules.qvWeeks.length === 0)) || activity === ''\r\n ? \r\n : \r\n }\r\n
\r\n \r\n
\r\n\r\n );\r\n\t}\r\n}\r\n\r\nexport default connect(\r\n state => state,\r\n dispatch => bindActionCreators({ ...clientRegistrationsActions, ...sitesActions, ...workbillSchedulesActions, ...workbillActivitesActions }, dispatch)\r\n)(QuickView);","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: App\r\n// Details: App\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n//-------------------------------------------------------\r\n*/\r\nimport React, { Component } from 'react';\r\nimport { Route } from 'react-router';\r\nimport { withRouter } from 'react-router-dom';\r\nimport { PrivateRoute } from './components/PrivateRoute';\r\nimport { bindActionCreators } from 'redux';\r\nimport { connect } from 'react-redux';\r\nimport { configActions } from './store/ClientConfiguration';\r\nimport { alertActions } from './store/Alerts';\r\nimport { printViewActions } from './store/PrintView';\r\nimport Layout from './components/Layout';\r\nimport Loading from './components/Loading';\r\nimport Login from './pages/Login';\r\nimport Logout from './pages/Logout';\r\nimport Authenticate from './pages/Authenticate';\r\nimport QuickView from './pages/QuickView';\r\n\r\n\r\nclass App extends Component {\r\n constructor(props) {\r\n super(props);\r\n\r\n props.requestClientConfig();\r\n }\r\n\r\n render() {\r\n\r\n //get the root default path\r\n var rootDefaultPath = Logout;\r\n\r\n if (this.props.systemControl.configuration && this.props.systemControl.configuration.isQuickViewEnabled) {\r\n rootDefaultPath = QuickView;\r\n };\r\n\r\n return (\r\n this.props.clientConfiguration.isLoading\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\nexport default withRouter(connect(\r\n state => state,\r\n dispatch => bindActionCreators({ ...configActions, ...alertActions, ...printViewActions }, dispatch)\r\n)(App));","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport default function register() {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n if (\r\n response.status === 404 ||\r\n response.headers.get('content-type').indexOf('javascript') === -1\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: fontawesome.js\r\n// Details: fontawesome library\r\n// This library allows font awesome icons to be imported once, rather than in each individual class they are required\r\n//\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 24/10/19 JC New\r\n// 105066 06/01/20 JC M01 Change faRemoveFormat to faTimes\r\n//-------------------------------------------------------\r\n*/\r\n\r\n\r\n// import the library\r\nimport { library } from '@fortawesome/fontawesome-svg-core';\r\n\r\n// import your icons\r\nimport {\r\n\r\n faExclamationCircle,\r\n faInfoCircle,\r\n faCheck,\r\n faClock,\r\n faTimes, //M01\r\n\r\n faPrint,\r\n faTimesCircle,\r\n faSearch,\r\n faFile,\r\n\r\n faChevronRight,\r\n faChevronLeft,\r\n faStepForward,\r\n faStepBackward,\r\n\r\n faLock,\r\n faLockOpen,\r\n faUserPlus,\r\n\r\n faPlus,\r\n faArrowUp,\r\n faArrowDown,\r\n faMapPin\r\n \r\n\r\n} from \"@fortawesome/free-solid-svg-icons\";\r\n\r\n\r\n//add to library\r\nlibrary.add(\r\n faExclamationCircle,\r\n faInfoCircle,\r\n faCheck,\r\n faClock,\r\n faTimes, //M01\r\n\r\n faPrint,\r\n faTimesCircle,\r\n faSearch,\r\n faFile,\r\n\r\n faChevronRight,\r\n faChevronLeft,\r\n faStepForward,\r\n faStepBackward,\r\n \r\n faLock,\r\n faLockOpen,\r\n faUserPlus,\r\n\r\n faPlus,\r\n faArrowUp,\r\n faArrowDown,\r\n faMapPin\r\n\r\n // more icons go here\r\n);\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: ManagerPortal.UI\r\n// Object: index.js\r\n// Details: app index\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 105229 12/03/19 AJ New\r\n// 103839 03/04/20 JC M01 React upgrade\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport 'react-app-polyfill/ie11'; //M01\r\nimport 'react-app-polyfill/stable'; //M01\r\nimport 'bootstrap/dist/css/bootstrap.css';\r\nimport 'bootstrap/dist/css/bootstrap-theme.css';\r\nimport './index.css';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\n//M01 import { ConnectedRouter } from 'react-router-redux';\r\nimport { ConnectedRouter } from 'connected-react-router'; //M01\r\nimport { history } from './history';\r\nimport configureStore from './store/configureStore';\r\nimport App from './App';\r\nimport registerServiceWorker from './registerServiceWorker';\r\n//import 'fontawesome';\r\nimport fontawesome from './fontawesome';\r\n\r\n//// Create browser history to use in the Redux store\r\n//const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\n//const history = createBrowserHistory({ basename: baseUrl });\r\n\r\n// Get the application-wide store instance, prepopulating with state from the server where available.\r\nconst initialState = window.initialReduxState;\r\nconst store = configureStore(history, initialState);\r\n\r\nconst rootElement = document.getElementById('root');\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n ,\r\n rootElement);\r\n\r\nregisterServiceWorker();\r\n","/*\r\n//-------------------------------------------------------\r\n// Copyright (c) 2019 Templa Computer Systems Ltd\r\n//\r\n// App: CustomerPortal.UI\r\n// Object: configureStore\r\n// Details: Store configuration\r\n//\r\n// Log Date By Scan Description\r\n// ----- -------- --- ---- ------------------------------\r\n// 103851 23/09/19 JC New\r\n// 103839 03/04/20 JC M01 React upgrade\r\n//-------------------------------------------------------\r\n*/\r\n\r\nimport { applyMiddleware, combineReducers, compose, createStore } from 'redux';\r\nimport thunk from 'redux-thunk';\r\n//M01 import { routerReducer, routerMiddleware } from 'react-router-redux';\r\nimport { connectRouter, routerMiddleware } from 'connected-react-router'; //M01\r\nimport * as ClientConfiguration from './ClientConfiguration';\r\nimport * as Authentication from './Authentication';\r\nimport * as SystemControl from './SystemControl';\r\nimport * as Alerts from './Alerts';\r\nimport * as PrintView from './PrintView';\r\nimport * as ClientRegistrations from './ClientRegistrations';\r\nimport * as Sites from './Sites';\r\nimport * as WorkbillSchedules from './WorkbillSchedules';\r\nimport * as WorkbillActivities from './WorkbillActivities';\r\nimport { lifetimeActions } from './Lifetime';\r\n\r\nexport default function configureStore(history, initialState) {\r\n\tconst reducers = {\r\n\t\tclientConfiguration: ClientConfiguration.reducer,\r\n\t\tauthentication: Authentication.reducer,\r\n systemControl: SystemControl.reducer,\r\n\t\talerts: Alerts.reducer,\r\n printView: PrintView.reducer,\r\n clientRegistrations: ClientRegistrations.reducer,\r\n workbillSchedules: WorkbillSchedules.reducer,\r\n sites: Sites.reducer,\r\n workbillActivities: WorkbillActivities.reducer\r\n\t};\r\n\r\n\tconst middleware = [\r\n\t\tthunk,\r\n\t\trouterMiddleware(history)\r\n\t];\r\n\r\n\t// In development, use the browser's Redux dev tools extension if installed\r\n\tconst enhancers = [];\r\n\tconst isDevelopment = process.env.NODE_ENV === 'development';\r\n if (isDevelopment && typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) {\r\n enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__(\r\n ));\r\n\t}\r\n\r\n const appReducer = combineReducers({\r\n ...reducers,\r\n //M01 routing: routerReducer\r\n router: connectRouter(history) //M01\r\n });\r\n\r\n\tconst rootReducer = (state, action) => {\r\n\t\t// Root reducer watches for the LOGOUT_SUCESS action to reset whole application state.\r\n\t\t// Therefore the LOGOUT_SUCESS action is not required to be handled by the authentication reducer.\r\n\t\t// Yes, reducers shouldn't have a side effect, but I'll make an exception as we're tearing down the app...\r\n\t\tif (action.type === Authentication.logoutSuccessType) {\r\n\t\t\tconst { clientConfiguration } = state;\r\n\t\t\tstate = { ...initialState, clientConfiguration: clientConfiguration, authentication: { message: action.message } };\r\n\t\t\tlifetimeActions.onLogOut();\r\n\t\t}\r\n\t\t// Debugging - show actions and resulting states as they are fired\r\n\t\t// NOTE THAT THE STATE WILL BE AS BEFORE THE ACTION IS DISPATCHED!!\r\n\t\t// console.log({ type: action.type, action, state });\r\n\t\treturn appReducer(state, action);\r\n\t};\r\n\r\n\treturn createStore(\r\n\t\trootReducer,\r\n\t\tinitialState,\r\n\t\tcompose(applyMiddleware(...middleware), ...enhancers)\r\n\t);\r\n}"],"sourceRoot":""}