Skip to content

Conversation

@chrisdoehring
Copy link
Contributor

@chrisdoehring chrisdoehring commented Sep 25, 2025

I added some UI friendliness for navigating between Inbound Integrations, Device Groups and Outbound Destinations.

This is primarily to prevent errors like what's described in https://allenai.atlassian.net/browse/GUNDI-4725. This is where a user probably visited the Device Groups page and accidentally un-selected the desired outbound connection.

feat: create+select for subject-type
feat: fixed up Subject Type autocomplete.
feat: update search feature in destinations search.
feat: consolidate Device Group page.
feat: navigation from inbound to device group
feat: disable changing the default device group for an inbound integration.
feat: add search to bridge integration list.
feat: tabbed view on Device Group page.

Copilot's summary

This pull request introduces significant enhancements to the device integration and management forms, focusing on improved search/filter capabilities and more user-friendly widgets. It also includes minor corrections to documentation and help texts for clarity. The most important changes are grouped below.

Search and Filtering Improvements:

  • Added a search filter to both DeviceFilter and BridgeIntegrationFilter, allowing users to search across multiple related fields for devices and integrations, improving usability in large datasets. [1] [2]

Form and Widget Enhancements:

  • Integrated new custom widgets (SearchableMultiSelectField, SubjectTypeAutocompleteField, etc.) into forms for device groups and integrations, enabling advanced selection and autocomplete features for destinations and subject types. [1] [2] [3]
  • Overhauled the InboundIntegrationConfigurationForm and related forms to provide context-aware filtering and display logic for device groups, including display-only widgets for existing integrations and auto-create messaging for new ones. [1] [2] [3]

Documentation and Help Text Updates:

  • Added a new README.md documenting the searchable multiselect widget, its features, usage, and dependencies for frontend developers.
  • Corrected spelling of "overridden" in comments and help texts for consistency and clarity throughout the codebase. [1] [2] [3] [4]

Note

Adds searchable multi-select and autocomplete widgets, consolidates and enhances Device Group management (including new devices management view), expands search/filters, and wires supporting endpoints/routes and UI updates.

  • UI/Forms:
    • Introduce custom widgets: SearchableMultiSelectField, DeviceSearchableMultiSelectField, SubjectTypeAutocompleteField, DeviceGroupSelectWithLinkField, DeviceGroupAutoCreateField, DeviceGroupDisplayWidget with JS (searchable-multiselect.js, device-searchable-multiselect.js, subject-type-autocomplete.js).
    • Add InboundIntegrationConfigurationAddForm and enhance InboundIntegrationConfigurationForm (permission-aware device group querying, display-only default device group on edit, preserve on save).
    • Replace Device Group pages with a consolidated update view featuring tabs and searchable destination selection; remove device_group_detail.html.
    • Add DeviceGroupManagementForm and new DeviceGroupDevicesManagementForm + page for selecting devices tied to the integration.
    • Improve list templates with search/clear controls for devices and bridge_integration_list.
  • Views/URLs:
    • Route devicegroups/<id> to DeviceGroupManagementUpdateView; add devicegroups/<id>/devices/manage (DeviceGroupDevicesManagementView).
    • Add add-form HTMX endpoints: inboundconfigurations/add_type_modal, add_schema, add_dropdown_restore.
    • Enhance existing update views to pass request to forms; add JS warning handler for type changes.
  • Filters/Search:
    • DeviceFilter: owner field path fix (inbound_configuration__owner__name) and add full-text search across device/config/owner/type/group.
    • BridgeIntegrationFilter: add search across owner/name/state/additional; update templates to expose it.
  • Models/Text:
    • Fix help-text typos (“overridden”).
    • Bridge schema fix: use additional instead of state when loading initial JSON.
  • API:
    • New endpoint POST /integrations/api/create-subject-type/ to create SubjectType for autocomplete.

Written by Cursor Bugbot for commit 7e48d1c. This will update automatically on new commits. Configure here.

feat: create+select for subject-type
feat: fixed up Subject Type autocomplete.
feat: update search feature in destinations search.
feat: consolidate Device Group page.
feat: navigation from inbound to device group
feat: disable changing the default device group for an inbound integration.
feat: add search to bridge integration list.
feat: tabbed view on Device Group page.
@chrisdoehring chrisdoehring marked this pull request as ready for review September 25, 2025 16:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces significant enhancements to device integration and management forms, focusing on improved search capabilities, user-friendly widgets, and consolidated device group management. The changes streamline the user experience with advanced selection interfaces and more intuitive navigation.

Key changes include:

  • Advanced searchable multiselect widgets for destinations and devices with real-time filtering
  • Subject type autocomplete field with create-new functionality and API integration
  • Consolidated device group management with tabbed interface and improved navigation flow
  • Enhanced search filters across device and bridge integration lists

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
cdip_admin/integrations/widgets.py Implements custom widgets including searchable multiselect, subject type autocomplete, and device group selection widgets
cdip_admin/integrations/views.py Adds device group management views, subject type creation API, and updates existing views with enhanced form handling
cdip_admin/integrations/forms.py Integrates new custom widgets into device group and integration forms with improved field configurations
cdip_admin/integrations/filters.py Adds comprehensive search functionality to device and bridge integration filters
cdip_admin/integrations/urls.py Updates URL patterns for new device group management views and API endpoints
cdip_admin/integrations/templates/ Updates templates with tabbed interfaces, improved layouts, and enhanced device management views
cdip_admin/integrations/static/integrations/js/ Adds JavaScript implementations for custom widgets and interaction handling
Comments suppressed due to low confidence (1)

cdip_admin/integrations/widgets.py:1

  • This condition uses truthiness check which will fail if type is '0' or other falsy values. Use is not None or != '' for more reliable comparison.
from django import forms

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chrisdoehring chrisdoehring changed the title feat: friendly destination selector in DeviceGroup pages. Better UI for Device Group admin (v1) Sep 25, 2025
cursor[bot]

This comment was marked as outdated.

Co-authored-by: chrisdoehring <chrisdoehring@gmail.com>
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

"search",
)

def filter_search(self, queryset, name, value):
Copy link
Contributor

@marianobrc marianobrc Sep 30, 2025

Choose a reason for hiding this comment

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

Alternative implementation: Use rest_framework.DjangoFilterBackend + SearchFilter and set a list of search fields at the view level (more examples in the v2 API views)


def get_unique_together_validators(self):
# Overriden to disable unique together check as it's handled in the create method
# Overridden to disable unique together check as it's handled in the create method
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for fixing those

import json
from django.utils.safestring import mark_safe

class SearchableMultiSelectWidget(forms.Widget):
Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.


def form_valid(self, form):
form.save()
return redirect("device_group", device_group_id=str(self.object.id))
Copy link

Choose a reason for hiding this comment

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

Bug: URL Reversal Errors Due to Positional Arguments

Several URL reversals, including redirect calls in DeviceGroupAddView and {% url %} tags in templates, are passing arguments positionally. This causes NoReverseMatch errors because the URL patterns expect device_group_id as a keyword argument.

Additional Locations (2)

Fix in Cursor Fix in Web

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.

5 participants