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

1789 Commits

Author SHA1 Message Date
6f6d483ca5 Merge branch 'feature' into 15277-object-types 2024-03-05 08:52:07 -05:00
4533c8dae0 Rename sequences for ObjectType M2M tables 2024-03-04 12:17:32 -05:00
0e89f46601 #15277: Clean up references to object types in templates 2024-03-04 11:49:39 -05:00
0419a69ae8 Clean up outdated references to ContentType 2024-03-04 10:46:34 -05:00
d538010069 Add GraphQL type for ObjectType 2024-03-04 10:06:28 -05:00
570f64784f Update Tag.object_types to reference ObjectType 2024-03-04 09:51:32 -05:00
e0165539b3 Rename ImageAttachment.content_type to object_type 2024-03-04 08:33:44 -05:00
ce6b2666a9 Rename SavedFilter.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
bef17e5a95 Rename ExportTemplate.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
e51d71d7e6 Rename EventRule.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
ba514aceac Rename CustomLink.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
aeeec284a5 Rename CustomField.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
0df68bf291 Rename ContentType proxy model to ObjectType 2024-03-04 08:33:44 -05:00
78e284c14f Initialize dynamically-resolved serializers with nested=True 2024-02-27 14:56:36 -05:00
ca56c8b9ef Add dynamic nesting support to SerializedPKRelatedField 2024-02-27 14:00:42 -05:00
c382ba0ae0 Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
c146f5e1b5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
d042e6f69d Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
3f3bcc5eb5 Closes #15235: Use primary serializers for REST API "brief" mode (#15246)
* Use primary serializers for brief mode

* Remove BriefModeMixin

