1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Commit Graph

197 Commits

Author SHA1 Message Date
46bd62fdc9 Merge branch 'develop' into feature 2024-04-22 13:23:42 -04:00
e87877b6ea Fixes #15771: Show id field as supported on all bulk import forms 2024-04-22 11:08:36 -04:00
6ac700e43f Move object_type_identifier() & object_type_name() to utilities.object_types 2024-03-22 08:59:52 -04:00
8ad73e3f90 Rename content_type_identifier() and content_type_name() 2024-03-22 08:59:52 -04:00
3547ea376c Move utilities.utils.get_viewname() to utilities.views 2024-03-22 08:59:52 -04:00
a9bb4c5c3e Move choice sets from utilities.choices to netbox.choices 2024-03-22 08:59:52 -04:00
32edb8dfe6 Misc cleanup & documentation for FieldSets 2024-03-19 13:34:13 -04:00
72d3c17b48 Use FieldSet instances for all forms 2024-03-19 13:34:13 -04:00
3b28e8e615 Refactor form rendering components & add docstrings 2024-03-19 13:34:13 -04:00
8f03a19b5f Introduce ObjectAttribute for displaying read-only instance attributes on forms 2024-03-19 13:34:13 -04:00
4c7b6fcec0 Enable tabbed group fields in fieldsets 2024-03-19 13:34:13 -04:00
f585c36d86 Introduce InlineFields for rendering fields side-by-side 2024-03-19 13:34:13 -04:00
78bd7dec48 Merge branch 'develop' into feature 2024-03-15 12:32:54 -04:00
1ff4e1287f Fixes: #13722 - Correct range expansion code when a numeric set is used (#15301)
* Fixes: #13722 - Correct range expansion code when a numeric set is used

* Correct to my own suggestion

* Clean up logic

* Simplify range detection

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-03-11 10:50:10 -04:00
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
276a73f820 #15094: Fix missing format variable 2024-02-21 14:06:01 -05:00
d8fb5a819f fixed json field save issue #14689 2024-02-21 14:00:34 -05:00
af27bf5eff 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
20824ceb25 Closes #13283: Add context to dropdown options (#15104)
* Initial work on #13283

* Enable passing TomSelect HTML template attibutes on DynamicModelChoiceField

* Merge disabled_indicator into option_attrs

* Add support for annotating a numeric count on dropdown options

* Annotate parent object on relevant fields

* Improve rendering of color options

* Improve rendering of color options

* Rename option_attrs to context

* Expose option context on ObjectVar for custom scripts

* Document dropdown context variables
2024-02-13 16:31:17 -05:00
d63e1dacbf Closes #14917: Replace slim-select with tom-select (#15080)
* Experimenting

* Remove testing resources

* Replace ApiSelect with TomSelect

* Add color support

* Add clear button

* Clear cached options when searching dynamic selects

* Add support for static parameters

* Refactor TomSelect implementation

* Add dynamic parameter support

* Limit number of options to 100

* Remove redundant api_url definitions for user model

* Add support for disabled indicator

* Remove obsolete value-field attr on dynamic select widgets

* Remove obsolete fetch_trigger kwarg from dynamic model choice widgets

* Remove obsolete empty_label kwarg from dynamic model choice widgets

* Add support for API path variables

* Add support for setting a 'null' option

* Annotate depth for recursive hierarchies

* Misc cleanup

* Remove obsolete APISelect code

* Remove slim-select & just-debounce-it

* Clean up type validation

* Closes #14237: Clear child selections on change to parent selection

* Use an MD icon for the clear button

* Use an MD icon for the clear button

* Explain why noUnusedParameters is disabled
2024-02-08 15:07:04 -05:00
74e67afa41 Merge branch 'develop' into feature 2024-02-05 14:38:26 -05:00
d302982a88 Fix left padding of login button in top menu
Clean up spacing for nav pills

Markdown fields should default to using monospace font

Wrap action buttons in object page header

Fix page link style for non-HTMX paginators

Clean up styling of Markdown preview widget

Fix spacing around placeholder text for empty panel tables

Remove obsolete templates

Tweak checkbox input spacing

Fix toggling of clear button for quick search

Fix positioning of quick search filter dropdown

Fix positioning of 'highlight device' button

Fix styling for custom field group names

Widen buttons on nav menu items

Restyle the login page

Fix active nav-pill background color in dark mode

