Commit Graph

52 Commits

Author SHA1 Message Date
Jeremy Stretch
a0a199cec3 #8198: Rename CustomField.validation_unique to unique (#17325)
* #8198: Rename CustomField.validation_unique to unique

* Update CustomField model documentation
2024-08-30 13:44:03 -04:00
Jeremy Stretch
350f6d65c8 Closes #16886: Dynamic event types (#16938)
* Initial work on #16886

* Restore GraphQL filter

* Remove namespace

* Add Event documentation

* Use MultipleChoiceField for event_types

* Fix event_types field class on EventRuleImportForm

* Fix tests

* Simplify event queue handling logic

* Misc cleanup
2024-07-22 08:12:04 -04:00
Jeremy Stretch
df0a728898 Closes #15621: User notifications (#16800)
* Initial work on #15621

* Signal receiver should ignore models which don't support notifications

* Flesh out NotificationGroup functionality

* Add NotificationGroup filters for users & groups

* Separate read & dimiss actions

* Enable one-click dismissals from notifications list

* Include total notification count in dropdown

* Drop 'kind' field from Notification model

* Register event types in the registry; add colors & icons

* Enable event rules to target notification groups

* Define dynamic choices for Notification.event_name

* Move event registration to core

* Add more job events

* Misc cleanup

* Misc cleanup

* Correct absolute URLs for notifications & subscriptions

* Optimize subscriber notifications

* Use core event types when queuing events

* Standardize queued event attribute to event_type; change content_type to object_type

* Rename Notification.event_name to event_type

* Restore NotificationGroupBulkEditView

* Add API tests

* Add view & filterset tests

* Add model documentation

* Fix tests

* Update notification bell when notifications have been cleared

* Ensure subscribe button appears only on relevant models

* Notifications/subscriptions cannot be ordered by object

* Misc cleanup

* Add event icon & type to notifications table

* Adjust icon sizing

* Mute color of read notifications

