Commit Graph

357 Commits

Author SHA1 Message Date
Jeremy Stretch
49dab05578 Dissuade non-superusers from creating API tokens via the admin view 2024-04-19 14:34:25 -04:00
Jeremy Stretch
625f5e2bd1 Fixes #15698: Drop and recreate FK constraints on ObjectPermission M2M tables 2024-04-19 08:17:19 -04:00
Jeremy Stretch
46d8375165 Fixes #15695: Clear any legacy group permission associations during migration 2024-04-16 16:20:00 -04:00
Jeremy Stretch
42b838b5fa Update API test for Group model 2024-04-02 16:33:12 -04:00
Jeremy Stretch
6594d8b7d3 Prevent the stock Django Group model from appearing in the admin UI (if enabled) 2024-04-02 15:48:40 -04:00
Jeremy Stretch
97db8507ff Include description field on Group serializer 2024-04-02 15:41:44 -04:00
Jeremy Stretch
56afcfc218 Refactor models under users app 2024-04-02 15:06:05 -04:00
Jeremy Stretch
de11ea5282 #12795: Complete support for description field on custom Group model 2024-04-02 14:44:26 -04:00
Jeremy Stretch
5ba59d3385 Fix ordering of Groups 2024-04-02 08:31:53 -04:00
Jeremy Stretch
7e419163b9 Closes #15464: Move permission assignments to user & group models (#15554)
* Move user & group M2M assignments for ObjectPermission

