Mentorship-android: Fetch and List tasks from a Mentorship relation

Created on 31 Dec 2018  路  26Comments  路  Source: anitab-org/mentorship-android

Description

As a user,
I need to see my mentorship relation's tasks,
so that I can know what my mentor has planned for me.

This is a follow-up issue for pull request #121.
In the previous PR UI component for adding a new task was added but the code to implement a full backend interaction and update the backend is still left.

Mocks

image

Acceptance Criteria

Update [Required]

  • [ ] List real tasks using GET /tasks API to list todo and achievements tasks
  • [ ] Make this request ^^ on TasksFragment

Enhancement to Update [Optional]

  • [ ] Create tasks using POST /mentorship_relation/{request_id}/task
  • [ ] Make "+ Add a new task" whole are clickable, instead of just the "+"

Definition of Done

  • [ ] All of the required items are completed.
  • [x] Approval by 1 mentor.

Estimation

5 hours

Coding Enhancement

All 26 comments

Make sure that the "Add a new task" whole area is clickable, not only the "+" sign. The sign and the text should all behave like a button showing some feedback when clicking. @Rimjhim28

@Rimjhim28 In this issue you can integrate the GET /tasks as well. I forgot about this. I will change this issue's description to reflect that.

@Rimjhim28 I updated the issue description. Before creating new tasks you can list tasks.
Remember to test this you need an ongoing mentorship relation and some tasks. For these tasks you can create them using the backend API here: http://systers-mentorship-dev.eu-central-1.elasticbeanstalk.com/

If you need me to create tasks just tell me.

@Rimjhim28 do you have any updates on this?

Hey @isabelcosta, I am almost done. I will send a PR latest by tomorrow.
Can you please add some tasks in the backend so that I can check if the code is working fine.

@Rimjhim28

Use this user:

  • user: catarina
  • password: 12345678

I created this tasks:

image

Here's how you can login on Swagger (if you need to). Try to learn how to create things on Swagger UI, because you may want to create more tasks or not. Also you need to understand the API input and output to develop the whole tasks API.

@Rimjhim28 I update those tasks and task with id = 2, is marked as achieved. So be aware that in your UI, you'll have to show that task under "Achievements" section

@isabelcosta Can you please specify what value is supposed to be passed in {request_id} when using /mentorship_relation/{request_id}/tasks and how should I get the value.

Also, can you please specify where exactly is the task marked as achieved so that it should be seperatedin the list.

@Rimjhim28

@isabelcosta Can you please specify what value is supposed to be passed in {request_id} when using /mentorship_relation/{request_id}/tasks and how should I get the value.

When GET /mentorship_relations/current relation is fetched, for the "Details" tab, it will return this response:

image

You can see the request_id there, it is the id field.

Also, can you please specify where exactly is the task marked as achieved so that it should be seperatedin the list.

I'm not sure I understood your doubt, but in the response you can see the is_done field, that indicates if a task was achieved or not:

image

_Just a thought: Maybe /current, could return tasks 馃 I'm not sure._

Hope this helps @Rimjhim28 ! If you have any other doubt, feel free to say here, I'll be more than happy to help you!

@isabelcosta I am not sure if there is something wrong with the parameters passes but everytime I try to fetch the tasks I keep getting this error:

error

@Rimjhim28 there isn't any relation with ID equal to 0. Did you put that to 0 on purpose? If you put 4, you'll get a response

@Rimjhim28 did you see my message ^^ I edited it, because I misspelled your GitHub id 馃檲

Yes @isabelcosta I read your comment.
I did put 0 there purposely but ony after checking the value return by relationViewModel. Anyways, I will try again. Thank You helping out! :)

@isabelcosta I need some help! When I try to post a request on backend, I am getting this error.

desc_error

I'm glad you asked for help @Rimjhim28 馃帀
I think I know what your problem is, and I can do a small review before you submit a PR (I can comment on your files, squash the commit so that I can comment on a commit with all of your changes)

Can you share the link to your fork's branch you're working on?

From the Swagger UI, you can see that what the backend is expecting is:

{
    "description": "Some random task"
}

And you are sending this:

{
    "taskDescription": "Some random task"
}

This is what I see from your log:

image

Here's Swagger UI for the backend:

image

Thank you so much @isabelcosta! I did most of the things. The only one that is left to get the correct request_id
Now, I have explicitly mentioned 4. The code works perfectly with the account you had created to help me out.
Here's the link to the branch: https://github.com/Rimjhim28/mentorship-android/tree/task
Can you suggest a way to get the correct request id, please?

Left this comment on one of your commits: https://github.com/Rimjhim28/mentorship-android/commit/334b7d678b1731584c952acc6d04d246f51f441b#r32096714

@Rimjhim28 , @mohak1283 is doing something that will help you on your PR #134 , because the Relation fragment will be able to pass the request details to the tabs fragments.

@Rimjhim28 are you still working on this? I'm asking because we have 2 contributors already working on task feature (create and delete task), and it's sort of depending on this. If you aren't available for this we can leave this for another contributor, I think that's completely fine :)

Yes, my university exams are on!
If anyone is interested and available please let them work on the issue. I will get back to the community when I am free. :)

Ok @Rimjhim28 ! Thank you for the update. I'll make this available for now, once you're free and interested let me know if you still want to work on this ;)

The whole discussion we had on this issue can help others finish this feature ;) Thank you for your efforts here!

Good luck with your exams! 馃挭

i'd be happy to take over once my PR is approved @isabelcosta

@jenpaff I rather wait for this issue and then check your PR. Do you want to complete this issue? Feel free to do so. I'll be sure to check your PR for this as soon as I can, so that yours and @sidvenu 's work can continue.
Thank you so much @jenpaff and @sidvenu for your patience through out this process!

Yes if that's okay, I'll take this one! Shouldn't take too long. Do you want me to work on a separate branch ? It would be easier for me to do it in my create-new-task branch :) Then both can be tested easily in one branch. but obviously I'm also happy to do it in a separate one

@jenpaff it would be nice if you do that in a separate branch, to keep the PR small and focused, for me and others to review. Once you finish the task, I'll do my best to review as soon as I can. Ping me once you submit it.

@isabelcosta okay I'm on it :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

annabauza picture annabauza  路  6Comments

annabauza picture annabauza  路  8Comments

iofall picture iofall  路  4Comments

vaishnavi-29 picture vaishnavi-29  路  3Comments

Priyansh-Kedia picture Priyansh-Kedia  路  6Comments