Fix spacing around 'map' button for sites
2024-01-31 17:59:14 -05:00
481d16de08 Fixes #14838: JSONField should treat initial form data as JSON 2024-01-24 17:18:17 -05:00
da085e60c2 Closes #14740: Remove BootstrapMixin (#14841)
* Introduce custom form widget templates to apply CSS classes

* Apply both mandatory and optional CSS classes to form widgets

* Omit required & placeholder attrs

* Move annotation of field validation failures to CSS

* Remove BootstrapMixin class

* Remove obsolete ComponentTemplateImportForm class

* Remove obsolete custom forms for login & password change

* Clean up obsolete accommodations for 'required' widget attr
2024-01-19 14:02:33 -05:00
1f2f0860fe Merge branch 'develop' into feature 2023-12-27 16:34:38 -05:00
113c60a44a Fixes #13909: Ignore empty choices when populating dynamic choice fields from initial data 2023-12-27 14:32:40 -05:00
25e67eb555 Merge branch 'develop' into feature 2023-12-15 16:52:42 -05:00
6939ae4a47 14467 change ChoiceField separator from comma to colon (#14469)
* 14467 change ChoiceField separator from comma to colon

* 14467 fix test

* 14467 fix test

* 14467 use regex for colon detection

* 14467 update tests
2023-12-12 14:31:39 -05:00
a38a38218b 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
fc7d6e1387 Fixes #14325: Ensure expanded numeric arrays are ordered (#14370)
* Fixes #14325: Ensure expanded numeric arrays are ordered

* Remove redundant casting to
2023-11-28 17:04:10 -05:00
ae4ea3443e Fixes #11617: Check for invalid CSV headers during bulk import (#13826)
* Fixes #11617: Check for invalid CSV headers during bulk import

* Add test for CSV import header validation
2023-09-20 14:40:27 -04:00
79bf12a8fe 13791 rename whitespace fix (#13793)
* Add test for bug #13791
https://github.com/netbox-community/netbox/issues/13791

* Fix #13791 by disabling striping on find and replace fields of BulkRenameForm
2023-09-18 08:33:29 -04:00
b7cfb2f7d9 Adds csv dialect detection to bulk import view (#13563)
* adds csv dialect detection to bulk import view #13239

* adds sane delimiters for dialect detection #13239

* adds csv delimiter tests #13239

* adds csv delimiter on the form

* pass delimiter to clean_csv method #13239

* fix tests for csv import #13239

* fix tests for csv import #13239

* fix tests for csv import #13239

* fix tests for csv import #13239

* Improve auto-detection of import data format

* Misc cleanup

* Include tab as a supported delimiting character for auto-detection

* Move delimiting chars to a separate constant for easy reference

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-09-12 16:48:40 -04:00
44f8a777df Merge branch 'develop' into feature 2023-08-15 11:04:03 -04:00
5de9d3f15f Fixes #12639 - Make sure name expansions throws a validation error on decrementing ranges (#13326)
* Fixes #12639 - Make sure name expansions throws a validation error on decrementing ranges

* Fix pep8

* Also fail on equal start & end values

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-11 11:53:16 -04:00
f255fe507d Fixes #13410: Fix rendering of custom choice fields with large numner of choices 2023-08-08 09:32:56 -04:00
43e6308d90 Closes #11732: Protect against errant overwriting of data via web UI forms 2023-08-01 09:06:51 -04:00
b7a9649269 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
2a0d76d564 Merge branch 'develop' into feature 2023-07-30 13:36:51 -04:00
0b10131564 Satisfy PEP8 E721 linter complaints 2023-07-30 13:34:08 -04:00
cf1b1a83eb 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
96ea0ac9c7 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
02db0bcc2e Closes #11766: Remove obsolete custom ChoiceField and MultipleChoiceField classes 2023-05-12 16:27:50 -04:00
b7f028fba3 Fixes #12550: Fix rear port selection widget under front port creation form 2023-05-10 10:44:01 -04:00
c08c7dda50 Closes #12292: Replace SelectSpeedWidget and SelectDurationWidget with NumberWithOptions 2023-04-18 16:33:43 -04:00
b807198e6d Rename ImportForm to BulkImportForm 2023-04-18 15:27:05 -04:00
9caa7f6b7c Move SyncedDataMixin from extras to core 2023-04-18 15:18:19 -04:00
d470848b29 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
08017c51f6 Merge branch 'develop' into feature 2023-04-07 13:00:00 -04:00
63a0ec7a79 Fixes #12190: Fix form layout for plugin textarea fields 2023-04-07 10:03:47 -04:00