Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Carlos add hours by team member visualization project reports" #2398

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion __mocks__/styleMock.js

This file was deleted.

5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ module.exports = {
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
'react-leaflet': '<rootDir>/src/_tests_/__mocks__/react-leaflet.js',
'marker-cluster-group': '<rootDir>/src/_tests_/__mocks__/react-leaflet-cluster.js',
'\\.(css|less|scss)$': '<rootDir>/__mocks__/styleMock.js',
},

// The paths to modules that run some code to configure or set up the testing environment before each test
setupFiles: ['jest-localstorage-mock'],

setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
setupFiles: ['<rootDir>src/setupTests.js'],

// The test environment that will be used for testing
testEnvironment: 'jsdom',
Expand Down
5,740 changes: 3,076 additions & 2,664 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@fortawesome/free-regular-svg-icons": "^5.12.1",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.19",
"@reduxjs/toolkit": "^2.2.5",
"@sentry/browser": "^4.6.6",
"@tinymce/tinymce-react": "^3.14.0",
"axios": "^0.21.2",
Expand Down Expand Up @@ -64,7 +63,6 @@
"reactjs-popup": "^2.0.5",
"reactstrap": "^8.4.1",
"read-excel-file": "^5.5.3",
"recharts": "^2.12.1",
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"redux-concatenate-reducers": "^1.0.0",
Expand Down Expand Up @@ -103,7 +101,6 @@
"cross-env": "^5.2.1",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.6.2",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^5.1.0",
Expand All @@ -113,15 +110,14 @@
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-testing-library": "^3.6.0",
"husky": "^8.0.0",
"jest-environment-jsdom-sixteen": "^1.0.3",
"jest-localstorage-mock": "^2.4.26",
"msw": "^0.19.5",
"node-fetch": "^3.1.1",
"node-sass": "^8.0.0",
"prettier": "^1.19.1",
"redux-mock-store": "^1.5.4",
"husky": "^8.0.0",
"sinon": "^7.3.2",
"surge": "^0.21.6"
"surge": "^0.21.6",
"jest-environment-jsdom-sixteen": "^1.0.3",
"node-fetch": "^3.1.1"
}
}
18 changes: 0 additions & 18 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,3 @@ export function postTimeEntry(timeEntryObj) {
);
};
};

export function getTimeEntryByProjectSpecifiedPeriod(projectId, fromDate, toDate) {
const request = httpService.get(`${APIEndpoint}/TimeEntry/projects/${projectId}/${fromDate}/${toDate}`);

return dispatch => {
return new Promise((resolve, reject) => {
request.then(({ data }) => {
dispatch({
type: 'GET_TIME_ENTRY_By_Project_FOR_SPECIFIED_PERIOD',
payload: data,
});
resolve(data);
}).catch(error => {
reject(error);
});
});
};
};
2 changes: 1 addition & 1 deletion src/actions/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getProjectDetail = projectId => {
}
});
if (!loggedOut) {
return dispatch(setProjectDetail(res.data));
await dispatch(setProjectDetail(res.data));
}
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/actions/projectMembers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
******************************************************************************* */
import axios from 'axios';
import * as types from '../constants/projectMembership';

import { searchWithAccent } from 'utils/search';
import { ENDPOINTS } from '../utils/URL';
/** *****************************************
* ACTION CREATORS
Expand Down
16 changes: 8 additions & 8 deletions src/actions/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
fetchTeamMembersDataError,
deleteTaskNotificationSuccess,
deleteTaskNotificationBegin,
} from '../components/TeamMemberTasks/actions';
import { createTaskEditSuggestionHTTP } from '../components/TaskEditSuggestions/service';
} from 'components/TeamMemberTasks/actions';
import { createTaskEditSuggestionHTTP } from 'components/TaskEditSuggestions/service';
import * as types from '../constants/task';
import { ENDPOINTS } from '../utils/URL';
import { createOrUpdateTaskNotificationHTTP } from './taskNotification';
Expand Down Expand Up @@ -54,8 +54,8 @@ export const fetchTeamMembersTimeEntries = () => async (dispatch, getState) => {
const userIds = teamMemberTasks.usersWithTasks.map(user => user.personId)

const { data: usersWithTimeEntries } = await axios.post(ENDPOINTS.TIME_ENTRIES_USER_LIST, {
users: userIds,
fromDate,
users: userIds,
fromDate,
toDate
});

Expand Down Expand Up @@ -130,18 +130,18 @@ export const updateTask = (taskId, updatedTask, hasPermission, prevTask) => asyn
let status = 200;
try {
const state = getState();

let oldTask
let oldTask
if(prevTask){
oldTask = prevTask
}else{
oldTask = selectUpdateTaskData(state, taskId);
}

if (hasPermission) {
await axios.put(ENDPOINTS.TASK_UPDATE(taskId), updatedTask);
const userIds = updatedTask.resources.map(resource => resource.userID);
await createOrUpdateTaskNotificationHTTP(taskId, oldTask, userIds);
await createOrUpdateTaskNotificationHTTP(taskId, oldTask, userIds);
} else {
await createTaskEditSuggestionHTTP(taskId, selectUserId(state), oldTask, updatedTask);
}
Expand Down
7 changes: 1 addition & 6 deletions src/components/BMDashboard/ItemList/ItemsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ export default function ItemsTable({
<td key={label}>{getNestedValue(el, key)}</td>
))}
<td className="items_cell">
<button
type="button"
onClick={() => handleEditRecordsClick(el, 'Update')}
aria-label="Update record"
>
{' '}
<button type="button" onClick={() => handleEditRecordsClick(el, 'Update')}>
<BiPencil />
</button>
<Button
Expand Down
1 change: 0 additions & 1 deletion src/components/BMDashboard/LogTools/LogTools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ function LogTools() {
<td>{toolType.using}</td>
<td>
<Select
aria-label="Select Tool"
ref={selectRefs.current[index]}
options={toolType.items}
isMulti
Expand Down
6 changes: 1 addition & 5 deletions src/components/BMDashboard/ToolItemList/ToolItemsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,7 @@ export default function ToolItemsTable({
</td>
<td>{el.code}</td>
<td className="items_cell">
<button
type="button"
onClick={() => handleEditRecordsClick(el, 'Update')}
aria-label="Update record"
>
<button type="button" onClick={() => handleEditRecordsClick(el, 'Update')}>
<BiPencil />
</button>
<Button
Expand Down
7 changes: 2 additions & 5 deletions src/components/LeaderBoard/Leaderboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function LeaderBoard({
</thead>
<tbody className="my-custome-scrollbar">
<tr className={darkMode ? 'bg-yinmn-blue' : ''}>
<td aria-label="Empty cell" />
<td />
<th scope="row" className="leaderboard-totals-container">
<span>{organizationData.name}</span>
{viewZeroHouraMembers(loggedInUser.role) && (
Expand All @@ -234,13 +234,12 @@ function LeaderBoard({
</span>
)}
</th>
<td className="align-middle" aria-label="Empty cell" />
<td className="align-middle" />
<td className="align-middle">
<span title="Tangible time">{organizationData.tangibletime || ''}</span>
</td>
<td className="align-middle">
<Progress
aria-label={`TangibleEffort: ${organizationData.tangibletime} hours`}
title={`TangibleEffort: ${organizationData.tangibletime} hours`}
value={organizationData.barprogress}
color={organizationData.barcolor}
Expand Down Expand Up @@ -396,7 +395,6 @@ function LeaderBoard({
<div>
<button
type="button"
aria-label="Open time off modal"
onClick={() => {
const data = {
requests: [...allRequests[item.personId]],
Expand Down Expand Up @@ -439,7 +437,6 @@ function LeaderBoard({
<Link
to={`/timelog/${item.personId}`}
title={`TangibleEffort: ${item.tangibletime} hours`}
aria-label={`TangibleEffort: ${item.tangibletime} hours`}
>
<Progress value={item.barprogress} color={item.barcolor} />
</Link>
Expand Down
18 changes: 9 additions & 9 deletions src/components/Projects/WBS/WBSDetail/EditTask/EditTaskModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import React, { useState, useEffect } from 'react';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { connect } from 'react-redux';
import ReactTooltip from 'react-tooltip';
import { DUE_DATE_MUST_GREATER_THAN_START_DATE } from '../../../../../../src/languages/en/messages';
import { DUE_DATE_MUST_GREATER_THAN_START_DATE } from 'languages/en/messages';
import DayPickerInput from 'react-day-picker/DayPickerInput';
import { DateUtils } from 'react-day-picker';
import 'react-day-picker/lib/style.css';
import dateFnsFormat from 'date-fns/format';
import dateFnsParse from 'date-fns/parse';
import { updateTask } from '../../../../../../src/actions/task';
import { updateTask } from 'actions/task';
import { Editor } from '@tinymce/tinymce-react';
import hasPermission from '../../../../../../src/utils/permissions';
import hasPermission from 'utils/permissions';
import axios from 'axios';
import { ENDPOINTS } from '../../../../../../src/utils/URL';
import { boxStyle, boxStyleDark } from '../../../../../../src/styles';
import { ENDPOINTS } from 'utils/URL';
import { boxStyle, boxStyleDark } from 'styles';
import { toast } from 'react-toastify';
import TagsSearch from '../components/TagsSearch';
import ReadOnlySectionWrapper from './ReadOnlySectionWrapper';
Expand Down Expand Up @@ -70,7 +70,7 @@ function EditTaskModal(props) {
{ value: 'Other', label: 'Other' },
];
const FORMAT = 'MM/dd/yy';

const EditorInit = {
license_key: 'gpl',
menubar: false,
Expand All @@ -88,7 +88,7 @@ function EditTaskModal(props) {
* -------------------------------- functions --------------------------------
*/
const toggle = () => setModal(!modal);

// set different mode while show modal through different button
const handleModalShow = (mode) => {
setCurrentMode(mode);
Expand Down Expand Up @@ -284,7 +284,7 @@ function EditTaskModal(props) {
<ModalBody className={darkMode ? 'bg-yinmn-blue' : ''}>
<table
className={`table table-bordered responsive
${canUpdateTask || canSuggestTask ? null : 'disable-div'}
${canUpdateTask || canSuggestTask ? null : 'disable-div'}
${darkMode ? 'text-light' : ''}`}
>
<tbody>
Expand All @@ -304,7 +304,7 @@ function EditTaskModal(props) {
onChange={e => setTaskName(e.target.value)}
onKeyPress={e => setTaskName(e.target.value)}
value={taskName}
/>,
/>,
editable,
taskName
)}
Expand Down

This file was deleted.

Loading
Loading