{"version":3,"sources":["axiosApi.ts","components/Login.tsx","features/ServerSidePaginator/sspAPI.ts","features/ServerSidePaginator/sspSlice.ts","features/ServerSidePaginator/sspSliceSparkles.ts","redux/reducers/isLoadingReducer.ts","redux/reducers/authReducer.ts","redux/store.ts","components/BranchOption.tsx","components/DeptOption.tsx","components/GroupOption.tsx","components/ExGroupOption.tsx","components/EmpStatusOption.tsx","components/EmpDesigOption.tsx","components/EmpList.tsx","components/TwilioAccount.tsx","components/SendButton.tsx","components/ShoutTool.tsx","redux/hooks.ts","components/ShoutHistory.tsx","components/Shout.tsx","components/sparkles/SparklesHistory.tsx","components/sparkles/Sparkles.tsx","components/Account.tsx","components/PrivateRoute.tsx","App.tsx","index.tsx"],"names":["axiosInstance","axios","create","baseURL","process","timeout","headers","localStorage","getItem","refreshTokenDuringRequest","refresh_token","originalRequest","a","refreshToken","response","defaults","data","access","console","log","Promise","reject","post","refresh","setItem","err","interceptors","use","error","config","status","detail","Title","Typography","Text","Login","state","show_error","error_message","undefined","redirectToReferrer","isAuthenticated","is_loading","onFinish","values","handleSubmit","event","setState","username","toLowerCase","password","then","sessionStorage","props","loggedIn","catch","handleFailure","pre_u","REACT_APP_PRELOAD_USER","pre_p","REACT_APP_PRELOAD_PW","this","from","location","pathname","history","push","to","span","offset","level","name","className","initialValues","remember","onFinishFailed","Item","rules","required","message","prefix","UserOutlined","placeholder","value","LockOutlined","type","showIcon","closable","htmlType","loading","icon","LoginOutlined","href","target","rel","Component","fetchCount","amount","resolve","setTimeout","incrementAsync","createAsyncThunk","pageSlice","createSlice","initialState","indexCurrent","urlCurrent","urlNext","urlPrev","pageSize","pageGoto","itemCount","items","reducers","paginationNext","paginationPrev","populateItems","action","payload","results","forEach","o","i","in_date","d_j","JSON","parse","created","now","Date","tz_offset","getTimezoneOffset","next_date","setHours","getHours","time_localize","toLocaleString","year","month","day","hour","hour12","minute","timeZoneName","split","slice","map","el","join","toUpperCase","time_tzabbrev","toString","key","body","message_body","url","s_id","lookup_url","encodeURIComponent","replace","next","previous","count","itemsPerPage","paginationExact","extraReducers","builder","addCase","pending","fulfilled","actions","sparklesPageSlice","sparklesPopulateItems","obj","v","k","reverse","item","index","isLoadingDept","isLoadingEmpDesig","isLoadingGroup","isLoadingExGroup","isLoadingReducer","isLoadingEmpStatus","auth","isAuthReducer","store","configureStore","reducer","sspSparkles","sspSparklesReducer","ssp","sspReducer","isLoading","isAuth","authReducer","decode_token_extra_data","token","payload_base64","payload_json","atob","exd","BranchOption","selected","handleChange","e","dispatchLoading","onChange","load","default_exclude_branches","excbranches","res","obj_clean","branches","length","includes","branch_id","stringify","dispatch","options","d","Button","branch_name","placement","title","Group","defaultValue","style","width","Option","Select","DeptOption","branchID","departments","prevProps","department_id","department_name","mode","filterOption","input","option","children","indexOf","optionFilterProp","allowClear","disabled","GroupOption","groups","group_id","group_name","ExGroupOption","default_exclude_groups","excgroups","EmpStatusOption","empstatuses","presets","curStatus","employee_status_name","EmpDesigOption","empdesigs","designation_name","showSearch","EmpList","generate","searchText","searchedColumn","selectedItems","unselectedItems","button","selected_emp_deets","empDeets","empDeetsMSRef","createRef","branchOptionRef","searchInputRef","updateSelectedEmpDeets","prevState","handleSearch","selectedKeys","confirm","dataIndex","handleReset","clearFilters","generateList","excluded_ids","selected_ids","branch","dept","ex_groups","empStatuses","empDesig","emp_list","newSelectedItems","newUnselectedItems","entries","employee_phone_main","employee_id","selected_count","loadSuccces","clearTable","EmpListTable","document","getElementById","datasource","handleDetailsSwitch","getColumnSearchProps","indexName","filterDropdown","setSelectedKeys","padding","ref","onPressEnter","marginBottom","display","onClick","SearchOutlined","size","marginRight","filterIcon","filtered","color","onFilter","record","temp","onFilterDropdownVisibleChange","visible","current","select","render","text","highlightStyle","backgroundColor","searchWords","autoEscape","textToHighlight","handleOverrideSelectAll","selectedRows","changeRows","Array","handleOverrideSelectNone","selecteselected","selectedRowKeys","handleSelect","newArray","splice","handleSelectAll","recRemove","success","polyColumnSorter","b","callback","update","employeesmscolumns","sorter","employee_first_name","employee_last_name","c","employee_link","employee_ac_id","employee_job_title","rowSelection","onSelect","onSelectAll","getCheckboxProps","gutter","SettingFilled","id","columns","dataSource","rowKey","pagination","position","sortDirections","connect","TwilioAccount","currency","balance","phone_number","testing","testing_number","twilio_account","us","ca","au","is_twilio_testing","onCharLimitLoad","calcMessageLimit","message_segment_limit","segments","calcUsedChars","char_count","message_char_count","char_count_with_header","Math","ceil","statistics","precision","active","justify","selected_recepient_count","TextArea","Input","SendButton","staging","send_success","textArea","sendList","show_alert","handleSendResult","alert_message","onSend","handleStaging","onStage","handleMessageChange","messageLength","fakeIt","setValue","maxLength","character_limit","autoSize","checked","onConfirm","okText","cancelText","SendOutlined","ShoutTool","branches_loading","sendButtonRef","empListRef","deptOptionRef","groupsOptionRef","exGroupsOptionRef","empStatOptionRef","updateSelected","updateExcluded","updateLoading","loadingState","updateSMSCharCount","updateSelectedCount","updateCharacterLimit","handleSend","msg","clearFields","strong","useAppDispatch","useDispatch","useAppSelector","useSelector","modalContext","React","createContext","Consumer","ShoutHistory","useState","setLoading","pageNumber","setPageNumber","setPageSize","Modal","useModal","contextHolder","useEffect","urlPath","queryArgs","get","statusText","loadFail","warning","Provider","expandable","expandedRowRender","phone_list","rowExpandable","defaultCurrent","total","page","TabPane","Tabs","Shout","new_entry","current_tab","ShoutToolRef","changeTab","newTab","sendSuccess","defaultActiveKey","activeKey","onTabClick","tab","HistoryOutlined","SparklesHistory","Sparkles","onSparkleUpdate","sparkle_id","j","sparkle_enabled","enabled","onNotifUpdate","notif_id","sparkles","sparkle_index","sparkle","notif_index","notifications","notif","notification_id","notification_enabled","schedule","cronstrue","run_schedule","parser","parseExpression","weekday","description","onCancel","r","notes","n","formItemLayout","tailFormItemLayout","Account","alert_type","current_password","curr_pw","new_password","new_pw","new_password_confirm","new_pw_confirm","errorInfo","ghost","onBack","window","back","subTitle","scrollToFirstError","hasFeedback","Password","getFieldValue","validator","rule","dependencies","PrivateRoute","exact","path","Header","Layout","Content","Footer","Sider","App","selectedMenuItem","defaultSelectedMenuItem","countryCode","handleLogout","removeItem","loginStatus","tokenExpiration","jwtDecode","exp","dateNow","getTime","onMenuSelect","deskcontactwidget","getElementsByTagName","createElement","async","src","basehref","parentNode","insertBefore","addEventListener","t","HTMLElement","height","min","innerHeight","installHelpDeskWidget","breakpoint","collapsedWidth","theme","defaultSelectedKeys","ItemGroup","SoundOutlined","ClockCircleOutlined","LogoutOutlined","flex","TeamOutlined","UnorderedListOutlined","margin","minHeight","textAlign"],"mappings":"kRAMMA,E,OAAgBC,EAAMC,OAAO,CACjCC,QAASC,yEACTC,QAAS,IACTC,QAAS,CACP,cAAiBC,aAAaC,QAAQ,gBAAkB,OAASD,aAAaC,QAAQ,gBAAkB,KACxG,eAAgB,mBAChB,OAAU,sBAIRC,EAAyB,uCAAG,WAAOC,EAA8BC,GAArC,eAAAC,EAAA,+EAEaC,EAAaH,GAF1B,cAExBI,EAFwB,OAI9Bd,EAAce,SAAST,QAAvB,cAAkD,eAASQ,QAAT,IAASA,OAAT,EAASA,EAAUE,KAAKC,QAC1EN,EAAgBL,QAAhB,cAA2C,OAASQ,EAASE,KAAKC,OALpC,kBAOvBjB,EAAcW,IAPS,gCAS9BO,QAAQC,IAAR,MAT8B,yDAAH,wDAalBN,EAAY,uCAAG,WAAOH,GAAP,eAAAE,EAAA,yDACrBF,EADqB,yCAEjBU,QAAQC,OAAO,8BAFE,gCAMmBrB,EAAcsB,KAAK,sBAAuB,CAAEC,QAASb,IANxE,cAMlBI,EANkB,OAQxBP,aAAaiB,QAAQ,eAAgBV,EAASE,KAAKC,QACnDV,aAAaiB,QAAQ,gBAAiBV,EAASE,KAAKO,SAT5B,kBAWjBT,GAXiB,yCAaxBI,QAAQC,IAAR,MAbwB,kBAejBC,QAAQC,OAAO,CAAEI,IAAG,QAfH,0DAAH,sDAmBzBzB,EAAc0B,aAAaZ,SAASa,KAClC,SAAAb,GAAQ,OAAIA,KACZ,SAAAc,GACE,IAAMjB,EAAkBi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F,2BAHR,2BAUN,cAAC+hB,GAAD,CAAS/T,MAAO,CAAEyW,OAAQ,eAA1B,SACE,qBACErgB,UAAU,yBACV4J,MAAO,CAAEkF,QAAS,GAAIwR,UAAW,KAFnC,SAIE,cAAC,IAAD,UACE,cAAC,IAAD,CAAK1gB,KAAM,GAAX,SACE,eAAC,IAAD,WACE,cAAC,IAAD,CACE2d,OAAK,EACLC,KAAM,UACNvN,OAAQ,SAACpR,GAAD,OACN,cAAC,EAAD,2BAAWA,GAAX,IAAkBC,SAAU,EAAKsf,kBAGrC,cAAC,GAAD,CACEb,OAAK,EACLC,KAAM,CAAC,UAAW,KAClBvf,gBAAiBoB,KAAKzB,MAAMK,gBAH9B,SAKE,cAAC,GAAD,MAEF,cAAC,GAAD,CACEsf,OAAK,EACLC,KAAM,CAAC,cACPvf,gBAAiBoB,KAAKzB,MAAMK,gBAH9B,SAKE,cAAC,GAAD,MAEF,cAAC,GAAD,CACEsf,OAAK,EACLC,KAAM,CAAC,aACPvf,gBAAiBoB,KAAKzB,MAAMK,gBAH9B,SAKE,cAAC,GAAD,iBAOZ,cAAC2f,GAAD,CAAQhU,MAAO,CAAE2W,UAAW,UAA5B,SACE,6EACwC,uBADxC,+B,GAtNIhf,aAsOHuR,qBANf,SAAyBlV,GACvB,MAAO,CACL+J,OAAQ/J,EAAM+J,OAAOV,QAIV6L,CAAyBgL,IC7SxC7N,iBAEE,cAAC,KAAD,CAAU9I,MAAOA,GAAjB,SACE,cAAC,IAAD,UACE,cAAC,GAAD,QAIJmH,SAASC,eAAe,W","file":"static/js/main.49c38472.chunk.js","sourcesContent":["import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';\r\n\r\n//this does a few things\r\n// sets up each request so it's going to be handled with normal calls without overhead\r\n// renews the token if it expires on a failed call\r\n\r\nconst axiosInstance = axios.create({\r\n baseURL: process.env.REACT_APP_API_URL,\r\n timeout: 90000,\r\n headers: {\r\n 'Authorization': localStorage.getItem('access_token') ? \"JWT \" + localStorage.getItem('access_token') : null,\r\n 'Content-Type': 'application/json',\r\n 'accept': 'application/json'\r\n }\r\n});\r\n\r\nconst refreshTokenDuringRequest = async (refresh_token: string | null, originalRequest: AxiosRequestConfig) => {\r\n try {\r\n const response: AxiosResponse = await refreshToken(refresh_token);\r\n\r\n axiosInstance.defaults.headers['Authorization'] = \"JWT \" + response?.data.access;\r\n originalRequest.headers['Authorization'] = \"JWT \" + response.data.access;\r\n\r\n return axiosInstance(originalRequest);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n};\r\n\r\nexport const refreshToken = async (refresh_token: string | null) => {\r\n if (!refresh_token) {\r\n return Promise.reject('No refresh token provided');\r\n }\r\n\r\n try {\r\n const response: AxiosResponse = await axiosInstance.post('/api/token/refresh/', { refresh: refresh_token });\r\n\r\n localStorage.setItem('access_token', response.data.access);\r\n localStorage.setItem('refresh_token', response.data.refresh);\r\n\r\n return response;\r\n } catch (err) {\r\n console.log(err);\r\n //@ts-ignore\r\n return Promise.reject({ err });\r\n }\r\n};\r\n\r\naxiosInstance.interceptors.response.use(\r\n response => response,\r\n error => {\r\n const originalRequest = error.config;\r\n\r\n // test for token presence, no point in sending a request if token isn't present\r\n if (localStorage.getItem('refresh_token')\r\n && error.response.status === 401\r\n && error.response.data.detail !== \"No active account found with the given credentials\") {\r\n const refresh_token = localStorage.getItem('refresh_token');\r\n\r\n return refreshTokenDuringRequest(refresh_token, originalRequest);\r\n }\r\n // specific error handling done elsewhere\r\n return Promise.reject({ ...error });\r\n }\r\n);\r\n\r\nexport default axiosInstance;\r\n","import React, { Component } from \"react\";\r\nimport { Redirect } from \"react-router-dom\";\r\nimport axiosInstance from \"../axiosApi\";\r\nimport { UserOutlined, LockOutlined, LoginOutlined } from \"@ant-design/icons\";\r\nimport { Row, Col, Form, Input, Button, Typography, Alert } from \"antd\";\r\nimport { store } from \"../redux/store\";\r\n\r\nconst { Title } = Typography;\r\nconst { Text } = Typography;\r\n\r\ntype Props = {\r\n location: any;\r\n history: any;\r\n loggedIn: () => void;\r\n};\r\ntype State = {\r\n show_error: boolean;\r\n error_message?: string;\r\n redirectToReferrer: boolean;\r\n isAuthenticated: boolean;\r\n is_loading: boolean;\r\n username?: string;\r\n password?: string;\r\n};\r\n\r\nclass Login extends Component {\r\n state: State = {\r\n show_error: false,\r\n error_message: undefined,\r\n redirectToReferrer: false,\r\n isAuthenticated: false,\r\n is_loading: false,\r\n };\r\n\r\n componentDidMount() {\r\n const pre_u = process.env.REACT_APP_PRELOAD_USER\r\n const pre_p = process.env.REACT_APP_PRELOAD_PW\r\n if (pre_u !== undefined && pre_p !== undefined) {\r\n console.log(\"Auto login detected.\")\r\n this.handleSubmit({ username: pre_u, password: pre_p })\r\n }\r\n }\r\n\r\n onFinish = (values: any) => {\r\n console.log(\"Received values of form: \", values);\r\n };\r\n\r\n handleSubmit = (event: any) => {\r\n this.setState({\r\n show_error: false,\r\n error_message: undefined,\r\n is_loading: true,\r\n });\r\n\r\n try {\r\n axiosInstance\r\n .post(\"/api/token/obtain/\", {\r\n username: event.username.toLowerCase(),\r\n password: event.password,\r\n })\r\n .then((response) => {\r\n axiosInstance.defaults.headers[\"Authorization\"] =\r\n \"JWT \" + response.data.access;\r\n localStorage.setItem(\"access_token\", response.data.access);\r\n localStorage.setItem(\"refresh_token\", response.data.refresh);\r\n sessionStorage.setItem(\"isAuth\", 'true')\r\n this.setState(\r\n {\r\n redirectToReferrer: true,\r\n isAuthenticated: true,\r\n },\r\n () => this.props.loggedIn()\r\n );\r\n\r\n })\r\n .catch((error) => {\r\n console.log(\"login error\");\r\n this.setState({\r\n error_message: error.response.data.detail,\r\n show_error: true,\r\n is_loading: false,\r\n });\r\n });\r\n } catch (error) {\r\n throw error;\r\n }\r\n };\r\n\r\n handleFailure = (event: any) => {\r\n console.log(\"FAILED Received values of form: \", event);\r\n };\r\n\r\n render() {\r\n const { from } = this.props.location.state || { from: { pathname: \"/\" } };\r\n const { redirectToReferrer } = this.state;\r\n\r\n if (redirectToReferrer === true) {\r\n this.props.history.push(from.pathname);\r\n }\r\n\r\n return this.state.isAuthenticated ? (\r\n \r\n ) : (\r\n
\r\n \r\n \r\n Welcome to Rubi Space!\r\n \r\n \r\n }\r\n placeholder=\"Username\"\r\n value={this.state.username}\r\n />\r\n \r\n \r\n }\r\n type=\"password\"\r\n placeholder=\"Password\"\r\n value={this.state.password}\r\n />\r\n \r\n {this.state.show_error ? (\r\n \r\n \r\n \r\n ) : null}\r\n \r\n }>\r\n Log in\r\n \r\n \r\n \r\n Please submit support ticket to have password reset.\r\n \r\n \r\n
\r\n )\r\n }\r\n}\r\nexport default Login;\r\n","// A mock function to mimic making an async request for data\r\nexport function fetchCount(amount = 1) {\r\n return new Promise<{ data: number }>((resolve) =>\r\n setTimeout(() => resolve({ data: amount }), 500)\r\n );\r\n}\r\n","import { bindActionCreators, createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';\r\nimport { string } from 'prop-types';\r\nimport { RootState, AppThunk } from '../../redux/store';\r\nimport { fetchCount } from './sspAPI';\r\n\r\nexport interface PageState {\r\n indexCurrent: number;\r\n urlCurrent: string;\r\n urlNext: string;\r\n urlPrev: string;\r\n pageSize: number;\r\n pageGoto: number;\r\n itemCount: number;\r\n items: Array;\r\n status: 'idle' | 'loading' | 'failed';\r\n}\r\n\r\nexport interface drfPaginationAPI {\r\n count: number;\r\n next: string;\r\n previous: string;\r\n results: Array;\r\n itemsPerPage: number; // TODO get this from backend API\r\n}\r\n\r\nconst initialState: PageState = {\r\n indexCurrent: 1,\r\n urlCurrent: \"\",\r\n urlNext: \"\",\r\n urlPrev: \"\",\r\n pageSize: 50,\r\n pageGoto: 0,\r\n itemCount: 0,\r\n items: [],\r\n status: 'idle',\r\n};\r\n\r\nfunction time_tzabbrev(in_date: Date) {\r\n return in_date.toLocaleString(\r\n 'en-US', { // abbreviate timezone (must do manually)\r\n timeZoneName: 'long' \r\n }).split(\r\n ' '\r\n ).slice(3).map(\r\n el => el[0]\r\n ).join(\r\n ''\r\n ).toUpperCase();\r\n};\r\n\r\nfunction time_nextrun(in_date: Date) {\r\n return in_date.toLocaleString('en-US', {\r\n year: 'numeric', \r\n month: 'numeric', \r\n day: 'numeric', \r\n hour:'2-digit', \r\n hour12: true, \r\n minute: '2-digit',\r\n }) + \" \" + time_tzabbrev(in_date);\r\n\r\n};\r\n\r\nfunction time_localize(in_date: Date) {\r\n const now = new Date(Date());\r\n const tz_offset = now.getTimezoneOffset() / 60;\r\n const next_date = in_date;\r\n\r\n console.log(\r\n \"Now: \" + now + \"\\n\" +\r\n \"Offset: \" + tz_offset + \"\\n\" + \r\n \"t(Next): \" + next_date + \"\\n\"\r\n );\r\n\r\n next_date.setHours( // Resets TZ\r\n next_date.getHours() //+ -tz_offset\r\n );\r\n\r\n console.log(\r\n \"t(NextAdj): \" + next_date + \"\\n\" \r\n );\r\n\r\n return next_date;\r\n\r\n};\r\n\r\n// The function below is called a thunk and allows us to perform async logic. It\r\n// can be dispatched like a regular action: `dispatch(incrementAsync(10))`. This\r\n// will call the thunk with the `dispatch` function as the first argument. Async\r\n// code can then be executed and other actions can be dispatched. Thunks are\r\n// typically used to make async requests.\r\nexport const incrementAsync = createAsyncThunk(\r\n 'counter/fetchCount',\r\n async (amount: number) => {\r\n const response = await fetchCount(amount);\r\n // The value we return becomes the `fulfilled` action payload\r\n return response.data;\r\n }\r\n);\r\n\r\nexport const pageSlice = createSlice({\r\n name: 'counter',\r\n initialState,\r\n // The `reducers` field lets us define reducers and generate associated actions\r\n reducers: {\r\n paginationNext: (state) => {\r\n // Redux Toolkit allows us to write \"mutating\" logic in reducers. It\r\n // doesn't actually mutate the state because it uses the Immer library,\r\n // which detects changes to a \"draft state\" and produces a brand new\r\n // immutable state based off those changes\r\n state.indexCurrent += 1; // <-- PAGE NEXT \r\n },\r\n paginationPrev: (state) => {\r\n state.indexCurrent -= 1; // <-- PAGE PREV\r\n },\r\n populateItems: (state, action: PayloadAction) => {\r\n const obj = action.payload.results;\r\n\r\n obj.forEach((o: any, i:number) => {\r\n let d_j = JSON.parse(o.data);\r\n //2021-11-03T16:09:34.248820Z\r\n o.created = time_nextrun( // MISNOMER, just formatting...\r\n time_localize(new Date(o.created))).toString(); //Date.parse(v.timestamp);\r\n d_j.key = i;\r\n o.body = d_j.message_body ? d_j.message_body : \"\";\r\n o.url = d_j.url ? d_j.url : \"\";\r\n o.s_id = o.url ? o.url.split(\"/\") : \"\";\r\n o.s_id = o.s_id ? o.s_id[6] : \"\";\r\n o.d_j = d_j;\r\n o.lookup_url = 'https://console.twilio.com/us1/service/notify/' + o.s_id + '/notify-service-logs?frameUrl=' + encodeURIComponent(o.url.replace(/https?:\\/\\/[^\\/]+/i, \"\"));\r\n })\r\n state.urlNext = action.payload.next ? action.payload.next : \"\";\r\n state.urlPrev = action.payload.previous ? action.payload.previous : \"\";\r\n state.itemCount = action.payload.count ? action.payload.count : 0;\r\n state.items = action.payload.results; // hey\r\n state.pageSize = action.payload.itemsPerPage || 50;\r\n console.log(\"ITEM COUNT \" + state.itemCount);\r\n },\r\n // Use the PayloadAction type to declare the contents of `action.payload`\r\n paginationExact: (state, action: PayloadAction) => {\r\n state.indexCurrent = action.payload; // <-- PAGE GOTO\r\n },\r\n },\r\n\r\n\r\n\r\n // B E L O W A R E E X A M P L E S\r\n\r\n // The `extraReducers` field lets the slice handle actions defined elsewhere,\r\n // including actions generated by createAsyncThunk or in other slices.\r\n extraReducers: (builder) => {\r\n builder\r\n .addCase(incrementAsync.pending, (state) => {\r\n state.status = 'loading';\r\n })\r\n .addCase(incrementAsync.fulfilled, (state, action) => {\r\n state.status = 'idle';\r\n });\r\n },\r\n});\r\n\r\n\r\n\r\n// NOTE ACTION CREATORS\r\nexport const { paginationNext, paginationPrev, paginationExact, populateItems } = pageSlice.actions;\r\n\r\n// The function below is called a selector and allows us to select a value from\r\n// the state. Selectors can also be defined inline where they're used instead of\r\n// in the slice file. For example: `useSelector((state: RootState) => state.counter.value)`\r\nexport const pageGoto = (state: RootState) => state.ssp.pageGoto;\r\n\r\n\r\n// NOTE MAYBE WE SHOULD USE THIS FIXME TODO \r\n// We can also write thunks by hand, which may contain both sync and async logic.\r\n// Here's an example of conditionally dispatching actions based on current state.\r\nexport const incrementIfOdd = (amount: number): AppThunk => (\r\n dispatch,\r\n getState\r\n) => {\r\n const currentValue = pageGoto(getState());\r\n if (currentValue % 2 === 1) {\r\n dispatch(paginationExact(amount));\r\n }\r\n};\r\n\r\n\r\nexport default pageSlice.reducer;\r\n","import { bindActionCreators, createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';\r\n\r\n\r\nfunction time_tzabbrev(in_date: Date) {\r\n return in_date.toLocaleString(\r\n 'en-US', { // abbreviate timezone (must do manually)\r\n timeZoneName: 'long' \r\n }).split(\r\n ' '\r\n ).slice(3).map(\r\n el => el[0]\r\n ).join(\r\n ''\r\n ).toUpperCase();\r\n };\r\n \r\nfunction time_nextrun(in_date: Date) {\r\n return in_date.toLocaleString('en-US', {\r\n year: 'numeric', \r\n month: 'numeric', \r\n day: 'numeric', \r\n hour:'2-digit', \r\n hour12: true, \r\n minute: '2-digit',\r\n }) + \" \" + time_tzabbrev(in_date);\r\n \r\n };\r\n \r\nfunction time_localize(in_date: Date) {\r\n const now = new Date(Date());\r\n const tz_offset = now.getTimezoneOffset() / 60;\r\n const next_date = in_date;\r\n \r\n console.log(\r\n \"Now: \" + now + \"\\n\" +\r\n \"Offset: \" + tz_offset + \"\\n\" + \r\n \"t(Next): \" + next_date + \"\\n\"\r\n );\r\n \r\n next_date.setHours( // Resets TZ\r\n next_date.getHours() //+ -tz_offset\r\n );\r\n \r\n console.log(\r\n \"t(NextAdj): \" + next_date + \"\\n\" \r\n );\r\n \r\n return next_date;\r\n \r\n };\r\nexport interface PageState {\r\n indexCurrent: number;\r\n urlCurrent: string;\r\n urlNext: string;\r\n urlPrev: string;\r\n pageSize: number;\r\n pageGoto: number;\r\n itemCount: number;\r\n items: Array;\r\n status: 'idle' | 'loading' | 'failed';\r\n}\r\nexport interface drfPaginationAPI {\r\n count: number;\r\n next: string;\r\n previous: string;\r\n results: Array;\r\n itemsPerPage: number; // TODO get this from backend API\r\n}\r\n\r\nconst initialState: PageState = {\r\n indexCurrent: 1,\r\n urlCurrent: \"\",\r\n urlNext: \"\",\r\n urlPrev: \"\",\r\n pageSize: 50,\r\n pageGoto: 0,\r\n itemCount: 0,\r\n items: [],\r\n status: 'idle',\r\n};\r\nexport const sparklesPageSlice = createSlice({\r\n name: 'sparklesSSP',\r\n initialState,\r\n reducers: {\r\n sparklesPopulateItems: (state, action: PayloadAction) => {\r\n const obj = action.payload.results;\r\n console.log(obj);\r\n\r\n obj.forEach((v: any, k: number, a: object[]) => {\r\n if ('timestamp' in v) {\r\n v['timestamp'] = time_nextrun( // MISNOMER, just formatting...\r\n time_localize(new Date(v['timestamp']))).toString(); //Date.parse(v.timestamp);\r\n\r\n }\r\n \r\n });\r\n\r\n state.items = obj.reverse().map((item: any, index: number) => ( \r\n {...item, key: index }\r\n ));\r\n\r\n \r\n\r\n state.urlNext = action.payload.next ? action.payload.next : \"\";\r\n state.urlPrev = action.payload.previous ? action.payload.previous : \"\";\r\n state.itemCount = action.payload.count ? action.payload.count : 0;\r\n state.pageSize = action.payload.itemsPerPage || 50;\r\n console.log(\"ITEM COUNT \" + state.itemCount);\r\n },\r\n },\r\n});\r\n\r\nexport const { sparklesPopulateItems } = sparklesPageSlice.actions;\r\n\r\nexport default sparklesPageSlice.reducer;\r\n","const initialState = {\r\n isLoadingDept: true,\r\n isLoadingEmpDesig: true,\r\n // isLoadingEmpStatus:true,\r\n isLoadingGroup: true,\r\n isLoadingExGroup: true\r\n};\r\n\r\nconst isLoadingReducer = (state = initialState, action: any) => { //Initial state is used if action is undefined, otherwise it will break\r\n switch (action.type) {\r\n case \"ISLOADING_Dept\":\r\n\r\n return {\r\n ...state,\r\n isLoadingDept: action.payload\r\n };\r\n case \"ISLOADING_EmpDesig\":\r\n\r\n return {\r\n ...state,\r\n isLoadingEmpDesig: action.payload\r\n };\r\n case \"ISLOADING_EmpStatus\":\r\n\r\n return {\r\n ...state,\r\n isLoadingEmpStatus: action.payload\r\n };\r\n case \"ISLOADING_Group\":\r\n\r\n return {\r\n ...state,\r\n isLoadingGroup: action.payload\r\n };\r\n case \"ISLOADING_Ex_Group\":\r\n\r\n return {\r\n ...state,\r\n isLoadingExGroup: action.payload\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default isLoadingReducer\r\n","\r\nconst initialState = {\r\n auth: false\r\n};\r\n\r\nconst isAuthReducer = (state = initialState, action: any) => {\r\n switch (action.type) {\r\n case \"Auth\":\r\n return {\r\n auth: action.payload\r\n }\r\n default:\r\n return state;\r\n }\r\n\r\n}\r\n\r\n\r\n\r\nexport default isAuthReducer\r\n","import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit';\r\n\r\nimport sspReducer from '../features/ServerSidePaginator/sspSlice';\r\nimport sspSparklesReducer from '../features/ServerSidePaginator/sspSliceSparkles';\r\nimport isLoadingReducer from './reducers/isLoadingReducer';\r\nimport authReducer from './reducers/authReducer';\r\n// a\r\n\r\nexport const store = configureStore({ // <-- func def that takes an object\r\n reducer: {\r\n sspSparkles: sspSparklesReducer,\r\n ssp: sspReducer,\r\n isLoading: isLoadingReducer,\r\n isAuth: authReducer,\r\n },\r\n});\r\n\r\nexport type AppDispatch = typeof store.dispatch; // <-- HERE'S THE DISPATCH\r\nexport type RootState = ReturnType; // <-- TypeScript type inference\r\nexport type AppThunk = ThunkAction<\r\n ReturnType,\r\n RootState,\r\n unknown,\r\n Action\r\n>;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Tooltip, Radio, Spin } from 'antd';\r\nimport { store } from '../redux/store'\r\n\r\ntype Props = {\r\n onChange: (key: string, value: any) => void,\r\n isLoading: (isLoading: boolean) => void,\r\n};\r\ntype State = {\r\n selected: string,\r\n items: any[],\r\n is_loading: boolean,\r\n};\r\n\r\nfunction decode_token_extra_data(token: string) {\r\n // NOTE token argument ignored for now\r\n const access_token = localStorage.getItem(\"access_token\") || \"\";\r\n // split token (base64) into header, payload and (opt) signature\r\n const [header_base64, payload_base64] = access_token.split(\".\");\r\n\r\n // convert data from base64 back into regular string\r\n const payload_json = atob(payload_base64);\r\n // return just the \"exd\" field in the token json\r\n // and discard other data (exd shall be a subobj as defined in backend admin)\r\n return (JSON.parse(payload_json).exd);\r\n}\r\n\r\nclass BranchOption extends Component {\r\n\r\n state: State = {\r\n selected: '0',\r\n items: [],\r\n is_loading: true,\r\n };\r\n\r\n dispatchLoading() { //this function passes true to a store value for EmpStatus when the branche is changed\r\n //it has to be done like this because branch change doesn't trigger EmpStatus Component (it only renders once)\r\n store.dispatch({\r\n type: \"ISLOADING_EmpStatus\",\r\n payload: true\r\n })\r\n\r\n\r\n }\r\n\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n handleChange = (e: any) => {\r\n this.setState({\r\n selected: e.target.value,\r\n });\r\n\r\n this.dispatchLoading()\r\n // This is going to pass the selected.branch: e back up to the parent components state\r\n this.props.onChange(\"branch\", e.target.value);\r\n };\r\n\r\n load = () => {\r\n this.props.isLoading(this.state.is_loading);\r\n\r\n try {\r\n const default_exclude_branches = decode_token_extra_data(\"\");\r\n console.log(default_exclude_branches.excbranches);\r\n const excbranches = default_exclude_branches.excbranches || [];\r\n\r\n axiosInstance.post('shout/branches/')\r\n .then(res => {\r\n const obj_clean = res.data.branches;\r\n\r\n var obj: any[] = [];\r\n\r\n // Filter any groups with branch_id matching in default_exclude_branches into the obj array\r\n for (let i = 0; i < obj_clean.length; i++) {\r\n if (!excbranches.includes(obj_clean[i].branch_id)) {\r\n obj.push(obj_clean[i]);\r\n }\r\n }\r\n\r\n this.setState({\r\n selected: obj[0].branch_id,\r\n items: obj,\r\n is_loading: false\r\n }, () => {\r\n this.props.onChange(\"branch\", obj[0].branch_id);\r\n this.props.isLoading(this.state.is_loading);\r\n\r\n\r\n\r\n });\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Branches: \", JSON.stringify(error, null, 4));\r\n }\r\n };\r\n\r\n render() {\r\n const options = this.state.items.map(d => {d.branch_name});\r\n return (\r\n
\r\n {this.state.is_loading ? (\r\n
\r\n \r\n
) : (\r\n \r\n \r\n {options}\r\n \r\n \r\n )}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default BranchOption;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Tooltip } from 'antd';\r\nimport { Select } from 'antd';\r\nimport { store } from '../redux/store'\r\nimport { UnconnectedEmpList } from './EmpList'\r\nconst { Option } = Select;\r\n\r\ntype Props = {\r\n branch_id: number,\r\n onChange: (key: string, value: any) => void,\r\n};\r\ntype State = {\r\n selected?: any[],\r\n items: any[];\r\n branchID: number,\r\n loading: boolean,\r\n};\r\n\r\nclass DeptOption extends Component {\r\n state: State = {\r\n selected: [],\r\n items: [],\r\n branchID: 0,\r\n loading: true\r\n };\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.setState({\r\n selected: undefined\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n handleChange = (e: any) => {\r\n console.log(e);\r\n this.setState({\r\n selected: e,\r\n });\r\n\r\n // send our selected department values back up to the parent to handle--like an adult\r\n this.props.onChange(\"dept\", e);\r\n };\r\n\r\n load = () => {\r\n if (this.props.branch_id !== undefined) {\r\n try {\r\n // updating to new department values needs to force a blanking to the parents selection\r\n this.props.onChange(\"dept\", []);\r\n\r\n let payload = {\r\n \"branch_id\": this.props.branch_id\r\n };\r\n\r\n this.setState({\r\n loading: true,\r\n selected: []\r\n });\r\n\r\n store.dispatch({ // sending value true when component is called, so that the button in EmpList gets disabled\r\n type: \"ISLOADING_Dept\",\r\n payload:true\r\n });\r\n axiosInstance.post('shout/departments/', payload)\r\n .then(res => {\r\n const obj = res.data.departments;\r\n this.setState({\r\n items: obj,\r\n loading: false\r\n });\r\n store.dispatch({ // this is sending false to store component, and enables the button along with other components\r\n type: \"ISLOADING_Dept\",\r\n payload:this.state.loading\r\n });\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Departments: \", JSON.stringify(error, null, 4));\r\n }\r\n }\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.branch_id !== prevProps.branch_id) {\r\n this.load();\r\n }\r\n }\r\n\r\n render() {\r\n const options = this.state.items.map((d: any) => ());\r\n return (\r\n
\r\n \r\n \r\n option?.props?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n optionFilterProp=\"children\"\r\n value={this.state.selected}\r\n loading={this.state.loading}\r\n style={{ width: '100%' }}\r\n allowClear\r\n disabled={this.state.loading}\r\n >\r\n {options}\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default DeptOption;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Tooltip } from 'antd';\r\nimport { Select } from 'antd';\r\nimport { store } from '../redux/store'\r\n\r\nconst { Option } = Select;\r\n\r\ntype Props = {\r\n branch_id: number,\r\n onChange: (key: string, value: any) => void,\r\n};\r\ntype State = {\r\n selected?: any[],\r\n items: any[];\r\n branchID: number,\r\n loading: boolean,\r\n};\r\n\r\nclass GroupOption extends Component {\r\n state: State = {\r\n selected: [],\r\n items: [],\r\n branchID: 0,\r\n loading: true\r\n };\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.setState({\r\n selected: undefined\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n handleChange = (e: any) => {\r\n console.log(e);\r\n this.setState({\r\n selected: e,\r\n });\r\n\r\n // send our selected group values back up to the parent to handle--like an adult\r\n this.props.onChange(\"groups\", e);\r\n };\r\n\r\n load = () => {\r\n if (this.props.branch_id !== undefined) {\r\n try {\r\n // updating to new group values needs to force a blanking to the parents selection\r\n this.props.onChange(\"groups\", []);\r\n\r\n let payload = {\r\n \"branch_id\": this.props.branch_id\r\n };\r\n\r\n this.setState({\r\n loading: true,\r\n selected: []\r\n });\r\n\r\n store.dispatch({ // sending value true when component is called, so that the button in EmpList gets disabled\r\n type: \"ISLOADING_Group\",\r\n payload:true\r\n });\r\n\r\n axiosInstance.post('shout/groups/', payload)\r\n .then(res => {\r\n const obj = res.data.groups;\r\n this.setState({\r\n items: obj,\r\n loading: false\r\n });\r\n store.dispatch({ // this is sending false to store component, and enables the button along with other components\r\n type: \"ISLOADING_Group\",\r\n payload:this.state.loading\r\n });\r\n store.dispatch({ // see EmpStatusOption for refference\r\n type: \"ISLOADING_EmpStatus\",\r\n payload:this.state.loading\r\n })\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Groups: \", JSON.stringify(error, null, 4));\r\n }\r\n }\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.branch_id !== prevProps.branch_id) {\r\n this.load();\r\n }\r\n }\r\n\r\n render() {\r\n const options = this.state.items.map((d: any) => );\r\n return (\r\n
\r\n \r\n \r\n option?.props?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n optionFilterProp=\"children\"\r\n value={this.state.selected}\r\n loading={this.state.loading}\r\n style={{ width: '100%' }}\r\n allowClear\r\n disabled={this.state.loading}\r\n >\r\n {options}\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default GroupOption;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Tooltip } from 'antd';\r\nimport { Select } from 'antd';\r\nimport { store } from '../redux/store'\r\n\r\n\r\n\r\nconst { Option } = Select;\r\n\r\ntype Props = {\r\n branch_id: number,\r\n onChange: (key: string, value: any) => void,\r\n};\r\ntype State = {\r\n selected?: any[],\r\n items: any[];\r\n branchID: number,\r\n loading: boolean,\r\n};\r\n\r\nfunction decode_token_extra_data(token: string) {\r\n // NOTE token argument ignored for now\r\n const access_token = localStorage.getItem(\"access_token\") || \"\";\r\n // split token (base64) into header, payload and (opt) signature\r\n const [header_base64, payload_base64] = access_token.split(\".\");\r\n\r\n // convert data from base64 back into regular string\r\n const payload_json = atob(payload_base64);\r\n // return just the \"exd\" field in the token json\r\n // and discard other data (exd shall be a subobj as defined in backend admin)\r\n return (JSON.parse(payload_json).exd);\r\n}\r\n\r\nclass ExGroupOption extends Component {\r\n state: State = {\r\n selected: [],\r\n items: [],\r\n branchID: 0,\r\n loading: true\r\n };\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.setState({\r\n selected: undefined\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n handleChange = (e: any) => {\r\n console.log(e);\r\n this.setState({\r\n selected: e,\r\n });\r\n\r\n // send our selected group values back up to the parent to handle--like an adult\r\n this.props.onChange(\"ex_groups\", e);\r\n };\r\n\r\n load = () => {\r\n if (this.props.branch_id !== undefined) {\r\n try {\r\n // updating to new group values needs to force a blanking to the parents selection\r\n this.props.onChange(\"ex_groups\", []);\r\n\r\n let payload = {\r\n \"branch_id\": this.props.branch_id\r\n };\r\n\r\n const default_exclude_groups = decode_token_extra_data(\"\");\r\n console.log(default_exclude_groups.excgroups);\r\n\r\n this.setState({\r\n loading: true,\r\n selected: default_exclude_groups.excgroups || []\r\n });\r\n\r\n store.dispatch({ // sending value true when component is called, so that the button in EmpList gets disabled\r\n type: \"ISLOADING_Ex_Group\",\r\n payload: true\r\n });\r\n\r\n axiosInstance.post('shout/groups/', payload)\r\n .then(res => {\r\n const obj = res.data.groups;\r\n this.setState({\r\n items: obj,\r\n loading: false\r\n });\r\n\r\n this.props.onChange(\"ex_groups\", this.state.selected);\r\n\r\n store.dispatch({ // this is sending false to store component, and enables the button along with other components\r\n type: \"ISLOADING_Ex_Group\",\r\n payload: this.state.loading\r\n });\r\n\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Ex Groups: \", JSON.stringify(error, null, 4));\r\n }\r\n }\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.branch_id !== prevProps.branch_id) {\r\n this.load();\r\n }\r\n }\r\n\r\n render() {\r\n const options = this.state.items.map((d: any) => );\r\n return (\r\n
\r\n \r\n \r\n option?.props?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n optionFilterProp=\"children\"\r\n value={this.state.selected}\r\n loading={this.state.loading}\r\n style={{ width: '100%' }}\r\n allowClear\r\n disabled={this.state.loading}\r\n >\r\n {options}\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default ExGroupOption;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Tooltip } from 'antd';\r\nimport { Select } from 'antd';\r\nimport { store } from '../redux/store'\r\n\r\nconst { Option } = Select;\r\n\r\ntype Props = {\r\n onChange: (key: string, value: any) => void,\r\n};\r\n\r\ntype State = {\r\n selected: any[],\r\n items: any[],\r\n loading: boolean,\r\n};\r\n\r\nclass EmpStatusOption extends Component {\r\n state: State = {\r\n selected: [],\r\n items: [],\r\n loading: true\r\n };\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.setState({\r\n selected: [],\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n handleChange = (e: any) => {\r\n this.setState({\r\n selected: e,\r\n });\r\n\r\n // This is going to pass the selected.valu: e back up to the parent components state\r\n this.props.onChange(\"empStatuses\", e);\r\n };\r\n\r\n load = () => {\r\n try {\r\n //push a blank value back up so people know to clear ish\r\n this.props.onChange(\"empStatuses\", []);\r\n\r\n this.setState({\r\n loading: true,\r\n selected: []\r\n });\r\n\r\n store.dispatch({ // sending value true when component is called, so that the button in EmpList gets disabled\r\n type: \"ISLOADING_EmpStatus\",\r\n payload: true\r\n });\r\n\r\n axiosInstance.post('shout/employeestatuses/')\r\n .then(res => {\r\n const obj: any[] = res.data.empstatuses;\r\n\r\n var presets: any[] = []\r\n\r\n obj.forEach(curStatus => {\r\n if (curStatus.employee_status_name == 'active') {\r\n presets.push(curStatus.employee_status_name)\r\n }\r\n });\r\n\r\n this.setState({\r\n items: obj,\r\n loading: false\r\n });\r\n\r\n this.handleChange(presets);\r\n //store.dispatch is in Group component, cuz this only gets called once, so it doesn't do anything on branch change\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Employee Statuses: \", JSON.stringify(error, null, 4));\r\n }\r\n };\r\n\r\n render() {\r\n const options = this.state.items.map((d: any) => );\r\n return (\r\n
\r\n \r\n \r\n option?.props?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n optionFilterProp=\"children\"\r\n value={this.state.selected}\r\n loading={this.state.loading}\r\n disabled={this.state.loading}\r\n style={{ width: '100%' }}\r\n allowClear\r\n >\r\n {options}\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default EmpStatusOption;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Tooltip } from 'antd';\r\nimport { Select } from 'antd';\r\nimport { store } from \"../redux/store\"\r\n\r\nconst { Option } = Select;\r\n\r\ntype Props = {\r\n branch_id: number,\r\n onChange: (key: string, value: any) => void,\r\n};\r\ntype State = {\r\n selected?: string,\r\n items: any[],\r\n loading: boolean,\r\n};\r\n\r\nclass EmpDesigOption extends Component {\r\n state: State = {\r\n items: [],\r\n loading: true,\r\n };\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.setState({\r\n selected: undefined\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n handleChange = (e: any) => {\r\n this.setState({\r\n selected: e,\r\n });\r\n\r\n // This is going to pass the {selected_branch: e} back up to the parent component\r\n this.props.onChange(\"empDesig\", e);\r\n };\r\n\r\n load = () => {\r\n if (this.props.branch_id !== undefined) {\r\n try {\r\n // clear the parent just in case it's got a value\r\n this.props.onChange(\"empDesig\", undefined);\r\n\r\n let payload = {\r\n \"branch_id\": this.props.branch_id\r\n };\r\n\r\n this.setState({\r\n loading: true,\r\n selected: undefined\r\n });\r\n store.dispatch({ // sending value true when component is called, so that the button in EmpList gets disabled\r\n type: \"ISLOADING_EmpDesig\",\r\n payload:true\r\n });\r\n\r\n axiosInstance.post('shout/employeedesigs/', payload)\r\n .then(res => {\r\n const obj = res.data.empdesigs;\r\n this.setState({\r\n items: obj,\r\n loading: false\r\n });\r\n store.dispatch({ // this is sending false to store component, and enables the button along with other components\r\n type: \"ISLOADING_EmpDesig\",\r\n payload:this.state.loading\r\n });\r\n\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Employee Designations: \", JSON.stringify(error));\r\n }\r\n }\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.branch_id !== prevProps.branch_id) {\r\n this.load();\r\n }\r\n }\r\n\r\n render() {\r\n const options = this.state.items.map((d: any) => );\r\n return (\r\n
\r\n \r\n \r\n option?.props?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}\r\n optionFilterProp=\"children\"\r\n value={this.state.selected}\r\n loading={this.state.loading}\r\n disabled={this.state.loading}\r\n style={{ width: '100%' }}\r\n allowClear\r\n >\r\n {options}\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default EmpDesigOption;\r\n","// @ts-nocheck\r\nimport React, { Component, createRef, forwardRef, ReactText, RefObject } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport axiosInstance from '../axiosApi';\r\nimport Highlighter from 'react-highlight-words';\r\n\r\nimport { Button, Row, Col, Tooltip, Table, Typography, Input, Divider, message, Alert } from 'antd';\r\nimport { SettingFilled, SearchOutlined } from '@ant-design/icons';\r\nimport { FilterDropdownProps } from 'antd/lib/table/interface';\r\nimport { connect } from 'react-redux'\r\nimport EmpDeetsMS from './EmpDeetsOption';\r\nimport { store } from '../redux/store'\r\nimport { isTemplateSpan } from 'typescript';\r\n\r\n\r\nconst { Text, Title } = Typography;\r\n\r\ntype Props = {\r\n loading: boolean,\r\n staging: boolean,\r\n excluded_ids: (ids: any[]) => void,\r\n selected_count: (length: number) => void,\r\n selected_ids: any,\r\n};\r\ntype State = {\r\n generate: any,\r\n items: any[],\r\n searchText: string,\r\n searchedColumn: string,\r\n selectedItems: ReactText[],\r\n unselectedItems: any[],\r\n button: boolean,\r\n selected_emp_deets: {\r\n empDeets: any[]\r\n },\r\n};\r\n\r\n\r\n\r\nclass EmpList extends Component { //changed to cuz of TypeScript\r\n\r\n constructor(props: any) {\r\n super(props)\r\n this.state.button = true\r\n }\r\n state: State = {\r\n generate: {\r\n loading: false\r\n },\r\n items: [],\r\n searchText: '',\r\n searchedColumn: '',\r\n selectedItems: [],\r\n unselectedItems: [],\r\n button: true,\r\n selected_emp_deets: {\r\n empDeets: []\r\n },\r\n };\r\n\r\n private empDeetsMSRef: RefObject = createRef();\r\n private branchOptionRef: RefObject = createRef();\r\n\r\n update() {\r\n if (this.props.isLoadingDept === true &&\r\n this.props.isLoadingEmpStatus === true &&\r\n this.props.isLoadingGroup === true &&\r\n this.props.isLoadingExGroup === true &&\r\n this.props.isLoadingEmpDesig === true &&\r\n this.state.button === false) {\r\n this.setState({ button: true })\r\n\r\n }\r\n if (\r\n this.props.isLoadingDept === false &&\r\n this.props.isLoadingEmpStatus === false &&\r\n this.props.isLoadingGroup === false &&\r\n this.props.isLoadingExGroup === false &&\r\n this.props.isLoadingEmpDesig === false &&\r\n this.state.button !== false) {\r\n this.setState({\r\n button: false\r\n })\r\n }\r\n }\r\n\r\n componentWillUnmount() { //returns null when component unmounts, so it does't hold any data. componentDidUpdate should't be used without this\r\n this.setState = (state, callback) => {\r\n return;\r\n };\r\n }\r\n\r\n componentDidUpdate() {\r\n this.update()\r\n } // what\r\n\r\n// @ts-ignore\r\n private searchInputRef: RefObject = createRef();\r\n\r\n updateSelectedEmpDeets = (k: any, v: any) => {\r\n this.setState(prevState => ({\r\n ...prevState,\r\n selected_emp_deets: {\r\n ...prevState.selected_emp_deets,\r\n [k]: v\r\n }\r\n }));\r\n };\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.setState({\r\n items: [],\r\n selectedItems: [],\r\n unselectedItems: [],\r\n });\r\n }\r\n\r\n handleSearch = (selectedKeys: any[], confirm: () => void, dataIndex: any) => {\r\n confirm();\r\n this.setState({\r\n searchText: selectedKeys[0],\r\n searchedColumn: dataIndex,\r\n });\r\n };\r\n\r\n handleReset = (clearFilters: (() => void) | undefined) => {\r\n if (!clearFilters) {\r\n return;\r\n }\r\n clearFilters();\r\n this.setState({ searchText: '' });\r\n };\r\n\r\n generateList = () => {\r\n // TODO: Create a log entry here for the current filter settings\r\n this.setState({\r\n items: [],\r\n generate: {\r\n loading: true\r\n },\r\n selectedItems: [],\r\n unselectedItems: []\r\n });\r\n\r\n // Update the parents exclude list too!\r\n this.props.excluded_ids(this.state.unselectedItems);\r\n\r\n try {\r\n let payload = {\r\n \"branch_id\": this.props.selected_ids.branch,\r\n \"department_id\": this.props.selected_ids.dept,\r\n \"ac_group_ids\": this.props.selected_ids.groups,\r\n \"ac_ex_group_ids\": this.props.selected_ids.ex_groups,\r\n \"emp_statuses\": this.props.selected_ids.empStatuses,\r\n \"emp_desigs\": this.props.selected_ids.empDesig,\r\n \"ac_additional_joins\": this.state.selected_emp_deets\r\n };\r\n\r\n axiosInstance.post('shout/employee/list/', payload)\r\n .then(res => {\r\n const obj = res.data.emp_list;\r\n\r\n // This was an attempt to select all valid values as they get loaded into the table\r\n // Not entirely sure why it's not working but I think it's something about how selectedItems is managed by the \r\n\r\n const newSelectedItems: any[] = [];\r\n const newUnselectedItems: any[] = [];\r\n for (const [index, value] of obj.entries()) {\r\n if (value.employee_phone_main !== \"invalid phone\") {\r\n newSelectedItems.push(value.employee_id);\r\n } else {\r\n newUnselectedItems.push(value.employee_id);\r\n }\r\n }\r\n\r\n this.setState({\r\n selectedItems: newSelectedItems,\r\n unselectedItems: newUnselectedItems,\r\n items: obj,\r\n generate: { loading: false },\r\n }, () => {\r\n this.props.selected_count(newSelectedItems.length);\r\n this.props.excluded_ids(newUnselectedItems);\r\n this.loadSuccces();\r\n });\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Departments: \", JSON.stringify(error, null, 4));\r\n }\r\n };\r\n\r\n clearTable = () => { // on branch change; \r\n // NOT for clearing selection; this is for clearing EMPLOYEE LIST\r\n // ON BRANCH CHANGE (different component); in effect, the rows\r\n // should disappear, because that's the default state ON LOAD.\r\n // Generate SMS List button takes BRANCH into account, and\r\n // we must remove the table rows ON BRANCH CHANGE. (as per task spec)\r\n // EASIER SAID THAN DONE.\r\n // Table DOM does not update just because we do\r\n EmpListTable = document.getElementById(\"theemplist\");\r\n EmpListTable.datasource = []\r\n this.setState({items: []})\r\n EmpListTable.datasource = this.state.items;\r\n // nor is it designed to.\r\n }\r\n\r\n handleDetailsSwitch = (e: any) => {\r\n\r\n console.log(e)\r\n }\r\n\r\n getColumnSearchProps = (dataIndex: string, indexName: any) => ({\r\n filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }: FilterDropdownProps) => (\r\n
\r\n setSelectedKeys(e.target.value ? [e.target.value] : [])}\r\n onPressEnter={() => this.handleSearch(selectedKeys, confirm, dataIndex)}\r\n style={{ width: 188, marginBottom: 8, display: 'block' }}\r\n />\r\n this.handleSearch(selectedKeys, confirm, dataIndex)}\r\n icon={}\r\n size=\"small\"\r\n style={{ width: 90, marginRight: 8 }}\r\n >\r\n Search\r\n \r\n \r\n
\r\n ),\r\n filterIcon: (filtered: any) => ,\r\n onFilter: (value: any, record: { [x: string]: any; }) => {\r\n let temp = record[dataIndex];\r\n if (temp === null) { temp = \"\"; }\r\n return temp\r\n .toString()\r\n .toLowerCase()\r\n .includes(value.toLowerCase());\r\n },\r\n onFilterDropdownVisibleChange: (visible: any) => {\r\n if (visible) {\r\n setTimeout(() => this.searchInputRef?.current?.select());\r\n }\r\n },\r\n render: (text: { toString: () => string; }) =>\r\n this.state.searchedColumn === dataIndex ? (\r\n \r\n ) : (\r\n text\r\n ),\r\n });\r\n\r\n handleOverrideSelectAll = (selected: any, selectedRows: any, changeRows: any[]) => {\r\n\r\n const newSelectedItems = Array();\r\n const newUnselectedItems = Array();\r\n\r\n this.state.items.forEach((value: any) => {\r\n if (value.employee_phone_main !== \"invalid phone\") {\r\n newSelectedItems.push(value.employee_id);\r\n } else {\r\n newUnselectedItems.push(value.employee_id);\r\n }\r\n });\r\n\r\n this.setState({ \r\n unselectedItems: newUnselectedItems,\r\n selectedItems: newSelectedItems \r\n },\r\n () => {\r\n this.props.excluded_ids(this.state.unselectedItems);\r\n this.props.selected_count(this.state.selectedItems.length);\r\n });\r\n\r\n \r\n \r\n };\r\n\r\n handleOverrideSelectNone = (selecteselected: any, selectedRows: any, changeRows: any[]) => {\r\n const newUnselectedItems = Array();\r\n\r\n this.state.items.forEach((value: any) => {\r\n newUnselectedItems.push(value.employee_id);\r\n });\r\n\r\n this.setState({ \r\n unselectedItems: newUnselectedItems,\r\n selectedItems: Array() \r\n },\r\n () => {\r\n this.props.excluded_ids(this.state.unselectedItems);\r\n this.props.selected_count(this.state.selectedItems.length);\r\n }\r\n );\r\n\r\n \r\n };\r\n\r\n handleChange = (selectedRowKeys: ReactText[]) => {\r\n this.setState({ selectedItems: selectedRowKeys });\r\n this.props.selected_count(selectedRowKeys.length);\r\n };\r\n\r\n handleSelect = (record: any, selected: any) => {\r\n // if selected is true, we're adding to the \"include list\" and need to remove it from the exclude list\r\n // if selected is false, we're deleting from the include list and need to add it to the exclude list\r\n if (selected) {\r\n const newArray = [...this.state.unselectedItems];\r\n const index = newArray.indexOf(record.employee_id);\r\n if (index !== -1) {\r\n newArray.splice(index, 1);\r\n this.setState({ unselectedItems: newArray },\r\n () => this.props.excluded_ids(this.state.unselectedItems));\r\n }\r\n } else {\r\n // add to the unselectedItems list\r\n this.setState({ unselectedItems: [...this.state.unselectedItems, record.employee_id] },\r\n () => this.props.excluded_ids(this.state.unselectedItems));\r\n }\r\n };\r\n\r\n handleSelectAll = (selected: any, selectedRows: any, changeRows: any[]) => {\r\n if (selected) {\r\n // adding to the exclude list\r\n // for each entry that is being selected, we need to remove it from the excluded id list\r\n // get the current list form state casuse state is slow\r\n\r\n // IF EXIST SELECTED ITEMS\r\n //\r\n // 1. init new array from unselected items\r\n // 2. for each in changeRows(?)\r\n // 2.1 get index of row record employee id\r\n // 2.2 if (index is valid)\r\n // 2.2.1 remove element from new array (will reorder array)\r\n // 3. set unselected items to new array\r\n // 3.1 with side effect of setting excluded_ids to unselected items\r\n //\r\n // ELSE\r\n //\r\n // 1. init new array and set it to unselected items\r\n // 2. for each in changeRows(?)\r\n // 2.1 add row record employee id to new array\r\n // 3. set unselected items to new array\r\n // 3.1 with side effect of setting excluded_ids to unselected items\r\n\r\n //find the entries, one by one, and remove them iterative loop\r\n const newArray = [...this.state.unselectedItems];\r\n changeRows.forEach(recRemove => {\r\n const index = newArray.indexOf(recRemove.employee_id);\r\n if (index !== -1) {\r\n newArray.splice(index, 1);\r\n }\r\n });\r\n this.setState({ unselectedItems: newArray },\r\n () => this.props.excluded_ids(this.state.unselectedItems));\r\n } else {\r\n // for each entry that gets unselected, we need to add it to the excluded list\r\n const newArray = this.state.unselectedItems;\r\n changeRows.forEach((record) => newArray.push(record.employee_id));\r\n this.setState({ unselectedItems: newArray },\r\n () => this.props.excluded_ids(this.state.unselectedItems));\r\n }\r\n };\r\n\r\n loadSuccces = () => {\r\n message.success(\"Found \" + this.state.items.length + \" people.\");\r\n };\r\n\r\n polyColumnSorter = (a: any, b: any) => {\r\n\r\n\r\n };\r\n\r\n render() {\r\n const employeesmscolumns = [\r\n {\r\n title: 'First Name',\r\n dataIndex: 'employee_first_name',\r\n ...this.getColumnSearchProps('employee_first_name', 'First Name'),\r\n sorter: (a: any, b: any) => a.employee_first_name.toUpperCase() < b.employee_first_name.toUpperCase() ? -1 : 1\r\n },\r\n {\r\n title: 'Last Name',\r\n dataIndex: 'employee_last_name',\r\n ...this.getColumnSearchProps('employee_last_name', 'Last Name'),\r\n sorter: (a: any, b: any) => a.employee_last_name.toUpperCase() < b.employee_last_name.toUpperCase() ? -1 : 1\r\n },\r\n {\r\n title: 'AC ID',\r\n dataIndex: 'employee_ac_id',\r\n ...this.getColumnSearchProps('employee_ac_id', 'AC ID'),\r\n render: (text: any, record: any, c: any) => {record.employee_ac_id},\r\n sorter: (a: any, b: any) => a.employee_ac_id.toUpperCase() < b.employee_ac_id.toUpperCase() ? -1 : 1\r\n },\r\n {\r\n title: 'Job Title',\r\n dataIndex: 'employee_job_title',\r\n ...this.getColumnSearchProps('employee_job_title', 'Job Title'),\r\n sorter: (a: any, b: any) => a.employee_job_title.toUpperCase() < b.employee_job_title.toUpperCase() ? -1 : 1\r\n },\r\n {\r\n title: 'Phone Number',\r\n dataIndex: 'employee_phone_main',\r\n ...this.getColumnSearchProps('employee_phone_main', 'Phone Number'),\r\n sorter: (a: any, b: any) => a.employee_phone_main.toUpperCase() < b.employee_phone_main.toUpperCase() ? -1 : 1\r\n },\r\n //this.state.selected_emp_deets ?\r\n // {\r\n // title: 'City',\r\n // dataIndex: 'employee_city',\r\n // ...this.getColumnSearchProps('employee_city', 'City'),\r\n // } : {},\r\n //this.state.selected_emp_deets ? {\r\n // title: 'State',\r\n // dataIndex: 'employee_state',\r\n // ...this.getColumnSearchProps('employee_state', 'State'),\r\n //} : {},\r\n ];\r\n\r\n // These two are managing the row selection but I can't pass a default checked in to the CheckboxProps function\r\n const rowSelection = {\r\n selectedRowKeys: this.state.selectedItems,\r\n onChange: this.handleChange,\r\n onSelect: this.handleSelect,\r\n onSelectAll: this.handleSelectAll,\r\n getCheckboxProps: (record: any) => ({\r\n disabled: record.employee_phone_main === 'invalid phone', // Column configuration not to be checked\r\n }),\r\n };\r\n// @ts-ignore\r\n return (\r\n
\r\n {/* Commenting this out till we fix the speed issues\r\n \r\n \r\n Fetch additional employee data\r\n \r\n \r\n \r\n \r\n \r\n */}\r\n \r\n \r\n \r\n }\r\n loading={this.state.button}\r\n onClick={this.generateList}\r\n disabled={this.state.button} // this should be changed with Redux\r\n >\r\n Generate SMS List\r\n \r\n \r\n \r\n \r\n \r\n \r\n record.employee_id}\r\n rowSelection={rowSelection}\r\n pagination={\r\n// @ts-ignore \r\n {\r\n// @ts-ignore \r\n position: 'bottom'\r\n \r\n }}\r\n \r\n sortDirections={['ascend', 'descend']}\r\n loading={this.state.generate.loading}\r\n size='middle'\r\n title={\r\n () => \r\n
\r\n Employee SMS Notification List\r\n \r\n Selection override  \r\n \r\n \r\n ALL\r\n \r\n \r\n \r\n \r\n NONE\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\nfunction mapStateToProps(state: any) {\r\n //built in function that should map store states into Component Props\r\n return {\r\n isLoadingDept: state.isLoading.isLoadingDept,\r\n isLoadingEmpDesig: state.isLoading.isLoadingEmpDesig,\r\n isLoadingEmpStatus: state.isLoading.isLoadingEmpStatus,\r\n isLoadingGroup: state.isLoading.isLoadingGroup,\r\n isLoadingExGroup: state.isLoading.isLoadingExGroup,\r\n\r\n\r\n }\r\n}\r\n\r\nexport { EmpList as UnconnectedEmpList }; //this is used in ShoutTool.tsx cuz default is wrapped in connect() function that is also Redux \r\nexport default connect(mapStateToProps)(EmpList)\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Statistic, Row, Col, Skeleton, Alert } from 'antd';\r\n\r\ntype Props = {\r\n branch_id: string,\r\n message_char_count: number,\r\n selected_recepient_count: number,\r\n onCharLimitLoad: (segments: number) => void,\r\n onChange: (key: string, value: any) => void,\r\n};\r\ntype State = {\r\n currency: number,\r\n balance: number,\r\n phone_number: number,\r\n us?: any,\r\n ca?: any,\r\n au?: any,\r\n loading: boolean,\r\n testing: boolean,\r\n testing_number: number;\r\n branch:string\r\n};\r\n\r\nclass TwilioAccount extends Component {\r\n state: State = {\r\n branch:'',\r\n currency: 0,\r\n balance: 0,\r\n phone_number: 0,\r\n loading: true,\r\n testing: false,\r\n testing_number: +1112223333\r\n };\r\n\r\n componentDidMount() {\r\n this.load();\r\n \r\n }\r\n\r\n load = () => {\r\n if (this.props.branch_id !== undefined) {\r\n this.setState({\r\n branch:this.props.branch_id\r\n })\r\n try {\r\n let payload = {\r\n \"branch_id\": this.props.branch_id\r\n };\r\n\r\n axiosInstance.post('shout/twilio_account/', payload)\r\n .then(res => {\r\n const obj = res.data.twilio_account;\r\n this.setState({\r\n loading: false,\r\n currency: obj.currency,\r\n balance: obj.balance,\r\n phone_number: obj.phone_number,\r\n us: obj.us,\r\n ca: obj.ca,\r\n au: obj.au,\r\n testing: obj.is_twilio_testing,\r\n testing_number: obj.testing_number\r\n });\r\n this.props.onCharLimitLoad(this.calcMessageLimit(obj.message_segment_limit));\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Twilio Account Info\", JSON.stringify(error, null, 4));\r\n }\r\n }\r\n };\r\n\r\n // determines the weird header size and new character limit based on user inputted characters\r\n calcMessageLimit = (segments: number) => {\r\n // each header over 1 message is 7 characters\r\n // each segments is 160 character \r\n if (segments > 1)\r\n return 153 * segments;\r\n return 160;\r\n };\r\n\r\n calcUsedChars = () => {\r\n const char_count = this.props.message_char_count;\r\n if (char_count <= 160) {\r\n return 1;\r\n }\r\n\r\n const segs = Math.ceil(char_count / 160);\r\n const char_count_with_header = char_count + (7 * segs);\r\n return Math.ceil(char_count_with_header / 160);\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.branch_id !== prevProps.branch_id) {\r\n this.load();\r\n \r\n }\r\n }\r\n\r\n render() {\r\n let statistics\r\n if(this.state.branch=='1000')\r\n statistics = \r\n\r\n return (\r\n
\r\n {this.state.loading ?\r\n :\r\n
\r\n {this.state.testing ? \r\n \r\n : null}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n {statistics}\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\nexport default TwilioAccount;\r\n","import React, { Component } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\n\r\nimport { Button, Col, Tooltip, Typography, Input, Checkbox, Popconfirm, Alert } from 'antd';\r\nimport { SendOutlined } from '@ant-design/icons';\r\n\r\nconst { Title } = Typography;\r\nconst { TextArea } = Input;\r\n\r\ntype Props = {\r\n character_limit: number,\r\n onStage: (b: boolean) => void,\r\n messageLength: (length: number) => void,\r\n onSend: (url: string, message_body: string) => void,\r\n selected_ids: any,\r\n excluded_ids: any,\r\n};\r\n\r\ntype State = {\r\n loading: boolean,\r\n disabled: boolean,\r\n staging: boolean,\r\n message: string,\r\n send_success: any,\r\n show_alert?: any,\r\n alert_message?: string;\r\n prefix: string;\r\n};\r\n\r\nfunction decode_token_extra_data(token: string) {\r\n // NOTE token argument ignored for now\r\n const access_token = localStorage.getItem(\"access_token\") || \"\";\r\n // split token (base64) into header, payload and (opt) signature\r\n const [header_base64, payload_base64] = access_token.split(\".\");\r\n\r\n // convert data from base64 back into regular string\r\n const payload_json = atob(payload_base64);\r\n // return just the \"exd\" field in the token json\r\n // and discard other data (exd shall be a subobj as defined in backend admin)\r\n return (JSON.parse(payload_json).exd);\r\n}\r\n\r\nclass SendButton extends Component {\r\n state: State = {\r\n loading: false,\r\n disabled: true,\r\n staging: false,\r\n message: \"\",\r\n send_success: {},\r\n prefix: \"\",\r\n };\r\n\r\n private textArea: any;\r\n\r\n clearFields() {\r\n console.log(\"clearing!\");\r\n this.textArea?.setValue(\"\");\r\n this.setState({\r\n message: \"\"\r\n });\r\n }\r\n\r\n sendList = () => {\r\n // TODO: Create a log entry here for the current filter settings\r\n this.setState({\r\n loading: true,\r\n show_alert: false\r\n });\r\n\r\n try {\r\n const { branch, dept, groups, ex_groups, empStatuses, empDesig } = this.props.selected_ids;\r\n const { excluded_ids } = this.props;\r\n var message = this.state.prefix + this.state.message;\r\n const payload = {\r\n \"branch_id\": branch,\r\n \"department_id\": dept,\r\n \"ac_group_ids\": groups,\r\n \"ac_ex_group_ids\": ex_groups,\r\n \"emp_statuses\": empStatuses,\r\n \"emp_desigs\": empDesig,\r\n \"exclude_users\": excluded_ids,\r\n \"message\": message,\r\n };\r\n\r\n axiosInstance.post('shout/send/', payload)\r\n .then(res => {\r\n const obj = res.data.emp_list;\r\n this.handleSendResult(obj);\r\n }).catch(error => {\r\n this.setState({\r\n show_alert: true,\r\n alert_message: \"There's been an error sending your message. Please copy the following text into a support ticket so Rubi Works can spring into action: \" + error.response.data.message,\r\n loading: false,\r\n staging: false,\r\n disabled: false,\r\n });\r\n });\r\n } catch (error) {\r\n console.log(\"Error Sending Messages: \", JSON.stringify(error, null, 4));\r\n }\r\n };\r\n\r\n componentDidMount() {\r\n //set prefix to empty string if not present or null\r\n const prefix = decode_token_extra_data(\"\").prefix || \"\";\r\n this.setState({\r\n prefix: prefix,\r\n })\r\n\r\n }\r\n\r\n handleSendResult = (e: any) => {\r\n console.log(e);\r\n // pass the success object up a level\r\n this.setState({ loading: false, staging: false, disabled: false });\r\n this.props.onSend(e.url, e.message_body);\r\n };\r\n\r\n handleStaging = () => {\r\n if (this.state.staging) {\r\n this.setState({\r\n staging: false\r\n });\r\n // kick this over to a handler function so we can pass fake data to it for testing\r\n this.props.onStage(false);\r\n } else {\r\n this.setState({ staging: true });\r\n this.props.onStage(true);\r\n }\r\n };\r\n\r\n handleMessageChange = (e: any) => {\r\n this.setState({ message: e.target.value });\r\n this.props.messageLength(e.target.value.length + this.state.prefix.length);\r\n };\r\n\r\n fakeIt = () => {\r\n const obj = {\r\n \"emp_list\": {\r\n \"notification_sid\": \"NTd89f75f00e29ec3abf8da4a8ca2c9365\",\r\n \"url\": \"https://www.twilio.com/console/notify/services/ISa6c21371223d59f3885c66e3494d4f4f/logs/NTd89f75f00e29ec3abf8da4a8ca2c9365\",\r\n \"phone_list\": [\"+12024138320\", \"+17574704204\"],\r\n \"message_body\": \"Test message\"\r\n }\r\n };\r\n this.handleSendResult(obj.emp_list);\r\n };\r\n\r\n render() {\r\n return (\r\n
\r\n \r\n Compose Message\r\n this.textArea = textArea}\r\n />\r\n \r\n \r\n By checking this box you are agreeing to sending the message above to the recepient list generated. Rubi Works LLC is not reponsible for the content or potential costs caused by user error or negligence.\r\n \r\n \r\n \r\n \r\n }\r\n loading={this.state.loading}\r\n disabled={!this.state.staging}\r\n >\r\n Send SMS Notifications\r\n \r\n \r\n \r\n {this.state.show_alert ? (\r\n \r\n ) : (null)}\r\n \r\n
\r\n );\r\n }\r\n}\r\nexport default SendButton;\r\n","import React, { Component, createRef, RefObject } from 'react';\r\n\r\nimport BranchOption from './BranchOption';\r\nimport DeptOption from './DeptOption';\r\nimport GroupOption from './GroupOption';\r\nimport ExGroupOption from './ExGroupOption';\r\nimport EmpStatusOption from './EmpStatusOption';\r\nimport EmpDesigOption from './EmpDesigOption';\r\nimport EmpList, { UnconnectedEmpList } from './EmpList'; //changed EmpList to UnconnectedEmpList/ see EmpList for reference\r\nimport TwilioAccount from './TwilioAccount';\r\nimport SendButton from './SendButton';\r\n\r\nimport { Row, Col, Tooltip, Form, Typography, Divider } from 'antd';\r\n\r\n\r\nconst { Title, Text } = Typography;\r\n\r\ntype Props = {\r\n handleSend: (url: string, msg: string) => void,\r\n};\r\ntype State = {\r\n selected: {\r\n branch?: any,\r\n dept: any[],\r\n groups: any[],\r\n ex_groups: any[],\r\n empStatuses: any[],\r\n empDesig?: any,\r\n },\r\n excluded_ids: any[],\r\n branches_loading: boolean,\r\n message_char_count: number,\r\n selected_count: number,\r\n staging: boolean,\r\n character_limit: number,\r\n};\r\n\r\nclass ShoutTool extends Component {\r\n state: State = {\r\n selected: {\r\n branch: undefined,\r\n dept: [],\r\n empStatuses: [],\r\n groups: [],\r\n ex_groups: [],\r\n empDesig: undefined,\r\n },\r\n excluded_ids: [],\r\n branches_loading: true,\r\n message_char_count: 0,\r\n selected_count: 0,\r\n staging: false,\r\n character_limit: 160\r\n };\r\n\r\n private sendButtonRef: RefObject = createRef();\r\n private empListRef: RefObject = createRef(); //changed EmpList to UnconnectedEmpList/ see EmpList for reference\r\n private deptOptionRef: RefObject = createRef();\r\n private groupsOptionRef: RefObject = createRef();\r\n private exGroupsOptionRef: RefObject = createRef();\r\n private empStatOptionRef: RefObject = createRef();\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n updateSelected = (k: any, v: any) => {\r\n this.setState(prevState => ({\r\n ...prevState,\r\n selected: {\r\n ...prevState.selected,\r\n [k]: v\r\n }\r\n }));\r\n };\r\n\r\n updateExcluded = (e: any) => {\r\n console.log(\"current ex list\", this.state.excluded_ids);\r\n console.log(\"new ex list\", e);\r\n this.setState({ excluded_ids: e });\r\n };\r\n\r\n updateLoading = (loadingState: boolean) => {\r\n this.setState({ branches_loading: loadingState });\r\n };\r\n\r\n load = () => { \r\n \r\n console.log(\"Shout loaded\");\r\n };\r\n\r\n handleStaging = (e: boolean) => {\r\n this.setState({\r\n staging: e\r\n });\r\n };\r\n\r\n updateSMSCharCount = (e: number) => {\r\n this.setState({\r\n message_char_count: e\r\n });\r\n };\r\n\r\n updateSelectedCount = (e: any) => {\r\n this.setState({ selected_count: e });\r\n };\r\n\r\n updateCharacterLimit = (e: any) => {\r\n this.setState({ character_limit: e });\r\n };\r\n\r\n handleSend = (url: any, msg: any) => {\r\n this.props.handleSend(url, msg);\r\n };\r\n\r\n clearFields() {\r\n // call each of the components in the page to clear their selections\r\n this.setState({\r\n message_char_count: 0,\r\n selected_count: 0,\r\n });\r\n\r\n this.sendButtonRef?.current?.clearFields();\r\n this.empListRef?.current?.clearFields();\r\n this.deptOptionRef?.current?.clearFields();\r\n this.groupsOptionRef?.current?.clearFields();\r\n this.exGroupsOptionRef?.current?.clearFields();\r\n this.empStatOptionRef?.current?.clearFields();\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n \r\n \r\n \r\n Branch\r\n \r\n \r\n \r\n \r\n \r\n Department\r\n \r\n \r\n\r\n \r\n Groups\r\n \r\n \r\n \r\n \r\n \r\n Employee Status\r\n \r\n \r\n \r\n Employee Designation\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n Excludes are applied after gathering all possible employees.\r\n \r\n \r\n Exclude Groups\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\nexport default ShoutTool;\r\n","import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';\r\nimport type { RootState, AppDispatch } from './store';\r\n\r\n// Use throughout your app instead of plain `useDispatch` and `useSelector`\r\nexport const useAppDispatch = () => useDispatch();\r\nexport const useAppSelector: TypedUseSelectorHook = useSelector; // <-- function alias\r\n\r\n\r\n// NOTE react-redux has hooks\r\n// for TS\r\n// TS types say how those hooks work\r\n// but they do not apply to generics\r\n\r\n// import 3 hooks\r\n// \r\n// define pretyped app versions of dispatch and selector\r\n// useAppDispatch => T\r\n// useAppSelector => T","import React, { Component, useEffect, useState } from 'react';\r\nimport axiosInstance from '../axiosApi';\r\nimport { Timeline, Skeleton, Table, message, Button, InputNumber, Pagination, Modal } from 'antd';\r\nimport { connect } from 'react-redux';\r\nimport { PageSelector } from '../features/ServerSidePaginator/Ssp';\r\nimport { useAppDispatch, useAppSelector } from '../redux/hooks';\r\n\r\nimport {\r\n paginationPrev,\r\n paginationNext,\r\n paginationExact,\r\n pageGoto,\r\n populateItems,\r\n} from '../features/ServerSidePaginator/sspSlice';\r\n\r\nconst modalContext = React.createContext({});\r\nconst modalContent = {\r\n title: 'Recepient phone numbers',\r\n content: (\r\n <>\r\n {phone_list => `${phone_list}`}\r\n \r\n ),\r\n}\r\n\r\nexport default function ShoutHistory(props: any) {\r\n const urlPrev = useAppSelector((state) => state.ssp.urlPrev);\r\n const urlNext = useAppSelector((state) => state.ssp.urlNext);\r\n const [loading, setLoading] = useState(true);\r\n const [history, setHistory] = useState([]);\r\n const dispatch = useAppDispatch();\r\n // const [selectedPage, setSelectedPage] = useState('2');\r\n const [pageNumber, setPageNumber] = useState(useAppSelector((state) => state.ssp.indexCurrent || 1));\r\n const [pageSize, setPageSize] = useState(useAppSelector((state) => state.ssp.pageSize));\r\n const [isModalVisible, setModalVisible] = useState(false);\r\n const expandable = {\r\n expandedRowRender: (record: any) => record.d_j.phone_list, //.forEach((i:string) => {{

