Skip to content
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

Fixed : User settings shows uuids instead of names as sync attributes #968 #1091

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

vedfordev
Copy link
Contributor

Notes :

Fixes #968

Presupposition :

For user, it become easy if we shows concpet value in sync attribute.

Tech Task :

  1. Find related component ConceptSyncAttributeShow in user.js.
  2. fetch answerconcept if conceptUUID is available.
  3. Replaced uuid with name attribute.

Dev Test :

User with sync attribute:

  1. checked with (http://localhost:6010/#/admin/user/699/show)
  2. reloading the page.

User without sync attribute:

  1. checked page is not breaking

Other Fixes:

As we can see there is no space between two skeleton of sync attribute. So I added margin

Result :

Screenshot 2023-11-28 at 9 25 14 AM

content.forEach(val => newValMap.set(val.id, val.name))
);
setValueMap(newValMap);
}, []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Since you are depending on a props value, you should declare it in the dependencies - https://react.dev/reference/react/useEffect#examples-dependencies
  2. valueMap is a generic name. Add something more meaningful. eg: conceptSyncAttributeValues

Copy link
Member

@vinayvenu vinayvenu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure of the purpose of the isMounted flag. How does it help?
Why do you catch an error and ignore it?

@vedfordev
Copy link
Contributor Author

vedfordev commented Dec 1, 2023

@vinayvenu

  1. isMount flag is for handling unexpected behaviour of ui.
    https://react.dev/reference/react/useEffect#updating-state-based-on-previous-state-from-an-effect
  2. can I remove catch statement ?

@vinayvenu
Copy link
Member

@

@vinayvenu

1. isMount flag is for handling unexpected behaviour of ui.
   https://react.dev/reference/react/useEffect#updating-state-based-on-previous-state-from-an-effect

2. can I remove catch statement ?

Catch statement should be ignored only if you want to suppress the error. If not, then you should not do this at all.

@himeshr himeshr merged commit 2d376b7 into avniproject:master Dec 19, 2023
@vedfordev vedfordev deleted the admin-user-sync branch March 14, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User settings shows uuids instead of names as sync attributes
3 participants