Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

bug: 'Add Task' button in relation screen is enabled for an empty relation too #128

Closed
yugantarjain opened this issue Sep 4, 2020 · 4 comments · Fixed by #150
Closed
Assignees
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. good first issue Good for newcomers. Hacktoberfest

Comments

@yugantarjain
Copy link
Contributor

yugantarjain commented Sep 4, 2020

Describe the bug
The 'Add Task' button in the relation screen stays enabled even when the user is not in a mentorship relation. A task can only be added when a relation exists, hence this button shall be disabled in case the relation is nil.

To Reproduce
Steps to reproduce the behavior:

  1. Withdraw from accepted relation (if any) from home screen
  2. Go to relation screen
  3. See 'Add Task' button is enabled (it shouldn't be)

Expected behavior
The 'Add Task' button should be disabled when the user is not in a relation

Screenshots
Add Task button is enabled
image

Smartphone (please complete the following information):

  • Device: iPhone
  • OS: iOS 13.6
  • Xcode 11.6
@yugantarjain yugantarjain added Category: Coding Changes to code base or refactored code that doesn't fix a bug. good first issue Good for newcomers. Status: Available Issue was approved and available to claim or abandoned for over 3 days. labels Sep 4, 2020
@yugantarjain yugantarjain changed the title Add Task button in relation screen is enabled for empty relation too bug: 'Add Task' button in relation screen is enabled for empty relation too Sep 4, 2020
@yugantarjain yugantarjain changed the title bug: 'Add Task' button in relation screen is enabled for empty relation too 'Add Task' button in relation screen is enabled for empty relation too Sep 4, 2020
@yugantarjain yugantarjain changed the title 'Add Task' button in relation screen is enabled for empty relation too bug: 'Add Task' button in relation screen is enabled for an empty relation too Sep 4, 2020
@gsnsg
Copy link
Contributor

gsnsg commented Sep 19, 2020

@yugantarjain Can I work on this issue? I got a working solution already

@yugantarjain
Copy link
Contributor Author

yugantarjain commented Sep 19, 2020

@yugantarjain Can I work on this issue? I got a working solution already

Hi @gsnsg, thanks a lot for your interest in working on this issue! I've kept this as a good first time issue due to its simplicity.

I do have another issue in mind about improving the Relation Screen UI when the user is not in a mentorship relation (like the screenshot above). As you can see, as of now the app shows default "Mentee" and "Jan 1, 1970". We can hide them, and also have a message on the screen saying something like "You're not in a mentorship relation, you can find members and send a request from members page." and have a button that redirects the user to the members tab.
Would you like to create an issue for this and work on it?

@Zoha131
Copy link
Contributor

Zoha131 commented Oct 13, 2020

@yugantarjain Can I work on this issue?

@yugantarjain
Copy link
Contributor Author

@yugantarjain Can I work on this issue?

Hi sure. Assigned!

@yugantarjain yugantarjain removed the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Oct 13, 2020
Zoha131 added a commit to Zoha131/mentorship-ios that referenced this issue Oct 14, 2020
…#128

I have used `@ViewBuilder` attribute to pass the appropriate `View` to the `navigationBarItems(trailing:)` method. Before collecting data from the server the `id` of `currentRelation` is 0 and if the user doesn't have any Relation then the server response for `id` would be nil. This is why I have checked both of the conditions.
yugantarjain added a commit that referenced this issue Dec 7, 2020
Hide `Add Task` button if current relation is empty to fix #128
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. good first issue Good for newcomers. Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants