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

Inconsistency in taskID on project details page and mapper's page #1982

Closed
manjitapandey opened this issue Dec 12, 2024 · 7 comments
Closed
Assignees
Labels
bug Something isn't working effort:low Likely a few hours frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time testing:ready Ready for testing

Comments

@manjitapandey
Copy link
Contributor

Describe the bug
The taskID on project details page on management frontend is different than the taskID of same task on mapper view. On project details page, the taskId start from 1 whereas the number is large on mapper's page

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'project details page of any project'
  2. Click on 'any task to see task ID'
  3. Click on start mapping to go to mapper's page
  4. Click on same task to see different project ID.
  5. See error

Expected behavior
The taskId should be consistent on each page

Screenshots
Image
Image

Additional context
Add any other context about the problem here.

@manjitapandey manjitapandey added bug Something isn't working frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time effort:low Likely a few hours labels Dec 12, 2024
@NSUWAL123 NSUWAL123 self-assigned this Dec 16, 2024
@NSUWAL123
Copy link
Contributor

@spwoodcock in the activities panel, we need to replace task id with task index on the UI. So we probably need to add a task_index column in the table?

Image
Image

@spwoodcock
Copy link
Member

In the submission table for the react frontend?
That's probably a good idea too.

Updating the activities panel on the mapper frontend is all needed to as you say - just updating the number is fine I think

@NSUWAL123
Copy link
Contributor

No. In the activities section in the mapper frontend, we show the task id in the UI. To ensure consistency over the UI we should also display the task index in the activities section. Currently, only task id is being returned from electric SQL since it's querying from the task_events table (database table ) where there is no task index column.

@spwoodcock
Copy link
Member

spwoodcock commented Dec 17, 2024

Oh sorry, I get you! I don't think we should display the task id to the user. Only the index 👍

If we could remove the id reference entirely it would be great, but I think we need it for calling the API and adding new events

@NSUWAL123
Copy link
Contributor

Yeah for the visible part of UI, we should use index, but we need id for API calls.

@spwoodcock
Copy link
Member

@spwoodcock in the activities panel, we need to replace task id with task index on the UI. So we probably need to add a task_index column in the table?

Image
Image

Oh you mean we might need to add task index to the task events table?

I'm reluctant to do that, as its a computed field anyway, rather than a user input of real value.

I understand the issue now, as the task index is typically calculated on the backend for the tasks API response, but we are using electric.

Based on the response from electric, could we not find the max and min task ids, set to an internal value in the store, then calculate the range (max-min) to set the task index values based on the task ids? Or something similar to this

@NSUWAL123
Copy link
Contributor

Then I'll make a list of objects mapping the task id with its index the {id: index}[]. Both id and index are returned in the /project/:id/minimal API. Then access the index where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort:low Likely a few hours frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time testing:ready Ready for testing
Projects
None yet
Development

No branches or pull requests

3 participants