From dc26d8b58cef60c2669d7e7c322fcdca05e1d50e Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 27 Sep 2023 10:10:49 -0700 Subject: [PATCH 01/32] add route, basic tb layout --- .../MaterialsList/MaterialsList.jsx | 36 +++++++++++++++++++ .../BMDashboard/MaterialsList/index.js | 1 + src/routes.js | 3 +- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/components/BMDashboard/MaterialsList/MaterialsList.jsx create mode 100644 src/components/BMDashboard/MaterialsList/index.js diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx new file mode 100644 index 0000000000..14cc03ab55 --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -0,0 +1,36 @@ +// import { connect } from 'react-redux'; +import { Table } from 'reactstrap'; + +export default function MaterialsList() { + return ( +
+

Material List

+
+ + + + + + + + + + + + + + + + + +
PIDIDNameUnitBoughtUsedAvailableHoldWastedUsage RecordUpdate RecordPurchase Record
+
+
+ ); +} + +// const mapStateToProps = state => ({ +// auth: state.auth, +// }); + +// export default connect(mapStateToProps)(MaterialsList); diff --git a/src/components/BMDashboard/MaterialsList/index.js b/src/components/BMDashboard/MaterialsList/index.js new file mode 100644 index 0000000000..572ddc03d5 --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/index.js @@ -0,0 +1 @@ +export { default } from './MaterialsList'; diff --git a/src/routes.js b/src/routes.js index a8b645b919..a99ad8b89c 100644 --- a/src/routes.js +++ b/src/routes.js @@ -40,10 +40,10 @@ import RoleInfoCollections from 'components/UserProfile/EditableModal/roleInfoMo import SetupProfile from 'components/SetupProfile/SetupProfile'; // BM Dashboard -// import ProtectedBMRoute from 'components/common/BMDashboard/BMProtectedRoute/ProtectedBMRoute'; import BMProtectedRoute from 'components/common/BMDashboard/BMProtectedRoute'; import BMDashboard from 'components/BMDashboard'; import BMLogin from 'components/BMDashboard/Login'; +import MaterialsList from 'components/BMDashboard/MaterialsList'; export default ( <> @@ -155,6 +155,7 @@ export default ( + {/* Temporary route to redirect all subdirectories to login if unauthenticated */} From 798217254109a498a5aba9093a9aa8126bbb078e Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 27 Sep 2023 10:37:24 -0700 Subject: [PATCH 02/32] add very basic tb layout, dummy data --- .../MaterialsList/MaterialsList.jsx | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 14cc03ab55..c5722b371d 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -1,6 +1,42 @@ // import { connect } from 'react-redux'; import { Table } from 'reactstrap'; +const dummyData = [ + { + id: 'P1', + projectId: 'M1', + name: 'Sand', + unit: 'kg', + bought: 55, + used: 25, + available: 25, + hold: 5, + wasted: 0, + }, + { + id: 'P1', + projectId: 'M2', + name: 'Rock', + unit: 'kg', + bought: 100, + used: 50, + available: 50, + hold: 0, + wasted: 0, + }, + { + id: 'P2', + projectId: 'M3', + name: 'Brick', + unit: 'count', + bought: 1000, + used: 500, + available: 400, + hold: 100, + wasted: 0, + }, +]; + export default function MaterialsList() { return (
@@ -23,6 +59,26 @@ export default function MaterialsList() { Purchase Record + + {dummyData.map((mat, idx) => { + return ( + + {mat.projectId} + {mat.id} + {mat.name} + {mat.unit} + {mat.bought} + {mat.used} + {mat.available} + {mat.hold} + {mat.wasted} + Button + Button + Button + + ); + })} +
From 823734d19f928a0dfb84b16dc6d835cf32e3a14f Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 27 Sep 2023 19:55:07 -0700 Subject: [PATCH 03/32] add project select form, logic --- .../MaterialsList/MaterialsList.jsx | 56 ++++++++++++++++--- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index c5722b371d..6f12358329 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -1,10 +1,11 @@ +import { useState, useEffect } from 'react'; // import { connect } from 'react-redux'; -import { Table } from 'reactstrap'; +import { Table, Form, FormGroup, Label, Input } from 'reactstrap'; const dummyData = [ { - id: 'P1', - projectId: 'M1', + id: 'M1', + projectId: 'P1', name: 'Sand', unit: 'kg', bought: 55, @@ -14,8 +15,8 @@ const dummyData = [ wasted: 0, }, { - id: 'P1', - projectId: 'M2', + id: 'M2', + projectId: 'P1', name: 'Rock', unit: 'kg', bought: 100, @@ -25,8 +26,8 @@ const dummyData = [ wasted: 0, }, { - id: 'P2', - projectId: 'M3', + id: 'M3', + projectId: 'P2', name: 'Brick', unit: 'count', bought: 1000, @@ -38,10 +39,47 @@ const dummyData = [ ]; export default function MaterialsList() { + // put materials data into state + const [materials, setMaterials] = useState(dummyData); + + // filter materials data by project + const [selectProject, setSelectProject] = useState('all'); + useEffect(() => { + if (selectProject === 'all') { + return setMaterials(dummyData); + } + const filterMaterials = dummyData.filter(mat => mat.projectId === selectProject); + setMaterials(filterMaterials); + }, [selectProject]); + + // create selectable projects set + const projects = [...new Set(dummyData.map(mat => mat.projectId))]; return (

Material List

+
+
+ + + setSelectProject(e.target.value)} + > + + {projects.map((name, i) => { + return ( + + ); + })} + + +
+
@@ -60,9 +98,9 @@ export default function MaterialsList() { - {dummyData.map((mat, idx) => { + {materials.map((mat, i) => { return ( - + From f8e33363a77d98af69b8e7851b5a3df12d51da2b Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Mon, 2 Oct 2023 14:30:31 -0700 Subject: [PATCH 04/32] add materials fetch action and reducer. map materials to props --- src/actions/bmdashboard/materialsActions.js | 21 +++++++++++++++++++ .../MaterialsList/MaterialsList.jsx | 21 ++++++++++++------- .../bmdashboard/materialsConstants.js | 1 + src/reducers/bmdashboard/materialsReducer.js | 15 +++++++++++++ src/reducers/index.js | 2 ++ src/utils/URL.js | 1 + 6 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 src/actions/bmdashboard/materialsActions.js create mode 100644 src/constants/bmdashboard/materialsConstants.js create mode 100644 src/reducers/bmdashboard/materialsReducer.js diff --git a/src/actions/bmdashboard/materialsActions.js b/src/actions/bmdashboard/materialsActions.js new file mode 100644 index 0000000000..f2c66ece88 --- /dev/null +++ b/src/actions/bmdashboard/materialsActions.js @@ -0,0 +1,21 @@ +import axios from "axios"; +import { ENDPOINTS } from "utils/URL"; +import { SET_MATERIALS } from "constants/bmdashboard/materialsConstants"; + +export const fetchAllMaterials = () => { + return async dispatch => { + axios.get(ENDPOINTS.BM_MATERIALS_LIST) + .then(res => { + console.log('response received', res) + dispatch(setMaterials(res.data)) + }) + .catch(err => console.log(err)) + } +} + +export const setMaterials = payload => { + return { + type: SET_MATERIALS, + payload + } +} \ No newline at end of file diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 6f12358329..cd2b964f70 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -1,7 +1,9 @@ import { useState, useEffect } from 'react'; -// import { connect } from 'react-redux'; +import { connect } from 'react-redux'; import { Table, Form, FormGroup, Label, Input } from 'reactstrap'; +import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; + const dummyData = [ { id: 'M1', @@ -38,9 +40,11 @@ const dummyData = [ }, ]; -export default function MaterialsList() { - // put materials data into state - const [materials, setMaterials] = useState(dummyData); +export function MaterialsList(props) { + console.log('materials props: ', props); + + // dispatch materials fetch action + useEffect(() => props.dispatch(fetchAllMaterials()), []); // filter materials data by project const [selectProject, setSelectProject] = useState('all'); @@ -123,8 +127,9 @@ export default function MaterialsList() { ); } -// const mapStateToProps = state => ({ -// auth: state.auth, -// }); +const mapStateToProps = state => ({ + // auth: state.auth, + materials: state.materials, +}); -// export default connect(mapStateToProps)(MaterialsList); +export default connect(mapStateToProps)(MaterialsList); diff --git a/src/constants/bmdashboard/materialsConstants.js b/src/constants/bmdashboard/materialsConstants.js new file mode 100644 index 0000000000..25299b623a --- /dev/null +++ b/src/constants/bmdashboard/materialsConstants.js @@ -0,0 +1 @@ +export const SET_MATERIALS = 'SET_MATERIALS'; \ No newline at end of file diff --git a/src/reducers/bmdashboard/materialsReducer.js b/src/reducers/bmdashboard/materialsReducer.js new file mode 100644 index 0000000000..4b34d77163 --- /dev/null +++ b/src/reducers/bmdashboard/materialsReducer.js @@ -0,0 +1,15 @@ +import { SET_MATERIALS } from "constants/bmdashboard/materialsConstants" + +const materialsDefaultState = { + materials: [] +} + +export const materialsReducer = (materials = materialsDefaultState, action) => { + if(action.type === SET_MATERIALS) { + return { + ...materialsDefaultState, + materials: action.payload + } + } + return materials +} \ No newline at end of file diff --git a/src/reducers/index.js b/src/reducers/index.js index c5a13f4ec0..73781fe8a7 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -28,6 +28,7 @@ import { ownerMessageReducer } from './ownerMessageReducer'; import { ownerStandardMessageReducer } from './ownerStandardMessageReducer'; import { infoCollectionsReducer} from './informationReducer'; import { mouseoverTextReducer } from './mouseoverTextReducer'; +import { materialsReducer } from './bmdashboard/materialsReducer'; export default combineReducers({ auth: authReducer, @@ -61,4 +62,5 @@ export default combineReducers({ ownerStandardMessage: ownerStandardMessageReducer, infoCollections: infoCollectionsReducer, mouseoverText: mouseoverTextReducer, + materials: materialsReducer }); diff --git a/src/utils/URL.js b/src/utils/URL.js index b4a77b75fb..6950456eb9 100644 --- a/src/utils/URL.js +++ b/src/utils/URL.js @@ -120,6 +120,7 @@ export const ENDPOINTS = { // bm dashboard endpoints BM_LOGIN: `${APIEndpoint}/bm/login`, + BM_MATERIALS_LIST: `${APIEndpoint}/bm/materials` }; export const ApiEndpoint = APIEndpoint; From d5c91f60632fa0b1c7b827f73cae9cc4c9f4421a Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Tue, 3 Oct 2023 11:55:21 -0700 Subject: [PATCH 05/32] update reducer. update frontend props to sync with fetched data. --- src/actions/bmdashboard/materialsActions.js | 2 +- .../MaterialsList/MaterialsList.jsx | 95 +++++++------------ src/reducers/bmdashboard/materialsReducer.js | 19 ++-- 3 files changed, 44 insertions(+), 72 deletions(-) diff --git a/src/actions/bmdashboard/materialsActions.js b/src/actions/bmdashboard/materialsActions.js index f2c66ece88..8992d430ff 100644 --- a/src/actions/bmdashboard/materialsActions.js +++ b/src/actions/bmdashboard/materialsActions.js @@ -1,4 +1,5 @@ import axios from "axios"; + import { ENDPOINTS } from "utils/URL"; import { SET_MATERIALS } from "constants/bmdashboard/materialsConstants"; @@ -6,7 +7,6 @@ export const fetchAllMaterials = () => { return async dispatch => { axios.get(ENDPOINTS.BM_MATERIALS_LIST) .then(res => { - console.log('response received', res) dispatch(setMaterials(res.data)) }) .catch(err => console.log(err)) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index cd2b964f70..82f5882f0f 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -4,60 +4,31 @@ import { Table, Form, FormGroup, Label, Input } from 'reactstrap'; import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; -const dummyData = [ - { - id: 'M1', - projectId: 'P1', - name: 'Sand', - unit: 'kg', - bought: 55, - used: 25, - available: 25, - hold: 5, - wasted: 0, - }, - { - id: 'M2', - projectId: 'P1', - name: 'Rock', - unit: 'kg', - bought: 100, - used: 50, - available: 50, - hold: 0, - wasted: 0, - }, - { - id: 'M3', - projectId: 'P2', - name: 'Brick', - unit: 'count', - bought: 1000, - used: 500, - available: 400, - hold: 100, - wasted: 0, - }, -]; - export function MaterialsList(props) { - console.log('materials props: ', props); + // console.log('materials props: ', props); + // props & state + const { materials } = props; + console.log('🚀 ~ file: MaterialsList.jsx:47 ~ MaterialsList ~ materials:', materials); + const [filteredMaterials, setFilteredMaterials] = useState(materials || []); + const [selectedProject, setSelectedProject] = useState('all'); // dispatch materials fetch action - useEffect(() => props.dispatch(fetchAllMaterials()), []); + useEffect(() => { + props.dispatch(fetchAllMaterials()); + }, []); + + // create selectable projects + const projectsSet = [...new Set(materials.map(mat => mat.project.projectName))]; // filter materials data by project - const [selectProject, setSelectProject] = useState('all'); useEffect(() => { - if (selectProject === 'all') { - return setMaterials(dummyData); + if (selectedProject === 'all') { + return setFilteredMaterials(materials); } - const filterMaterials = dummyData.filter(mat => mat.projectId === selectProject); - setMaterials(filterMaterials); - }, [selectProject]); + const filterMaterials = materials.filter(mat => mat.project.projectName === selectedProject); + setFilteredMaterials(filterMaterials); + }, [selectedProject]); - // create selectable projects set - const projects = [...new Set(dummyData.map(mat => mat.projectId))]; return (

Material List

@@ -70,10 +41,10 @@ export function MaterialsList(props) { id="select-project" name="select-project" type="select" - onChange={e => setSelectProject(e.target.value)} + onChange={e => setSelectedProject(e.target.value)} > - {projects.map((name, i) => { + {projectsSet.map((name, i) => { return (
{mat.projectId} {mat.id} {mat.name}
- - + @@ -96,24 +66,23 @@ export function MaterialsList(props) { - - - + + + - {materials.map((mat, i) => { + {filteredMaterials.map((mat, i) => { return ( - - - - - - - - - + + + + + + + + diff --git a/src/reducers/bmdashboard/materialsReducer.js b/src/reducers/bmdashboard/materialsReducer.js index 4b34d77163..226c80a2e7 100644 --- a/src/reducers/bmdashboard/materialsReducer.js +++ b/src/reducers/bmdashboard/materialsReducer.js @@ -1,15 +1,18 @@ import { SET_MATERIALS } from "constants/bmdashboard/materialsConstants" -const materialsDefaultState = { - materials: [] -} +// const materialsDefaultState = { +// materials: [] +// } -export const materialsReducer = (materials = materialsDefaultState, action) => { +const defaultState = [] + +export const materialsReducer = (materials = defaultState, action) => { if(action.type === SET_MATERIALS) { - return { - ...materialsDefaultState, - materials: action.payload - } + // return { + // ...materialsDefaultState, + // materials: action.payload + // } + return action.payload } return materials } \ No newline at end of file From 08c5aac58d324fb3206d0c338b61864fa5f9e8ac Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Tue, 3 Oct 2023 14:47:34 -0700 Subject: [PATCH 06/32] add error and no results handling --- src/actions/bmdashboard/materialsActions.js | 12 +- .../MaterialsList/MaterialsList.jsx | 116 +++++++++++++----- src/reducers/bmdashboard/materialsReducer.js | 8 -- 3 files changed, 96 insertions(+), 40 deletions(-) diff --git a/src/actions/bmdashboard/materialsActions.js b/src/actions/bmdashboard/materialsActions.js index 8992d430ff..e1215698ab 100644 --- a/src/actions/bmdashboard/materialsActions.js +++ b/src/actions/bmdashboard/materialsActions.js @@ -2,6 +2,7 @@ import axios from "axios"; import { ENDPOINTS } from "utils/URL"; import { SET_MATERIALS } from "constants/bmdashboard/materialsConstants"; +import { GET_ERRORS } from "constants/errors"; export const fetchAllMaterials = () => { return async dispatch => { @@ -9,7 +10,9 @@ export const fetchAllMaterials = () => { .then(res => { dispatch(setMaterials(res.data)) }) - .catch(err => console.log(err)) + .catch(err => { + dispatch(setErrors(err)) + }) } } @@ -18,4 +21,11 @@ export const setMaterials = payload => { type: SET_MATERIALS, payload } +} + +export const setErrors = payload => { + return { + type: GET_ERRORS, + payload + } } \ No newline at end of file diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 82f5882f0f..c1c371756f 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -5,12 +5,14 @@ import { Table, Form, FormGroup, Label, Input } from 'reactstrap'; import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; export function MaterialsList(props) { - // console.log('materials props: ', props); + console.log('materials props: ', props); // props & state - const { materials } = props; - console.log('🚀 ~ file: MaterialsList.jsx:47 ~ MaterialsList ~ materials:', materials); - const [filteredMaterials, setFilteredMaterials] = useState(materials || []); + const { materials, errors } = props; + // console.log('🚀 ~ file: MaterialsList.jsx:47 ~ MaterialsList ~ materials:', materials); + const [filteredMaterials, setFilteredMaterials] = useState(materials); const [selectedProject, setSelectedProject] = useState('all'); + const [isError, setIsError] = useState(false); + const [error, setError] = useState({ status: '', message: '' }); // dispatch materials fetch action useEffect(() => { @@ -18,7 +20,10 @@ export function MaterialsList(props) { }, []); // create selectable projects - const projectsSet = [...new Set(materials.map(mat => mat.project.projectName))]; + let projectsSet = []; + if (filteredMaterials.length) { + projectsSet = [...new Set(materials.map(mat => mat.project.projectName))]; + } // filter materials data by project useEffect(() => { @@ -29,9 +34,42 @@ export function MaterialsList(props) { setFilteredMaterials(filterMaterials); }, [selectedProject]); + // error handling + useEffect(() => { + if (Object.entries(errors).length) { + setIsError(true); + // no response object if server is offline + if (!errors.response) { + return setError({ + status: 503, + message: 'The server is temporarily offline. Please try again later.', + }); + } + setError({ + status: errors.response.status, + message: errors.response.statusText, + }); + } + }, [errors]); + + if (isError) { + return ( +
+

Materials List

+
+

There was an error!

+

Error Code: {error.status}

+

Error Message: {error.message}

+

Try again:

+ +
+
+ ); + } + return (
-

Material List

+

Materials List

@@ -42,15 +80,22 @@ export function MaterialsList(props) { name="select-project" type="select" onChange={e => setSelectedProject(e.target.value)} + disabled={!materials.length} > - - {projectsSet.map((name, i) => { - return ( - - ); - })} + {materials.length ? ( + <> + + {projectsSet.map((name, i) => { + return ( + + ); + })} + + ) : ( + + )} @@ -72,23 +117,31 @@ export function MaterialsList(props) {
- {filteredMaterials.map((mat, i) => { - return ( - - - - - - - - - - - - - - ); - })} + {filteredMaterials.length ? ( + filteredMaterials.map((mat, i) => { + return ( + + + + + + + + + + + + + + ); + }) + ) : ( + + + + )}
PIDIDProject Name Unit BoughtAvailable Hold WastedUsage RecordUpdate RecordPurchase RecordLogUpdatesPurchases
{mat.projectId}{mat.id}{mat.name}{mat.unit}{mat.bought}{mat.used}{mat.available}{mat.hold}{mat.wasted}{mat.project.projectName}{mat.inventoryItemType.name}{mat.inventoryItemType.uom}{mat.stockBought}{mat.stockUsed}{mat.stockAvailable}{mat.stockHeld}{mat.stockWasted} Button Button Button
{mat.project.projectName}{mat.inventoryItemType.name}{mat.inventoryItemType.uom}{mat.stockBought}{mat.stockUsed}{mat.stockAvailable}{mat.stockHeld}{mat.stockWasted}ButtonButtonButton
{mat.project.projectName}{mat.inventoryItemType.name}{mat.inventoryItemType.uom}{mat.stockBought}{mat.stockUsed}{mat.stockAvailable}{mat.stockHeld}{mat.stockWasted}ButtonButtonButton
+ No materials data +
@@ -99,6 +152,7 @@ export function MaterialsList(props) { const mapStateToProps = state => ({ // auth: state.auth, materials: state.materials, + errors: state.errors, }); export default connect(mapStateToProps)(MaterialsList); diff --git a/src/reducers/bmdashboard/materialsReducer.js b/src/reducers/bmdashboard/materialsReducer.js index 226c80a2e7..65bac85aab 100644 --- a/src/reducers/bmdashboard/materialsReducer.js +++ b/src/reducers/bmdashboard/materialsReducer.js @@ -1,17 +1,9 @@ import { SET_MATERIALS } from "constants/bmdashboard/materialsConstants" -// const materialsDefaultState = { -// materials: [] -// } - const defaultState = [] export const materialsReducer = (materials = defaultState, action) => { if(action.type === SET_MATERIALS) { - // return { - // ...materialsDefaultState, - // materials: action.payload - // } return action.payload } return materials From 85117fd7088ffa6ad1f22e68e4e465fdd28a7455 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 4 Oct 2023 16:29:05 -0700 Subject: [PATCH 07/32] componentize table, form. add records modal --- .../MaterialsList/MaterialsList.jsx | 89 ++------------ .../MaterialsList/MaterialsTable.jsx | 96 +++++++++++++++ .../MaterialsList/RecordsModal.jsx | 112 ++++++++++++++++++ .../BMDashboard/MaterialsList/SelectForm.jsx | 38 ++++++ 4 files changed, 253 insertions(+), 82 deletions(-) create mode 100644 src/components/BMDashboard/MaterialsList/MaterialsTable.jsx create mode 100644 src/components/BMDashboard/MaterialsList/RecordsModal.jsx create mode 100644 src/components/BMDashboard/MaterialsList/SelectForm.jsx diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index c1c371756f..b757e316a5 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -1,30 +1,26 @@ import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; -import { Table, Form, FormGroup, Label, Input } from 'reactstrap'; import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; +import SelectForm from './SelectForm'; +import MaterialsTable from './MaterialsTable'; +import RecordsModal from './RecordsModal'; export function MaterialsList(props) { - console.log('materials props: ', props); + // console.log('materials props: ', props); // props & state const { materials, errors } = props; - // console.log('🚀 ~ file: MaterialsList.jsx:47 ~ MaterialsList ~ materials:', materials); const [filteredMaterials, setFilteredMaterials] = useState(materials); const [selectedProject, setSelectedProject] = useState('all'); const [isError, setIsError] = useState(false); const [error, setError] = useState({ status: '', message: '' }); // dispatch materials fetch action + // response is mapped to materials or errors in redux store useEffect(() => { props.dispatch(fetchAllMaterials()); }, []); - // create selectable projects - let projectsSet = []; - if (filteredMaterials.length) { - projectsSet = [...new Set(materials.map(mat => mat.project.projectName))]; - } - // filter materials data by project useEffect(() => { if (selectedProject === 'all') { @@ -71,79 +67,8 @@ export function MaterialsList(props) {

Materials List

-
-
- - - setSelectedProject(e.target.value)} - disabled={!materials.length} - > - {materials.length ? ( - <> - - {projectsSet.map((name, i) => { - return ( - - ); - })} - - ) : ( - - )} - - -
-
- - - - - - - - - - - - - - - - - - {filteredMaterials.length ? ( - filteredMaterials.map((mat, i) => { - return ( - - - - - - - - - - - - - - ); - }) - ) : ( - - - - )} - -
ProjectNameUnitBoughtUsedAvailableHoldWastedLogUpdatesPurchases
{mat.project.projectName}{mat.inventoryItemType.name}{mat.inventoryItemType.uom}{mat.stockBought}{mat.stockUsed}{mat.stockAvailable}{mat.stockHeld}{mat.stockWasted}ButtonButtonButton
- No materials data -
+ +
); diff --git a/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx b/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx new file mode 100644 index 0000000000..8ba4001917 --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx @@ -0,0 +1,96 @@ +import { useState } from 'react'; +import { Table, Button } from 'reactstrap'; + +import RecordsModal from './RecordsModal'; + +export default function MaterialsTable({ filteredMaterials }) { + const [modal, setModal] = useState(false); + const [record, setRecord] = useState(null); + const [recordType, setRecordType] = useState(''); + + const handleClick = (data, type) => { + setModal(true); + setRecord(data); + setRecordType(type); + }; + + return ( + <> + + + + + + + + + + + + + + + + + + + {filteredMaterials.length ? ( + filteredMaterials.map((mat, i) => { + return ( + + + + + + + + + + + + + + ); + }) + ) : ( + + + + )} + +
ProjectNameUnitBoughtUsedAvailableHoldWastedUsageUpdatesPurchases
{mat.project.projectName}{mat.inventoryItemType.name}{mat.inventoryItemType.uom}{mat.stockBought}{mat.stockUsed}{mat.stockAvailable}{mat.stockHeld}{mat.stockWasted} + + + + + +
+ No materials data +
+ + ); +} diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx new file mode 100644 index 0000000000..df2be2bbab --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx @@ -0,0 +1,112 @@ +import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Table } from 'reactstrap'; + +export default function RecordsModal({ modal, setModal, record, setRecord, recordType }) { + if (record) { + const toggle = () => { + setModal(false); + setRecord(null); + }; + + return ( + + {recordType} Record + + + +
+
+ + + +
+ ); + } + return null; +} + +export function Record({ record, recordType }) { + if (recordType === 'Usage') { + return ( + <> + + + Date + Qty + Logged by + + + + {record.map((entry, i) => ( + + {entry.date} + {entry.quantityUsed} + {entry.createdBy} + + ))} + + + ); + } + if (recordType === 'Update') { + return ( + <> + + + Date + Qty + Action + Cause + Description + Logged by + + + + {record.map((entry, i) => ( + + {entry.date} + {entry.quantity} + {entry.action} + {entry.cause} + {entry.description} + {entry.createdBy} + + ))} + + + ); + } + if (recordType === 'Purchase') { + return ( + <> + + + Date + PO + Seller ID + Qty + Subtotal + Taxes + Shipping + Created by + + + + {record.map((entry, i) => ( + + {entry.date} + {entry.poId} + {entry.sellerId} + {entry.quantity} + {entry.subtotal} + {entry.tax} + {entry.shipping} + {entry.createdBy} + + ))} + + + ); + } + + return null; +} diff --git a/src/components/BMDashboard/MaterialsList/SelectForm.jsx b/src/components/BMDashboard/MaterialsList/SelectForm.jsx new file mode 100644 index 0000000000..9c0ec81212 --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/SelectForm.jsx @@ -0,0 +1,38 @@ +import { Form, FormGroup, Label, Input } from 'reactstrap'; + +export default function SelectForm({ materials, setSelectedProject }) { + // create selectable projects + let projectsSet = []; + if (materials.length) { + projectsSet = [...new Set(materials.map(mat => mat.project.projectName))]; + } + return ( +
+ + + setSelectedProject(e.target.value)} + disabled={!materials.length} + > + {materials.length ? ( + <> + + {projectsSet.map((name, i) => { + return ( + + ); + })} + + ) : ( + + )} + + +
+ ); +} From a860df9a13530f802a755b44b76faff28c21c516 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Thu, 5 Oct 2023 12:20:37 -0700 Subject: [PATCH 08/32] update modal props, date format --- .../MaterialsList/RecordsModal.jsx | 77 +++++++++++-------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx index df2be2bbab..8cf2e5bde0 100644 --- a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx @@ -1,4 +1,5 @@ import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Table } from 'reactstrap'; +import moment from 'moment'; export default function RecordsModal({ modal, setModal, record, setRecord, recordType }) { if (record) { @@ -31,18 +32,20 @@ export function Record({ record, recordType }) { Date - Qty - Logged by + Quantity + Created by - {record.map((entry, i) => ( - - {entry.date} - {entry.quantityUsed} - {entry.createdBy} - - ))} + {record.map(({ date, quantityUsed, createdBy }, i) => { + return ( + + {moment(date).format('MM/DD/YY')} + {quantityUsed} + {createdBy.firstName + ' ' + createdBy.lastName} + + ); + })} ); @@ -53,24 +56,26 @@ export function Record({ record, recordType }) { Date - Qty + Quantity Action Cause Description - Logged by + Created by - {record.map((entry, i) => ( - - {entry.date} - {entry.quantity} - {entry.action} - {entry.cause} - {entry.description} - {entry.createdBy} - - ))} + {record.map(({ date, quantity, action, cause, description, createdBy }, i) => { + return ( + + {moment(date).format('MM/DD/YY')} + {quantity} + {action} + {cause} + {description} + {createdBy.firstName + ' ' + createdBy.lastName} + + ); + })} ); @@ -83,7 +88,7 @@ export function Record({ record, recordType }) { Date PO Seller ID - Qty + Quantity Subtotal Taxes Shipping @@ -91,18 +96,22 @@ export function Record({ record, recordType }) { - {record.map((entry, i) => ( - - {entry.date} - {entry.poId} - {entry.sellerId} - {entry.quantity} - {entry.subtotal} - {entry.tax} - {entry.shipping} - {entry.createdBy} - - ))} + {record.map( + ({ date, poId, sellerId, quantity, subtotal, tax, shipping, createdBy }, i) => { + return ( + + {moment(date).format('MM/DD/YY')} + {poId} + {sellerId} + {quantity} + {subtotal} + {tax} + {shipping} + {createdBy.firstName + ' ' + createdBy.lastName} + + ); + }, + )} ); From 3acb8cc8661cce36a9ccb359b4afb9c8a2ebfda4 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Thu, 5 Oct 2023 13:22:05 -0700 Subject: [PATCH 09/32] add styles sheet and basic styling, add links to user profile in modal --- .../MaterialsList/MaterialsList.css | 10 ++++++++++ .../MaterialsList/MaterialsList.jsx | 8 ++++---- .../MaterialsList/RecordsModal.jsx | 20 +++++++++++++++---- .../BMDashboard/MaterialsList/SelectForm.jsx | 2 +- 4 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 src/components/BMDashboard/MaterialsList/MaterialsList.css diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.css b/src/components/BMDashboard/MaterialsList/MaterialsList.css new file mode 100644 index 0000000000..e5e56f4624 --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.css @@ -0,0 +1,10 @@ +.materials_list_section { + margin-top: 2rem; +} + +.select_input { + display: flex; + align-items: end; + width: 30%; + column-gap: 1rem; +} diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index b757e316a5..9bdcec150d 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -4,7 +4,7 @@ import { connect } from 'react-redux'; import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; import SelectForm from './SelectForm'; import MaterialsTable from './MaterialsTable'; -import RecordsModal from './RecordsModal'; +import './MaterialsList.css'; export function MaterialsList(props) { // console.log('materials props: ', props); @@ -64,9 +64,9 @@ export function MaterialsList(props) { } return ( -
-

Materials List

-
+
+

Materials

+
diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx index 8cf2e5bde0..f86297b95a 100644 --- a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx @@ -9,7 +9,7 @@ export default function RecordsModal({ modal, setModal, record, setRecord, recor }; return ( - + {recordType} Record @@ -42,7 +42,11 @@ export function Record({ record, recordType }) { - + ); })} @@ -72,7 +76,11 @@ export function Record({ record, recordType }) { - + ); })} @@ -107,7 +115,11 @@ export function Record({ record, recordType }) { - + ); }, diff --git a/src/components/BMDashboard/MaterialsList/SelectForm.jsx b/src/components/BMDashboard/MaterialsList/SelectForm.jsx index 9c0ec81212..98b5ffc044 100644 --- a/src/components/BMDashboard/MaterialsList/SelectForm.jsx +++ b/src/components/BMDashboard/MaterialsList/SelectForm.jsx @@ -8,7 +8,7 @@ export default function SelectForm({ materials, setSelectedProject }) { } return ( - + Date: Fri, 6 Oct 2023 17:01:10 -0300 Subject: [PATCH 10/32] Yuri - Design navigation bar --- .../BMDashboard/BMHeader/BMHeader.css | 28 +++ .../BMDashboard/BMHeader/BMHeader.jsx | 205 ++++++++++++++++++ src/components/BMDashboard/BMHeader/index.js | 1 + src/languages/en/ui.js | 9 +- src/routes.js | 4 +- 5 files changed, 245 insertions(+), 2 deletions(-) create mode 100644 src/components/BMDashboard/BMHeader/BMHeader.css create mode 100644 src/components/BMDashboard/BMHeader/BMHeader.jsx create mode 100644 src/components/BMDashboard/BMHeader/index.js diff --git a/src/components/BMDashboard/BMHeader/BMHeader.css b/src/components/BMDashboard/BMHeader/BMHeader.css new file mode 100644 index 0000000000..4c42151d5b --- /dev/null +++ b/src/components/BMDashboard/BMHeader/BMHeader.css @@ -0,0 +1,28 @@ +.header-wrapper { + height: fit-content; + width: clamp(100vw, 0.1rem + 1vw, 100%); +} + +.navbar { + z-index: 100; + white-space: nowrap; +} + +.logo-section { + color: #fff; + font-weight: bold; +} + +.nav-links { + align-items: center; +} + +.dashboardimg { + margin-left: 30px; +} + +@media (max-width: 1500px) { + .dashboard-text-link { + font-size: 14px; + } +} diff --git a/src/components/BMDashboard/BMHeader/BMHeader.jsx b/src/components/BMDashboard/BMHeader/BMHeader.jsx new file mode 100644 index 0000000000..731ed6b4c4 --- /dev/null +++ b/src/components/BMDashboard/BMHeader/BMHeader.jsx @@ -0,0 +1,205 @@ +import React, { useState, useEffect } from 'react'; +import { Link } from 'react-router-dom'; +import { connect, useDispatch } from 'react-redux'; +import { + Collapse, + Navbar, + NavbarToggler, + Nav, + NavItem, + NavLink, + UncontrolledDropdown, + DropdownToggle, + DropdownMenu, + DropdownItem, +} from 'reactstrap'; +import { fetchTaskEditSuggestions } from 'components/TaskEditSuggestions/thunks'; +import { getHeaderData } from '../../../actions/authActions'; +import { getTimerData } from '../../../actions/timer'; +import { getAllRoles } from '../../../actions/role'; +import { + ADD_MET, + LOG_MET, + LOG_TIME, + LOG_ISSUE, + ADD_MEMBER, + MATERIAL, + TOOL_EQUIPMENT, + REPORTS, + WEEKLY_SUMMARIES_REPORT, + WELCOME, + VIEW_PROFILE, + UPDATE_PASSWORD, + LOGOUT, +} from '../../../languages/en/ui'; +import Logout from '../../Logout/Logout'; +import hasPermission, { cantUpdateDevAdminDetails } from '../../../utils/permissions'; +import './BMHeader.css'; + +export function Header(props) { + const [isOpen, setIsOpen] = useState(false); + const { isAuthenticated, user, firstName, profilePic } = props.auth; + const [logoutPopup, setLogoutPopup] = useState(false); + const canGetWeeklySummaries = props.hasPermission('getWeeklySummaries'); + + const dispatch = useDispatch(); + + useEffect(() => { + if (props.auth.isAuthenticated) { + props.getHeaderData(props.auth.user.userid); + props.getTimerData(props.auth.user.userid); + if (props.auth.user.role === 'Administrator') { + dispatch(fetchTaskEditSuggestions()); + } + } + }, [props.auth.isAuthenticated]); + + useEffect(() => { + if (roles.length === 0) { + props.getAllRoles(); + } + }, []); + const roles = props.role?.roles; + + const toggle = () => { + setIsOpen(prevIsOpen => !prevIsOpen); + }; + + const openModal = () => { + setLogoutPopup(true); + }; + + return ( +
+ + {logoutPopup && } +
HGN Logo
+ + + {isAuthenticated && ( + + + + )} +
+
+ ); +} + +const mapStateToProps = state => ({ + auth: state.auth, + userProfile: state.userProfile, + taskEditSuggestionCount: state.taskEditSuggestions.count, + role: state.role, +}); +export default connect(mapStateToProps, { + getHeaderData, + getTimerData, + getAllRoles, + hasPermission, +})(Header); diff --git a/src/components/BMDashboard/BMHeader/index.js b/src/components/BMDashboard/BMHeader/index.js new file mode 100644 index 0000000000..db24be7f14 --- /dev/null +++ b/src/components/BMDashboard/BMHeader/index.js @@ -0,0 +1 @@ +export { default } from './BMHeader'; diff --git a/src/languages/en/ui.js b/src/languages/en/ui.js index b472c784b8..bb0cd15943 100644 --- a/src/languages/en/ui.js +++ b/src/languages/en/ui.js @@ -52,4 +52,11 @@ export const SET_FINAL_DAY = 'Set Final Day'; export const MANAGE_FINAL_DAY = 'Manage Final Day'; export const SEND_SETUP_LINK = 'Send Setup Link'; export const USER_START_DATE = 'Start Date'; -export const USER_END_DATE = 'End Date'; \ No newline at end of file +export const USER_END_DATE = 'End Date'; +export const ADD_MET = 'Add MET'; +export const MATERIAL = 'Material'; +export const TOOL_EQUIPMENT = 'Tool/Equipment'; +export const LOG_MET = 'Log MET'; +export const LOG_TIME = 'Log Time'; +export const LOG_ISSUE = 'Log Issue'; +export const ADD_MEMBER = 'Add Member'; \ No newline at end of file diff --git a/src/routes.js b/src/routes.js index 5844f44d69..97688ba2d6 100644 --- a/src/routes.js +++ b/src/routes.js @@ -44,13 +44,15 @@ import SetupProfile from 'components/SetupProfile/SetupProfile'; import BMProtectedRoute from 'components/common/BMDashboard/BMProtectedRoute'; import BMDashboard from 'components/BMDashboard'; import BMLogin from 'components/BMDashboard/Login'; +import BMHeader from 'components/BMDashboard/BMHeader/BMHeader'; export default ( <> <> -
+ {/*
*/} + From 6cbe982e26c19d97f35ac03157a492031399935a Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Fri, 6 Oct 2023 17:50:16 -0700 Subject: [PATCH 11/32] add error comp. add new css modules. --- .../MaterialsList/MaterialsList.jsx | 14 ++++---------- .../MaterialsList/RecordsModal.css | 4 ++++ .../MaterialsList/RecordsModal.jsx | 4 +++- .../{MaterialsList.css => SelectForm.css} | 4 ---- .../BMDashboard/MaterialsList/SelectForm.jsx | 2 ++ src/components/BMDashboard/shared/BMError.css | 5 +++++ src/components/BMDashboard/shared/BMError.jsx | 19 +++++++++++++++++++ 7 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 src/components/BMDashboard/MaterialsList/RecordsModal.css rename src/components/BMDashboard/MaterialsList/{MaterialsList.css => SelectForm.css} (64%) create mode 100644 src/components/BMDashboard/shared/BMError.css create mode 100644 src/components/BMDashboard/shared/BMError.jsx diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 9bdcec150d..3bda56999d 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -2,9 +2,9 @@ import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; +import BMError from '../shared/BMError'; import SelectForm from './SelectForm'; import MaterialsTable from './MaterialsTable'; -import './MaterialsList.css'; export function MaterialsList(props) { // console.log('materials props: ', props); @@ -50,15 +50,9 @@ export function MaterialsList(props) { if (isError) { return ( -
+

Materials List

-
-

There was an error!

-

Error Code: {error.status}

-

Error Message: {error.message}

-

Try again:

- -
+
); } @@ -66,7 +60,7 @@ export function MaterialsList(props) { return (

Materials

-
+
diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.css b/src/components/BMDashboard/MaterialsList/RecordsModal.css new file mode 100644 index 0000000000..06ba8f2f12 --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.css @@ -0,0 +1,4 @@ +.custom-modal-style { + overflow: auto; + overflow-y: scroll; +} diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx index f86297b95a..ba5066285d 100644 --- a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx @@ -1,6 +1,8 @@ import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Table } from 'reactstrap'; import moment from 'moment'; +import './RecordsModal.css'; + export default function RecordsModal({ modal, setModal, record, setRecord, recordType }) { if (record) { const toggle = () => { @@ -9,7 +11,7 @@ export default function RecordsModal({ modal, setModal, record, setRecord, recor }; return ( - + {recordType} Record
{moment(date).format('MM/DD/YY')} {quantityUsed}{createdBy.firstName + ' ' + createdBy.lastName} + + {createdBy.firstName + ' ' + createdBy.lastName} + +
{action} {cause} {description}{createdBy.firstName + ' ' + createdBy.lastName} + + {createdBy.firstName + ' ' + createdBy.lastName} + +
{subtotal} {tax} {shipping}{createdBy.firstName + ' ' + createdBy.lastName} + + {createdBy.firstName + ' ' + createdBy.lastName} + +
diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.css b/src/components/BMDashboard/MaterialsList/SelectForm.css similarity index 64% rename from src/components/BMDashboard/MaterialsList/MaterialsList.css rename to src/components/BMDashboard/MaterialsList/SelectForm.css index e5e56f4624..67a3fb0c53 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.css +++ b/src/components/BMDashboard/MaterialsList/SelectForm.css @@ -1,7 +1,3 @@ -.materials_list_section { - margin-top: 2rem; -} - .select_input { display: flex; align-items: end; diff --git a/src/components/BMDashboard/MaterialsList/SelectForm.jsx b/src/components/BMDashboard/MaterialsList/SelectForm.jsx index 98b5ffc044..0f21c6d6b9 100644 --- a/src/components/BMDashboard/MaterialsList/SelectForm.jsx +++ b/src/components/BMDashboard/MaterialsList/SelectForm.jsx @@ -1,5 +1,7 @@ import { Form, FormGroup, Label, Input } from 'reactstrap'; +import './SelectForm.css'; + export default function SelectForm({ materials, setSelectedProject }) { // create selectable projects let projectsSet = []; diff --git a/src/components/BMDashboard/shared/BMError.css b/src/components/BMDashboard/shared/BMError.css new file mode 100644 index 0000000000..29aac6d930 --- /dev/null +++ b/src/components/BMDashboard/shared/BMError.css @@ -0,0 +1,5 @@ +.error_text { + display: flex; + align-items: center; + column-gap: 4px; +} diff --git a/src/components/BMDashboard/shared/BMError.jsx b/src/components/BMDashboard/shared/BMError.jsx new file mode 100644 index 0000000000..3085b95593 --- /dev/null +++ b/src/components/BMDashboard/shared/BMError.jsx @@ -0,0 +1,19 @@ +import { Button } from 'react-bootstrap'; +import { BiErrorCircle } from 'react-icons/bi'; + +import './BMError.css'; + +export default function BMError({ error }) { + return ( +
+

+ + There was an error processing your request: {error.status} ({error.message}) +

+

Please try again.

+ +
+ ); +} From d16765f8e843b243295d302f150292e9853b6589 Mon Sep 17 00:00:00 2001 From: Jiangwei-shi <56906163+Jiangwei-shi@users.noreply.github.com> Date: Sun, 8 Oct 2023 00:21:20 -0400 Subject: [PATCH 12/32] Update FormattedReport.jsx --- .../WeeklySummariesReport/FormattedReport.jsx | 37 +++++-------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/src/components/WeeklySummariesReport/FormattedReport.jsx b/src/components/WeeklySummariesReport/FormattedReport.jsx index 4c067cb948..e888d9518d 100644 --- a/src/components/WeeklySummariesReport/FormattedReport.jsx +++ b/src/components/WeeklySummariesReport/FormattedReport.jsx @@ -174,34 +174,15 @@ function ReportDetails({ canEditSummaryCount={canEditSummaryCount} /> - {hoursLogged >= summary.promisedHoursByWeek[weekIndex] && ( - -

- - Hours logged:{' '} - - {hoursLogged.toFixed(2)} / {summary.promisedHoursByWeek[weekIndex]} -

-
- )} - {hoursLogged < summary.promisedHoursByWeek[weekIndex] && ( - - - Hours logged: - - - {hoursLogged.toFixed(2)} / {summary.promisedHoursByWeek[weekIndex]} - - - )} + + + Hours logged: + + {(hoursLogged >= summary.promisedHoursByWeek[weekIndex]) + ?

{hoursLogged.toFixed(2)} / {summary.promisedHoursByWeek[weekIndex]}

+ : {hoursLogged.toFixed(2)} / {summary.promisedHoursByWeek[weekIndex]} + } +
From 1d894f7959ee3353147cf0f5fb87ff5e70d63420 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Mon, 9 Oct 2023 14:17:59 -0700 Subject: [PATCH 13/32] remove bmdashboard directory from eslistignore --- .eslintignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 58b85ab980..9e7bcfcf0d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -24,7 +24,6 @@ src/components/App.jsx src/components/AutoReload/** src/components/AutoUpdate/** src/components/Badge/** -src/components/BMDashboard/** src/components/common/** src/components/ForcePasswordUpdate/** src/components/Header/** From b25baf602aaee7401691c798a7be1e674390e995 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Mon, 9 Oct 2023 20:02:19 -0700 Subject: [PATCH 14/32] update table styles --- .../MaterialsList/MaterialsList.css | 43 +++++ .../MaterialsList/MaterialsList.jsx | 8 +- .../MaterialsList/MaterialsTable.jsx | 151 ++++++++++-------- .../BMDashboard/MaterialsList/SelectForm.css | 6 - .../BMDashboard/MaterialsList/SelectForm.jsx | 6 +- 5 files changed, 134 insertions(+), 80 deletions(-) create mode 100644 src/components/BMDashboard/MaterialsList/MaterialsList.css delete mode 100644 src/components/BMDashboard/MaterialsList/SelectForm.css diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.css b/src/components/BMDashboard/MaterialsList/MaterialsList.css new file mode 100644 index 0000000000..eaf703eacb --- /dev/null +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.css @@ -0,0 +1,43 @@ +.materials_list_container { + width: 100%; + max-width: 1536px; + margin: 1rem auto; + padding: 0 1rem; + font-size: small; +} + +.materials_table_container { + overflow-x: scroll; +} + +.materials_list_container table { + text-align: center; + min-width: 1024px; + overflow: scroll; +} + +.materials_list_container th { + height: 2rem; +} + +.materials_cell button { + cursor: pointer; +} + +.materials_cell svg { + width: 20px; + height: 20px; + margin-right: 6px; + color: dimgray; +} + +.materials_cell svg:hover { + color: black; +} + +.select_input { + display: flex; + align-items: end; + width: 300px; + column-gap: 1rem; +} diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 3bda56999d..41a288121d 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -1,3 +1,4 @@ +/* eslint-disable consistent-return */ import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; @@ -5,11 +6,12 @@ import { fetchAllMaterials } from 'actions/bmdashboard/materialsActions'; import BMError from '../shared/BMError'; import SelectForm from './SelectForm'; import MaterialsTable from './MaterialsTable'; +import './MaterialsList.css'; export function MaterialsList(props) { // console.log('materials props: ', props); // props & state - const { materials, errors } = props; + const { materials, errors, dispatch } = props; const [filteredMaterials, setFilteredMaterials] = useState(materials); const [selectedProject, setSelectedProject] = useState('all'); const [isError, setIsError] = useState(false); @@ -18,7 +20,7 @@ export function MaterialsList(props) { // dispatch materials fetch action // response is mapped to materials or errors in redux store useEffect(() => { - props.dispatch(fetchAllMaterials()); + dispatch(fetchAllMaterials()); }, []); // filter materials data by project @@ -58,7 +60,7 @@ export function MaterialsList(props) { } return ( -
+

Materials

diff --git a/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx b/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx index 8ba4001917..f2750ac878 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx @@ -1,5 +1,6 @@ import { useState } from 'react'; import { Table, Button } from 'reactstrap'; +import { BiPencil } from 'react-icons/bi'; import RecordsModal from './RecordsModal'; @@ -8,7 +9,12 @@ export default function MaterialsTable({ filteredMaterials }) { const [record, setRecord] = useState(null); const [recordType, setRecordType] = useState(''); - const handleClick = (data, type) => { + const handleEditRecordsClick = () => { + // open records editor + return null; + }; + + const handleViewRecordsClick = (data, type) => { setModal(true); setRecord(data); setRecordType(type); @@ -23,74 +29,85 @@ export default function MaterialsTable({ filteredMaterials }) { setRecord={setRecord} recordType={recordType} /> -
- - - - - - - - - - - - - - - - - {filteredMaterials.length ? ( - filteredMaterials.map((mat, i) => { - return ( - - - - - - - - - - - - - - ); - }) - ) : ( +
+
ProjectNameUnitBoughtUsedAvailableHoldWastedUsageUpdatesPurchases
{mat.project.projectName}{mat.inventoryItemType.name}{mat.inventoryItemType.uom}{mat.stockBought}{mat.stockUsed}{mat.stockAvailable}{mat.stockHeld}{mat.stockWasted} - - - - - -
+ - + + + + + + + + + + + - )} - -
- No materials data - ProjectNameUnitBoughtUsedAvailableHoldWasteUsageUpdatesPurchases
+ + + {filteredMaterials.length ? ( + filteredMaterials.map(mat => { + return ( + + {mat.project.projectName} + {mat.inventoryItemType.name} + {mat.inventoryItemType.uom} + {mat.stockBought} + {mat.stockUsed} + {mat.stockAvailable} + {mat.stockHeld} + {mat.stockWasted} + + + + + + + + + + + + + ); + }) + ) : ( + + + No materials data + + + )} + + + ); } diff --git a/src/components/BMDashboard/MaterialsList/SelectForm.css b/src/components/BMDashboard/MaterialsList/SelectForm.css deleted file mode 100644 index 67a3fb0c53..0000000000 --- a/src/components/BMDashboard/MaterialsList/SelectForm.css +++ /dev/null @@ -1,6 +0,0 @@ -.select_input { - display: flex; - align-items: end; - width: 30%; - column-gap: 1rem; -} diff --git a/src/components/BMDashboard/MaterialsList/SelectForm.jsx b/src/components/BMDashboard/MaterialsList/SelectForm.jsx index 0f21c6d6b9..0c0284de1f 100644 --- a/src/components/BMDashboard/MaterialsList/SelectForm.jsx +++ b/src/components/BMDashboard/MaterialsList/SelectForm.jsx @@ -1,7 +1,5 @@ import { Form, FormGroup, Label, Input } from 'reactstrap'; -import './SelectForm.css'; - export default function SelectForm({ materials, setSelectedProject }) { // create selectable projects let projectsSet = []; @@ -22,9 +20,9 @@ export default function SelectForm({ materials, setSelectedProject }) { {materials.length ? ( <> - {projectsSet.map((name, i) => { + {projectsSet.map(name => { return ( - ); From 8d56c4250c15a2b9b25835c7458d6412e1543227 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Tue, 10 Oct 2023 12:10:07 -0700 Subject: [PATCH 15/32] update table, modal, error page css --- .../MaterialsList/MaterialsList.css | 6 +++- .../MaterialsList/MaterialsList.jsx | 4 +-- .../MaterialsList/RecordsModal.css | 15 +++++++-- .../MaterialsList/RecordsModal.jsx | 33 ++++++++++--------- src/components/BMDashboard/shared/BMError.jsx | 4 +-- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.css b/src/components/BMDashboard/MaterialsList/MaterialsList.css index eaf703eacb..0e84972828 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.css +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.css @@ -3,17 +3,21 @@ max-width: 1536px; margin: 1rem auto; padding: 0 1rem; - font-size: small; } .materials_table_container { overflow-x: scroll; } +.materials_list_container section { + margin-top: 2rem; +} + .materials_list_container table { text-align: center; min-width: 1024px; overflow: scroll; + font-size: small; } .materials_list_container th { diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 41a288121d..8f2aa2628e 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -52,7 +52,7 @@ export function MaterialsList(props) { if (isError) { return ( -
+

Materials List

@@ -62,7 +62,7 @@ export function MaterialsList(props) { return (

Materials

-
+
diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.css b/src/components/BMDashboard/MaterialsList/RecordsModal.css index 06ba8f2f12..413c8a2c12 100644 --- a/src/components/BMDashboard/MaterialsList/RecordsModal.css +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.css @@ -1,4 +1,13 @@ -.custom-modal-style { - overflow: auto; - overflow-y: scroll; +.records_modal_table_container { + overflow: scroll; + height: 75vh; + text-align: center; + font-size: small; + white-space: nowrap; +} + +@media (min-width: 1200px) { + .records_modal_table_container { + font-size: medium; + } } diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx index ba5066285d..72487bea1c 100644 --- a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx @@ -1,3 +1,4 @@ +/* eslint-disable react/no-array-index-key */ import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Table } from 'reactstrap'; import moment from 'moment'; @@ -11,12 +12,14 @@ export default function RecordsModal({ modal, setModal, record, setRecord, recor }; return ( - + {recordType} Record - - -
+
+ + +
+
@@ -34,8 +37,8 @@ export function Record({ record, recordType }) { Date - Quantity - Created by + Qty + Creator @@ -46,7 +49,7 @@ export function Record({ record, recordType }) { {quantityUsed} - {createdBy.firstName + ' ' + createdBy.lastName} + {`${createdBy.firstName} ${createdBy.lastName}`} @@ -62,11 +65,11 @@ export function Record({ record, recordType }) { Date - Quantity + Qty Action Cause - Description - Created by + Desc + Creator @@ -80,7 +83,7 @@ export function Record({ record, recordType }) { {description} - {createdBy.firstName + ' ' + createdBy.lastName} + {`${createdBy.firstName} ${createdBy.lastName}`} @@ -97,12 +100,12 @@ export function Record({ record, recordType }) { Date PO - Seller ID - Quantity + Seller + Qty Subtotal Taxes Shipping - Created by + Creator @@ -119,7 +122,7 @@ export function Record({ record, recordType }) { {shipping} - {createdBy.firstName + ' ' + createdBy.lastName} + {`${createdBy.firstName} ${createdBy.lastName}`} diff --git a/src/components/BMDashboard/shared/BMError.jsx b/src/components/BMDashboard/shared/BMError.jsx index 3085b95593..7d07afba0a 100644 --- a/src/components/BMDashboard/shared/BMError.jsx +++ b/src/components/BMDashboard/shared/BMError.jsx @@ -5,13 +5,13 @@ import './BMError.css'; export default function BMError({ error }) { return ( -
+

There was an error processing your request: {error.status} ({error.message})

Please try again.

-
From f0e96298f5a2220fd94abfb29fc1030df3e64f7c Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 11 Oct 2023 12:31:21 -0700 Subject: [PATCH 16/32] add chaining to inventoryItemType props --- src/components/BMDashboard/MaterialsList/MaterialsTable.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx b/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx index f2750ac878..cba81d26ba 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsTable.jsx @@ -52,8 +52,9 @@ export default function MaterialsTable({ filteredMaterials }) { return ( {mat.project.projectName} - {mat.inventoryItemType.name} - {mat.inventoryItemType.uom} + {/* Note: optional chaining to prevent crashes while db work ongoing */} + {mat.inventoryItemType?.name} + {mat.inventoryItemType?.uom} {mat.stockBought} {mat.stockUsed} {mat.stockAvailable} From d1d65227bf02193fa3f7c797415db4d324b4f192 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 11 Oct 2023 13:50:16 -0700 Subject: [PATCH 17/32] add lint fixes --- src/components/BMDashboard/BMDashboard.jsx | 10 +- src/components/BMDashboard/Login/BMLogin.jsx | 117 +++++++++--------- src/components/BMDashboard/Login/index.js | 4 +- .../BMDashboard/MaterialsList/index.js | 4 +- src/components/BMDashboard/index.js | 4 +- 5 files changed, 73 insertions(+), 66 deletions(-) diff --git a/src/components/BMDashboard/BMDashboard.jsx b/src/components/BMDashboard/BMDashboard.jsx index 2e1614b22f..f38f268fff 100644 --- a/src/components/BMDashboard/BMDashboard.jsx +++ b/src/components/BMDashboard/BMDashboard.jsx @@ -1,7 +1,9 @@ -export const BMDashboard = () => { - return
-

Building and Inventory Management Dashboard

-
+export function BMDashboard() { + return ( +
+

Building and Inventory Management Dashboard

+
+ ); } export default BMDashboard; diff --git a/src/components/BMDashboard/Login/BMLogin.jsx b/src/components/BMDashboard/Login/BMLogin.jsx index f18a2f51b0..c8eb416cb5 100644 --- a/src/components/BMDashboard/Login/BMLogin.jsx +++ b/src/components/BMDashboard/Login/BMLogin.jsx @@ -1,104 +1,106 @@ import { useEffect, useState } from 'react'; import { connect } from 'react-redux'; -import { Redirect, withRouter } from 'react-router-dom'; +import { Redirect } from 'react-router-dom'; import { Form, FormGroup, FormText, Input, Label, Button, FormFeedback } from 'reactstrap'; import Joi from 'joi'; import { loginBMUser } from 'actions/authActions'; -const BMLogin = (props) => { - const { dispatch, auth, history } = props +function BMLogin(props) { + const { dispatch, auth, history, location } = props; // state - const [enteredEmail, setEnteredEmail] = useState("") - const [enterPassword, setEnteredPassword] = useState("") - const [validationError, setValidationError] = useState(null) - const [hasAccess, setHasAccess] = useState(false) + const [enteredEmail, setEnteredEmail] = useState(''); + const [enterPassword, setEnteredPassword] = useState(''); + const [validationError, setValidationError] = useState(null); + const [hasAccess, setHasAccess] = useState(false); // push to dashboard if user is authenticated useEffect(() => { - if(auth.user.access && auth.user.access.canAccessBMPortal) { - history.push('/bmdashboard') + if (auth.user.access && auth.user.access.canAccessBMPortal) { + history.push('/bmdashboard'); } }, []); useEffect(() => { - if(hasAccess) { + if (hasAccess) { history.push('/bmdashboard'); } - },[hasAccess]) + }, [hasAccess]); // Note: email input type="text" to validate with Joi const schema = Joi.object({ email: Joi.string() .email() .required(), - password: Joi.string() - .min(8) - }) + password: Joi.string().min(8), + }); const handleChange = ({ target }) => { // clears validationError only if error input is being edited - if(validationError && target.name === validationError.label) { - setValidationError(null) - } - if(target.name === "email") { - setEnteredEmail(target.value) + if (validationError && target.name === validationError.label) { + setValidationError(null); } - else { - setEnteredPassword(target.value) + if (target.name === 'email') { + setEnteredEmail(target.value); + } else { + setEnteredPassword(target.value); } - } + }; // submit login - const handleSubmit = async (e) => { - e.preventDefault() + const handleSubmit = async e => { + e.preventDefault(); // client side error validation // Note: Joi by default stops validation on first error - const validate = schema.validate({ email: enteredEmail, password: enterPassword }) - if(validate.error) { - return setValidationError({ + const validate = schema.validate({ email: enteredEmail, password: enterPassword }); + if (validate.error) { + return setValidationError({ label: validate.error.details[0].context.label, - message: validate.error.details[0].message - }) + message: validate.error.details[0].message, + }); } const res = await dispatch(loginBMUser({ email: enteredEmail, password: enterPassword })); // server side error validation - if(res.statusText !== "OK") { - if(res.status === 422) { - return setValidationError({ + if (res.statusText !== 'OK') { + if (res.status === 422) { + return setValidationError({ label: res.data.label, message: res.data.message, - }) + }); } - return alert(res.data.message) + // TODO: add additional error handling + return setValidationError({ + label: '', + message: '', + }); } // initiate push to BM Dashboard if validated (ie received token) - setHasAccess(!!res.data.token) - } + return setHasAccess(!!res.data.token); + }; // push Dashboard if not authenticated - if(!auth.isAuthenticated) { - return + if (!auth.isAuthenticated) { + return ; } - + return ( -
+

Log In To Building Management Dashboard

- Enter your current user credentials to access the Building Management Dashboard + + Enter your current user credentials to access the Building Management Dashboard + - { validationError && validationError.label === "email" && ( - - {validationError.message} - ) - } + {validationError && validationError.label === 'email' && ( + {validationError.message} + )} @@ -106,24 +108,21 @@ const BMLogin = (props) => { id="password" name="password" type="password" - invalid={validationError && validationError.label === "password"} + invalid={validationError && validationError.label === 'password'} onChange={handleChange} /> - { validationError && validationError.label === "password" && ( - - {validationError.message} - ) - } + {validationError && validationError.label === 'password' && ( + {validationError.message} + )} - + -
) +
+ ); } const mapStateToProps = state => ({ - auth: state.auth + auth: state.auth, }); -export default connect (mapStateToProps)(BMLogin); \ No newline at end of file +export default connect(mapStateToProps)(BMLogin); diff --git a/src/components/BMDashboard/Login/index.js b/src/components/BMDashboard/Login/index.js index 62de678f63..e81439f158 100644 --- a/src/components/BMDashboard/Login/index.js +++ b/src/components/BMDashboard/Login/index.js @@ -1 +1,3 @@ -export { default } from './BMLogin'; +import BMLogin from './BMLogin'; + +export default BMLogin; diff --git a/src/components/BMDashboard/MaterialsList/index.js b/src/components/BMDashboard/MaterialsList/index.js index 572ddc03d5..cb7ea90d65 100644 --- a/src/components/BMDashboard/MaterialsList/index.js +++ b/src/components/BMDashboard/MaterialsList/index.js @@ -1 +1,3 @@ -export { default } from './MaterialsList'; +import MaterialsList from './MaterialsList'; + +export default MaterialsList; diff --git a/src/components/BMDashboard/index.js b/src/components/BMDashboard/index.js index c896f1c572..808da76466 100644 --- a/src/components/BMDashboard/index.js +++ b/src/components/BMDashboard/index.js @@ -1 +1,3 @@ -export { default } from './BMDashboard'; +import BMDashboard from './BMDashboard'; + +export default BMDashboard; From 173d009f9052ce43b800075ade81f5b8dd84b407 Mon Sep 17 00:00:00 2001 From: GKD890 Date: Thu, 12 Oct 2023 17:17:36 -0400 Subject: [PATCH 18/32] prevent warning popup appearing when editing empty media folder link --- .../UserProfileModal/EditLinkModal.jsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx b/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx index 7f8595d75a..ce646f035a 100644 --- a/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx +++ b/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx @@ -71,6 +71,20 @@ const EditLinkModal = props => { setIsChanged(true); }; + const handleMediaFolderLinkChanges = (e) => { + setMediaFolderLink({ ...mediaFolderLink, Link: e.target.value.trim() }); + setIsChanged(true); + if (!isMediaFolderLinkChanged && !isWarningPopupOpen && !e.target.value){ + // Prevent warning popup apear if empty media folder link + if(!e.target.value){ + return; + } else { + setIsMediaFolderLinkChanged(true); + setIsWarningPopupOpen(true); + } + } + } + const addNewLink = (links, setLinks, newLink, clearInput) => { if ( isDuplicateLink([googleLink, mediaFolderLink, ...links], newLink) || @@ -149,6 +163,8 @@ const EditLinkModal = props => { [googleLink, mediaFolderLink, ...adminLinks], mediaFolderLink.Link, ); + // Update ref to reflect updated original Media Folder Link + originalMediaFolderLink.current = mediaFolderLink.Link; } else { await updateLink(personalLinks, [googleLink, mediaFolderLink, ...adminLinks]); } @@ -204,14 +220,7 @@ const EditLinkModal = props => { id="linkURL2" placeholder="Enter Dropbox link" value={mediaFolderLink.Link} - onChange={e => { - setMediaFolderLink({ ...mediaFolderLink, Link: e.target.value.trim() }); - setIsChanged(true); - if (!isMediaFolderLinkChanged && !isWarningPopupOpen){ - setIsMediaFolderLinkChanged(true); - setIsWarningPopupOpen(true); - } - }} + onChange={e => {handleMediaFolderLinkChanges(e)}} /> {adminLinks?.map((link, index) => { From 99376e3ad965a9674df3128bfa2c217994a9f300 Mon Sep 17 00:00:00 2001 From: yurisokolovicz Date: Sat, 14 Oct 2023 12:51:37 -0300 Subject: [PATCH 19/32] Adding BMDashboard and Project --- src/components/Header/Header.jsx | 52 ++++++++++++++++++++++++++++++++ src/languages/en/ui.js | 11 +++++++ src/routes.js | 4 +-- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/src/components/Header/Header.jsx b/src/components/Header/Header.jsx index d8141b9be3..83bd98b85e 100644 --- a/src/components/Header/Header.jsx +++ b/src/components/Header/Header.jsx @@ -10,6 +10,17 @@ import OwnerMessage from '../OwnerMessage/OwnerMessage'; import { LOGO, DASHBOARD, + BM_DASHBOARD, + BM_PROJECT, + ADD_MATERIAL, + LOG_MATERIAL, + MATERIAL_LIST, + ADD_EQUIPMENT_TOOL, + LOG_EQUIPMENT_TOOL, + UPDATE_EQUIPMENT_TOOL, + EQUIPMENT_TOOL_LIST, + ISSUE, + LESSON, TIMELOG, REPORTS, WEEKLY_SUMMARIES_REPORT, @@ -132,12 +143,53 @@ export const Header = props => { {DASHBOARD} + + + + {BM_DASHBOARD} + {TIMELOG} + + + {BM_PROJECT} + + + <> + + {ADD_MATERIAL} + + + {LOG_MATERIAL} + + + {MATERIAL_LIST} + + + {ADD_EQUIPMENT_TOOL} + + + {LOG_EQUIPMENT_TOOL} + + + {UPDATE_EQUIPMENT_TOOL} + + + {EQUIPMENT_TOOL_LIST} + + + {ISSUE} + + + {LESSON} + + + + {canGetWeeklySummaries ? ( diff --git a/src/languages/en/ui.js b/src/languages/en/ui.js index bb0cd15943..8a292b6b1c 100644 --- a/src/languages/en/ui.js +++ b/src/languages/en/ui.js @@ -5,6 +5,17 @@ export const ACTIVE = 'Active'; export const INACTIVE = 'InActive'; export const ACTIVE_PROJECTS = 'Active Projects'; +export const BM_DASHBOARD = 'BM Dashboard'; +export const BM_PROJECT = 'Project'; +export const ADD_MATERIAL = 'Add Material'; +export const LOG_MATERIAL = 'Log Material'; +export const MATERIAL_LIST = 'Material List'; +export const ADD_EQUIPMENT_TOOL = 'Add Equipment/Tool'; +export const LOG_EQUIPMENT_TOOL = 'Log Equipment/Tool'; +export const UPDATE_EQUIPMENT_TOOL = 'Update Equipment/Tool'; +export const EQUIPMENT_TOOL_LIST = 'Equipment/Tool List'; +export const ISSUE = 'Issue'; +export const LESSON = 'Lesson'; export const DASHBOARD = 'Dashboard'; export const DELETE = 'Delete'; export const LOGO = 'Time Tracking Tool'; diff --git a/src/routes.js b/src/routes.js index 97688ba2d6..0a51ea644b 100644 --- a/src/routes.js +++ b/src/routes.js @@ -51,8 +51,8 @@ export default ( <> - {/*
*/} - +
+ {/* */} From 61815cbf608c9f679e42c002b7e563c9694ced41 Mon Sep 17 00:00:00 2001 From: GKD890 Date: Sat, 14 Oct 2023 17:33:35 -0400 Subject: [PATCH 20/32] fix-no popup in empty media folder link --- .../UserProfileModal/EditLinkModal.jsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx b/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx index ce646f035a..bf76ff0e7e 100644 --- a/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx +++ b/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx @@ -72,15 +72,18 @@ const EditLinkModal = props => { }; const handleMediaFolderLinkChanges = (e) => { - setMediaFolderLink({ ...mediaFolderLink, Link: e.target.value.trim() }); - setIsChanged(true); - if (!isMediaFolderLinkChanged && !isWarningPopupOpen && !e.target.value){ + if (!mediaFolderLink.Link){ // Prevent warning popup apear if empty media folder link - if(!e.target.value){ - return; - } else { - setIsMediaFolderLinkChanged(true); - setIsWarningPopupOpen(true); + setIsMediaFolderLinkChanged(true); + setMediaFolderLink({ ...mediaFolderLink, Link: e.target.value.trim() }); + setIsChanged(true); + } + else { + setMediaFolderLink({ ...mediaFolderLink, Link: e.target.value.trim() }); + setIsChanged(true); + if (!isMediaFolderLinkChanged && !isWarningPopupOpen){ // Fisrt time media folder link is changed + setIsMediaFolderLinkChanged(true); + setIsWarningPopupOpen(true); } } } @@ -170,8 +173,9 @@ const EditLinkModal = props => { } handleSubmit(); setIsValidLink(true); - setIsChanged(true); + setIsChanged(false); closeModal(); + setIsMediaFolderLinkChanged(false); } else { setIsValidLink(false); } From 78c22d53ecd100f0c4221f2198c2c28f9345d06d Mon Sep 17 00:00:00 2001 From: GKD890 <57503876+GKD890@users.noreply.github.com> Date: Sat, 14 Oct 2023 18:40:16 -0400 Subject: [PATCH 21/32] fix a typo in comment --- src/components/UserProfile/UserProfileModal/EditLinkModal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx b/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx index bf76ff0e7e..64f938d8c4 100644 --- a/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx +++ b/src/components/UserProfile/UserProfileModal/EditLinkModal.jsx @@ -73,7 +73,7 @@ const EditLinkModal = props => { const handleMediaFolderLinkChanges = (e) => { if (!mediaFolderLink.Link){ - // Prevent warning popup apear if empty media folder link + // Prevent warning popup appear if empty media folder link setIsMediaFolderLinkChanged(true); setMediaFolderLink({ ...mediaFolderLink, Link: e.target.value.trim() }); setIsChanged(true); From ce021cb916c061bff0980c742fa2d70fdc1666a7 Mon Sep 17 00:00:00 2001 From: Munkh Erdene Date: Mon, 16 Oct 2023 17:38:19 -0400 Subject: [PATCH 22/32] branch update --- Dockerfile | 30 +++++++++--------- images/logo.png | Bin 420027 -> 420022 bytes images/screenshot.png | Bin 185384 -> 185381 bytes public/pfp-default-header.png | Bin 22159 -> 22158 bytes public/pfp-default.png | Bin 3501 -> 3500 bytes src/components/Badge/BadgeReport.css | 26 +++++++-------- .../assets/Delete-Icon-HGN-48x48px-2.png | Bin 4947 -> 4946 bytes src/components/OwnerMessage/assets/delete.png | Bin 4887 -> 4886 bytes src/components/OwnerMessage/assets/edit.png | Bin 1868 -> 1867 bytes src/components/SummaryBar/badges_icon.png | Bin 10889 -> 10888 bytes src/components/SummaryBar/bluesquare_icon.png | Bin 8915 -> 8914 bytes src/components/SummaryBar/report_icon.png | Bin 11457 -> 11456 bytes .../SummaryBar/suggestions_icon.png | Bin 6626 -> 6625 bytes src/components/SummaryBar/task_icon.png | Bin 11170 -> 11169 bytes .../WeeklySummariesReport/google_doc_icon.png | Bin 23357 -> 23356 bytes .../google_doc_icon_gray.png | Bin 22960 -> 22958 bytes 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e2770b994..bd987a421f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -# Define a imagem base -FROM node:14-alpine -# Set the working directory to /app -WORKDIR /app -# Copy the package.json and yarn.lock files to the container -COPY package.json yarn.lock ./ -# Install dependencies -RUN yarn install -# Copy the rest of the app files to the container -COPY . ./ -# Build the app -RUN yarn build -# Expose port 3000 -EXPOSE 3000 -# Set the startup command to run the app using Node.js +# Define a imagem base +FROM node:14-alpine +# Set the working directory to /app +WORKDIR /app +# Copy the package.json and yarn.lock files to the container +COPY package.json yarn.lock ./ +# Install dependencies +RUN yarn install +# Copy the rest of the app files to the container +COPY . ./ +# Build the app +RUN yarn build +# Expose port 3000 +EXPOSE 3000 +# Set the startup command to run the app using Node.js CMD ["yarn", "start:local"] \ No newline at end of file diff --git a/images/logo.png b/images/logo.png index 577a0ca91507431790d9df0fab9a6458ba08c20e..37c2a0b6cf5cc47582eaa7b2571818bc9f035ad6 100644 GIT binary patch delta 53 zcmdmeQF7Zw$qjc)H{UD0#<+QFx%bj`Mp?$~jIvD64sU<)fJsQS{r6WUAZ7+)mhHd4 IvK}Y`0O>0n4gdfE delta 63 zcmdmXQF8Z1$qjc)8F@F~ExpDFq&Am(FJB?Z$pgUt0m%?+%y% delta 35 rcmZ3wf_udZZr08KKX=}ZEXVFK@;0BkxBb*T#4sdjJ3c delta 14 Vcmcblc3F+JGr-TCcO#3RFaRhG1c(3t diff --git a/src/components/OwnerMessage/assets/delete.png b/src/components/OwnerMessage/assets/delete.png index 9e857680673a379773ee428e7ba80a48949472e1..19b8a99051eeef55c7040ad7331b6b7a32b3abcb 100644 GIT binary patch delta 13 UcmbQPHcgGCGr-S%Bdd@w03J&N#{d8T delta 14 VcmbQHHeHRiGr-TCcO#3CFaRNa1JnQj diff --git a/src/components/OwnerMessage/assets/edit.png b/src/components/OwnerMessage/assets/edit.png index 089844a516846e1f44554b63f1c9f84c20b65bd7..dd3461afc1efe74780badf2d67dd1aab98592fb1 100644 GIT binary patch delta 13 UcmX@Zcbbo-Gr-S%Bda?*03neCDgXcg delta 14 VcmX@jcZQF(Gr-TCcO#2CI{+m81UCQx diff --git a/src/components/SummaryBar/badges_icon.png b/src/components/SummaryBar/badges_icon.png index c16857768ed4c0887b15c89965555034930bd335..434c91590f411ee4c8fbf3d755d2ea2edcda3429 100644 GIT binary patch delta 13 UcmeAS?FeP*4DfT`$l9U>03rYck^lez delta 14 VcmeAO?F?n@4DfU3-N@3S1pp;<1fKu^ diff --git a/src/components/SummaryBar/bluesquare_icon.png b/src/components/SummaryBar/bluesquare_icon.png index 7951a7a228413106b4c0227e10b3b49161c8f286..2321b09505104adf740d91e56d576663af58f6bb 100644 GIT binary patch delta 13 UcmccYddZcgGr-S%BkMUO04N**f01yuk5 diff --git a/src/components/SummaryBar/report_icon.png b/src/components/SummaryBar/report_icon.png index 847a6778beb3fab1e7a0024e5b33b24c8208dd43..3d53be832e761f88a31c886385a915d1f1328209 100644 GIT binary patch delta 13 UcmX>Yc_5OdGr-S%BkLX=04NFtL;wH) delta 14 VcmX>Qc`%Z-Gr-TCcO%Ol9RMr#1yKM1 diff --git a/src/components/SummaryBar/suggestions_icon.png b/src/components/SummaryBar/suggestions_icon.png index e3c8172cf2604462c6e9be959a4ec82aa46e83be..d663e9ef4fa39f6bcb14601a49b54ec555a1bcb8 100644 GIT binary patch delta 13 UcmaE4{Lq-CGr-S%BkNsB04NOwNB{r; delta 14 VcmaE8{K%NKGr-TCcO%PPNdPPF1yuk5 diff --git a/src/components/SummaryBar/task_icon.png b/src/components/SummaryBar/task_icon.png index c6ec28ba20132a3f1ce3f9fece3d6a7e5d6cc3b6..786d4710b6b1f25c8c092075006442aac9c9f06f 100644 GIT binary patch delta 13 UcmZ1!zA&7nGr-S%BkNpk03^2r;s5{u delta 14 VcmZ1&z9^ivGr-TCcO%POZ2%}?1n&R< diff --git a/src/components/WeeklySummariesReport/google_doc_icon.png b/src/components/WeeklySummariesReport/google_doc_icon.png index 2163aca4bb82fe4e7cc8b7f2a97a5fcde1db5d2d..c67c03a807d977ac1c48575ef9fedc9fa4f1c87c 100644 GIT binary patch delta 15 WcmdnHjd9O5MwZS1KlhES7SRARKn0@! delta 16 Xcmdn9jdAZbM%K;%KX=}ZEEdrKH{S)Y diff --git a/src/components/WeeklySummariesReport/google_doc_icon_gray.png b/src/components/WeeklySummariesReport/google_doc_icon_gray.png index 62e21b9f6403e3efcb8b3b3415d7a2984a36c6fd..c2576c2b48aeb3f6002e28175e81f15810e7f3c8 100644 GIT binary patch delta 20 ccmdn6nQ`4_MwZS1KlhES>y0*VHTtav09a%QivR!s delta 23 fcmZ3tnQ_BrM%K;%KX=}ZEbEOJc{gu1`mF{4X(tGz From 7efbac8615de87a77ddbeacf029ff5ca155ef17e Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Tue, 17 Oct 2023 09:23:11 -0700 Subject: [PATCH 23/32] lint fixes for bmdash project components --- .../BMDashboard/Projects/ProjectDetails/LogBar.jsx | 1 - .../ProjectDetails/Materials/MaterialsDisplay.jsx | 1 - .../Projects/ProjectDetails/ProjectDetails.jsx | 4 +--- .../BMDashboard/Projects/ProjectDetails/ProjectLog.jsx | 3 +-- .../ProjectDetails/RentedTools/RentedToolsDisplay.jsx | 1 - .../Projects/ProjectDetails/RentedTools/ToolCard.jsx | 2 -- .../BMDashboard/Projects/ProjectSelectForm.jsx | 9 +++++---- src/components/BMDashboard/Projects/ProjectSummary.jsx | 10 +++------- src/components/BMDashboard/Projects/ProjectsList.jsx | 5 ++--- 9 files changed, 12 insertions(+), 24 deletions(-) diff --git a/src/components/BMDashboard/Projects/ProjectDetails/LogBar.jsx b/src/components/BMDashboard/Projects/ProjectDetails/LogBar.jsx index 886e6ea7d1..59c52cd7fa 100644 --- a/src/components/BMDashboard/Projects/ProjectDetails/LogBar.jsx +++ b/src/components/BMDashboard/Projects/ProjectDetails/LogBar.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { v4 as uuidv4 } from 'uuid'; import { Button } from 'reactstrap'; diff --git a/src/components/BMDashboard/Projects/ProjectDetails/Materials/MaterialsDisplay.jsx b/src/components/BMDashboard/Projects/ProjectDetails/Materials/MaterialsDisplay.jsx index cc4b85530a..2a974eb14a 100644 --- a/src/components/BMDashboard/Projects/ProjectDetails/Materials/MaterialsDisplay.jsx +++ b/src/components/BMDashboard/Projects/ProjectDetails/Materials/MaterialsDisplay.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Card } from 'reactstrap'; import Materials from './Materials'; diff --git a/src/components/BMDashboard/Projects/ProjectDetails/ProjectDetails.jsx b/src/components/BMDashboard/Projects/ProjectDetails/ProjectDetails.jsx index 0874cb9578..63f2a25d80 100644 --- a/src/components/BMDashboard/Projects/ProjectDetails/ProjectDetails.jsx +++ b/src/components/BMDashboard/Projects/ProjectDetails/ProjectDetails.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { useParams } from 'react-router-dom'; import { Container, Row, Col } from 'reactstrap'; import LogBar from './LogBar'; @@ -8,9 +7,8 @@ import ProjectLog from './ProjectLog'; import './ProjectDetails.css'; function ProjectDetails() { - const { projectId } = useParams(); - + return ( diff --git a/src/components/BMDashboard/Projects/ProjectDetails/ProjectLog.jsx b/src/components/BMDashboard/Projects/ProjectDetails/ProjectLog.jsx index e9dccde72d..33855d73d5 100644 --- a/src/components/BMDashboard/Projects/ProjectDetails/ProjectLog.jsx +++ b/src/components/BMDashboard/Projects/ProjectDetails/ProjectLog.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Card, Table } from 'reactstrap'; const DummyData = [ @@ -61,7 +60,7 @@ function ProjectLog() { Team Current Task Total Hrs - Today's Hrs + Today's Hrs {tableRows} diff --git a/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/RentedToolsDisplay.jsx b/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/RentedToolsDisplay.jsx index d3cf707d86..0c5c223aac 100644 --- a/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/RentedToolsDisplay.jsx +++ b/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/RentedToolsDisplay.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Card } from 'reactstrap'; import ToolCards from './ToolCards'; diff --git a/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/ToolCard.jsx b/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/ToolCard.jsx index 71936da59d..38939e9fbb 100644 --- a/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/ToolCard.jsx +++ b/src/components/BMDashboard/Projects/ProjectDetails/RentedTools/ToolCard.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - function ToolCard() { return (
diff --git a/src/components/BMDashboard/Projects/ProjectSelectForm.jsx b/src/components/BMDashboard/Projects/ProjectSelectForm.jsx index a846e3eda4..d7048ecdb6 100644 --- a/src/components/BMDashboard/Projects/ProjectSelectForm.jsx +++ b/src/components/BMDashboard/Projects/ProjectSelectForm.jsx @@ -1,8 +1,8 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; import { useHistory } from 'react-router-dom'; import { Form, FormGroup, Col, Row, Label, Input, Button } from 'reactstrap'; -const ProjectSelectForm = ({ projects }) => { +function ProjectSelectForm({ projects }) { const history = useHistory(); const [selectedProjectId, setSelectedProjectId] = useState(''); @@ -20,9 +20,10 @@ const ProjectSelectForm = ({ projects }) => { const handleButtonClick = () => { if (selectedProjectId) { - //navigate to a new page with information about the selected project + // navigate to a new page with information about the selected project history.push(`/bmdashboard/projects/${selectedProjectId}`); } else { + // eslint-disable-next-line no-alert alert('Please select an option first'); } }; @@ -57,6 +58,6 @@ const ProjectSelectForm = ({ projects }) => { ); -}; +} export default ProjectSelectForm; diff --git a/src/components/BMDashboard/Projects/ProjectSummary.jsx b/src/components/BMDashboard/Projects/ProjectSummary.jsx index 9ecdabd6a9..7e41af9b7b 100644 --- a/src/components/BMDashboard/Projects/ProjectSummary.jsx +++ b/src/components/BMDashboard/Projects/ProjectSummary.jsx @@ -1,14 +1,10 @@ -import React from 'react'; - -const ProjectSummary = ({ project }) => { +function ProjectSummary({ project }) { return ( <>

{project.projectName} summary

-

- Details of project summary TBD. -

+

Details of project summary TBD.

); -}; +} export default ProjectSummary; diff --git a/src/components/BMDashboard/Projects/ProjectsList.jsx b/src/components/BMDashboard/Projects/ProjectsList.jsx index d563b5c4e6..429df9322b 100644 --- a/src/components/BMDashboard/Projects/ProjectsList.jsx +++ b/src/components/BMDashboard/Projects/ProjectsList.jsx @@ -1,8 +1,7 @@ -import React from 'react'; import { Row } from 'reactstrap'; import ProjectSummary from './ProjectSummary'; -const ProjectsList = ({ projects }) => { +function ProjectsList({ projects }) { const listItems = projects.map(project => { return (
  • @@ -15,6 +14,6 @@ const ProjectsList = ({ projects }) => {
      {listItems}
    ); -}; +} export default ProjectsList; From e889ba1e728584a1ad3bf8bc2ec2d9840583c09a Mon Sep 17 00:00:00 2001 From: Carl Bebli Date: Wed, 18 Oct 2023 10:52:36 +0000 Subject: [PATCH 24/32] Suggestion Change --- src/components/SummaryBar/SummaryBar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SummaryBar/SummaryBar.jsx b/src/components/SummaryBar/SummaryBar.jsx index f67528c28e..2ee0b321e4 100644 --- a/src/components/SummaryBar/SummaryBar.jsx +++ b/src/components/SummaryBar/SummaryBar.jsx @@ -595,7 +595,7 @@ const SummaryBar = props => { {takeInput && ( - + Date: Wed, 18 Oct 2023 09:20:21 -0300 Subject: [PATCH 25/32] Updating BM dashboard links --- src/components/Header/Header.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Header/Header.jsx b/src/components/Header/Header.jsx index 83bd98b85e..a111420459 100644 --- a/src/components/Header/Header.jsx +++ b/src/components/Header/Header.jsx @@ -163,10 +163,10 @@ export const Header = props => { {ADD_MATERIAL} - + {LOG_MATERIAL} - + {MATERIAL_LIST} From 7e58f59a138eec47a94acef91637a19408053854 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Wed, 18 Oct 2023 12:48:35 -0700 Subject: [PATCH 26/32] update key props, fix flex-end css --- .../MaterialsList/MaterialsList.css | 2 +- .../MaterialsList/RecordsModal.jsx | 47 +++++++++---------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.css b/src/components/BMDashboard/MaterialsList/MaterialsList.css index 0e84972828..a2218c3b7c 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.css +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.css @@ -41,7 +41,7 @@ .select_input { display: flex; - align-items: end; + align-items: flex-end; width: 300px; column-gap: 1rem; } diff --git a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx index 72487bea1c..cacdf80daf 100644 --- a/src/components/BMDashboard/MaterialsList/RecordsModal.jsx +++ b/src/components/BMDashboard/MaterialsList/RecordsModal.jsx @@ -1,4 +1,3 @@ -/* eslint-disable react/no-array-index-key */ import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Table } from 'reactstrap'; import moment from 'moment'; @@ -42,9 +41,9 @@ export function Record({ record, recordType }) { - {record.map(({ date, quantityUsed, createdBy }, i) => { + {record.map(({ date, quantityUsed, createdBy }) => { return ( - + {moment(date).format('MM/DD/YY')} {quantityUsed} @@ -73,9 +72,9 @@ export function Record({ record, recordType }) { - {record.map(({ date, quantity, action, cause, description, createdBy }, i) => { + {record.map(({ date, quantity, action, cause, description, createdBy }) => { return ( - + {moment(date).format('MM/DD/YY')} {quantity} {action} @@ -109,26 +108,24 @@ export function Record({ record, recordType }) { - {record.map( - ({ date, poId, sellerId, quantity, subtotal, tax, shipping, createdBy }, i) => { - return ( - - {moment(date).format('MM/DD/YY')} - {poId} - {sellerId} - {quantity} - {subtotal} - {tax} - {shipping} - - - {`${createdBy.firstName} ${createdBy.lastName}`} - - - - ); - }, - )} + {record.map(({ date, poId, sellerId, quantity, subtotal, tax, shipping, createdBy }) => { + return ( + + {moment(date).format('MM/DD/YY')} + {poId} + {sellerId} + {quantity} + {subtotal} + {tax} + {shipping} + + + {`${createdBy.firstName} ${createdBy.lastName}`} + + + + ); + })} ); From 25360b49783f3cc3f95f2019cc6f2f69cee09524 Mon Sep 17 00:00:00 2001 From: yurisokolovicz Date: Thu, 19 Oct 2023 12:00:00 -0300 Subject: [PATCH 27/32] Tansferring logic from Header to BMHeader --- .../BMDashboard/BMHeader/BMHeader.css | 46 ++- .../BMDashboard/BMHeader/BMHeader.jsx | 266 +++++++++++++----- src/components/Header/Header.jsx | 52 ---- src/routes.js | 5 +- 4 files changed, 239 insertions(+), 130 deletions(-) diff --git a/src/components/BMDashboard/BMHeader/BMHeader.css b/src/components/BMDashboard/BMHeader/BMHeader.css index 4c42151d5b..726145140a 100644 --- a/src/components/BMDashboard/BMHeader/BMHeader.css +++ b/src/components/BMDashboard/BMHeader/BMHeader.css @@ -8,21 +8,57 @@ white-space: nowrap; } -.logo-section { - color: #fff; - font-weight: bold; +.timer-message-section { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + gap: 1rem; } .nav-links { align-items: center; } -.dashboardimg { - margin-left: 30px; +.redBackGroupHeader { + z-index: 10; + bottom: 0; + right: 0; + position: relative; + height: 30px; + text-align: center; + vertical-align: middle; + background: #ff4d4f; + border-radius: 40px; + color: #fff; + padding: 3px 6px; + max-width: 39px; + font-size: 1rem; + min-width: 29px; +} + +.owner-message { + margin-right: 3rem; } @media (max-width: 1500px) { .dashboard-text-link { font-size: 14px; } + + .owner-message { + margin-right: 0; + } +} + +@media (max-width: 1400px) { + .timer-message-section { + display: flex; + width: 0; + margin-right: 0; + } + + .owner-message { + display: none; + } } diff --git a/src/components/BMDashboard/BMHeader/BMHeader.jsx b/src/components/BMDashboard/BMHeader/BMHeader.jsx index 731ed6b4c4..92b4bd91e9 100644 --- a/src/components/BMDashboard/BMHeader/BMHeader.jsx +++ b/src/components/BMDashboard/BMHeader/BMHeader.jsx @@ -1,10 +1,46 @@ import React, { useState, useEffect } from 'react'; +// import { getUserProfile } from '../../actions/userProfile' +import { getHeaderData } from '../../../actions/authActions'; +import { getTimerData } from '../../../actions/timer'; +import { getAllRoles } from '../../../actions/role'; import { Link } from 'react-router-dom'; import { connect, useDispatch } from 'react-redux'; +import Timer from '../../Timer/Timer'; +import OwnerMessage from '../../OwnerMessage/OwnerMessage'; +import { + LOGO, + DASHBOARD, + BM_DASHBOARD, + BM_PROJECT, + ADD_MATERIAL, + LOG_MATERIAL, + MATERIAL_LIST, + ADD_EQUIPMENT_TOOL, + LOG_EQUIPMENT_TOOL, + UPDATE_EQUIPMENT_TOOL, + EQUIPMENT_TOOL_LIST, + ISSUE, + LESSON, + TIMELOG, + REPORTS, + WEEKLY_SUMMARIES_REPORT, + OTHER_LINKS, + USER_MANAGEMENT, + BADGE_MANAGEMENT, + PROJECTS, + TEAMS, + WELCOME, + VIEW_PROFILE, + UPDATE_PASSWORD, + LOGOUT, + POPUP_MANAGEMENT, + PERMISSIONS_MANAGEMENT, +} from '../../../languages/en/ui'; import { Collapse, Navbar, NavbarToggler, + NavbarBrand, Nav, NavItem, NavLink, @@ -13,34 +49,41 @@ import { DropdownMenu, DropdownItem, } from 'reactstrap'; -import { fetchTaskEditSuggestions } from 'components/TaskEditSuggestions/thunks'; -import { getHeaderData } from '../../../actions/authActions'; -import { getTimerData } from '../../../actions/timer'; -import { getAllRoles } from '../../../actions/role'; -import { - ADD_MET, - LOG_MET, - LOG_TIME, - LOG_ISSUE, - ADD_MEMBER, - MATERIAL, - TOOL_EQUIPMENT, - REPORTS, - WEEKLY_SUMMARIES_REPORT, - WELCOME, - VIEW_PROFILE, - UPDATE_PASSWORD, - LOGOUT, -} from '../../../languages/en/ui'; import Logout from '../../Logout/Logout'; -import hasPermission, { cantUpdateDevAdminDetails } from '../../../utils/permissions'; import './BMHeader.css'; +import hasPermission, { cantUpdateDevAdminDetails } from '../../../utils/permissions'; +import { fetchTaskEditSuggestions } from 'components/TaskEditSuggestions/thunks'; -export function Header(props) { +export const Header = props => { const [isOpen, setIsOpen] = useState(false); - const { isAuthenticated, user, firstName, profilePic } = props.auth; const [logoutPopup, setLogoutPopup] = useState(false); + const { isAuthenticated, user, firstName, profilePic } = props.auth; + + // Reports const canGetWeeklySummaries = props.hasPermission('getWeeklySummaries'); + // Users + + const canPostUserProfile = props.hasPermission('postUserProfile'); + const canDeleteUserProfile = props.hasPermission('deleteUserProfile'); + const canPutUserProfileImportantInfo = props.hasPermission('putUserProfileImportantInfo'); + // Badges + const canCreateBadges = props.hasPermission('createBadges'); + // Projects + const canSeeProjectManagementTab = + props.hasPermission('seeProjectManagement') || props.hasPermission('seeProjectManagementTab'); + const canPostProject = props.hasPermission('postProject'); + // Tasks + const canUpdateTask = props.hasPermission('updateTask'); + // Teams + const canDeleteTeam = props.hasPermission('deleteTeam'); + const canPutTeam = props.hasPermission('putTeam'); + // Popups + const canCreatePopup = props.hasPermission('createPopup'); + const canUpdatePopup = props.hasPermission('updatePopup'); + // Roles + const canPutRole = props.hasPermission('putRole'); + // Permissions + const canManageUser = props.hasPermission('putUserProfilePermissions'); const dispatch = useDispatch(); @@ -73,84 +116,164 @@ export function Header(props) {
    {logoutPopup && } -
    HGN Logo
    - +
    + {isAuthenticated && } + {isAuthenticated && ( +
    + +
    + )} +
    {isAuthenticated && (
    ); -} +}; const mapStateToProps = state => ({ auth: state.auth, diff --git a/src/components/Header/Header.jsx b/src/components/Header/Header.jsx index a111420459..d8141b9be3 100644 --- a/src/components/Header/Header.jsx +++ b/src/components/Header/Header.jsx @@ -10,17 +10,6 @@ import OwnerMessage from '../OwnerMessage/OwnerMessage'; import { LOGO, DASHBOARD, - BM_DASHBOARD, - BM_PROJECT, - ADD_MATERIAL, - LOG_MATERIAL, - MATERIAL_LIST, - ADD_EQUIPMENT_TOOL, - LOG_EQUIPMENT_TOOL, - UPDATE_EQUIPMENT_TOOL, - EQUIPMENT_TOOL_LIST, - ISSUE, - LESSON, TIMELOG, REPORTS, WEEKLY_SUMMARIES_REPORT, @@ -143,53 +132,12 @@ export const Header = props => { {DASHBOARD} - - - - {BM_DASHBOARD} - {TIMELOG} - - - {BM_PROJECT} - - - <> - - {ADD_MATERIAL} - - - {LOG_MATERIAL} - - - {MATERIAL_LIST} - - - {ADD_EQUIPMENT_TOOL} - - - {LOG_EQUIPMENT_TOOL} - - - {UPDATE_EQUIPMENT_TOOL} - - - {EQUIPMENT_TOOL_LIST} - - - {ISSUE} - - - {LESSON} - - - - {canGetWeeklySummaries ? ( diff --git a/src/routes.js b/src/routes.js index 6fadce905e..add430af10 100644 --- a/src/routes.js +++ b/src/routes.js @@ -44,6 +44,7 @@ import SetupProfile from 'components/SetupProfile/SetupProfile'; import BMProtectedRoute from 'components/common/BMDashboard/BMProtectedRoute'; import BMDashboard from 'components/BMDashboard'; import BMLogin from 'components/BMDashboard/Login'; +import BMHeader from 'components/BMDashboard/BMHeader'; import ProjectDetails from 'components/BMDashboard/Projects/ProjectDetails/ProjectDetails'; @@ -53,8 +54,10 @@ export default ( <> + {/* Comment out the Header component and its import during phase 2 development. */}
    - {/* */} + {/* Uncomment BMHeader and its import during phase 2 development. */} + {/* */} From 46f2afe7735cc2791a9ca7bb975667bd14f2b341 Mon Sep 17 00:00:00 2001 From: Tim Kent Date: Thu, 19 Oct 2023 09:32:09 -0700 Subject: [PATCH 28/32] update shared error component --- .../MaterialsList/MaterialsList.jsx | 22 ++++--------------- src/components/BMDashboard/shared/BMError.jsx | 19 ++++++++++++---- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx index 8f2aa2628e..e1be6fe7d2 100644 --- a/src/components/BMDashboard/MaterialsList/MaterialsList.jsx +++ b/src/components/BMDashboard/MaterialsList/MaterialsList.jsx @@ -1,4 +1,3 @@ -/* eslint-disable consistent-return */ import { useState, useEffect } from 'react'; import { connect } from 'react-redux'; @@ -9,13 +8,11 @@ import MaterialsTable from './MaterialsTable'; import './MaterialsList.css'; export function MaterialsList(props) { - // console.log('materials props: ', props); // props & state const { materials, errors, dispatch } = props; const [filteredMaterials, setFilteredMaterials] = useState(materials); const [selectedProject, setSelectedProject] = useState('all'); const [isError, setIsError] = useState(false); - const [error, setError] = useState({ status: '', message: '' }); // dispatch materials fetch action // response is mapped to materials or errors in redux store @@ -29,32 +26,22 @@ export function MaterialsList(props) { return setFilteredMaterials(materials); } const filterMaterials = materials.filter(mat => mat.project.projectName === selectedProject); - setFilteredMaterials(filterMaterials); + return setFilteredMaterials(filterMaterials); }, [selectedProject]); - // error handling + // trigger error state if an error object is added to props useEffect(() => { if (Object.entries(errors).length) { setIsError(true); - // no response object if server is offline - if (!errors.response) { - return setError({ - status: 503, - message: 'The server is temporarily offline. Please try again later.', - }); - } - setError({ - status: errors.response.status, - message: errors.response.statusText, - }); } }, [errors]); + // error state if (isError) { return (

    Materials List

    - +
    ); } @@ -71,7 +58,6 @@ export function MaterialsList(props) { } const mapStateToProps = state => ({ - // auth: state.auth, materials: state.materials, errors: state.errors, }); diff --git a/src/components/BMDashboard/shared/BMError.jsx b/src/components/BMDashboard/shared/BMError.jsx index 7d07afba0a..8d6c87b52d 100644 --- a/src/components/BMDashboard/shared/BMError.jsx +++ b/src/components/BMDashboard/shared/BMError.jsx @@ -1,17 +1,28 @@ -import { Button } from 'react-bootstrap'; +// The component provides users with information about the error +// and the ability to refresh the page to reattempt their request. +// The component takes in an axios error as props. +// If the error is client-side, the status and statusText fields are +// extracted from the response object and used on the page. +// If the error is server-side, such as if the backend web service is offline, +// there will be no response object and a generic 503 error is used instead. + +import { Button } from 'reactstrap'; import { BiErrorCircle } from 'react-icons/bi'; import './BMError.css'; -export default function BMError({ error }) { +export default function BMError({ errors }) { return (

    - There was an error processing your request: {error.status} ({error.message}) + There was an error processing your request:{' '} + {errors.response + ? `${errors.response.status}(${errors.response.statusText})` + : '503 (The server is temporarily offline. Please try again later.)'}

    Please try again.

    -
    From fb982462aa4dce8c92ced696570f92fbe28ba3b5 Mon Sep 17 00:00:00 2001 From: yurisokolovicz Date: Thu, 19 Oct 2023 18:00:38 -0300 Subject: [PATCH 29/32] Commenting out import BMHeader --- src/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.js b/src/routes.js index add430af10..d4554f067c 100644 --- a/src/routes.js +++ b/src/routes.js @@ -44,7 +44,7 @@ import SetupProfile from 'components/SetupProfile/SetupProfile'; import BMProtectedRoute from 'components/common/BMDashboard/BMProtectedRoute'; import BMDashboard from 'components/BMDashboard'; import BMLogin from 'components/BMDashboard/Login'; -import BMHeader from 'components/BMDashboard/BMHeader'; +// import BMHeader from 'components/BMDashboard/BMHeader'; import ProjectDetails from 'components/BMDashboard/Projects/ProjectDetails/ProjectDetails'; From a9790a9d04fad134d6054947323867e9529674dd Mon Sep 17 00:00:00 2001 From: yurisokolovicz Date: Thu, 19 Oct 2023 18:02:59 -0300 Subject: [PATCH 30/32] Correcting conflicting files --- src/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.js b/src/routes.js index d4554f067c..add430af10 100644 --- a/src/routes.js +++ b/src/routes.js @@ -44,7 +44,7 @@ import SetupProfile from 'components/SetupProfile/SetupProfile'; import BMProtectedRoute from 'components/common/BMDashboard/BMProtectedRoute'; import BMDashboard from 'components/BMDashboard'; import BMLogin from 'components/BMDashboard/Login'; -// import BMHeader from 'components/BMDashboard/BMHeader'; +import BMHeader from 'components/BMDashboard/BMHeader'; import ProjectDetails from 'components/BMDashboard/Projects/ProjectDetails/ProjectDetails'; From 18891cade090e978c998f2ebb11caeee9cd258ed Mon Sep 17 00:00:00 2001 From: yurisokolovicz Date: Thu, 19 Oct 2023 21:14:23 -0300 Subject: [PATCH 31/32] ESLint fix for BMHeader --- .eslintignore | 1 + src/components/BMDashboard/BMHeader/BMHeader.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 776a279d70..7ce1d1277b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -26,6 +26,7 @@ src/components/AutoUpdate/** src/components/Badge/** src/components/common/** src/components/Header/** +src/components/BMDashboard/BMHeader/** src/components/Inventory/** src/components/Login/** src/components/ManageMemberships/** diff --git a/src/components/BMDashboard/BMHeader/BMHeader.jsx b/src/components/BMDashboard/BMHeader/BMHeader.jsx index 92b4bd91e9..2762b77aae 100644 --- a/src/components/BMDashboard/BMHeader/BMHeader.jsx +++ b/src/components/BMDashboard/BMHeader/BMHeader.jsx @@ -8,7 +8,7 @@ import { connect, useDispatch } from 'react-redux'; import Timer from '../../Timer/Timer'; import OwnerMessage from '../../OwnerMessage/OwnerMessage'; import { - LOGO, + // LOGO, DASHBOARD, BM_DASHBOARD, BM_PROJECT, From 23a96961b7d800148ef9bd6e8ae36fabed87ccd4 Mon Sep 17 00:00:00 2001 From: Aaron Persaud Date: Fri, 20 Oct 2023 02:01:26 -0400 Subject: [PATCH 32/32] update babel/traverse --- package-lock.json | 272 ++++++++++++++++++++++++++++++++++++++++------ package.json | 2 +- 2 files changed, 238 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90a740f9da..ac0aaaa369 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==" }, "@adobe/css-tools": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.2.0.tgz", - "integrity": "sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", + "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", "dev": true }, "@ampproject/remapping": { @@ -668,14 +668,31 @@ } }, "@babel/generator": { - "version": "7.22.9", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz", - "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "requires": { - "@babel/types": "^7.22.5", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==" + }, + "@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "requires": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-validator-identifier": { @@ -709,20 +726,85 @@ } }, "@babel/traverse": { - "version": "7.22.8", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz", - "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==", - "requires": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.7", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.7", - "@babel/types": "^7.22.5", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "requires": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==" + }, + "@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "requires": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==" + }, + "@babel/highlight": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==" + }, + "@babel/template": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" + } + }, + "@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "requires": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/types": { @@ -1947,20 +2029,140 @@ } }, "@babel/traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.1.tgz", - "integrity": "sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==", - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "requires": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + } + }, + "@babel/generator": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "requires": { + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==" + }, + "@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "requires": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==" + }, + "@babel/highlight": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==" + }, + "@babel/template": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" + } + }, + "@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "requires": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/types": { @@ -16217,9 +16419,9 @@ "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" }, "postcss": { - "version": "8.4.27", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", - "integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "requires": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", @@ -20155,9 +20357,9 @@ "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, "tinymce": { - "version": "5.10.7", - "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-5.10.7.tgz", - "integrity": "sha512-9UUjaO0R7FxcFo0oxnd1lMs7H+D0Eh+dDVo5hKbVe1a+VB0nit97vOqlinj+YwgoBDt6/DSCUoWqAYlLI8BLYA==" + "version": "5.10.8", + "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-5.10.8.tgz", + "integrity": "sha512-iyoo3VGMAJhLMDdblAefKvYgBRk9kQi58GTwAmoieqsyggGsKZWlQl/YY6nTILFHUCA1FhYu0HdmM5YYjs17UQ==" }, "tmp": { "version": "0.0.33", diff --git a/package.json b/package.json index 21282445fa..daa0220ec4 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "redux-actions": "^2.6.5", "redux-persist": "^5.10.0", "redux-thunk": "^2.3.0", - "tinymce": "^5.10.7", + "tinymce": "^5.10.8", "uuid": "^9.0.1", "websocket-extensions": ">=0.1.4" },