* Misc cleanup
2024-07-15 14:24:11 -04:00
Jeremy Stretch
3d23f9c099 Merge branch 'develop' into feature 2024-07-09 15:16:05 -04:00
Julio Oliveira at Encora
9f247caa2a 16704 - Define a default help_text for ColorField (#16708)
* Added `help_text` to ColorField.

* Addressed PR comment to remove the redundant help_text from all the forms where ColorField was used.

* Add space before example value

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-06-26 09:14:08 -04:00
Jeremy Stretch
8be1a1f042 Closes #8198: Custom field uniqueness (#16661)
* Closes #8198: Implement ability to enforce custom field uniqueness

* Add missing form fields & table columns for validation attributes

* Remove obsolete code
2024-06-25 08:37:10 -04:00
Jeremy Stretch
2914276837 Merge branch 'develop' into feature 2024-04-22 13:23:42 -04:00
Jeremy Stretch
8c333d3a03 Closes #15547: Add comments field to CustomField model 2024-04-19 15:10:06 -04:00
Arthur
93af5545cd 15597 add button_class choices to import form 2024-04-03 13:06:53 -04:00
Jeremy Stretch
68149ecec6 Closes #15357: Rename CustomField.object_type to related_object_type (#15366) 2024-03-09 06:16:17 -05:00
Jeremy Stretch
545830e430 Rename SavedFilter.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
731d03e753 Rename ExportTemplate.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
4411bec20d Rename EventRule.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
97d8bce886 Rename CustomLink.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
b2857ab559 Rename CustomField.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
903f02ff01 Rename ContentType proxy model to ObjectType 2024-03-04 08:33:44 -05:00
Arthur Hanson
0555d991bf Closes #14438: Database representation of scripts
- Introduces the Script model to represent individual Python classes within a ScriptModule file
- Automatically migrates jobs & event rules

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-23 08:27:37 -05:00
Arthur Hanson
16712ad8d9 15094 Add missing gettext to error strings for internationalization (#15155)
* 15049 add missing gettext to error strings

* 15049 add missing gettext to error strings

* 15094 review change

* 15094 review change

* Formatting cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 09:44:02 -05:00
Jeremy Stretch
c49e4c3797 Merge branch 'develop' into feature 2023-12-15 16:52:42 -05:00
Arthur Hanson
9f4881d01a 13983 Add nested arrays for extra_choices in CustomFieldChoiceSet (#14470)
* 13983 split array fields in CSV data for CustomFieldChoices

* 13983 fix help text

* 13983 update tests

* 13983 use re for split

* 13983 replace escaped chars

* 13983 fix escape handling

* 13983 fix escape handling

* 13983 fix escape handling
2023-12-14 15:18:56 -05:00
Jeremy Stretch
b845762928 #14132: Simplify form logic for script EventRules 2023-12-04 10:57:29 -05:00
Jeremy Stretch
a98a8019a4 Closes #14361: Add a description field to Webhook (#14380) 2023-11-30 17:02:45 -05:00
Arthur Hanson
8cfb44fd4b 14132 Add EventRule - change webhook and add in script processing to events (#14267)
---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-11-30 16:36:33 -05:00
Jeremy Stretch
a7f6b53e9a Closes #13299: Improve options for controlling custom field visibility (#14289)
* Add ui_visible and ui_editable fields

* Extend migration to map new visible/editable values

* Remove ui_visibility field

* Update docs
2023-11-20 13:06:34 -05:00
Jeremy Stretch
d7179282e6 Closes #14153: Filter ContentTypes by supported feature (#14191)
* WIP

* Remove FeatureQuery

* Standardize use of proxy ContentType for models

* Remove TODO

* Correctly filter BookmarksWidget object_types choices

* Add feature-specific object type validation
2023-11-16 12:12:51 -05:00
Jeremy Stretch
196964ad77 Closes #13427: Public model registration (#14152)
* Initial work on #13427

* Clarify documentation

* Reference public models registry when populating models for ConfigTemplate context
2023-11-03 10:32:59 -04:00
Jeremy Stretch
5eae35c875 Misc i18n cleanup 2023-09-11 15:59:50 -04:00
Abhimanyu Saharan
69c508b84e Adds custom field on webhook model (#13336)
* adds custom field on webhook model #11936

* adds tags on webhook model #11936

* Remove extraneous import; revert change to NetBoxModelForm (no longer needed)

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-01 14:05:47 -04:00
Arthur Hanson
c68cc5cd5c Closes #13149: Wrap form field labels with gettext_lazy()
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 12:52:38 -04:00
Jeremy Stretch
d809644c4d Closes #12194: Add pre-defined custom field choices (#13219)
* Initial work on custom field choice sets

* Rename choices to extra_choices (prep for #12194)

* Remove CustomField.choices

* Add & update tests

* Clean up table columns

* Add order_alphanetically boolean for choice sets

* Introduce ArrayColumn for choice lists

* Show dependent custom fields on choice set view

* Update custom fields documentation

* Introduce ArrayWidget for more convenient editing of choices

* Incorporate PR feedback

* Misc cleanup

* Initial work on predefined choices for custom fields

* Misc cleanup

* Add IATA airport codes

* #13241: Add support for custom field choice labels

* Restore ArrayColumn

* Misc cleanup

* Change extra_choices back to a nested ArrayField to preserve choice ordering

* Hack to bypass GraphQL API test utility absent support for nested ArrayFields
2023-07-28 11:24:21 -04:00
Jeremy Stretch
1ab8477642 Closes #12988: Introduce custom field choice sets (#13195)
* Initial work on custom field choice sets

* Rename choices to extra_choices (prep for #12194)

* Remove CustomField.choices

* Add & update tests

* Clean up table columns

* Add order_alphanetically boolean for choice sets

* Introduce ArrayColumn for choice lists

* Show dependent custom fields on choice set view

* Update custom fields documentation

* Introduce ArrayWidget for more convenient editing of choices

* Incorporate PR feedback

* Misc cleanup
2023-07-19 10:26:24 -04:00
Abhimanyu Saharan
ec5b140237 Adds bulk import for journal entry (#12485)
* adds bulk import for journal entry #12122

* lint fix

* Add kind as CSVChoiceField on JournalEntryImportForm

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-05-05 09:57:09 -04:00
Jeremy Stretch
8e9ddd0189 Closes #12246: General cleanup of utilities modules
* Clean up base modules

* Clean up forms modules

* Clean up templatetags modules

* Replace custom simplify_decimal filter with floatformat

* Misc cleanup

* Merge ReturnURLForm into ConfirmationForm

* Clean up import statements for utilities.forms

* Fix field class references in docs
2023-04-14 10:33:53 -04:00
Arthur
1a1d6cca7a 8749 clone custom fields 2023-03-14 15:44:16 -04:00
jeremystretch
9388a7370c Add type_job_start & type_job_end to Webhook 2023-03-07 18:01:32 -05:00
Jeremy Stretch
86690d83a1 Closes #11559: Implement config template rendering (#11769)
* WIP

* Add config_template field to Device

* Pre-fetch referenced templates

* Correct up_to_date callable

* Add config_template FK to Device

* Update & merge migrations

* Add config_template FK to Platform

* Add tagging support for ConfigTemplate

* Catch exceptions when rendering device templates in UI

* Refactor ConfigTemplate.render()

* Add support for returning plain text content

* Add ConfigTemplate model documentation

* Add feature documentation for config rendering
2023-02-19 20:09:52 -05:00
jeremystretch
e5f3ff8ff9 #4347: Rename NetBoxModelCSVForm to NetBoxModelImportForm 2022-11-15 12:24:57 -05:00
jeremystretch
6f4e5eae07 #9623: Add slug field to SavedFilter 2022-11-15 10:44:12 -05:00
Arthur
b06845e666 10300 initial translation support use gettext 2022-11-11 08:47:29 -05:00
Jeremy Stretch
687f342496 Closes #9623: Implement saved filters (#10801)
* Initial work on saved filters

* Return only enabled/shared filters

* Add tests

* Clean up filtering of usable SavedFilters
2022-11-02 12:27:53 -04:00
jeremystretch
f8424ddefc Closes #10761: Enable associating an export template with multiple object types 2022-10-26 13:30:45 -04:00
jeremystretch
42b4660b77 Closes #8274: Enable associating a custom link with multiple object types 2022-10-26 11:39:26 -04:00
Jeremy Stretch
68cf700a3e Closes #10560: New global search (#10676)
* Initial work on new search backend

* Clean up search backends

* Return only the most relevant result per object

* Clear any pre-existing cached entries on cache()

* #6003: Implement global search functionality for custom field values

* Tweak field weights & document guidance

* Extend search() to accept a lookup type

* Move get_registry() out of SearchBackend

* Enforce object permissions when returning search results

* Add indexers for remaining models

* Avoid calling remove() on non-cacheable objects

* Use new search backend by default

* Extend search backend to filter by object type

* Clean up search view form

* Enable specifying lookup logic

* Add indexes for value field

* Remove object type selector from search bar

* Introduce SearchTable and enable HTMX for results

* Enable pagination

* Remove legacy search backend

* Cleanup

* Use a UUID for CachedValue primary key

* Refactoring search methods

* Define max search results limit

* Extend reindex command to support specifying particular models

* Add clear() and size to SearchBackend

* Optimize bulk caching performance

* Highlight matched portion of field value

* Performance improvements for reindexing

* Started on search tests

* Cleanup & docs

* Documentation updates

* Clean up SearchIndex

* Flatten search registry to register by app_label.model_name

* Clean up search backend classes

* Clean up RestrictedGenericForeignKey and RestrictedPrefetch

* Resolve migrations conflict
2022-10-21 13:16:16 -04:00
jeremystretch
fb7848ac67 Fixes #10333: Show available values for ui_visibility field of CustomField for CSV import 2022-09-12 10:36:19 -04:00
jeremystretch
898a362f0d Merge branch 'develop' into feature 2022-05-31 15:50:23 -04:00
jeremystretch
fa83afe215 Fixes #9425: Fix bulk import for object and multi-object custom fields 2022-05-31 11:37:30 -04:00
jeremystretch
b10ee60dee Changelog & cleanup for #9166 2022-05-24 16:39:05 -04:00
kkthxbye
e4f967e7c6 #9166 - Add UI Visibility setting for custom fields 2022-05-24 10:12:32 +02:00
jeremystretch
4c32f23d10 Closes #8495: Enable custom field grouping 2022-04-15 14:45:28 -04:00
jeremystretch
108644262b Closes #8296: Allow disabling custom links 2022-01-10 12:11:37 -05:00