Skip to content

Ogc management and settings#2441

Merged
BreathingFlesh merged 27 commits into
masterfrom
ogc-management-and-settings
Apr 16, 2026
Merged

Ogc management and settings#2441
BreathingFlesh merged 27 commits into
masterfrom
ogc-management-and-settings

Conversation

@BreathingFlesh

@BreathingFlesh BreathingFlesh commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Please fill in the commit message below and work through the checklist. You can delete parts that are not needed, e.g. the optional description, the link to a ticket or irrelevant options of the checklist.

Commit message

Org: Rearrange settings and management bar

  • Added a link for User manual
  • Added a new category "modules" to the global tools
  • Rearranged the global tools and settings
  • Added categories to settings

TYPE: Feature

Checklist

  • I have performed a self-review of my code
  • I considered adding a reviewer
  • I have updated the PO files
  • I made changes/features for both org and town6
  • I have tested my code thoroughly by hand

@Daverball Daverball left a comment

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.

Nicely done. I like this a lot better.

There are a couple of minor issues, like a missing translation.

I also have some other small nitpicks and some suggested potential refactors, but we don't necessarily need to tackle those now, since it is no worse than it was before.

Comment thread src/onegov/feriennet/templates/layout.pt
Comment thread src/onegov/feriennet/templates/layout.pt Outdated
Comment thread src/onegov/org/forms/__init__.py Outdated
Comment thread src/onegov/org/templates/layout.pt
Comment on lines +92 to +103

if (
setting['name'] == 'newsletter-settings'
and not request.app.org.show_newsletter
):
continue

if (
setting['name'] == 'ris-settings'
and not request.app.org.ris_enabled | False
):
continue

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 might not be quite worth it yet, but if we see more conditions sneaking in like this, we may want to extract this into an optional setting_visible predicate that takes a callback (lambda request: True by default) that needs to return True in order for the setting to be visible.

But if you feel like cleaning this up a bit, please go ahead.

Furthermore in terms of refactors, that might be worth it: Defining a new directive for settings views, with its own registry (or rather making the one we didn't end up using work correctly). So we don't have to use quite as much work to retrieve all of the setting views. This could be a CompositeAction that yields a HtmlHandleFormAction and a new action that registers the setting or a subclass of HtmlHandleFormAction that adds the extra logic for registering the setting.

We could then also be a little bit more robust and emit an exception if we encounter a setting with a setting category we don't know about.

Comment thread src/onegov/org/views/ticket.py Outdated
Comment thread src/onegov/org/views/settings.py Outdated
@OrgApp.form(
model=Organisation, name='module-activation-settings', template='form.pt',
permission=Secret, form=ModuleActivationSettingsForm,
setting=_('Activate/deactivate modules'), order=0,

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 found this to be a little wordy and it also ends up not fitting into one line in the settings view and gets broken up weirdly, on the other hand it's very clear what it means and I can't think of something shorter that still explains what the setting is for. Maybe "Optional Modules" could work?

@BreathingFlesh BreathingFlesh Apr 15, 2026

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.

I like "optional Modules". I will leave the "activate/deactivate Modules" in the modules dropdown and rename it in the settings.

Comment thread src/onegov/org/custom.py Outdated
Comment thread src/onegov/town6/forms/settings.py
Comment thread src/onegov/town6/views/ris_settings.py
@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.35450% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.30%. Comparing base (383ec48) to head (07b916c).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/onegov/town6/views/settings.py 94.33% 3 Missing ⚠️
src/onegov/org/views/settings.py 96.15% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/onegov/agency/app.py 97.79% <100.00%> (+0.01%) ⬆️
src/onegov/agency/custom.py 100.00% <100.00%> (ø)
src/onegov/core/directives.py 99.28% <100.00%> (-0.04%) ⬇️
src/onegov/core/framework.py 93.11% <100.00%> (+0.03%) ⬆️
src/onegov/core/templates.py 100.00% <100.00%> (ø)
src/onegov/form/widgets.py 85.71% <ø> (ø)
src/onegov/intranet/app.py 85.71% <100.00%> (ø)
src/onegov/landsgemeinde/app.py 100.00% <100.00%> (ø)
src/onegov/landsgemeinde/custom.py 100.00% <100.00%> (ø)
src/onegov/org/app.py 94.59% <ø> (-0.02%) ⬇️
... and 15 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 383ec48...07b916c. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/onegov/org/layout.py Outdated
BreathingFlesh and others added 2 commits April 16, 2026 09:31
Co-authored-by: David Salvisberg <david.salvisberg@seantis.ch>
@BreathingFlesh
BreathingFlesh merged commit a245aa0 into master Apr 16, 2026
15 checks passed
@BreathingFlesh
BreathingFlesh deleted the ogc-management-and-settings branch April 16, 2026 10:45
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