Skip to content

Commit b7129e1

Browse files
Merge pull request #7984 from netbox-community/develop
Release v3.0.12
2 parents 869808b + dc6decd commit b7129e1

File tree

14 files changed

+102
-25
lines changed

14 files changed

+102
-25
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v3.0.11
17+
placeholder: v3.0.12
1818
validations:
1919
required: true
2020
- type: dropdown

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v3.0.11
17+
placeholder: v3.0.12
1818
validations:
1919
required: true
2020
- type: dropdown

docs/release-notes/version-3.0.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# NetBox v3.0
22

3+
## v3.0.12 (2021-12-06)
4+
5+
### Enhancements
6+
7+
* [#7751](https://github.com/netbox-community/netbox/issues/7751) - Get API user from LDAP only when `FIND_GROUP_PERMS` is enabled
8+
* [#7885](https://github.com/netbox-community/netbox/issues/7885) - Linkify VLAN name in VLANs table
9+
* [#7892](https://github.com/netbox-community/netbox/issues/7892) - Add L22-30 power port & outlet types
10+
* [#7932](https://github.com/netbox-community/netbox/issues/7932) - Improve performance of the "quick find" function
11+
* [#7941](https://github.com/netbox-community/netbox/issues/7941) - Add multi-standard ITA power outlet type
12+
13+
### Bug Fixes
14+
15+
* [#7823](https://github.com/netbox-community/netbox/issues/7823) - Fix issue where `return_url` is not honored when 'Save & Continue' button is present
16+
* [#7981](https://github.com/netbox-community/netbox/issues/7981) - Fix Markdown sanitization regex
17+
18+
---
19+
320
## v3.0.11 (2021-11-24)
421

522
### Enhancements

netbox/dcim/choices.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ class PowerPortTypeChoices(ChoiceSet):
312312
TYPE_NEMA_L1560P = 'nema-l15-60p'
313313
TYPE_NEMA_L2120P = 'nema-l21-20p'
314314
TYPE_NEMA_L2130P = 'nema-l21-30p'
315+
TYPE_NEMA_L2230P = 'nema-l22-30p'
315316
# California style
316317
TYPE_CS6361C = 'cs6361c'
317318
TYPE_CS6365C = 'cs6365c'
@@ -417,6 +418,7 @@ class PowerPortTypeChoices(ChoiceSet):
417418
(TYPE_NEMA_L1560P, 'NEMA L15-60P'),
418419
(TYPE_NEMA_L2120P, 'NEMA L21-20P'),
419420
(TYPE_NEMA_L2130P, 'NEMA L21-30P'),
421+
(TYPE_NEMA_L2230P, 'NEMA L22-30P'),
420422
)),
421423
('California Style', (
422424
(TYPE_CS6361C, 'CS6361C'),
@@ -533,6 +535,7 @@ class PowerOutletTypeChoices(ChoiceSet):
533535
TYPE_NEMA_L1560R = 'nema-l15-60r'
534536
TYPE_NEMA_L2120R = 'nema-l21-20r'
535537
TYPE_NEMA_L2130R = 'nema-l21-30r'
538+
TYPE_NEMA_L2230R = 'nema-l22-30r'
536539
# California style
537540
TYPE_CS6360C = 'CS6360C'
538541
TYPE_CS6364C = 'CS6364C'
@@ -552,6 +555,7 @@ class PowerOutletTypeChoices(ChoiceSet):
552555
TYPE_ITA_M = 'ita-m'
553556
TYPE_ITA_N = 'ita-n'
554557
TYPE_ITA_O = 'ita-o'
558+
TYPE_ITA_MULTISTANDARD = 'ita-multistandard'
555559
# USB
556560
TYPE_USB_A = 'usb-a'
557561
TYPE_USB_MICROB = 'usb-micro-b'
@@ -630,6 +634,7 @@ class PowerOutletTypeChoices(ChoiceSet):
630634
(TYPE_NEMA_L1560R, 'NEMA L15-60R'),
631635
(TYPE_NEMA_L2120R, 'NEMA L21-20R'),
632636
(TYPE_NEMA_L2130R, 'NEMA L21-30R'),
637+
(TYPE_NEMA_L2230R, 'NEMA L22-30R'),
633638
)),
634639
('California Style', (
635640
(TYPE_CS6360C, 'CS6360C'),
@@ -651,6 +656,7 @@ class PowerOutletTypeChoices(ChoiceSet):
651656
(TYPE_ITA_M, 'ITA Type M (BS 546)'),
652657
(TYPE_ITA_N, 'ITA Type N'),
653658
(TYPE_ITA_O, 'ITA Type O'),
659+
(TYPE_ITA_MULTISTANDARD, 'ITA Multistandard'),
654660
)),
655661
('USB', (
656662
(TYPE_USB_A, 'USB Type A'),

netbox/ipam/tables/vlans.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ class VLANTable(BaseTable):
9595
template_code=VLAN_LINK,
9696
verbose_name='VID'
9797
)
98+
name = tables.Column(
99+
linkify=True
100+
)
98101
site = tables.Column(
99102
linkify=True
100103
)

netbox/netbox/api/authentication.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ def authenticate_credentials(self, key):
2929
if settings.REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend':
3030
from netbox.authentication import LDAPBackend
3131
ldap_backend = LDAPBackend()
32-
user = ldap_backend.populate_user(token.user.username)
33-
# If the user is found in the LDAP directory use it, if not fallback to the local user
34-
if user:
35-
return user, token
32+
33+
# Load from LDAP if FIND_GROUP_PERMS is active
34+
if ldap_backend.settings.FIND_GROUP_PERMS:
35+
user = ldap_backend.populate_user(token.user.username)
36+
# If the user is found in the LDAP directory use it, if not fallback to the local user
37+
if user:
38+
return user, token
3639

3740
return token.user, token
3841

netbox/netbox/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Environment setup
1818
#
1919

20-
VERSION = '3.0.11'
20+
VERSION = '3.0.12'
2121

2222
# Hostname
2323
HOSTNAME = platform.node()

netbox/project-static/dist/netbox.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netbox/project-static/dist/netbox.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netbox/project-static/src/forms/elements.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
import { getElements, scrollTo } from '../util';
1+
import { getElements, scrollTo, isTruthy } from '../util';
2+
3+
/**
4+
* When editing an object, it is sometimes desirable to customize the form action *without*
5+
* overriding the form's `submit` event. For example, the 'Save & Continue' button. We don't want
6+
* to use the `formaction` attribute on that element because it will be included on the form even
7+
* if the button isn't clicked.
8+
*
9+
* @example
10+
* ```html
11+
* <button type="button" return-url="/special-url/">
12+
* Save & Continue
13+
* </button>
14+
* ```
15+
*
16+
* @param event Click event.
17+
*/
18+
function handleSubmitWithReturnUrl(event: MouseEvent): void {
19+
const element = event.target as HTMLElement;
20+
if (element.tagName === 'BUTTON') {
21+
const button = element as HTMLButtonElement;
22+
const action = button.getAttribute('return-url');
23+
const form = button.form;
24+
if (form !== null && isTruthy(action)) {
25+
form.action = action;
26+
form.submit();
27+
}
28+
}
29+
}
230

331
function handleFormSubmit(event: Event, form: HTMLFormElement): void {
432
// Track the names of each invalid field.
@@ -38,6 +66,15 @@ function handleFormSubmit(event: Event, form: HTMLFormElement): void {
3866
}
3967
}
4068

69+
/**
70+
* Attach event listeners to form buttons with the `return-url` attribute present.
71+
*/
72+
function initReturnUrlSubmitButtons(): void {
73+
for (const button of getElements<HTMLButtonElement>('button[return-url]')) {
74+
button.addEventListener('click', handleSubmitWithReturnUrl);
75+
}
76+
}
77+
4178
/**
4279
* Attach an event listener to each form's submitter (button[type=submit]). When called, the
4380
* callback checks the validity of each form field and adds the appropriate Bootstrap CSS class
@@ -54,4 +91,5 @@ export function initFormElements(): void {
5491
submitter.addEventListener('click', (event: Event) => handleFormSubmit(event, form));
5592
}
5693
}
94+
initReturnUrlSubmitButtons();
5795
}

0 commit comments

Comments
 (0)