-
Notifications
You must be signed in to change notification settings - Fork 40
Add a comments sidebar & associate comments to specific objects #4923
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
Open
wes-otf
wants to merge
11
commits into
main
Choose a base branch
from
feature/comments-on-specific-objects
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
882047c
Initial implementation for a comments sidebar on reports, invoices, P…
wes-otf fcbb483
Removed unneeded InvoiceDetailView
wes-otf 4275015
Fix PAF status retrieval issues, handle no fetch URL being provided
wes-otf d49e374
Merge branch 'main' into feature/comments-on-specific-objects
wes-otf fb502bb
Removed CommentFormMini in favor of using init args
wes-otf d9dd253
fixed migrations
wes-otf aafb359
Merge branch 'main' into feature/comments-on-specific-objects
wes-otf d82ac71
Squashed migrations
wes-otf 5e82208
Added more unit tests
wes-otf 4673e01
Merge branch 'main' into feature/comments-on-specific-objects
wes-otf 0b181fd
Various fixes: changed `an` tag to be more verbose + unit test adds, …
wes-otf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,93 @@ | ||
| # Generated by Django 5.2.17 on 2026-08-05 16:25 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("activity", "0095_alter_event_type"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="event", | ||
| name="type", | ||
| field=models.CharField( | ||
| choices=[ | ||
| ("UPDATE_LEAD", "updated lead"), | ||
| ("BATCH_UPDATE_LEAD", "batch updated lead"), | ||
| ("EDIT_SUBMISSION", "edited submission"), | ||
| ("APPLICANT_EDIT", "edited applicant"), | ||
| ("NEW_SUBMISSION", "submitted new submission"), | ||
| ("DRAFT_SUBMISSION", "submitted new draft submission"), | ||
| ("SCREENING", "screened"), | ||
| ("TRANSITION", "transitioned"), | ||
| ("BATCH_TRANSITION", "batch transitioned"), | ||
| ("DETERMINATION_OUTCOME", "sent determination outcome"), | ||
| ("BATCH_DETERMINATION_OUTCOME", "sent batch determination outcome"), | ||
| ("INVITED_TO_PROPOSAL", "invited to proposal"), | ||
| ("REVIEWERS_UPDATED", "updated reviewers"), | ||
| ("BATCH_REVIEWERS_UPDATED", "batch updated reviewers"), | ||
| ("READY_FOR_REVIEW", "marked ready for review"), | ||
| ("BATCH_READY_FOR_REVIEW", "marked batch ready for review"), | ||
| ("NEW_REVIEW", "added new review"), | ||
| ("COMMENT", "added comment"), | ||
| ("PROPOSAL_SUBMITTED", "submitted proposal"), | ||
| ("OPENED_SEALED", "opened sealed submission"), | ||
| ("REVIEW_OPINION", "reviewed opinion"), | ||
| ("DELETE_SUBMISSION", "deleted submission"), | ||
| ("ANONYMIZE_SUBMISSION", "anonymized submission"), | ||
| ("DELETE_REVIEW", "deleted review"), | ||
| ("DELETE_REVIEW_OPINION", "deleted review opinion"), | ||
| ("CREATED_PROJECT", "created project"), | ||
| ("CREATED_SOW", "created a project SOW"), | ||
| ("EDITED_SOW", "edited a project SOW"), | ||
| ("CREATED_PF", "created a project form"), | ||
| ("EDITED_PF", "edited a project form"), | ||
| ("UPDATE_PROJECT_LEAD", "updated project lead"), | ||
| ("UPDATE_PROJECT_TITLE", "updated project title"), | ||
| ( | ||
| "UPDATE_PROJECT_CONTRACT_NUMBER", | ||
| "updated project contract number", | ||
| ), | ||
| ("EDIT_REVIEW", "edited review"), | ||
| ("SEND_FOR_APPROVAL", "sent for approval"), | ||
| ("APPROVE_PROJECT", "approved project"), | ||
| ("ASSIGN_PAF_APPROVER", "assign project form approver"), | ||
| ("APPROVE_PAF", "approved project form"), | ||
| ("PROJECT_TRANSITION", "transitioned project"), | ||
| ("REQUEST_PROJECT_CHANGE", "requested project change"), | ||
| ("SUBMIT_CONTRACT_DOCUMENTS", "submitted contract documents"), | ||
| ("UPLOAD_DOCUMENT", "uploaded document to project"), | ||
| ("UPLOAD_CONTRACT", "uploaded contract to project"), | ||
| ("APPROVE_CONTRACT", "approved contract"), | ||
| ("CREATE_INVOICE", "created invoice for project"), | ||
| ("UPDATE_INVOICE_STATUS", "updated invoice status"), | ||
| ("APPROVE_INVOICE", "approve invoice"), | ||
| ("DELETE_INVOICE", "deleted invoice"), | ||
| ("SENT_TO_COMPLIANCE", "sent project to compliance"), | ||
| ("UPDATE_INVOICE", "updated invoice"), | ||
| ("SUBMIT_REPORT", "submitted report"), | ||
| ("DELETE_REPORT", "deleted report"), | ||
| ("SKIPPED_REPORT", "skipped report"), | ||
| ("REPORT_FREQUENCY_CHANGED", "changed report frequency"), | ||
| ("DISABLED_REPORTING", "disabled reporting"), | ||
| ("REPORT_NOTIFY", "notified report"), | ||
| ("REVIEW_REMINDER", "reminder to review"), | ||
| ("BATCH_DELETE_SUBMISSION", "batch deleted submissions"), | ||
| ("BATCH_ANONYMIZE_SUBMISSION", "batch anonymized submissions"), | ||
| ("BATCH_ARCHIVE_SUBMISSION", "batch archive submissions"), | ||
| ("BATCH_INVOICE_STATUS_UPDATE", "batch update invoice status"), | ||
| ("STAFF_ACCOUNT_CREATED", "created new account"), | ||
| ("STAFF_ACCOUNT_EDITED", "edited account"), | ||
| ("ARCHIVE_SUBMISSION", "archived submission"), | ||
| ("UNARCHIVE_SUBMISSION", "unarchived submission"), | ||
| ("REMOVE_TASK", "remove task"), | ||
| ("INVITE_COAPPLICANT", "invite co-applicant"), | ||
| ("UPDATE_AUTHOR", "updated author"), | ||
| ], | ||
| max_length=50, | ||
| verbose_name="verb", | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or 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
37 changes: 37 additions & 0 deletions
37
hypha/apply/activity/templates/activity/partials/comment_form.html
This file contains hidden or 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 @@ | ||
| {% comment %} | ||
| Renders the sidebar comments form. | ||
|
|
||
| Params: | ||
| form – the CommentForm form | ||
| {% endcomment %} | ||
|
|
||
| {% load i18n static heroicons %} | ||
|
|
||
| <form hx-post="{% url 'activity:post-comment' %}" class="flex flex-col gap-2 p-2 card-body" hx-on::after-request="if(event.detail.successful) this.reset()"> | ||
| <h2 class="card-title">Comment</h2> | ||
| {% csrf_token %} | ||
|
|
||
| {% for hidden in form.hidden_fields %} | ||
| {{ hidden }} | ||
| {% endfor %} | ||
| <div> | ||
| {% include "forms/includes/field.html" with field=form.message label_classes="sr-only" %} | ||
| </div> | ||
|
|
||
| <details class="mb-1 collapse bg-base-100 group"> | ||
| <summary class="flex gap-1.5 items-center text-sm collapse-title"><span>{% trans 'Additional options' %}</span>{% heroicon_mini 'chevron-down' class="size-5 group-open:-rotate-180" %}</summary> | ||
| {# Some small modifications to django-file-form to make it fit better with the smaller modal #} | ||
| <div class="collapse-content [&_.dff-uploader]:hidden [&_.btn-upload]:w-full"> | ||
| {% include "forms/includes/field.html" with field=form.visibility %} | ||
| {% include "forms/includes/field.html" with field=form.assign_to %} | ||
| {% include "forms/includes/field.html" with field=form.attachments %} | ||
| {{ form.related_content_type }} | ||
| </div> | ||
| </details> | ||
| <button | ||
| class="btn btn-primary" | ||
| type="submit" | ||
| > | ||
| {% trans "Add Comment" %} | ||
| </button> | ||
| </form> |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.