* Restore users & groups fields on ObjectPermission serializer
2024-03-29 14:57:16 -04:00
Arthur Hanson
cc979e110f 15553 change graphql sub-queries from functions to types (#15557)
* 15553 change graphql list to types

* 15553 review changes
2024-03-29 14:54:31 -04:00
Jeremy Stretch
6dc7b332b5 Closes #14736: Enable HTMX navigation globally (#15158)
* Enable HTMX boosting

* Refactor HTMX properties for tables

* Fix dashboard object list widget

* Disable scrolling to page content

* Fix initialization of TomSelect dropdowns after HTMX loading

* Replace formaction properties with hx-post

* Fix quick search field on object list view

* Reinitialize copy-to-clipboard buttons upon HTMX load

* Disable scrolling effect for intra-page navigation

* Introduce user preference for toggling HTMX navigation

* Enable HTMX navigation only when selected by user

* Pass htmx_navigation context

* Fix display of confirmation form when deleting an object

* Disable HTMX boosting for rack elevation SVG downloads

* Fix dyanmic form rendering

* Introduce htmx_boost template tag; enable HTMX for user menu

* Use out-of-band sap to update footer stamp

* Fix display of toasts after form submission

* Fix user preference selection

* Misc cleanup

* Rename render_partial() to htmx_partial()

* Add docstring to htmx_boost template tag

* Disable HTMX for user preferences form to force a full page refresh on changes
2024-03-28 11:51:38 -04:00
Arthur Hanson
d166f577e1 9856 Replace graphene with Strawberry (#15141)
* 9856 base strawberry integration

* 9856 user and group

* 9856 user and circuits base

* 9856 extras and mixins

* 9856 fk

* 9856 update strawberry version

* 9856 update imports

* 9856 compatability fixes

* 9856 compatability fixes

* 9856 update strawberry types

* 9856 update strawberry types

* 9856 core schema

* 9856 dcim schema

* 9856 extras schema

* 9856 ipam and tenant schema

* 9856 virtualization, vpn, wireless schema

* 9856 fix old decorator

* 9856 cleanup

* 9856 cleanup

* 9856 fixes to circuits type specifiers

* 9856 fixes to circuits type specifiers

* 9856 update types

* 9856 GFK working

* 9856 GFK working

* 9856 _name

* 9856 misc fixes

* 9856 type updates

* 9856 _name to types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 update types

* 9856 GraphQLView

* 9856 GraphQLView

* 9856 fix OrganizationalObjectType

* 9856 single item query for schema

* 9856 circuits graphql tests working

* 9856 test fixes

* 9856 test fixes

* 9856 test fixes

* 9856 test fix vpn

* 9856 test fixes

* 9856 test fixes

* 9856 test fixes

* 9856 circuits test sans DjangoModelType

* 9856 core test sans DjangoModelType

* 9856 temp checkin

* 9856 fix extas FK

* 9856 fix tenancy FK

* 9856 fix virtualization FK

* 9856 fix vpn FK

* 9856 fix wireless FK

* 9856 fix ipam FK

* 9856 fix partial dcim FK

* 9856 fix dcim FK

* 9856 fix virtualization FK

* 9856 fix tests / remove debug code

* 9856 fix test imagefield

* 9856 cleanup graphene

* 9856 fix plugin schema

* 9856 fix requirements

* 9856 fix requirements

* 9856 fix docs

* 9856 fix docs

* 9856 temp fix tests

* 9856 first filterset

* 9856 first filterset

* 9856 fix tests

* 9856 fix tests

* 9856 working auto filter generation

* 9856 filter types

* 9856 filter types

* 9856 filter types

* 9856 fix graphiql test

* 9856 fix counter fields and merge feature

* 9856 temp fix tests

* 9856 fix tests

* 9856 fix tenancy, ipam filter definitions

* 9856 cleanup

* 9856 cleanup

* 9856 cleanup

* 9856 review changes

* 9856 review changes

* 9856 review changes

* 9856 fix base-requirements

* 9856 add wrapper to graphiql

* 9856 remove old graphiql debug toolbar

* 9856 review changes

* 9856 update strawberry

* 9856 remove superfluous check

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-03-22 12:56:30 -04:00
Jeremy Stretch
d0009c7dbe Move array_to_range(), array_to_string(), deepmerge(), drange(), flatten_dict(), and shallow_compare_dict() to utilities.data 2024-03-22 08:59:52 -04:00
Jeremy Stretch
c928756396 Use FieldSet instances for all forms 2024-03-19 13:34:13 -04:00
Jeremy Stretch
8c40f937b7 Extend logic for validating filter class 2024-03-11 15:35:40 -04:00
Jeremy Stretch
69f370fddc Add missing filters for reverse many-to-many relationships 2024-03-11 14:39:34 -04:00
Jeremy Stretch
a547155241 Test for missing ManyToManyField filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
4f863af698 Fix remaining tests 2024-03-11 14:39:34 -04:00
Jeremy Stretch
813ec0c7f3 Add missing filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
411862a55e Add tests for missing FilterSet filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
768e0245d6 #15357: Rename CustomField object_type to related_object_type 2024-03-11 11:49:04 -04:00
Jeremy Stretch
9134873151 Merge branch 'feature' into 15277-object-types 2024-03-05 08:52:07 -05:00
Jeremy Stretch
1fb5c9035a Merge branch 'feature' into 15278-primary-nested-serializers 2024-03-04 16:42:36 -05:00
Jeremy Stretch
b53a99cae8 Clean up outdated references to ContentType 2024-03-04 10:46:34 -05:00
Jeremy Stretch
3f9e6d1360 Update ObjectPermission.object_types to reference ObjectType 2024-03-04 09:52:45 -05:00
Jeremy Stretch
903f02ff01 Rename ContentType proxy model to ObjectType 2024-03-04 08:33:44 -05:00
Jeremy Stretch
5a40437ef2 #12795: Introduce a custom Group model (#15304)
* Rename sequences & indexes after renaming users table

* Migrate from auth.Group to a custom group model

* Delete original groups from auth_group table

* Update object & multi-object custom fields referencing the Group model

* Fix ContentType resolution

* Clean up obsolete logic for view/serializer resolution
2024-03-04 08:29:53 -05:00
Jeremy Stretch
66cc58e7d0 Add dynamic nesting support to SerializedPKRelatedField 2024-02-27 14:00:42 -05:00
Jeremy Stretch
de0427a45b Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
Jeremy Stretch
aea8c693f5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
Jeremy Stretch
5c2f7fa59c Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
Jeremy Stretch
c9a62ed6bd 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
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
Jeremy Stretch
703791326d Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
Jeremy Stretch
fd7bccb2d9 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
Zacho
58f28f44dc Added Last Login to user/profile GUI views and the /users/user API output (#15198)
* Added Last Login to user/profile GUI and user api output

* Update netbox/templates/account/profile.html

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

* Update netbox/templates/account/profile.html

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

* Update netbox/templates/users/user.html

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

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 15:43:49 -05:00
Abhimanyu Saharan
5fa0d0d163 added validation error for script and report constraint #15174 2024-02-20 14:15:27 -05:00
Jeremy Stretch
214c91a78e 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
Jeremy Stretch
028ae9d85c Fixes #15115: Fix unhandled exception with invalid permission constraints 2024-02-13 09:55:07 -05:00
Jeremy Stretch
4f01d8f70e 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
Arthur Hanson
a9facbdda2 12795 custom user model (#15005)
* 12795 users.User migration

* 12795 users.User migration

* 12795 review changes

* 12795 fix user model registration

* 12795 fix user model registration

* 12795 update migration

* 12795 update migration

* 12795 update migration

* 12795 add comment to migration db_table

* Tweak import to avoid class name collision

* 12795 add comment for _register_features requirement

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-05 13:24:03 -05:00
Jeremy Stretch
7e3c990c66 Squash migrations 2024-01-25 12:35:04 -05:00
Jeremy Stretch
c0c1c1fc2d Revert "Closes #13647: Squash all migrations prior to v3.7 (#14853)"
This reverts commit 1da6869039.
2024-01-22 13:15:43 -05:00
Jeremy Stretch
5272e9e2db 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
Jeremy Stretch
1da6869039 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
Jeremy Stretch
97ae947fcf PEP8 cleanup 2024-01-05 13:08:37 -05:00
Jeremy Stretch
0324db1c74 Merge branch 'develop' into feature 2023-12-28 14:20:04 -05:00
Jeremy Stretch
8f452486c3 Closes #14629: Add filter tests for all q and description filters 2023-12-28 13:53:16 -05:00
Jeremy Stretch
5894c93814 Closes #14579: Add user language preference 2023-12-21 14:27:52 -05:00