Skip to content

Commit

Permalink
Merge branch 'development' into Nahiyan_Dropdown-items-in-dark-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahiyan-16 authored Jul 4, 2024
2 parents 46b0def + f1f0916 commit 5fe04b0
Show file tree
Hide file tree
Showing 139 changed files with 3,807 additions and 2,332 deletions.
26 changes: 0 additions & 26 deletions .vscode/settings.json

This file was deleted.

43 changes: 19 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"redux-concatenate-reducers": "^1.0.0",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"tinymce": "^5.10.9",
"tinymce": "^7.0.0",
"uuid": "^9.0.1"
},
"scripts": {
Expand Down
4 changes: 0 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="%PUBLIC_URL%/index.css" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<script
src="https://cdn.tiny.cloud/1/1rsz7lmakcvzg8trwjy91zht48pj4oubz8jrdyqxbbr63pvs/tinymce/5/tinymce.min.js"
referrerpolicy="origin"
></script>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/mockAdminState.js
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,7 @@ export default {
'postUserProfile',
'putUserProfile',
'putUserProfileImportantInfo',
'updateSummaryRequirements',
'updatePassword',
'deleteUserProfile',
'infringementAuthorizer',
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mockStates.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ export const rolesMock = {
'putUserProfile',
'putUserProfileImportantInfo',
'manageAdminLinks',
'updateSummaryRequirements',
'changeUserStatus',
'updatePassword',
'deleteUserProfile',
Expand Down Expand Up @@ -1259,6 +1260,7 @@ export const rolesMock = {
'postUserProfile',
'putUserProfile',
'putUserProfileImportantInfo',
'updateSummaryRequirements',
'deleteUserProfile',
'infringementAuthorizer',
'manageAdminLinks',
Expand Down
73 changes: 73 additions & 0 deletions src/actions/blueSquareEmailBCCAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import * as types from '../constants/BluequareEmailBccConstants';
import axios from 'axios';
import { ENDPOINTS } from '../utils/URL';
import { toast } from 'react-toastify';

const getAllBlueSquareEmailBccs = allAssignements => ({
type: types.GET_BLUE_SQUARE_EMAIL_ASSIGNMENTS,
payload: allAssignements,
});

const setBlueSquareEmailBcc = emailAssignement => ({
type: types.SET_BLUE_SQUARE_EMAIL_ASSIGNMENT,
payload: emailAssignement,
});

const deleteBlueSquareEmailBcc = id => ({
type: types.DELETE_BLUE_SQUARE_EMAIL_ASSIGNMENT,
payload: id,
});

const blueSquareEmailBccError = error => ({
type: types.BLUE_SQUARE_EMAIL_ASSIGNMENT_ERROR,
payload: error,
});

export const getAllBlueSquareEmailAssignements = () => {
const url = ENDPOINTS.BLUE_SQUARE_EMAIL_BCC();
return async dispatch => {
try {
const response = await axios.get(url);
if (response.status === 200) {
dispatch(getAllBlueSquareEmailBccs(response.data));
} else {
dispatch(blueSquareEmailBccError(response.data));
}
} catch (err) {
dispatch(blueSquareEmailBccError(err));
}
};
};

export const setBlueSquareEmailAssignement = email => {
const url = ENDPOINTS.BLUE_SQUARE_EMAIL_BCC();
return async dispatch => {
try {
const response = await axios.post(url, {email});
if (response.status === 200) {
dispatch(setBlueSquareEmailBcc(response.data));
} else {
dispatch(blueSquareEmailBccError(response.data));
}
} catch (err) {
dispatch(blueSquareEmailBccError(err));
}
};
};

export const deleteBlueSquareEmailAssignement = id => {
const url = ENDPOINTS.DELETE_BLUE_SQUARE_EMAIL_BCC(id);
return async dispatch => {
try {
const response = await axios.delete(url);
if (response.status === 200) {
console.log(response.data)
dispatch(deleteBlueSquareEmailBcc(response.data.id));
} else {
dispatch(blueSquareEmailBccError(response.data));
}
} catch (err) {
dispatch(blueSquareEmailBccError(err));
}
};
};
31 changes: 30 additions & 1 deletion src/actions/bmdashboard/equipmentActions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";
import { ENDPOINTS } from "utils/URL";
import GET_EQUIPMENT_BY_ID from 'constants/bmdashboard/equipmentConstants';
import GET_EQUIPMENT_BY_ID,{SET_EQUIPMENTS}from 'constants/bmdashboard/equipmentConstants';
import { GET_ERRORS } from 'constants/errors';

export const fetchEquipmentById = (equipmentId) => {
Expand All @@ -16,6 +16,25 @@ export const fetchEquipmentById = (equipmentId) => {
}
}

export const fetchAllEQUIPMENTS = () => {
return async dispatch => {
axios.get(ENDPOINTS.BM_EQUIPMENTS)
.then(res => {
dispatch(setEquipments(res.data))
})
.catch(err => {
dispatch(setErrors(err))
})
}
}

export const setEquipments = payload => {
return {
type: SET_EQUIPMENTS,
payload
}
}

export const addEquipmentType = async (body) => {
return axios.post(`${ENDPOINTS.BM_INVTYPE_ROOT}/equipment`, body)
.then(res => res)
Expand All @@ -38,4 +57,14 @@ export const setErrors = payload => {
type: GET_ERRORS,
payload
}
}

export const purchaseEquipment = async (body) => {
return axios.post(ENDPOINTS.BM_EQUIPMENT_PURCHASE, body)
.then(res => res)
.catch((err) => {
if (err.response) return err.response
if (err.request) return err.request
return err.message
})
}
23 changes: 21 additions & 2 deletions src/actions/bmdashboard/invTypeActions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import { ENDPOINTS } from "utils/URL";
import GET_MATERIAL_TYPES, { POST_BUILDING_MATERIAL_INVENTORY_TYPE, POST_ERROR_BUILDING_MATERIAL_INVENTORY_TYPE, RESET_POST_BUILDING_MATERIAL_INVENTORY_TYPE, GET_INV_BY_TYPE, GET_TOOL_TYPES ,GET_CONSUMABLE_TYPES } from "constants/bmdashboard/inventoryTypeConstants";
import GET_MATERIAL_TYPES, { POST_BUILDING_MATERIAL_INVENTORY_TYPE, POST_ERROR_BUILDING_MATERIAL_INVENTORY_TYPE, RESET_POST_BUILDING_MATERIAL_INVENTORY_TYPE, GET_INV_BY_TYPE, GET_TOOL_TYPES ,GET_CONSUMABLE_TYPES, GET_EQUIPMENT_TYPES, GET_REUSABLE_TYPES } from "constants/bmdashboard/inventoryTypeConstants";
import { POST_TOOLS_LOG, POST_ERROR_TOOLS_LOG, RESET_POST_TOOLS_LOG } from 'constants/bmdashboard/toolsConstants';

import { GET_ERRORS } from "constants/errors";

export const fetchMaterialTypes = () => {
Expand All @@ -17,7 +16,20 @@ export const fetchMaterialTypes = () => {
}
}

export const fetchEquipmentTypes = () => {
return async dispatch => {
axios.get(ENDPOINTS.BM_EQUIPMENT_TYPES)
.then(res => {
dispatch(setEquipmentTypes(res.data))
})
.catch(err => {
dispatch(setErrors(err))
})
}
}

export const fetchReusableTypes = () => {
console.log("fetchReusableTypes");
return async dispatch => {
axios.get(ENDPOINTS.BM_REUSABLE_TYPES)
.then(res => {
Expand Down Expand Up @@ -157,6 +169,13 @@ export const setMaterialTypes = payload => {
}
}

export const setEquipmentTypes = payload => {
return {
type: GET_EQUIPMENT_TYPES,
payload
}
}

export const setReusableTypes = payload => {
return {
type: GET_REUSABLE_TYPES,
Expand Down
Loading

0 comments on commit 5fe04b0

Please sign in to comment.