Skip to content

Refactor: Replace multiple team selector with multiple item selector#4162

Open
ayshushus wants to merge 1 commit into
mozilla:mainfrom
ayshushus:3368
Open

Refactor: Replace multiple team selector with multiple item selector#4162
ayshushus wants to merge 1 commit into
mozilla:mainfrom
ayshushus:3368

Conversation

@ayshushus
Copy link
Copy Markdown
Collaborator

Fix #3368

Consolidate multiple_team_selector into generic multiple_item_selector widget introduced in #3367.
Team-specific CSS file held unscoped global rules (form > div, label, form a:link/visited), leaked into CSS pipelines.
Preserved by moving CSS into per-page stylesheets.

  • Extend multiple_item_selector to render locale rows (if item.code truthy) and accept form_field as string (renders hidden input) or Django form field (renders <select multiple>).
  • Switch admin_project.html pretranslate, contributors/settings.html preferred-locales, messaging/includes/compose.html locale filter to new widget. Drop sync in admin_project.js.
  • Update settings.js, messaging.js selectors to match .item.select.* class names.
  • Drop teams/widgets/multiple_team_selector.html, static/js/multiple_team_selector.js, static/css/multiple_team_selector.css. Update CSS/JS pipelines.
  • Move dropped per-page side effects to settings.css, messaging.css, admin_project.css.

@functionzz, this PR drops global rules styled non-widget elements on admin_project, project, settings, messaging pipelines. Smoke-test at least:

  • /settings/ green locale codes, green help-link colors, list borders intact.
  • /admin/projects/<slug>/ Locales widget bottom borders; Pretranslation Available/Chosen sit side-by-side.
  • /messaging/ locale/project filter search box fills the menu, codes green, label spacing unchanged.
  • /projects/<slug>/ bundle changed.

@ayshushus ayshushus requested a review from functionzz May 16, 2026 06:01
@ayshushus ayshushus self-assigned this May 16, 2026
@ayshushus ayshushus marked this pull request as ready for review May 16, 2026 06:01
Copy link
Copy Markdown
Collaborator

@functionzz functionzz left a comment

Choose a reason for hiding this comment

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

Overall very good PR! I've tested functionality for all major use cases and there are no issues that I've seen. I've also looked at the code and found it acceptable. See below for more comments:

Comment on lines +35 to +40
<input
type="hidden"
name="{{ form_field }}"
value="{{ items|map(attribute='pk')|join(',') }}"
/>
{% endif %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this specifically needed here? I get that you need to add the form_field condition for the multiple teams widget but do we need to set form_field for items in particular?

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.

Replace multiple team selector with multiple item selector

2 participants