PHONE {i}

}}),\r\n rowExpandable: (record: any) => record.d_j.phone_list instanceof Array,\r\n defaultExpandAllRows: false,\r\n };\r\n\r\n const [modal, contextHolder] = Modal.useModal();\r\n\r\n const columns = [\r\n {\r\n title: 'Time Stamp',\r\n dataIndex: 'created',\r\n key: 'created',\r\n },\r\n {\r\n title: 'Message',\r\n dataIndex: 'body',\r\n key: 'body',\r\n },\r\n {\r\n title: 'Sender',\r\n dataIndex: 'user',\r\n key: 'user',\r\n },\r\n {\r\n title: 'Branch',\r\n dataIndex: 'branch',\r\n key: 'branch',\r\n }\r\n ];\r\n\r\n useEffect(() => {\r\n load(\"shout/history/\", \"?page=1\");\r\n setPageSize(50);\r\n\r\n }, []);\r\n\r\n const load = (urlPath: string, queryArgs: string) => {\r\n try { // does NOT effect promises (.then(s))\r\n axiosInstance.get(urlPath + queryArgs)\r\n .then(res => {\r\n try {\r\n dispatch(populateItems(res.data));\r\n setLoading(false);\r\n } catch (e) {\r\n console.log(\r\n res.statusText + \"; \" +\r\n res.config.url + \"-> \" +\r\n (res.data.length ? \"(some data)\" : \"no data\") + \"\\n\" +\r\n e\r\n );\r\n setLoading(false);\r\n loadFail();\r\n }\r\n });\r\n } catch (error) {\r\n console.log(\"Error Loading Histories: \", JSON.stringify(error, null, 4));\r\n }\r\n };\r\n\r\n const loadFail = () => {\r\n message.warning(\"Loading data failed.\");\r\n };\r\n\r\n const showModal = (e: any) => {\r\n\r\n setModalVisible(true);\r\n };\r\n\r\n const onModalOK = () => {\r\n setModalVisible(false);\r\n };\r\n\r\n return (\r\n\r\n\r\n\r\n \r\n
\r\n
\r\n record.d_j.key}\r\n\r\n expandable={{\r\n expandedRowRender: (record: any) =>

{record.d_j.phone_list}

, //.forEach((i:string) => {{

PHONE {i}

}}),\r\n rowExpandable: (record: any) => record.d_j.phone_list instanceof Array && record.d_j.phone_list != [],\r\n }}\r\n dataSource={useAppSelector((state) => state.ssp.items)}\r\n />\r\n\r\n\r\n\r\n state.ssp.itemCount)}\r\n pageSize={useAppSelector((state) => state.ssp.pageSize)}\r\n onChange={(page: number, pageSize?: number | undefined) => {\r\n setPageNumber(page);\r\n load(\"shout/history/\", \"?page=\" + page);\r\n }} />\r\n\r\n {contextHolder}\r\n\r\n
\r\n
\r\n
\r\n\r\n )\r\n}\r\n","import React, { Component, createRef } from 'react';\r\n\r\nimport ShoutTool from './ShoutTool';\r\nimport ShoutHistory from './ShoutHistory';\r\nimport { Typography, Tabs, Divider } from 'antd';\r\nimport { HistoryOutlined } from '@ant-design/icons';\r\nimport { RefObject } from 'react';\r\n\r\nconst { TabPane } = Tabs;\r\nconst { Title } = Typography;\r\nconst { Text } = Typography;\r\n\r\ntype Props = {};\r\ntype State = {\r\n selected: {\r\n branch: number,\r\n dept: any[],\r\n groups: any[],\r\n ex_groups: any[],\r\n empStatuses: any[],\r\n empDesig?: any,\r\n },\r\n selected_count: number,\r\n excluded_ids: any[],\r\n loading: {\r\n branches: boolean,\r\n departments: boolean,\r\n groups: boolean,\r\n ex_groups: boolean\r\n },\r\n message_char_count: number,\r\n staging: boolean,\r\n send_success: {\r\n url: string,\r\n message_body: string,\r\n new_entry: boolean,\r\n },\r\n current_tab: string,\r\n};\r\n\r\n\r\nclass Shout extends Component {\r\n state: State = {\r\n selected: {\r\n branch: 0,\r\n dept: [],\r\n groups: [],\r\n ex_groups: [],\r\n empStatuses: [],\r\n empDesig: undefined,\r\n },\r\n selected_count: 0,\r\n excluded_ids: [],\r\n loading: {\r\n branches: true,\r\n departments: true,\r\n groups: true,\r\n ex_groups: true,\r\n },\r\n message_char_count: 0,\r\n staging: false,\r\n send_success: {\r\n url: \"\",\r\n message_body: \"\",\r\n new_entry: false,\r\n },\r\n current_tab: \"1\",\r\n }\r\n\r\n private ShoutToolRef: RefObject = createRef();\r\n\r\n updateSelected = (k: string, v: any) => {\r\n this.setState((prevState: State) => ({\r\n ...prevState,\r\n selected: {\r\n ...prevState.selected,\r\n [k]: v\r\n }\r\n }))\r\n }\r\n\r\n updateExcluded = (e: any[]) => {\r\n console.log(\"current ex list\", this.state.excluded_ids);\r\n console.log(\"new ex list\", e);\r\n this.setState({ excluded_ids: e })\r\n }\r\n\r\n updateSMSCharCount = (e: number) => {\r\n this.setState({\r\n message_char_count: e\r\n })\r\n }\r\n\r\n updateSelectedCount = (e: number) => {\r\n this.setState({ selected_count: e })\r\n }\r\n\r\n changeTab = (newTab: string) => {\r\n this.setState({ current_tab: newTab })\r\n }\r\n\r\n sendSuccess = (url: any, message: any) => {\r\n this.setState({\r\n send_success: {\r\n url,\r\n message_body: message,\r\n new_entry: true,\r\n }\r\n }, () => {\r\n this.changeTab(\"3\");\r\n this.ShoutToolRef.current?.clearFields();\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n
\r\n
\r\n Shout\r\n Welcome! Shout allows you to send targeted and customized SMS notifications to Alayacare employees, clients, and contacts.\r\n \r\n
\r\n \r\n \r\n \r\n \r\n\r\n \r\n Client notifications are currently under development.\r\n\r\n ...wait. How did you get in here?! Guards!!\r\n \r\n\r\n \r\n \r\n History\r\n \r\n } key=\"3\">\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default Shout;\r\n","import { useEffect, useState } from 'react';\r\nimport { Table, message, Pagination } from 'antd';\r\nimport axiosInstance from '../../axiosApi';\r\nimport { useAppDispatch, useAppSelector } from '../../redux/hooks';\r\nimport {\r\n sparklesPopulateItems\r\n} from '../../features/ServerSidePaginator/sspSliceSparkles';\r\nimport axios from 'axios';\r\nimport time_localize from './Sparkles';\r\n\r\nexport default function SparklesHistory(props: any) {\r\n const dispatch = useAppDispatch();\r\n const [loading, setLoading] = useState(true);\r\n const [pageNumber, setPageNumber] = useState(useAppSelector((state) => state.sspSparkles.indexCurrent || 1));\r\n const [pageSize, setPageSize] = useState(useAppSelector((state) => state.sspSparkles.pageSize));\r\n const columns = [\r\n {\r\n title: 'Time Stamp',\r\n dataIndex: 'timestamp',\r\n key: 'timestamp',\r\n },\r\n {\r\n title: 'Recipient',\r\n dataIndex: 'recipient',\r\n key: 'recipient',\r\n },\r\n {\r\n title: 'Message',\r\n dataIndex: 'content',\r\n key: 'content',\r\n },\r\n {\r\n title: 'Sending Result',\r\n dataIndex: 'response',\r\n key: 'response',\r\n },\r\n {\r\n title: 'Branch',\r\n dataIndex: ['sparkle_run', 'sparkle', 'branch_owner', 'name'],\r\n key: 'branch_owner',\r\n }\r\n ];\r\n\r\n useEffect(() => {\r\n load(\"sparkles/history/\", \"?page=1\");\r\n setPageSize(50);\r\n\r\n }, []);\r\n\r\n const load = (urlPath: string, queryArgs: string) => {\r\n axiosInstance.get(urlPath + queryArgs)\r\n .then(res => {\r\n try {\r\n dispatch(sparklesPopulateItems(res.data));\r\n setLoading(false);\r\n } catch (e) {\r\n console.log(\"Error fetching Sparkles history → \" + e);\r\n setLoading(false);\r\n }\r\n });\r\n };\r\n\r\n\r\n return (\r\n
\r\n
\r\n {\r\n state.sspSparkles.items)}\r\n columns={columns}\r\n pagination={false} />\r\n\r\n }\r\n\r\n state.sspSparkles.itemCount)}\r\n pageSize={useAppSelector((state) => state.sspSparkles.pageSize)}\r\n onChange={(page: number, pageSize?: number | undefined) => {\r\n setPageNumber(page);\r\n load(\"sparkles/history/\", \"?page=\" + page);\r\n }} />\r\n \r\n \r\n\r\n )\r\n\r\n};\r\n","import React, { Component } from 'react';\r\n\r\nimport SparklesHistory from './SparklesHistory';\r\nimport { Typography, Tabs, Divider, Card, Row, Col, Table, Checkbox, Popconfirm, Skeleton, Tooltip } from 'antd';\r\nimport { HistoryOutlined } from '@ant-design/icons';\r\n\r\nimport cronstrue from 'cronstrue';\r\nimport parser from 'cron-parser';\r\n\r\nimport axiosInstance from '../../axiosApi';\r\n\r\nconst { TabPane } = Tabs;\r\nconst { Title, Text } = Typography;\r\n\r\ntype Props = {};\r\ntype State = {\r\n loading: boolean,\r\n current_tab: string,\r\n items: any[],\r\n history: any[];\r\n};\r\n\r\nfunction time_tzabbrev(in_date: Date) {\r\n return in_date.toLocaleString(\r\n 'en-US', { // abbreviate timezone (must do manually)\r\n timeZoneName: 'long' \r\n }).split(\r\n ' '\r\n ).slice(3).map(\r\n el => el[0]\r\n ).join(\r\n ''\r\n ).toUpperCase();\r\n};\r\n\r\nfunction time_nextrun(in_date: Date) {\r\n return in_date.toLocaleString('en-US', {\r\n weekday: 'short', \r\n month: 'short', \r\n day: 'numeric', \r\n hour:'2-digit', \r\n hour12: true, \r\n minute: '2-digit',\r\n }) + \" \" + time_tzabbrev(in_date);\r\n\r\n};\r\n\r\nfunction time_localize(in_date: Date) {\r\n const now = new Date(Date());\r\n const tz_offset = now.getTimezoneOffset() / 60;\r\n const next_date = in_date;\r\n\r\n console.log(\r\n \"Now: \" + now + \"\\n\" +\r\n \"Offset: \" + tz_offset + \"\\n\" + \r\n \"t(Next): \" + next_date + \"\\n\"\r\n );\r\n\r\n next_date.setHours( // Resets TZ\r\n next_date.getHours() //+ -tz_offset\r\n );\r\n\r\n console.log(\r\n \"t(NextAdj): \" + next_date + \"\\n\" \r\n );\r\n\r\n return next_date;\r\n\r\n};\r\n\r\nclass Sparkles extends Component {\r\n state: State = {\r\n loading: true,\r\n current_tab: \"1\",\r\n items: [],\r\n history: []\r\n };\r\n\r\n componentDidMount() {\r\n this.load();\r\n }\r\n\r\n onSparkleUpdate = (sparkle_id: any) => {\r\n\r\n //This is so gross but here it goes\r\n let items = [...this.state.items]\r\n\r\n let i = -1\r\n for (let j = 0; j < this.state.items.length && i == -1; j++) {\r\n if (this.state.items[j].id == sparkle_id) {\r\n i = j\r\n }\r\n }\r\n\r\n let item = { ...items[i] }\r\n\r\n axiosInstance.post('/sparkles/enabled/', {\r\n sparkle_id: sparkle_id,\r\n sparkle_enabled: !item.enabled\r\n }).then(response => {\r\n item.enabled = !item.enabled\r\n items[i] = item\r\n this.setState({ items })\r\n }).catch(error => {\r\n items[i] = item\r\n this.setState({ items })\r\n })\r\n }\r\n\r\n onNotifUpdate = (sparkle_id: any, notif_id: any) => {\r\n //This is so gross but here it goes\r\n let sparkles = [...this.state.items]\r\n\r\n let sparkle_index = -1\r\n for (let j = 0; j < this.state.items.length && sparkle_index == -1; j++) {\r\n if (this.state.items[j].id == sparkle_id) {\r\n sparkle_index = j\r\n }\r\n }\r\n\r\n let sparkle = { ...sparkles[sparkle_index] }\r\n sparkles[sparkle_index] = sparkle\r\n\r\n let notif_index = -1\r\n for (let j = 0; j < this.state.items.length && notif_index == -1; j++) {\r\n if (this.state.items[sparkle_index].notifications[j].id == notif_id) {\r\n notif_index = j;\r\n }\r\n }\r\n\r\n let notif = { ...sparkles[sparkle_index].notifications[notif_index] }\r\n\r\n axiosInstance.post('/sparkles/notifications/enabled/', {\r\n sparkle_id: sparkle_id,\r\n notification_id: notif_id,\r\n notification_enabled: !notif.enabled,\r\n }).then(response => {\r\n notif.enabled = !notif.enabled\r\n sparkles[sparkle_index].notifications[notif_index] = notif\r\n this.setState({ items: sparkles })\r\n }).catch(error => {\r\n sparkles[sparkle_index].notifications[notif_index] = notif\r\n this.setState({ items: sparkles })\r\n })\r\n }\r\n\r\n \r\n\r\n load = () => {\r\n try { // does not apply to promises (i.e. \".then()\")\r\n axiosInstance.get('sparkles/list/')\r\n .then(res => {\r\n try {\r\n const obj = res.data; \r\n\r\n obj.forEach((o: any) => { \r\n o.schedule = cronstrue.toString(o.run_schedule);\r\n o.next_date = time_localize(\r\n new Date(parser.parseExpression(o.run_schedule).next().toString())\r\n );\r\n });\r\n\r\n this.setState({\r\n items: obj.reverse(),\r\n loading: false\r\n });\r\n } catch (e) {\r\n console.log(res.statusText + \"; \" + res.config.url + \"-> \" + res.data.length + \"B\\n\" + e);\r\n }\r\n });\r\n \r\n } catch (error) {\r\n console.log(\"Error Loading Sparkles: \", JSON.stringify(error, null, 4));\r\n }\r\n };\r\n\r\n changeTab = (newTab: string) => {\r\n this.setState({ current_tab: newTab });\r\n };\r\n\r\n render() {\r\n const options = this.state.items.map((d: any, index: number) => {\r\n return (\r\n
\r\n \r\n \r\n {\r\n d.schedule\r\n }\r\n
Next Run: {time_nextrun(d.next_date)}\r\n \r\n \r\n

{d.description}

\r\n this.onSparkleUpdate(d.id)} onCancel={(e) => { }} okText=\"Confirm Change\" cancelText=\"I changed my mind.\">\r\n { }}>Enable Sparkle\r\n \r\n \r\n \r\n
\r\n Rules\r\n {d.rules.map((r: any, index: any) => {\r\n return (\r\n
\r\n {r.name}\r\n

{r.notes}

\r\n
\r\n );\r\n })}\r\n \r\n \r\n Notifications\r\n {d.notifications.map((n: any, index: number) => {\r\n return (\r\n
\r\n {n.name}\r\n

{n.notes}

\r\n this.onNotifUpdate(d.id, n.id)} onCancel={(e) => { }} okText=\"Confirm Change\" cancelText=\"I changed my mind.\">\r\n { }}>Enable Notification\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 const dataSource = this.state.history;\r\n\r\n const columns = [\r\n {\r\n title: 'Time Stamp',\r\n dataIndex: 'timestamp',\r\n key: 'timestamp',\r\n },\r\n {\r\n title: 'Recipient',\r\n dataIndex: 'recipient',\r\n key: 'recipient',\r\n },\r\n {\r\n title: 'Message',\r\n dataIndex: 'content',\r\n key: 'content',\r\n },\r\n {\r\n title: 'Sending Result',\r\n dataIndex: 'response',\r\n key: 'response',\r\n },\r\n {\r\n title: 'Branch',\r\n dataIndex: ['sparkle_run', 'sparkle', 'branch_owner', 'name'],\r\n key: 'branch_owner',\r\n }\r\n ];\r\n\r\n return (\r\n
\r\n {\r\n this.state.loading ?\r\n :\r\n
\r\n
\r\n Sparkles\r\n Sparkles allows you to create visit reminders for employees, get visit late alerts, and much more!\r\n \r\n
\r\n \r\n \r\n {options}\r\n \r\n\r\n \r\n \r\n History\r\n \r\n } key=\"2\">\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 Sparkles;\r\n","import React, { Component } from 'react';\r\n\r\nimport axiosInstance from '../axiosApi';\r\n\r\nimport { Alert, Form, Input, Button, PageHeader, Card } from 'antd';\r\n\r\nimport { LockOutlined } from '@ant-design/icons';\r\n\r\nconst formItemLayout = {};\r\nconst tailFormItemLayout = {};\r\n\r\ntype Props = {};\r\ntype State = {\r\n show_alert: boolean,\r\n alert_message?: string,\r\n alert_type: \"error\" | \"info\" | \"success\" | \"warning\",\r\n is_loading: boolean,\r\n};\r\n\r\nclass Account extends Component {\r\n state: State = {\r\n show_alert: false,\r\n alert_type: \"error\",\r\n is_loading: false,\r\n };\r\n\r\n onFinish = (values: any) => {\r\n console.log('Success:', values);\r\n\r\n this.setState({\r\n is_loading: true,\r\n show_alert: false,\r\n });\r\n axiosInstance.post('/api/user/password/change/', {\r\n current_password: values.curr_pw,\r\n new_password: values.new_pw,\r\n new_password_confirm: values.new_pw_confirm\r\n }).then(response => {\r\n this.setState({\r\n is_loading: false,\r\n show_alert: true,\r\n alert_message: \"Password updated successfully.\",\r\n alert_type: \"info\"\r\n });\r\n }).catch(error => {\r\n this.setState({\r\n is_loading: false,\r\n show_alert: true,\r\n alert_message: \"Error changing password: \" + error.response.data.error,\r\n alert_type: \"error\"\r\n });\r\n });\r\n };\r\n\r\n onFinishFailed = (errorInfo: any) => {\r\n console.log('Failed:', errorInfo);\r\n };\r\n\r\n render() {\r\n return (\r\n
\r\n window.history.back()}\r\n title=\"Account Settings\"\r\n subTitle=\"View and change your account settings\"\r\n >\r\n \r\n

Passwords must be at least 16 characters long. A combination of 5 words or a phrase is a highly memorable way to achieve this.

\r\n \r\n \r\n } />\r\n \r\n ({\r\n validator(rule, value) {\r\n if (value.length >= 16) {\r\n return Promise.resolve();\r\n }\r\n return Promise.reject('Your password must be at least 16 characters. Try using a personally significant phrase.');\r\n },\r\n })\r\n ]}\r\n hasFeedback\r\n >\r\n } />\r\n \r\n ({\r\n validator(rule, value) {\r\n if (!value || getFieldValue('new_pw') === value) {\r\n return Promise.resolve();\r\n }\r\n return Promise.reject('The two passwords that you entered do not match!');\r\n },\r\n }),\r\n ]}\r\n >\r\n } />\r\n \r\n {this.state.show_alert ? (\r\n \r\n \r\n \r\n ) : (null)}\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 Account;\r\n","import React from 'react';\r\nimport { Route, Redirect, RouteComponentProps } from 'react-router-dom';\r\nimport { store } from '../redux/store'\r\n\r\ntype Props = {\r\n path: string[],\r\n isAuthenticated: boolean,\r\n children: any,\r\n render?: (props: RouteComponentProps) => React.ReactNode,\r\n exact?: boolean,\r\n};\r\n\r\nconst PrivateRoute = ({ render, exact, path, isAuthenticated , children }: Props) => {\r\n\r\n if(sessionStorage.getItem(\"isAuth\") === 'true')\r\n isAuthenticated = true\r\n else isAuthenticated = false\r\n\r\n return (\r\n \r\n {isAuthenticated ?\r\n (children) :\r\n }\r\n \r\n );\r\n};\r\n\r\nexport default PrivateRoute;\r\n","import React, { Component } from \"react\";\r\nimport { Switch, Route, Link } from \"react-router-dom\";\r\nimport Login from \"./components/Login\";\r\nimport Shout from \"./components/Shout\";\r\nimport Sparkles from \"./components/sparkles/Sparkles\";\r\nimport Account from \"./components/Account\";\r\nimport PrivateRoute from \"./components/PrivateRoute\";\r\nimport jwtDecode, { JwtPayload } from \"jwt-decode\";\r\nimport axiosInstance, { refreshToken } from \"./axiosApi\";\r\nimport { store } from \"./redux/store\";\r\nimport \"./App.css\";\r\nimport { Layout, Menu, Button } from \"antd\";\r\nimport { Row, Col } from \"antd\";\r\n\r\nimport {\r\n TeamOutlined,\r\n UnorderedListOutlined,\r\n SoundOutlined,\r\n LoginOutlined,\r\n LogoutOutlined,\r\n ClockCircleOutlined,\r\n RocketOutlined,\r\n AlertOutlined,\r\n LockOutlined,\r\n} from \"@ant-design/icons\";\r\nimport { connect } from \"react-redux\";\r\nimport Item from 'antd/lib/list/Item';\r\n\r\nconst { Header, Content, Footer, Sider } = Layout;\r\n\r\ntype Props = {};\r\ntype State = {\r\n isAuthenticated: boolean;\r\n selectedMenuItem: string;\r\n defaultSelectedMenuItem: string;\r\n countryCode?: string;\r\n};\r\n\r\n// the deskcontactwidget is an explicit assignment\r\n// to a global object; various TypeScript specs\r\n// prevent this, so we need to\r\ndeclare global {\r\n interface Window {\r\n deskcontactwidget: any;\r\n }\r\n}\r\n\r\nvar installHelpDeskWidget = function () {\r\n // helpdesk widget\r\n var basehref = \"https://portal.rubi.works\",\r\n token = \"094b9f36-1c7e-4d8b-a398-0af2ed536551\";\r\n\r\n window.deskcontactwidget = {};\r\n var r = document.getElementsByTagName(\"script\")[0],\r\n c = document.createElement(\"script\");\r\n c.type = \"text/javascript\";\r\n c.async = !0;\r\n c.src = basehref + \"/support/v1/contact/main.js?token=\" + token;\r\n\r\n if (r.parentNode)\r\n r.parentNode.insertBefore(c, r);\r\n\r\n window.addEventListener(\"message\",\r\n function (e) {\r\n var t = e.data[0], a = e.data[1];\r\n var deskcontactwidget = document.getElementById(\"deskcontactwidgetframe\");\r\n\r\n switch (t) {\r\n case \"setContactFormHeight\":\r\n if (deskcontactwidget instanceof HTMLElement)\r\n deskcontactwidget.style.height = Math.min(\r\n a, window.window.innerHeight - 75).toString() + \"px\";\r\n break;\r\n default:\r\n break;\r\n }\r\n }, !1);\r\n\r\n};\r\nclass App extends Component {\r\n state: State = {\r\n isAuthenticated: false,\r\n selectedMenuItem: \"shout\", // bc its at \"/\"\r\n defaultSelectedMenuItem: \"shout\",\r\n countryCode: process.env.REACT_APP_COUNTRY_CODE,\r\n };\r\n\r\n handleLogout = async () => {\r\n try {\r\n sessionStorage.setItem(\"isAuth\", 'false') //store.dispatch({ type: \"Auth\", payload: false });\r\n this.setState({ isAuthenticated: false });\r\n const response = await axiosInstance.post(\"api/blacklist/\", {\r\n refresh_token: localStorage.getItem(\"refresh_token\"),\r\n });\r\n localStorage.removeItem(\"access_token\");\r\n localStorage.removeItem(\"refresh_token\");\r\n axiosInstance.defaults.headers[\"Authorization\"] = null;\r\n return response;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n };\r\n\r\n componentDidMount() {\r\n this.loginStatus();\r\n console.log(process.env.REACT_APP_COUNTRY_CODE);\r\n installHelpDeskWidget();\r\n }\r\n\r\n\r\n loginStatus = () => {\r\n const token: string | null = localStorage.getItem(\"access_token\");\r\n if (token !== null) {\r\n const jwtDecoded: JwtPayload = jwtDecode(token);\r\n let tokenExpiration: any = jwtDecoded.exp;\r\n let dateNow = new Date();\r\n // check on the token and refresh if it's expired\r\n if (token && tokenExpiration < dateNow.getTime() / 5000) {\r\n\r\n try {\r\n sessionStorage.setItem(\"isAuth\", 'true');\r\n refreshToken(localStorage.getItem(\"refresh_token\"))\r\n .then(() => {\r\n this.setState({\r\n isAuthenticated: true,\r\n // selectedMenuItem: \"logout\",\r\n });\r\n })\r\n .catch((err: Error) => {\r\n sessionStorage.setItem(\"isAuth\", 'false');\r\n console.log(err);\r\n this.setState({\r\n isAuthenticated: false,\r\n selectedMenuItem: \"login\",\r\n });\r\n });\r\n } catch (e) {\r\n sessionStorage.setItem(\"isAuth\", 'false');\r\n console.log(\"Error passively refreshing token: \" + e);\r\n this.setState({\r\n isAuthenticated: false,\r\n selectedMenuItem: \"login\",\r\n });\r\n }\r\n } else if (token && sessionStorage.getItem(\"isAuth\") === 'true') {\r\n this.setState({\r\n isAuthenticated: true,\r\n //selectedMenuItem: \"logout\",\r\n });\r\n }\r\n } else {\r\n sessionStorage.setItem(\"isAuth\", 'false');\r\n this.setState({\r\n isAuthenticated: false, //maybe true\r\n selectedMenuItem: \"login\",\r\n }); //isAuthenticated: store.getState().isAuth.auth,\r\n }\r\n };\r\n\r\n onMenuSelect = (e: any) => {\r\n this.setState({\r\n selectedMenuItem: e.key\r\n })\r\n this.loginStatus();\r\n console.log(e);\r\n };\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 Shout\r\n \r\n \r\n \r\n \r\n \r\n Sparkles / Launch\r\n \r\n \r\n \r\n\r\n {this.state.isAuthenticated ? (\r\n \r\n \r\n \r\n \r\n Security\r\n \r\n \r\n \r\n \r\n \r\n Logout\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n Login\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n }\r\n type=\"primary\"\r\n target=\"_blank\"\r\n href={process.env.REACT_APP_SUPPORT}\r\n >\r\n Support\r\n \r\n \r\n \r\n }\r\n target=\"_blank\"\r\n href={process.env.REACT_APP_HOWTO}\r\n >\r\n How To\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 Rubi Space ©2020 Created by Rubi.Works

v2021.10.14\r\n
\r\n
\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nfunction mapStateToProps(state: any) {\r\n return {\r\n isAuth: state.isAuth.auth,\r\n };\r\n}\r\n\r\nexport default connect(mapStateToProps)(App);\r\n","import React from 'react';\r\nimport { render } from 'react-dom';\r\nimport App from './App';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport { store } from './redux/store'\r\nimport {Provider} from 'react-redux'\r\nimport {createStore} from 'redux'\r\n\r\nrender(\r\n // had to turn this off because was getting strict error when Redux was implemented\r\n \r\n \r\n \r\n \r\n ,\r\n // ,\r\n document.getElementById('root')\r\n);\r\n"],"sourceRoot":""}