Skip to content

Update contact modal#2657

Open
styrix560 wants to merge 22 commits intoe-valuation:mainfrom
styrix560:2129-update-contact-modal
Open

Update contact modal#2657
styrix560 wants to merge 22 commits intoe-valuation:mainfrom
styrix560:2129-update-contact-modal

Conversation

@styrix560
Copy link
Copy Markdown
Collaborator

@styrix560 styrix560 commented Mar 2, 2026

Fixes #2129

@styrix560 styrix560 marked this pull request as ready for review March 16, 2026 19:19
@styrix560 styrix560 force-pushed the 2129-update-contact-modal branch from 41f249c to 013b600 Compare March 16, 2026 20:29
Comment thread evap/student/tests/test_live.py
Comment thread evap/evaluation/templates/contact_modal.html Outdated
Comment thread evap/static/scss/components/_buttons.scss
Comment thread evap/evaluation/templates/contact_modal.html Outdated
Comment thread evap/evaluation/templates/base.html
Comment thread evap/evaluation/templates/contribution_formset.html
Comment thread evap/evaluation/templates/contact_modal.html Outdated
@styrix560 styrix560 force-pushed the 2129-update-contact-modal branch from e262c2f to b945b30 Compare April 13, 2026 17:11
@niklasmohrin niklasmohrin self-requested a review April 13, 2026 17:21
Copy link
Copy Markdown
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

I think the end goal should be to not use django include for modals at all; this is definitely a step in the right direction.

Comment thread evap/evaluation/tests/test_live.py Outdated
self.wait.until(visibility_of_element_located((By.ID, "feedbackModalMessageText")))
self.selenium.find_element(By.ID, "feedbackModalMessageText").send_keys("Test message")
self.selenium.find_element(By.ID, "feedbackModalActionButton").click()
self.selenium.find_element(By.CSS_SELECTOR, "span[slot='action-text']").click()
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.

is there any selector that ensures that we click on the contact modal?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There is now :)

self.evaluation.save()
page = self.app.get(self.url, user=self.responsible, status=200)

self.assertIn("changeEvaluationRequestModalLabel", page)
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.

Why?

Copy link
Copy Markdown
Collaborator Author

@styrix560 styrix560 Apr 13, 2026

Choose a reason for hiding this comment

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

Before, this was the code <h5 class="modal-title" id="{{ modal_id }}Label">{{ title }}</h5>. Now, the id also reflects, that this is the title and not some kind of label: <span slot="title" id="{{ modal_id }}Title">{{ title }}</span>

Copy link
Copy Markdown
Member

@niklasmohrin niklasmohrin Apr 13, 2026

Choose a reason for hiding this comment

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

but the "change evaluation" part changed too, I think this is the more interesting change

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think I know why this is happening and the reason is a bit hilarious.

Our test was (kinda) supposed to fail always. Before, we included the modals unconditionally and only showed the show-buttons conditionally. Now, we also show modals conditionally. Where before both modals lay in the DOM, now only the createContributorAccountRequestModal appears.

Comment thread evap/contributor/templates/contributor_evaluation_form.html
Comment thread evap/evaluation/templates/contribution_formset.html
</div>
</div>
</div>
<form reload-on-success id="contact-modal-form-{{ modal_id }}" method="POST" action="{% url 'evaluation:contact' %}">
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.

Looks like this ID is now unused -- can we remove it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, it is required for the test test_contact_modal_escape in contributor:test_views

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.

It does not use contact-modal-form-...?

</div>
<form reload-on-success id="contact-modal-form-{{ modal_id }}" method="POST" action="{% url 'evaluation:contact' %}">
{% csrf_token %}
<input hidden name="title" value="{{ title }}"/>
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.

Before, we passed the title to a hidden input with id="{{ modal_id }}Subject" and no name. We still have the corresponding input below, but now we also have name="title". Is this intended and required?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Before, we had custom logic to fire the http request, that passed the title value with key 'title' as body parameters. Because we now use html forms for this, name="title" submits the title the same way as before.
The input you mention was only for UI and was never submitted, because it had no 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.

But then let's just use one input instead of having two of them? I'd propose to remove this one here and juts add name="title" to the one below in line 26

@richardebeling richardebeling removed their request for review April 19, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Use web components for contact and direct delegation modals

4 participants