* Correct ModuleBayTest brief_fields (see #15243)
2024-02-23 14:21:25 -05:00
ca2ee436a0 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
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
5f159795dd Closes #15042: Move model registration logic to AppConfigs (#15203)
* Closes #15042: Move model registration logic to AppConfigs

* Refactor register_model() to accept multiple models
2024-02-21 14:22:13 -05:00
a3b8262ab0 Added index on cachevalue (#15199)
* added index on cachevalue #14966

* Update netbox/extras/models/search.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* fixed migration

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-21 13:20:55 -05:00
dbcd713fe7 Fixes #15090: Run deletion protection rules prior to enqueueing events 2024-02-20 13:22:55 -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
bd7d4a3f34 Fixes #14079: Explicitly remove M2M assignments to objects being deleted to ensure change logging 2024-02-16 11:42:27 -05:00
7abb2b2ab5 Closes #15131: Dynamic queryset annotations for REST API endpoints (#15152)
* Introduce RelatedObjectCountField

* Introduce get_annotations_for_serializer() and enable dynamic annotations

* Add RelatedObjectCountFields to serializers; remove static annotations from querysets

* Remove annotations cleanup logic from BriefModeMixin

* Annotate type for RelatedObjectCountField

* Remove redundant field on TagSerializer

* Add missing reverse relationship for power feeds to rack

* Refactor RelatedObjectCountField to take a single relationship name
2024-02-15 14:49:27 -05:00
b3f25a400b Closes #15087: Support for specifying a subset of API serializer fields (#15122)
* Enable dynamic field inclusion for REST API serializers

* Recurse through nested serializer when resolving prefetches

* Remove obsolete calls to prefetch_related() for API views

* Remove support for brief_prefetch_fields viewset attribute

* Rename query parameter

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode (#15134)

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode

* Update API test

* Restore get_queryset() on BriefModeMixin, minus prefetch logic

* get_prefetches_for_serializer() should reference serializer field source if set
2024-02-14 09:28:37 -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
11697d19a6 12510 Merge Scripts and Reports (#14976)
* 12510 move reports to use BaseScript

* 12510 merge report into script view

* 12510 add migration for job report to script

* 12510 update templates

* 12510 remove reports

* 12510 cleanup

* 12510 legacy jobs

* 12510 legacy jobs

* 12510 fixes

* 12510 review changes

* 12510 review changes

* 12510 update docs

* 12510 review changes

* 12510 review changes

* 12510 review changes

* 12510 review changes

* 12510 main log results to empty string

* 12510 move migration

* Introduce an internal log level for debug to simplify Script logging

* Misc cleanup

* Remove obsolete is_valid() method

* Reformat script job data (log, output, tests)

* Remove ScriptLogMessageSerializer

* Fix formatting of script logs

* Record a timestamp with script logs

* Rename _current_method to _current_test

* Clean up template

* Remove obsolete runreport management command

* Misc cleanup & refactoring

* Clean up template

* Clean up migration

* Clean up docs

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-07 12:02:09 -05:00
74e67afa41 Merge branch 'develop' into feature 2024-02-05 14:38:26 -05:00
0eba3acdb8 Closes: #14570 - Remove extra query for job under scripts and reports detailed view (#14998)
* Closes: #14570 - Remove extra query for job under scripts and reports detailed view

* Add report.result back as it is used by report.html
2024-02-05 12:13:03 -05:00
31fb6961e9 14947 fix for missing changelog if only update m2m (#14986)
* 14947 fix for missing changelog if only update m2m

* 14947 review change

* 14947 DRY save logic

* 14947 DRY save logic

* Refactor logic

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-05 09:52:10 -05:00
59510b4bd0 Issue #14962 VM to merge directly related site context (#14992)
* Issue #14962 VM to merge directly related site context

* Cleanup & rewrite test

---------

Co-authored-by: Chris Carter <chris.carter@spinlocksecurity.com>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-02 10:16:07 -05:00
b554e70eda Squash migrations 2024-01-25 12:35:04 -05:00
487f1ccfde Fixes #14703: Catch exceptions when rendering dashboard and revert to default 2024-01-24 17:19:07 -05:00
23e201cec6 Fixes #14905: Fix miscellaneous errors with string translations 2024-01-24 17:05:02 -05:00
d606749335 Fixes #14892: Omit username when running report/script via command line 2024-01-22 15:52:03 -05:00
fd5392563f Fixes #14572 - Constrains JobView (and related views) badge to specific named job (#14754)
* Fixes #14572 - Constrains JobView (and related views) badge to specific named job

* Adjust report views to resolve same problem

* Fixed PEP8 error

* Update netbox/templates/extras/script/base.html

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Move function to method on PythonModuleMixin

* Update netbox/extras/views.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Update netbox/extras/views.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Update netbox/extras/views.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Update netbox/extras/views.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Update to mixin and view

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-01-22 14:01:53 -05:00
222388b988 Revert "Closes #13647: Squash all migrations prior to v3.7 (#14853)"
This reverts commit 874685fd6f6b463e68fd2eef4711aa6765371a17.
2024-01-22 13:15:43 -05:00
1d41a8ace5 Closes #14735: Implement django-htmx (#14873)
* Install django-htmx

* Replace is_htmx() function with request.htmx

* Remove is_embedded() HTMX utility

* Include django-htmx debug error handler
2024-01-22 12:09:15 -05:00
48168de4ff Fixes #14755: ValueError in web UI after REST API accepts invalid cus… (#14804)
* Fixes #14755: ValueError in web UI after REST API accepts invalid custom-field choice-set data

* PR Comments Addressed

* Set max_length=2 on extra_choices items; remove custom validation logic

* Move test for invalid choices to CustomFieldChoiceSetTest

* Omit unused imports

---------

Co-authored-by: julio.oliveira <julio.oliveira@alertmedia.com>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-01-19 15:24:08 -05:00
a87d76ad17 Fixes user delete when they have a bookmark (#14867)
* fixes user delete when they have a bookmark #14851

* Include migration for user field

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-01-19 15:23:20 -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
874685fd6f Closes #13647: Squash all migrations prior to v3.7 (#14853)
* Regenerate pre-v3.7 migrations

* Annotate replaced migrations

* Rename dependencies; remove FeatureQuery references

* Add missed replacement
2024-01-19 13:55:22 -05:00
ef5e10d360 14728 Move installed plugins list from admin UI to NetBox UI (#14768)
* 14728 move plugins view from admin

* 14728 move plugins view from admin

* 14728 remove plugins view from admin

* Update template for #12128

* 14728 review fixes

* 14728 review fixes

* 14728 review fixes

* 14728 review fixes

* 14728 configure table

* Clean up table columns

* Fix app config lookup for plugins referenced by dotted path

* Move template; fix table display

* Fix user table configuration

* Remove nonfunctional quick search

* Limit PluginListView to staff users

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-01-19 11:27:15 -05:00
66db4f3874 Fixes #14827: Ensure all matching event rules are processed in response to an event 2024-01-17 14:09:06 -05:00
70dd8f17b6 Fixes #14778: Allow null values in CustomFieldSerializer object_type & choice_set fields 2024-01-16 13:08:02 -05:00
58227293f3 14637 update to Django 5 (#14675)
* 14637 update to Django 5

* 14637 fix tests

* 14637 remove extra assignment

* Syntax tweak

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-01-05 13:30:04 -05:00