Skip to content
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

modal.js: remove jquery and convert to typescript #4618

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

freyavs
Copy link
Contributor

@freyavs freyavs commented May 5, 2023

This pull request removes all jquery from modal.js and converts it to typescript.

Progress on #3590

@freyavs freyavs added the chore Repository/build/dependency maintenance label May 5, 2023
@freyavs freyavs self-assigned this May 5, 2023
app/assets/javascripts/modal.ts Fixed Show fixed Hide fixed
app/assets/javascripts/modal.ts Fixed Show fixed Hide fixed
@jorg-vr jorg-vr changed the base branch from develop to main June 5, 2023 07:32
@freyavs freyavs marked this pull request as ready for review July 28, 2023 06:30
@freyavs freyavs requested a review from a team as a code owner July 28, 2023 06:30
@freyavs freyavs requested review from bmesuere, niknetniko and jorg-vr and removed request for a team July 28, 2023 06:30
Copy link
Member

@bmesuere bmesuere left a comment

Choose a reason for hiding this comment

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

The CodeQL warnings seem to be valid concerns. @jorg-vr do you know if we need to be able to inject html into these?

@jorg-vr
Copy link
Contributor

jorg-vr commented Jul 28, 2023

Looking at the three usecases it should support html. (all usecases are for pythia submissions)
But one case has user input in the template string (a filename, chosen by a teacher, is used in the title), thus we best improve the safety of the method

Might be best to use the render function from lit

Eg render(title, document.querySelector("#info-modal .modal-title"))
The title and content arguments will have to be of type TemplateResult | string
And usages of the function could use html\`` to generate template strings, which will make sure everything is safe

@jorg-vr jorg-vr self-requested a review July 28, 2023 08:48
app/assets/javascripts/modal.ts Outdated Show resolved Hide resolved
app/assets/javascripts/modal.ts Outdated Show resolved Hide resolved
@jorg-vr jorg-vr requested a review from niknetniko August 1, 2023 07:46
@jorg-vr jorg-vr merged commit 4224cba into main Aug 1, 2023
@jorg-vr jorg-vr deleted the chore/modal-jquery-removal branch August 1, 2023 09:32
@jorg-vr jorg-vr temporarily deployed to naos August 1, 2023 09:33 — with GitHub Actions Inactive
@jorg-vr jorg-vr temporarily deployed to production August 1, 2023 09:37 — with GitHub Actions Inactive
@freyavs freyavs mentioned this pull request Aug 1, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Repository/build/dependency maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants