Skip to content

Commit 152481c

Browse files
committed
Merge branch 'feat/progress-update-card' of https://github.com/Real-Dev-Squad/website-status into feat/progress-update-card
2 parents 1d48720 + 7a790a9 commit 152481c

File tree

11 files changed

+15
-30
lines changed

11 files changed

+15
-30
lines changed

__tests__/Utils/updateQueryStringToUrl.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { render, fireEvent, screen } from '@testing-library/react';
21
import { updateQueryStringToUrl } from '@/utils/updateQueryStringToUrl';
32
import { NextRouter } from 'next/router';
43

src/components/Layout/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import styles from '@/components/Layout/Layout.module.scss';
44
import NavBar from '@/components/navBar';
55
import { useGetUserQuery } from '@/app/services/userApi';
66
import { Loader } from '../tasks/card/Loader';
7-
import useUserData from '@/hooks/useUserData';
87
import { Header } from '@/components/Header';
98

109
interface Props {

src/components/ProgressForm/ProgressForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const ProgressForm = ({ questions }: formProps) => {
5959
};
6060
saveProgress(data)
6161
.unwrap()
62-
.then((res) => {
62+
.then(() => {
6363
toast(SUCCESS, 'Task Progress saved successfully');
6464
setIsLoading(false);
6565
})

src/components/issues/ActionForm.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { reducerAction } from '@/types/ProgressUpdates';
55
import { beautifyStatus } from '../tasks/card/TaskStatusEditMode';
66
import { BACKEND_TASK_STATUS } from '@/constants/task-status';
77
import { useGetTaskDetailsQuery } from '@/app/services/taskDetailsApi';
8-
import { ToastTypes } from '@/helperFunctions/toast';
98
import { Loader } from '../tasks/card/Loader';
109
import Suggestions from '../tasks/SuggestionBox/Suggestions';
1110
import { useGetAllUsersByUsernameQuery } from '@/app/services/usersApi';
@@ -59,8 +58,6 @@ const reducer = (state: ActionFormReducer, action: reducerAction) => {
5958
}
6059
};
6160

62-
const { SUCCESS, ERROR } = ToastTypes;
63-
6461
const ActionForm: FC<ActionFormProps> = ({
6562
taskId,
6663
taskAssignee,

src/components/issues/Card.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { FC, useContext, useState } from 'react';
1+
import { FC, useState } from 'react';
22
import styles from '@/components/issues/Card.module.scss';
33
import MarkdownRenderer from '@/components/MarkdownRenderer/MarkdownRenderer';
44
import { toast, ToastTypes } from '@/helperFunctions/toast';
55
import fetch from '@/helperFunctions/fetch';
66
import { IssueCardProps } from '@/interfaces/issueProps.type';
7-
import { TASKS_URL, TASK_REQUEST_URL } from '../../constants/url';
7+
import { TASKS_URL } from '../../constants/url';
88
import useUserData from '@/hooks/useUserData';
99
import { useRouter } from 'next/router';
1010
import { useUpdateTaskMutation } from '@/app/services/tasksApi';
@@ -29,8 +29,7 @@ const Card: FC<IssueCardProps> = ({ issue }) => {
2929
const [assignee, setAssignee] = useState<string | undefined>();
3030
const [updateTask] = useUpdateTaskMutation();
3131
const [isTaskModalOpen, setIsTaskModalOpen] = useState(false);
32-
const [addOrUpdateTaskRequest, taskRequestUpdateStatus] =
33-
useAddOrUpdateMutation();
32+
const [addOrUpdateTaskRequest] = useAddOrUpdateMutation();
3433
const isTaskButtonDisabled = isLoading || (!isUserAuthorized && taskExists);
3534

3635
const toggle = () => {

src/components/navBar/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ import {
88
HOME_URL,
99
WELCOME_URL,
1010
EVENTS_URL,
11-
CRYPTO_URL,
1211
MEMBERS_URL,
1312
STATUS_URL,
1413
GITHUB_LOGO,
1514
RDS_LOGO,
1615
} from '@/constants/url';
1716
import Dropdown from '../Dropdown/Dropdown';
1817
import styles from '@/components/navBar/navBar.module.scss';
19-
import { Loader } from '../tasks/card/Loader';
2018
import useUserData from '@/hooks/useUserData';
2119
import useAuthenticated from '@/hooks/useAuthenticated';
2220

src/components/taskDetails/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ const TaskDetails: FC<Props> = ({ taskID }) => {
116116

117117
setEditedTaskDetails((prev) => ({ ...prev, status: newStatus }));
118118
};
119-
const [addOrUpdateTaskRequest, taskRequestUpdateStatus] =
120-
useAddOrUpdateMutation();
119+
const [addOrUpdateTaskRequest] = useAddOrUpdateMutation();
121120

122121
useEffect(() => {
123122
if (data?.taskData) {

src/components/tasks/card/TaskStatusEditMode.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ const TaskStatusEditMode = ({
4343

4444
response
4545
.unwrap()
46-
.then((result: any) => {
46+
.then(() => {
4747
setSaveStatus(SAVED);
4848
})
49-
.catch((err: { data: { message: string } }) => {
49+
.catch(() => {
5050
setSaveStatus(ERROR_STATUS);
5151
})
5252
.finally(() => {

src/components/tasks/card/index.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ const Card: FC<CardProps> = ({
110110

111111
const localEndsOn = new Date(cardDetails.endsOn * 1000);
112112
const fromNowEndsOn = moment(localEndsOn).fromNow();
113-
const statusFontColor = !statusRedList.includes(cardDetails.status)
114-
? '#00a337'
115-
: '#f83535';
116113
const iconHeight = '25';
117114
const iconWidth = '25';
118115

@@ -179,13 +176,13 @@ const Card: FC<CardProps> = ({
179176

180177
response
181178
.unwrap()
182-
.then((result) => {
179+
.then(() => {
183180
setEditedTaskDetails((prev) => ({
184181
...prev,
185182
savingDate: SAVED,
186183
}));
187184
})
188-
.catch((err) => {
185+
.catch(() => {
189186
setEditedTaskDetails((prev) => ({
190187
...prev,
191188
savingDate: ERROR_STATUS,
@@ -283,9 +280,7 @@ const Card: FC<CardProps> = ({
283280

284281
response
285282
.unwrap()
286-
.then((result) =>
287-
toast(SUCCESS, 'Task status changed successfully!')
288-
)
283+
.then(() => toast(SUCCESS, 'Task status changed successfully!'))
289284
.catch((err) => {
290285
if ('response' in err) {
291286
toast(ERROR, err.response.data.message);
@@ -370,13 +365,13 @@ const Card: FC<CardProps> = ({
370365

371366
response
372367
.unwrap()
373-
.then((result) => {
368+
.then(() => {
374369
setEditedTaskDetails((prev) => ({
375370
...prev,
376371
assigningUser: SAVED,
377372
}));
378373
})
379-
.catch((err) => {
374+
.catch(() => {
380375
setEditedTaskDetails((prev) => ({
381376
...prev,
382377
assigningUser: ERROR_STATUS,
@@ -425,13 +420,13 @@ const Card: FC<CardProps> = ({
425420

426421
response
427422
.unwrap()
428-
.then((result) => {
423+
.then(() => {
429424
setEditedTaskDetails((prev) => ({
430425
...prev,
431426
savingText: SAVED,
432427
}));
433428
})
434-
.catch((err) => {
429+
.catch(() => {
435430
setEditedTaskDetails((prev) => ({
436431
...prev,
437432
savingText: ERROR_STATUS,

src/components/tasks/card/progressContainer/ProgressBar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import classNames from '@/components/tasks/card/card.module.scss';
88
const Progressbar: FC<ProgressBarProps> = ({
99
progress,
1010
progressValue,
11-
percentCompleted,
1211
handleProgressChange,
1312
debounceSlider,
1413
startedOn,

src/interfaces/taskDetails.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangeEvent, ChangeEventHandler } from 'react';
1+
import { ChangeEventHandler } from 'react';
22
import task from './task.type';
33
export type taskDetailsDataType = {
44
message?: string;

0 commit comments

Comments
 (0)