Skip to content

Add author updated feature to submission#4380

Open
sandeepsajan0 wants to merge 9 commits into
mainfrom
feature/gh-4192-change-applicant
Open

Add author updated feature to submission#4380
sandeepsajan0 wants to merge 9 commits into
mainfrom
feature/gh-4192-change-applicant

Conversation

@sandeepsajan0
Copy link
Copy Markdown
Member

@sandeepsajan0 sandeepsajan0 commented Feb 6, 2025

Fixes #4192

Staff can update the submission's author. Flow is similar to the Lead update but the button is a bit hidden in more actions.

Test Steps

  • Staff should find an option to 'Change Author' on the submission detail page in sidebar(More action).
  • Staff can select any applicant and assign them as an author of that submission.
  • New applicant should be notified about new assignment.
  • A slack notification should be there, like which user has replaced {old applicant} from {new_applicant}.
  • The new applicant's name should be updated in all the places on submission.
  • A new activity item should be created in the activity feed indicating the author update

@sandeepsajan0 sandeepsajan0 marked this pull request as ready for review February 6, 2025 04:47
Copy link
Copy Markdown
Member

@frjo frjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well but can be simplified I think.

Comment thread hypha/apply/funds/forms.py Outdated
label=_("Applicants"),
required=False,
)
author.widget.attrs.update({"data-placeholder": "Select..."})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this author.widget.attrs.update({"data-placeholder": "Select...", "data-js-choices": ""})?

allowHTML: true,
});
});
</script>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With setting data-js-choices above I believe this script snippet is not needed.


{% url 'funds:submissions:change_author' pk=object.pk as author_update_url %}
{% include 'funds/includes/dialog_form_base.html' with form=form value=value %}
</form>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "lead" modal is much simpler, no form in form. Here there seems to be two htmx calls, is that needed?

I see that the partner modal looks like above, I suspect that is overcomplicated as well.

</dl>
</div>

{% url 'funds:submissions:change_author' pk=object.pk as author_update_url %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this is used anywhere.

@frjo frjo added Type: Feature This is something new (not an enhancement of an existing thing). Type: Patch Mini change, used in release drafter labels Feb 6, 2025
@frjo frjo marked this pull request as draft February 6, 2025 17:20
@wes-otf wes-otf force-pushed the feature/gh-4192-change-applicant branch from 319770d to 78224f8 Compare May 11, 2026 19:33
@wes-otf wes-otf force-pushed the feature/gh-4192-change-applicant branch from 4779c15 to 5561272 Compare May 18, 2026 16:09
@wes-otf wes-otf force-pushed the feature/gh-4192-change-applicant branch from 5561272 to f1b3c07 Compare May 18, 2026 16:13
@wes-otf
Copy link
Copy Markdown
Contributor

wes-otf commented May 18, 2026

@frjo if you have the capacity can you review this? gotten lots of requests for this feature lately. Will likely add unit tests but otherwise feels pretty good to go. would eventually love to add emails to the choice options so staff doesn't only need to rely on the display name

Almost wondering if we should move the update author button to this Edit button instead as I find that could be a bit confusing
Screenshot 2026-05-18 at 14 09 01

@wes-otf wes-otf requested a review from frjo May 18, 2026 18:11
@wes-otf wes-otf marked this pull request as ready for review May 18, 2026 18:12
Comment thread hypha/apply/activity/templates/messages/email/author_updated.html Outdated
Comment thread hypha/apply/funds/forms.py Outdated
Comment thread hypha/apply/funds/forms.py Outdated
class UpdateAuthorView(View):
model = ApplicationSubmission
form_class = UpdateAuthorForm
context_name = "author_form"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this is actually used anywhere. Same for "UpdateLeadView".

Copy link
Copy Markdown
Contributor

@wes-otf wes-otf May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in the view itself isn't used anywhere? or the context_name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "context_name" part only.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed it's not used, should be set now

@wes-otf
Copy link
Copy Markdown
Contributor

wes-otf commented May 19, 2026

thanks for the flags @frjo! couple of issues were existing that I glazed over when I revived the PR

@wes-otf wes-otf requested a review from frjo May 19, 2026 14:47
@frjo
Copy link
Copy Markdown
Member

frjo commented May 19, 2026

Regarding the "Edit" link, could we make the Legal name itself into a link, for staff only, to the wagtail admin user page? Then we can remove the separate "Edit" link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature This is something new (not an enhancement of an existing thing). Type: Patch Mini change, used in release drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow staff to change applicant/author of an application

3 participants