-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a sensible dialogue when updating a file (#605)
* Add FileForm * we don't need the filetype for updating a file (we want to keep the old one) * Split up workspace_add_file_to_request() * Refactor add/update permissions checks for more granularity * Create replace file endpoints to complement the add file endpoints * Add tests for multiselect update * Refactor functions away from workspace & into policies
- Loading branch information
Showing
11 changed files
with
453 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{# hide default button, as we are going to autoshow the modal anyway #} | ||
{% fragment as button %} | ||
{% endfragment %} | ||
{% #modal id="updateRequestFile" custom_button=button autoshow=True %} | ||
{% #card container=True title="Update Files in Request" %} | ||
<form action="{{ add_file_url }}" method="POST" aria-label="add-file-form"> | ||
{% csrf_token %} | ||
{{ form.next_url }} | ||
{{ formset.management_form }} | ||
{% #list_group %} | ||
{% for name, reason in files_ignored.items %} | ||
{% #list_group_item %} | ||
<div class="flex items-center gap-2 justify-between"> | ||
<span>{{ name }}</span> | ||
<span class="flex flex-row">{{ reason }}</span> | ||
</div> | ||
{% /list_group_item %} | ||
{% endfor %} | ||
{% for formset_form in formset %} | ||
{% #list_group_item %} | ||
<div class="flex items-center gap-2 justify-between"> | ||
<span>{{ formset_form.file.value }}</span> | ||
{{ formset_form.file }} | ||
</div> | ||
{% /list_group_item %} | ||
{% endfor %} | ||
{% /list_group %} | ||
|
||
<div class="mt-2"> | ||
{% #button type="submit" variant="success" id="update-file-button" disabled=no_valid_files %} | ||
Update Files in Request | ||
{% /button %} | ||
{% #button variant="danger" type="cancel" %}Cancel{% /button %} | ||
</div> | ||
</form> | ||
{% /card %} | ||
{% /modal %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.