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

Add button to quickly include all form variables in JSON dump plugin #5070

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

viktorvanwijk
Copy link
Contributor

@viktorvanwijk viktorvanwijk commented Jan 31, 2025

Closes #5066

Changes

Add button to quickly include all form variables in JSON dump plugin

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.74%. Comparing base (a1a1b00) to head (3819dac).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5070   +/-   ##
=======================================
  Coverage   96.74%   96.74%           
=======================================
  Files         771      771           
  Lines       26636    26636           
  Branches     3467     3467           
=======================================
  Hits        25770    25770           
  Misses        605      605           
  Partials      261      261           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@viktorvanwijk viktorvanwijk changed the title Add button to quickly include all form varianles in JSON dump plugin Add button to quickly include all form variables in JSON dump plugin Feb 3, 2025
@viktorvanwijk viktorvanwijk force-pushed the 5066-add-possiblity-to-quickly-include-all-form-fields-in-the-data-to-be-sent-for-the-json-dump-registration-backend branch from b11b609 to 1013703 Compare February 3, 2025 08:37
@viktorvanwijk viktorvanwijk marked this pull request as ready for review February 4, 2025 14:10
@viktorvanwijk viktorvanwijk force-pushed the 5066-add-possiblity-to-quickly-include-all-form-fields-in-the-data-to-be-sent-for-the-json-dump-registration-backend branch from 820f230 to 62bc105 Compare February 5, 2025 10:16
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm thinking now this might be better placed in Backend -> Admin styling?

Copy link
Contributor

Choose a reason for hiding this comment

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

No this would be the correct place. (S)CSS is frontend stuff :)
I would suggest moving this to a separate file, instead of added it to the index.rst, just to give some structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was a bit confused by the definition of frontend here. If you look at the frontend documentation, it only mentions the repos related to the form frontend, not the admin styling. I guess it depends on what is meant exactly by Backend and Frontend here:
image

Copy link
Contributor

@robinmolen robinmolen left a comment

Choose a reason for hiding this comment

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

Some small comments/things to keep in mind :)


<button
type="button"
className="button button--padded"
Copy link
Contributor

Choose a reason for hiding this comment

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

.button--padded currently does nothing, as its not defined in any .scss file. I think it would be nice to add some padding to this button.

As i see it, you have two options:

  • You could add .button--padded to the _button.scss file (using @include bem.modifier('padded')) and define the padding there (in this case, keep the padding inline with the other buttons)
  • Or you could use the <ActionButton /> component (which is already styled like you would want)

Copy link
Contributor Author

@viktorvanwijk viktorvanwijk Feb 13, 2025

Choose a reason for hiding this comment

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

I had indeed seen the <ActionButton />, but it uses an <input /> component rather than a <button />. Wouldn't this mean that it acts like a 'Save' button of the modal?

EDIT: I guess we can override the type property with type="button"

Copy link
Contributor

Choose a reason for hiding this comment

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

No this would be the correct place. (S)CSS is frontend stuff :)
I would suggest moving this to a separate file, instead of added it to the index.rst, just to give some structure.

docs/developers/frontend/index.rst Outdated Show resolved Hide resolved
docs/developers/frontend/index.rst Outdated Show resolved Hide resolved
.json-dump-variables {
display: flex;

&--horizontal {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are gonna add documentation for styling, we might as well convince the reader to use @include bem. stuff :)

Suggested change
&--horizontal {
@include bem.modifier('horizontal') {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there an advantage of using @include bem.modifier?

docs/developers/frontend/index.rst Outdated Show resolved Hide resolved
@viktorvanwijk viktorvanwijk force-pushed the 5066-add-possiblity-to-quickly-include-all-form-fields-in-the-data-to-be-sent-for-the-json-dump-registration-backend branch 3 times, most recently from 00d1a2d to 0ad3397 Compare February 13, 2025 13:34
Added a (short) section on how to add custom styling of admin components.
@viktorvanwijk viktorvanwijk force-pushed the 5066-add-possiblity-to-quickly-include-all-form-fields-in-the-data-to-be-sent-for-the-json-dump-registration-backend branch from 0ad3397 to 3819dac Compare February 13, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants