Skip to content

Commit

Permalink
Merge branch 'development' into Rahul-Fix-Reports-Team-Page-Layout-On…
Browse files Browse the repository at this point in the history
…-Small-Screens
  • Loading branch information
slidracoon72 authored Dec 14, 2024
2 parents c299426 + a99db5c commit e4fc1ca
Show file tree
Hide file tree
Showing 173 changed files with 6,456 additions and 2,619 deletions.
Binary file removed ..env.un~
Binary file not shown.
Empty file removed .env~
Empty file.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ src/config.json
src/index.js
src/reducers/**
src/styles.js
src/utils/**
src/__tests__/**

/public/
Expand All @@ -19,11 +18,9 @@ src/components/App.jsx
src/components/AutoReload/**
src/components/Badge/**
src/components/common/**
src/components/Header/**
src/components/Projects/**
src/components/Reports/**
src/components/SetupProfile/**
src/components/SummaryBar/**
src/components/SummaryManagement/**
src/components/TaskEditSuggestions/**
src/components/TeamMemberTasks/**
Expand Down
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ src/routes.js
src/setupTests.js
src/store.js
src/styles.js
src/utils/**
src/__tests__/**


src/components/App.jsx
src/components/AutoReload/**
src/components/Header/**
src/components/Inventory/**
src/components/Memberships/**
src/components/Projects/**
src/components/Reports/**
src/components/SetupProfile/**
src/components/SummaryBar/**
src/components/SummaryManagement/**
src/components/TaskEditSuggestions/**
src/components/TeamLocations/**
Expand Down
27 changes: 27 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^10.4.9",
"@testing-library/user-event": "^12.0.14",
"@types/react-router-dom": "^5.3.3",
"babel-eslint": "^10.1.0",
"cross-env": "^5.2.1",
"enzyme": "^3.10.0",
Expand Down
20 changes: 20 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,38 @@ body {
background-color: #1B2A41 !important;
}

/* .bg-oxford-blue:hover{
background-color: #1B2A41 !important;
color:black;
} */

.bg-space-cadet{
background-color: #1C2541 !important;
}

/* .bg-space-cadet:hover{
background-color: #1C2541 !important;
color:black;
} */

.bg-yinmn-blue{
background-color: #3A506B !important;
}

/* .bg-yinmn-blue:hover{
background-color: #3A506B !important;
color: black;
} */

.bg-yinmn-blue-light{
background-color:#2f4157;
}

/* .bg-yinmn-blue-light:hover{
background-color:#2f4157;
color: black;
} */

.bg-azure{
background-color: #007BFF !important;
}
Expand Down
9 changes: 9 additions & 0 deletions src/actions/dashboardActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const INCREMENT_DASHBOARD_TASK_COUNT = 'INCREMENT_DASHBOARD_TASK_COUNT';

export const incrementDashboardTaskCount = (taskId) => {
console.log(`Dispatching incrementDashboardTaskCount for task ID: ${taskId}`);
return {
type: INCREMENT_DASHBOARD_TASK_COUNT,
payload: { taskId },
};
};
9 changes: 6 additions & 3 deletions src/actions/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ export const postNewProject = (projectName, projectCategory) => {
isActive: true,
};
dispatch(addNewProject({ newProject, status }));
await dispatch(fetchAllProjects());
return _id;
} catch (err) {
status = err.response.status;
error = err.response.data;
dispatch(addNewProject({ status, error }));
const errorInfo = {
status: err.response ? err.response.status : 500,
error: err.response ? err.response.data : 'Network error'
};
dispatch(setProjectsError(errorInfo));
throw error;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/actions/sendEmails.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ export const removeNonHgnUserEmailSubscription = async (email = '') => {

return { success: false, error: error };
}
};
};
1 change: 0 additions & 1 deletion src/actions/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export const updateTask = (taskId, updatedTask, hasPermission, prevTask) => asyn
}else{
oldTask = selectUpdateTaskData(state, taskId);
}

if (hasPermission) {
await axios.put(ENDPOINTS.TASK_UPDATE(taskId), updatedTask);
const userIds = updatedTask.resources.map(resource => resource.userID);
Expand Down
39 changes: 30 additions & 9 deletions src/actions/totalOrgSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const fetchTotalOrgSummaryReportSuccess = volunteerstats => ({
type: actions.FETCH_TOTAL_ORG_SUMMARY_SUCCESS,
payload: { volunteerstats },
});

/**
* Handle the error case.
*
Expand All @@ -28,31 +29,51 @@ export const fetchTotalOrgSummaryReportError = error => ({
payload: { error },
});

export const getTotalOrgSummary = (startDate, endDate) => {
const url = ENDPOINTS.TOTAL_ORG_SUMMARY(startDate, endDate);
export const getTaskAndProjectStats = (startDate, endDate) => {
const url = ENDPOINTS.HOURS_TOTAL_ORG_SUMMARY(startDate, endDate);
return async dispatch => {
dispatch(fetchTotalOrgSummaryReportBegin());
await dispatch(fetchTotalOrgSummaryReportBegin());
try {
const response = await axios.get(url);
dispatch(fetchTotalOrgSummaryReportSuccess(response.data));
return {status: response.status, data: response.data};
return response.data;
} catch (error) {
dispatch(fetchTotalOrgSummaryReportError(error));
return error.response.status;
}
};
};

export const getTaskAndProjectStats = (startDate, endDate) => {
const url = ENDPOINTS.HOURS_TOTAL_ORG_SUMMARY(startDate, endDate);
/**
* This action is used to set the volunteer stats data in store.
*
* @param {array} volunteerOverview An array of all volunteer stats data
*/
export const fetchTotalOrgSummaryDataSuccess = volunteerOverview => ({
type: actions.FETCH_TOTAL_ORG_SUMMARY_DATA_SUCCESS,
payload: { volunteerOverview },
});

/**
* keep record of error while fetching the volunteer stats data
*
* @param {Object} error The error object.
*/
export const fetchTotalOrgSummaryDataError = fetchingError => ({
type: actions.FETCH_TOTAL_ORG_SUMMARY_DATA_ERROR,
payload: { fetchingError },
});

export const getTotalOrgSummary = (startDate, endDate) => {
const url = ENDPOINTS.TOTAL_ORG_SUMMARY(startDate, endDate);
return async dispatch => {
dispatch(fetchTotalOrgSummaryReportBegin());
try {
const response = await axios.get(url);
dispatch(fetchTotalOrgSummaryReportSuccess(response.data));
return response.data;
dispatch(fetchTotalOrgSummaryDataSuccess(response.data));
return {status: response.status, data: response.data};
} catch (error) {
dispatch(fetchTotalOrgSummaryReportError(error));
dispatch(fetchTotalOrgSummaryDataError(error));
return error.response.status;
}
};
Expand Down
24 changes: 23 additions & 1 deletion src/actions/userProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
EDIT_USER_PROFILE,
CLEAR_USER_PROFILE,
GET_PROJECT_BY_USER_NAME,
USER_NOT_FOUND_ERROR
USER_NOT_FOUND_ERROR,
GET_USER_AUTOCOMPLETE
} from '../constants/userProfile';
import { ENDPOINTS } from '../utils/URL';
import { toast } from 'react-toastify';
Expand Down Expand Up @@ -91,6 +92,21 @@ export const getProjectsByUsersName = searchName => {
};
};

// Action to get user suggestions for autocomplete
export const getUserByAutocomplete = (searchText) => {
const url = ENDPOINTS.USER_AUTOCOMPLETE(searchText);
return async (dispatch) => {
try {
const res = await axios.get(url);
dispatch(getUserAutocompleteActionCreator(res.data)); // Dispatching the data to the store
return res.data; // Return the data to be used in the component
} catch (error) {
toast.error('Error fetching autocomplete suggestions');
return [];
}
};
};

export const getProjectsByPersonActionCreator = data => ({
type: GET_PROJECT_BY_USER_NAME,
payload: data
Expand Down Expand Up @@ -119,4 +135,10 @@ export const editFirstNameActionCreator = data => ({
export const putUserProfileActionCreator = data => ({
type: EDIT_USER_PROFILE,
payload: data,
});

// Action creator for user autocomplete
export const getUserAutocompleteActionCreator = (data) => ({
type: GET_USER_AUTOCOMPLETE,
payload: data,
});
Loading

0 comments on commit e4fc1ca

Please sign in to comment.