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

Add button to 'Validate this feature' when clicking a feature on the map #1946

Open
spwoodcock opened this issue Dec 4, 2024 · 10 comments
Open
Assignees
Labels
backend Related to backend code effort:low Likely a few hours enhancement New feature or request frontend Related to frontend code priority:high Should be addressed as a priority

Comments

@spwoodcock
Copy link
Member

Is your feature request related to a problem? Please describe.

  • We have a button to 'Map in ODK' currently.
  • In a future release this will be removed.

Image

  • But, we also want a button to 'validate this feature now'.
  • It should simply open the feature detail page, to allow for the validation to happen.
@spwoodcock spwoodcock added effort:high Broader scope task with unclear timeline (consider splitting) effort:low Likely a few hours enhancement New feature or request frontend Related to frontend code labels Dec 4, 2024
@spwoodcock spwoodcock added priority:high Should be addressed as a priority and removed effort:high Broader scope task with unclear timeline (consider splitting) labels Dec 4, 2024
@NSUWAL123
Copy link
Contributor

The problem here is we need the submission instance ID to redirect user to submission instance page (feature detail page).
Image

But from the project page, there's no way to access the submission instance id. Is it possible to attach the submission instance ID to the/status API?

CC: @spwoodcock , @Sujanadh

@NSUWAL123 NSUWAL123 added the backend Related to backend code label Dec 6, 2024
@spwoodcock
Copy link
Member Author

Damn, I hoped this would be a simple addition until we do the large validation workflow refactor, but you are completely right!

For now, when the user clicks validate now, could we:

  • Redirect to the submission table, but filter by the associated entity id (can we do that?)
  • Allow the user to click on the details page button and validate from there.

The reason I suggest this is that there could be multiple submissions for a feature!

@Sujanadh
Copy link
Contributor

Sujanadh commented Dec 6, 2024

Doing that wouldn't follow our discussion to validate features by using the next button to validate another feature consequently. Creating another API to list the submission instances along with the entity ID might solve this?

c.c: @ramyaragupathy @manjitapandey

@spwoodcock
Copy link
Member Author

I think the 'next' based validation would only be on a task level, if the user clicks on a task then 'Validate Task'. On the feature level we wanted to go straight to the submission page, but I realise that's not possible as there may be multiple submissions per feature.

Two options:

  • The first is as you say, have a new API. It should take an entity ID, and return the submissions present for that entity. The question remains how to we decide which submission to redirect to, if multiple are present. There could be a selector popup if two are present, so allow the user to choose. Else redirect automatically if only one submission is present.

  • Redirect to the submission table, but filter down by entity id field (should be in the submission). The user can click through to the validation page for the submission (not perfect UX if there is only one submission - most cases - but I can't think of an easier solution for now)

@NSUWAL123
Copy link
Contributor

Yeah I was thinking about the first approach too!

@Sujanadh
Copy link
Contributor

I was thinking about linking submission_id(instance_id) to entity after submission by adding properties submission_id in the entities and dataset and automatically populating it when submissions are made. So I tried adding column submission_id in the entities sheet, but it is not supported, I went through your discussions in odk forum where you had talked about adding notes in the entity sheet.

What I think would work for us is updating the entity ID of that feature to the submission id, so that we can use that entity id which will be same to submission id, to filter the submission table and view the submission detail directly.
@spwoodcock

@Sujanadh
Copy link
Contributor

But if a single entity has multiple submissions, it might not work.

@spwoodcock
Copy link
Member Author

I love the idea! But as you say, the major drawback is if we have multiple submissions.

The use case we imagine normally does only have one submission, but we could imagine a mapping campaign for say street level imagery collection, where the user might make multiple submissions for a single POI.

If ODK supports it, then we should probably too!

@spwoodcock
Copy link
Member Author

Plus that's a really tricky thing to do by the sounds of it!

I think with any other field we could probably update an entity property on submission, but I imagine the submission uuid is generated on insert into the ODK database, so its not known at the point of submission. Its only after the submission is made it will have an id/uuid, so we may not be able to trigger the entity property update

@Sujanadh
Copy link
Contributor

Actually, we can access the submission id in the form. Instance id is generated when the form is processed, so we can access it using /data/meta/instanceID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code effort:low Likely a few hours enhancement New feature or request frontend Related to frontend code priority:high Should be addressed as a priority
Projects
Development

No branches or pull requests

3 participants