uninstall: Fix issue with uninstall of apps that have no backup
Closes: #2342 (closed).
-
Define a helper method to figure if app has backup. Use the helper method in main AppView.
-
Minor refactor of repeated code in uninstall view that gets the app and app_id.
-
Pass whether an app has backup or not into form. Delete backup related form fields when backup is not supported. UX when fields are disabled is not nice, it is not explained why fields are disabled. Better UX seems to be to remove the backup fields entirely.
Tests:
-
Install wireguard. In the uninstall form backup fields don't appear. Uninstall is successful.
-
Install Bepasty. In the uninstall form back fields are shown. Uninstall is successful with and without a backup. In case backup is chosen, backup is created and can successfully be restored.
-
Run functional tests for bepasty. For wireguard uninstall test succeeds.
Signed-off-by: Sunil Mohan Adapa sunil@medhas.org