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

Delete an Entity from the Entity detail page #591

Closed
matthew-white opened this issue Jan 23, 2024 · 9 comments · Fixed by getodk/central-frontend#946
Closed

Delete an Entity from the Entity detail page #591

matthew-white opened this issue Jan 23, 2024 · 9 comments · Fixed by getodk/central-frontend#946
Assignees
Labels
behavior verified Behavior has been manually verified enhancement New feature or behavior entities Multiple Encounter workflows frontend Requires a change to the UI

Comments

@matthew-white
Copy link
Member

See the story in the release criteria.

@matthew-white matthew-white added enhancement New feature or behavior frontend Requires a change to the UI needs testing Needs manual testing needs design review Needs verification from designer entities Multiple Encounter workflows labels Jan 23, 2024
@matthew-white matthew-white self-assigned this Feb 8, 2024
matthew-white added a commit to getodk/central-frontend that referenced this issue Feb 24, 2024
matthew-white added a commit to getodk/central-frontend that referenced this issue Feb 26, 2024
@matthew-white
Copy link
Member Author

@getodk/testers, this issue is now ready to be verified on staging.

@dbemke
Copy link

dbemke commented Feb 27, 2024

I'm not sure what is the expected result in this case: When I go from entity lists page to Entity detail page, the entity detail page is opened in a new tab. Then, I delete the entity (in entity detail page) and I'm moved to the entity lists page. After that I see 2 tabs:

  • the first tab (entity list page) which isn't refreshed - shows the list of entities before deleting the entity
  • the second tab (entity list page) which is refreshed after being brought to it from entity detail page

@matthew-white
Copy link
Member Author

I was also noticing that. I think that's the expected behavior at the moment, but one day, it'd be great if we could keep the table in sync with changes made on the entity detail page in another tab. There's an issue #646 to track that idea.

@srujner
Copy link

srujner commented Feb 28, 2024

Hey I've gather some questions, most related to the UI or expected behavior and I though it'll be better to post it in one place and in one bigger comment.

  1. Shouldn't the Delete an Entity button from the Entity data table have tool tip called "Delete Entity" instead of "Delete" to keep consistency in the app?
    Screenshot(22)
    Screenshot from 2024-02-28 12-39-06

  2. When I deleted an Entity in the one tab and tried to edit or click "more" for the deleted Entity in the second tab I see this dialog. It is perfectly fine, but maybe we would like to change the text information inside of it? To something like "The Entity you were looking for has been deleted"?
    Screenshot(23)

  3. I was wondering about one scenario . Let's assume that person 1 and person 2 made some changes to the same Entity which resulted in a conflict. In this case, when the person 1 wants to delete an Entity, shouldn't he or she first have permission from person 2 to do so? What if a dozen people make changes to the same entity? If I'm thinking too abstractly then let me know :D

  4. Last thing is not related with Deleting the Entity. I saw the new "Upload" button and first thing that comes up to my mind was If it should be possible to delete the uploaded .csv file from this window. Now if I upload a wrong csv I need to close the whole window and open it again.
    Screenshot(24)

@matthew-white
Copy link
Member Author

Shouldn't the Delete an Entity button from the Entity data table have tool tip called "Delete Entity" instead of "Delete" to keep consistency in the app?

We thought about making the button above the activity feed say "Delete" instead of "Delete Entity", but @issa-tseng thought that'd be ambiguous. The idea is that by saying "Delete Entity", it's clear that the user is deleting the entity and not deleting the feed. But I guess in the table, there's not the same ambiguity, so it's OK to use the shorter "Delete".

When I deleted an Entity in the one tab and tried to edit or click "more" for the deleted Entity in the second tab I see this dialog. It is perfectly fine, but maybe we would like to change the text information inside of it?

Hmm good question. That could also happen if a different user deleted the entity while you're looking at it in the table. There's a bit of a challenge though, because if that error is received from the server, it's not always clear that the entity was deleted:

  • You can navigate directly to the entity detail page rather than clicking the More button in the table, so on its own, the entity detail page can't be sure that the entity ever existed. For example, the user could have pasted in an incorrect URL. The two browser tabs don't really communicate with each other, so the entity detail page doesn't know that it came from the table.
  • If that error is seen in the edit/update modal, it probably means that the entity was deleted. However, it could also be that the entire project was deleted. In the future, we'll also allow entity lists to be deleted.

What do you think about keeping the error message generic (not just about the entity), but mentioning deletion in it? I'm thinking of a message like, "Could not find the resource you were looking for. The resource may have been deleted."

Let's assume that person 1 and person 2 made some changes to the same Entity which resulted in a conflict. In this case, when the person 1 wants to delete an Entity, shouldn't he or she first have permission from person 2 to do so?

Right now, there's no concept in Central of resource ownership. Even though person 2 made changes to the entity, that doesn't prevent others from also making changes or even deleting the entity (assuming that those are actions that they're allowed to take in general). If you can delete one entity in a project, then you can delete any entity in the project. At the moment, only project managers and sitewide administrators are allowed to delete entities. A project manager has full control over a project and can even delete the project as a whole (using the API).

I saw the new "Upload" button and first thing that comes up to my mind was If it should be possible to delete the uploaded .csv file from this window.

Ah sorry, that's very much a work in progress. 😅 That's part of getodk/central-frontend#589, and even though some of it is already visible, there's definitely more to come, including a clear/reset button and a nicer way of displaying the file.

@srujner
Copy link

srujner commented Feb 29, 2024

@matthew-white Thank You for answers!
I'm ok with keeping the error message generic with extra note ;)

@srujner
Copy link

srujner commented Mar 1, 2024

Tested with Success!

1 similar comment
@dbemke
Copy link

dbemke commented Mar 1, 2024

Tested with Success!

@dbemke dbemke added behavior verified Behavior has been manually verified and removed needs testing Needs manual testing labels Mar 1, 2024
@matthew-white
Copy link
Member Author

I'm ok with keeping the error message generic with extra note

I've made that change in getodk/central-frontend#952 (not yet merged). It's a very small change though, so I don't think it needs to be verified beyond what I did during development.

@matthew-white matthew-white removed the needs design review Needs verification from designer label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior verified Behavior has been manually verified enhancement New feature or behavior entities Multiple Encounter workflows frontend Requires a change to the UI
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

3 participants