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

Project deletion frontend implementation #545

Closed
konishon opened this issue Jun 28, 2023 · 5 comments · Fixed by #1168
Closed

Project deletion frontend implementation #545

konishon opened this issue Jun 28, 2023 · 5 comments · Fixed by #1168
Assignees
Labels
enhancement New feature or request frontend Related to frontend code

Comments

@konishon
Copy link
Collaborator

konishon commented Jun 28, 2023

Is your feature request related to a problem? Please describe.
I encountered an issue while creating a project where the form upload failed,(#544) resulting in a project being created without a form. However, this project is not useful to me as it lacks the necessary form. I was expecting the project completion form to continue the process, but instead, it redirected me to the project details page. Therefore, I would like to have a delete project feature to remove this unnecessary project from the system

  • I created a project but need to change the grid size. Initially, I intended to send only one surveyor, but now I plan to send multiple surveyors, which requires adjusting the grid size accordingly.

Describe the solution you'd like
For the project created without a form due to a failed upload, I would like to have a delete project feature that allows me to remove this project completely from the system. This way, I can eliminate any trace of the project without a form.

I would also like to have a project edit feature that enables me to modify the grid size of the created project. This way, I can adjust the grid size to accommodate the multiple surveys I intend to send, ensuring proper alignment and display of the survey content. This modification is necessary to adapt the project to my updated requirements and optimize the survey presentation.

Describe alternatives you've considered
An alternative solution for changing the grid size could be to create a new project with the desired grid size and manually transfer the survey content. However, this approach is time-consuming and prone to errors. Having a project edit feature to modify the grid size directly would be a more efficient and convenient solution.

Additional context
Related to #544

@konishon konishon added the enhancement New feature or request label Jun 28, 2023
@robsavoye
Copy link
Collaborator

Assuming this now works on the backend, we do need some kind of project management functionality to delete or archive projects. Note that deleting a project from FMTM should also archive the ODK Central project as well. Central keeps archived projects for 30 days before they're totally gone.

@spwoodcock spwoodcock changed the title There should be a delete project feature Project deletion frontend implementation Nov 28, 2023
@spwoodcock spwoodcock added the frontend Related to frontend code label Nov 28, 2023
@spwoodcock
Copy link
Member

spwoodcock commented Nov 28, 2023

There is an endpoint /delete/{project_id} that can be used on the backend.
It should be thoroughly tested and implemented on the frontend.

However, this is blocked until #243 is complete, as we can't allow unauthenticated users to delete projects (without knowing if they are a project admin).

@nrjadkry
Copy link
Member

Now that we've added user roles and permissions in fmtm, it's a good time to let users delete projects right from the frontend. As for archiving projects instead of deleting them outright, might be a smart move. We might need to set up scheduled jobs to clean out these archived projects later on. This might still be dependent on #1124

@spwoodcock
Copy link
Member

spwoodcock commented Jan 30, 2024

We can start with a simple delete from FMTM (and work out archiving later, which IMO would be better provided as a full project export/import functionality).

Hopefully the DROP CASCADE options in the DB should cleanup related tables too. We will have to check.

As for ODK, deletion can also patch the Central project with archived: true and then delete the forms.

As Rob says, the forms are not actually deleted, but put in a list where they are deleted after 30 days.

Also need to consider the submissions. We should look at osm-fieldwork OdkCentral.py.

Once done, the frontend needs a simple button to call the endpoint.

@spwoodcock
Copy link
Member

Checking the SQLAlchemy schema we have DROP CASCADE in place for all related tables, so deleting a project should delete project info, tasks, associated user role entries 👍

No point adding an archive feature until later - definitely useful, but not critical for now (org admins should just be careful).

I will add a button to the frontend to call this endpoint and we are set 😄

@spwoodcock spwoodcock self-assigned this Feb 2, 2024
@spwoodcock spwoodcock added this to the FMTM Public Beta milestone Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Related to frontend code
Projects
Development

Successfully merging a pull request may close this issue.

4 participants