Skip to content

Add UI options tab and setting to disable opening diff in a new tab#3071

Merged
dgtlmoon merged 5 commits into
dgtlmoon:masterfrom
OPerepadia:add-ui-options-tab
Apr 9, 2025
Merged

Add UI options tab and setting to disable opening diff in a new tab#3071
dgtlmoon merged 5 commits into
dgtlmoon:masterfrom
OPerepadia:add-ui-options-tab

Conversation

@OPerepadia
Copy link
Copy Markdown
Contributor

@OPerepadia OPerepadia commented Mar 30, 2025

Following the discussion in #2839, I've added a UI options tab in settings with an option to prevent the diff page from opening in a new tab.
I've tested it and everything seems to work as expected. Please let me know if any changes are needed to merge this.

image

</div>
<div class="tab-pane-inner" id="ui-options">
<div class="pure-control-group">
{{ render_checkbox_field(form.application.form.open_diff_in_new_tab, class="open_diff_in_new_tab") }}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

better is if you can move it to something like

{{ render_checkbox_field(form.application.form.ui.from.open_diff_in_new_tab, class="open_diff_in_new_tab") }}

it needs to be in its own "UI" dict because in the future there will likely be a lot more options

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

also needs sub form added

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread changedetectionio/model/App.py Outdated
@dgtlmoon
Copy link
Copy Markdown
Owner

the PR breaks all tests at the linting stage for some reason hmm

@dgtlmoon
Copy link
Copy Markdown
Owner

#3074

@dgtlmoon
Copy link
Copy Markdown
Owner

alright, now rebase or merge out master your way :) and repush

@dgtlmoon
Copy link
Copy Markdown
Owner

Ok and now you need to add a test, its enough to copy some test from tests/test_... and call it test_ui.py , its enough for the test to turn on/off the checkbox and see its reflected in the template output/ get overview page

@OPerepadia
Copy link
Copy Markdown
Contributor Author

OPerepadia commented Apr 8, 2025

It's strange, one of the checks failed with python 3.10. I'm not sure if the issue is with my test, because it passed according to the logs, but this one failed: tests/visualselector/test_fetch_data.py::test_setup

@dgtlmoon
Copy link
Copy Markdown
Owner

dgtlmoon commented Apr 8, 2025

it can be intermittant, i'll run that one again

@dgtlmoon dgtlmoon merged commit 1378b5b into dgtlmoon:master Apr 9, 2025
5 checks passed
@dgtlmoon
Copy link
Copy Markdown
Owner

dgtlmoon commented Apr 9, 2025

thanks!

This was referenced May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants