Skip to content

Commit

Permalink
code revereted for invoice and time tracking (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajinkya Deshmukh authored Apr 22, 2022
1 parent 9bf36c3 commit 03ffeb4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export const DropdownHeader = () => (
/>
</button>
</div>
<div>
{/* <div>
<button className=" mx-3 font-bold text-xs tracking-widest text-miru-han-purple-1000">
CLICK TO ADD MULTIPLE ENTRIES
</button>
</div>
</div> */}
</div>
);
34 changes: 17 additions & 17 deletions app/javascript/src/components/time-tracking/WeeklyEntries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ const WeeklyEntries: React.FC<Props> = ({
}
};

const handleDeleteEntries = async () => {
try {
if (!currentEntries.length) return;
const ids = getIds();
const delRes = await timesheetEntryApi.destroyBulk({ ids: ids });
if (delRes.status === 200) {
const getRes = await timesheetEntryApi.list(dayInfo[0]["fullDate"], dayInfo[6]["fullDate"]);
if (getRes.status === 200) {
const newState = { ...entryList, ...getRes.data.entries };
setEntryList(newState);
}
}
} catch (error) {
Logger.error(error.message);
}
};
// const handleDeleteEntries = async () => {
// try {
// if (!currentEntries.length) return;
// const ids = getIds();
// const delRes = await timesheetEntryApi.destroyBulk({ ids: ids });
// if (delRes.status === 200) {
// const getRes = await timesheetEntryApi.list(dayInfo[0]["fullDate"], dayInfo[6]["fullDate"]);
// if (getRes.status === 200) {
// const newState = { ...entryList, ...getRes.data.entries };
// setEntryList(newState);
// }
// }
// } catch (error) {
// Logger.error(error.message);
// }
// };

const handleSetData = () => {
if (projectId) {
Expand Down Expand Up @@ -105,7 +105,7 @@ const WeeklyEntries: React.FC<Props> = ({
newRowView={newRowView}
setNewRowView={setNewRowView}
setEntryList={setEntryList}
handleDeleteEntries={handleDeleteEntries}
// handleDeleteEntries={handleDeleteEntries}
handleEditEntries={handleEditEntries}
dayInfo={dayInfo}
isWeeklyEditing={isWeeklyEditing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const WeeklyEntriesCard = ({
project,
currentEntries,
setProjectSelected,
handleDeleteEntries,
// handleDeleteEntries,
currentProjectId,
setEntryList,
setCurrentEntries,
Expand Down Expand Up @@ -205,12 +205,12 @@ const WeeklyEntriesCard = ({
alt="edit"
className="icon-hover ml-8 cursor-pointer"
/>
<img
{/* <img
onClick={handleDeleteEntries}
src="/delete.svg"
alt="delete"
className="icon-hover ml-8 cursor-pointer"
/>
/> */}
</div>
</div>
{showNote && (
Expand Down Expand Up @@ -307,7 +307,7 @@ interface Iprops {
newRowView: boolean;
setNewRowView: React.Dispatch<React.SetStateAction<boolean>>;
setEntryList: React.Dispatch<React.SetStateAction<[]>>;
handleDeleteEntries: () => any;
// handleDeleteEntries: () => any;
handleEditEntries: () => any;
dayInfo: Array<any>;
isWeeklyEditing: boolean;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/helpers/validateTimesheetEntry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { minutesFromHHMM } from "./hhmm-parser";
// import { minutesFromHHMM } from "./hhmm-parser";

const validateTimesheetEntry = (tse: object) => {
if (tse["duration"] <= 0 || tse["duration"] >= (3600 * 24)) {
Expand Down

0 comments on commit 03ffeb4

Please sign in to comment.