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

User able to see their own forms #1365

Closed
12 tasks done
Tracked by #1565
mahalakshme opened this issue Apr 7, 2024 · 16 comments
Closed
12 tasks done
Tracked by #1565

User able to see their own forms #1365

mahalakshme opened this issue Apr 7, 2024 · 16 comments
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Apr 7, 2024

As a user, I should be able to fill required details related to me, to communicate my grievances to my supervisor.
As a user, I should be able to see the forms that I filled with details related to me.

Acceptance criteria:

  • Validate that only his own User specific Subject(UserType SubjectType) is synced to the User's device for each User.
  • UserType Subject types, without any address details should still sync correctly only to its corresponding user.
  • Sync should success with both old and new versions of env apks. The only difference, being that old apk, will not show any UserType Subject types, whereas the new apk should show them all that info.
  • As a user of any user group level I should be able to sync my forms (Unless Privileges restrict syncing the UserType Subject or its children entities)
  • On clicking on Register only show subject types with registeration Form Mapping. So for now User subject type will not display. Administrator User in UserGroup Privileges section, always sees the Privilege.ViewSubject for all User type SubjectTypes, even if they do not have a FormMapping associated with them. This would need the Adminstrator to Void the FormMapping to the User type SubjectType and enabling the Privilege.ViewSubject for that SubjectType for sync to work on client for related entities.
  • Do not show User subject type in Search.
  • Mockups for when there are due encounters that User need to fill for themselves - Standard report card(Overdue) and custom report card(right) like below - user identified as '${username}(You)'
Screenshot 2024-04-01 at 7 39 05 PM
  • On clicking on '${username}(You)', take to the profile(below) of the User. On clicking on red arrow take to encounter form like done currently.
Screenshot 2024-04-10 at 1 59 23 PM
  • no need to display Location, just '${username}(You)' in the header
  • Do not show 'Registration Details' section in the profile page when the registration form has no form elements
  • The UI of profile page is currently determined based on the entities associated with subject type: Eg: when the subject type has general encounters, encounters get displayed on the subject profile page itself - so similar kind of behaviour need to continue for User subject type
  • Rules in the form if any added should continue to work.

Old: Ignore:

  • On clicking on My forms -> direct to profile page. Like in Teach AP, since it has general encounters and no programs make it to display like below:
    Image

  • When registeration form not associated, do not show Registeration details section.

  • Standard report card(Overdue) and custom report card(right)

Screenshot 2024-04-01 at 7 39 05 PM
  • User subject type, should not appear in Search and Register.

Technical details:

  • Entity sync status same as current
  • Make it extensible to be able to sync when ordering of levels comes in

Inputs

  • one subject type -

  • might not work in real life - this hierarchy

  • Menu item - separate card - not needed to deliver now

  • ETL, register, resgiteration details - no form elemtns, immutable,

  • system stable - 4x

  • readme - salesforce - videos

Points of discussion:

  • standard report card needed?
  • in profile need to display the menu item? remove
  • sync and locations
@mahalakshme mahalakshme converted this from a draft issue Apr 7, 2024
@mahalakshme mahalakshme moved this from In Analysis to Ready in Avni Product Apr 10, 2024
@petmongrels petmongrels moved this from Ready to In Progress in Avni Product Apr 22, 2024
@petmongrels petmongrels self-assigned this Apr 22, 2024
@petmongrels
Copy link
Contributor

petmongrels commented Apr 22, 2024

  • There are existing assumptions in the code that the user has catchment at the time of sync. This means the User cannot be the only subject type in an implementation and for that reason, user doesn't have any catchment. It won't work. Unlikely but pointing out. Will document.
  • Individual in realm requires address level as a mandatory field. Don't like relaxing this constraint. Also the avni client code may have made assumptions. Null object pattern?

petmongrels added a commit to avniproject/avni-server that referenced this issue Apr 23, 2024
…c methods in other tests. UserSubjectType sync work in progress.
@himeshr himeshr self-assigned this Apr 29, 2024
@himeshr
Copy link
Contributor

himeshr commented May 1, 2024

  • In-order to ensure we do not break sync for older versions of Avni-client, the AddressLevel should return a dummy value as part of the Server Individuals sync response
  • We cannot handle requirement to hide User Subject Types in Search box, in old client
  • We cannot meet UI requirements mentioned in this card for old versions of client, which could cause issues like broken Touchable entities and irregular Formatting

@mahalakshme
Copy link
Contributor Author

@himeshr

  1. what would happen if the user selects User subject type in older versions of client
  2. are we storing the dummy value somewhere as well? If so, to avoid it, is it possible to create another api version for new version of clients and modifying the server api of old version to not return User subject types?

himeshr added a commit to avniproject/avni-models that referenced this issue May 1, 2024
… Dummy value only if the Individual SubjectType is User
himeshr added a commit to avniproject/avni-models that referenced this issue May 1, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue May 1, 2024
…if syncDetails call has includeUserSubjectType=true
@himeshr
Copy link
Contributor

himeshr commented May 1, 2024

@mahalakshme and @vinayvenu If we do not have Registration Forms for UserType subject, then scheduling the First Encounter on User Create capability will be lost.

@mahalakshme
Copy link
Contributor Author

based on the above discussion we have decided to not support 'User' subject type for older versions of client.

@himeshr good point. but currently we can do the same of displaying registeration form only if there is atleast one form element - for completing the story - you can insert some dummy encounter data.

I will analyse the gap and create a separate story for dealing with it.

@himeshr
Copy link
Contributor

himeshr commented May 2, 2024

  • In-order to ensure we do not break sync for older versions of Avni-client, the AddressLevel should return a dummy value as part of the Server Individuals sync response
  • We cannot handle requirement to hide User Subject Types in Search box, in old client
  • We cannot meet UI requirements mentioned in this card for old versions of client, which could cause issues like broken Touchable entities and irregular Formatting

Changes to approach based on Tech discussions

  • We are not sending Dummy AddressLevel from Server, rather we are only populating DummyAddressLevel in Client during Sync
  • We are not going to sync UserType Subjects to old versions of Avni-client, as we have a flag based sync for this, which only new clients will send

@himeshr
Copy link
Contributor

himeshr commented May 2, 2024

Sample client screen recording for UserType subject handling on client

Screen.Recording.2024-05-02.at.4.16.31.PM.mov

@himeshr
Copy link
Contributor

himeshr commented May 2, 2024

@mahalakshme and @vinayvenu , currently we do not sync UserSubject entity that links User to Subject(of subjectType.type User) to client. Therefore, if there are more than 1 UserType subjects belong to different Users, then, we'll not be able to reliably figure out which Subject corresponds to logged-in user, as name comparison is not sufficient.

@himeshr
Copy link
Contributor

himeshr commented May 2, 2024

Sample screen recording for English

Screen.Recording.2024-05-02.at.4.21.52.PM.mov

himeshr added a commit to avniproject/avni-models that referenced this issue May 2, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue May 2, 2024
@himeshr
Copy link
Contributor

himeshr commented May 2, 2024

@mahalakshme and @vinayvenu
To satisfy this requirement
As a user of any user group level I should be able to sync my forms (Unless Privileges restrict syncing the UserType Subject or its children entities)
I haven't made any changes in code, this should be achievable by enabling/disabling Permissions in UserGroups.

himeshr added a commit to avniproject/avni-server that referenced this issue May 2, 2024
…ubjectTypes to be able to sync it to client
@himeshr
Copy link
Contributor

himeshr commented May 2, 2024

In-order to get User Type SubjectTypes data to be synced to the Client, Its Privilege.ViewSubject should be enabled.

@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product May 2, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue May 3, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue May 3, 2024
@mahalakshme
Copy link
Contributor Author

Currently User subject type will not show if form mapping for that User registration is deleted - and sync is made to work with this.

@himeshr
Copy link
Contributor

himeshr commented May 15, 2024

Have improperly handled below Acceptance Criteria:

  • On clicking on Register only show subject types with registeration form, that atleast have one form element. So for now User subject type will not display.

  • Have made changes such that Admin User in UserGroup Privileges, sees the Privilege.ViewSubject for all UserType subjects, even if they do not have a FormMapping associated with them. This needs Admin user to remove the FormMapping to the UserType Subject and enabling the Privilege.ViewSubject for the things to work on client.

@petmongrels and @vinayvenu should this be reversed and we do a simple change in Client.?

@himeshr himeshr moved this from Code Review Ready to In Progress in Avni Product May 15, 2024
@himeshr
Copy link
Contributor

himeshr commented May 15, 2024

Have improperly handled below Acceptance Criteria:

  • On clicking on Register only show subject types with registeration form, that atleast have one form element. So for now User subject type will not display.
  • Have made changes such that Admin User in UserGroup Privileges, sees the Privilege.ViewSubject for all UserType subjects, even if they do not have a FormMapping associated with them. This needs Admin user to remove the FormMapping to the UserType Subject and enabling the Privilege.ViewSubject for the things to work on client.

@petmongrels and @vinayvenu should this be reversed and we do a simple change in Client.?

After discussion with Vivek, we concluded that this approach is fine.

@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product May 15, 2024
@1t5j0y 1t5j0y moved this from Code Review Ready to In Code Review in Avni Product May 20, 2024
@1t5j0y 1t5j0y moved this from In Code Review to QA Ready in Avni Product May 20, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product May 21, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to QA Ready in Avni Product May 21, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Jun 5, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to QA Ready in Avni Product Jun 5, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Jun 6, 2024
@AchalaBelokar
Copy link

AchalaBelokar commented Jun 6, 2024

  • I created one org which contain the user subject type . user name is AchalaB@usersub
  • After creating the usersubtype login on client and try to register individual but it as mentioned in the card without location individual should be registered but I am not able to register the individual .
  • After removing form mapping it is not showing on client
  • created a program encounter, program enrolment , general encounter

@himeshr
Copy link
Contributor

himeshr commented Jun 6, 2024

@achala, this case is not valid as of now After creating the usersubtype login on client and try to register individual but it as mentioned in the card without location individual should be registered but I am not able to register the individual Sorry for the confusion.

@AchalaBelokar AchalaBelokar moved this from In QA to QA Ready in Avni Product Jun 11, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Jun 14, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to Done in Avni Product Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants