-
Notifications
You must be signed in to change notification settings - Fork 165
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
feat(1263): Add purpose & status to task card, based on task card in website-my #1319
base: develop
Are you sure you want to change the base?
feat(1263): Add purpose & status to task card, based on task card in website-my #1319
Conversation
@Saitharun279 is attempting to deploy a commit to the RDS-Team Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please update this branch with develop.
- please pass me the link to the design you have updated.
- and if there is any design doc created for this task, please attach that to this PR details.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Saitharun279, could you please check if we can use predefined color variables from variables.scss
instead of adding random colors?
Purpose:{' '} | ||
</b> | ||
<span className={styles.cardPurposeText}> | ||
{editedTaskDetails.purpose} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have purpose field when we create the TCR from status site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked, it is not present in the TCR.
I think it needs to be added.
@@ -91,6 +91,16 @@ | |||
color: #aeaeae; | |||
} | |||
|
|||
.cardPurposeAndStatusFont { | |||
font-size: 1.1rem; | |||
color: #555; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a predefined color from variables.scss
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the colors that I used are not present in variables.css. I have taken them from my site.
should i add them in variables.scss ?
|
Attached mobile video |
.taskStatusEditMode { | ||
margin-top: 0.8rem; | ||
} | ||
|
||
.taskStatusUpdate { | ||
border: 1px solid #000000b3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- are there existing css variables we can use instead of hardcoding the color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't find any existing css variables for this one.
src/components/tasks/card/index.tsx
Outdated
@@ -266,6 +266,10 @@ const Card: FC<CardProps> = ({ | |||
setIsEditMode(true); | |||
}; | |||
const isEditable = shouldEdit && isUserAuthorized && isEditMode; | |||
const isSelfTask = editedTaskDetails.assignee === data?.username; | |||
const verifiedTask = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- should this be named
isTaskCompleted
as we're doing a check on the percentage this task has be completed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The dropdown to update task staus should only be shown for non verified tasks, this variable
verifiedTask
is to check if task status is verified. - The check for 100 percent completion can be removed, as the status updation API allows update to Verified when percentage is 100.
I will remove this percentage check in next commit.
I think the variable can be renamed to isVerifiedTask
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed 100 percentage check and modified variable name to isVerifiedTask
}: Props) => { | ||
const [saveStatus, setSaveStatus] = useState(''); | ||
const [updateTask] = useUpdateTaskMutation(); | ||
const [updateSelfTask] = useUpdateSelfTaskMutation(); | ||
|
||
const onChangeUpdateTaskStatus = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- can we update this function to use try catch to make this cleaner and easier to update? example:
const onChangeUpdateTaskStatus = async ({
newStatus,
newProgress,
}: taskStatusUpdateHandleProp) => {
setSaveStatus(PENDING);
const payload: { status: string; percentCompleted?: number } = {
status: newStatus,
};
if (newProgress !== undefined) {
payload.percentCompleted = newProgress;
}
setEditedTaskDetails((prev: CardTaskDetails) => ({
...prev,
...payload,
}));
try{
if (isDevMode && isSelfTask){
await updateSelfTask({ id: task.id, task: payload })
} else {
await updateTask({ id: task.id, task: payload });
}
} catch(error){
setSaveStatus(ERROR_STATUS);
} finally {
setTimeout(() => {
setSaveStatus('');
}, 3000);
}
};
- should we call
setEditedTaskDetails
after the API call is successful preventing any inconsistent states? - can we remove the
setTimeout
from thefinally
block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update in next commit.
But not sure about removing setTimeout, will check and update that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
…h and toast messages.
Date: 17 January, 2025
Developer Name: Saitharun B
Issue Ticket Number
Description
Added code changes to let task owner do the following:
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Web
local_testing.mov
mobile
local.testing.moble.mov
Test Coverage
Screenshot
Additional Notes
design doc link