Compare commits

...

16 Commits

Author SHA1 Message Date
Ariel Rin
b17b1f7504 Version Bump 4.0.1 2024-03-21 19:34:02 +10:00
Ariel Rin
7081fc0e76 Merge branch 'docs' into 'master'
Documentation

See merge request allianceauth/allianceauth!1610
2024-03-21 09:17:43 +00:00
Ariel Rin
68e4574f19 Merge branch 'analytics' into 'master'
Pass Version to analytics user properties

See merge request allianceauth/allianceauth!1612
2024-03-21 09:12:53 +00:00
Ariel Rin
e6e0a70012 Pass Version to analytics user properties 2024-03-21 09:12:53 +00:00
Ariel Rin
13e38da942 Merge branch 'timers-row-background' into 'master'
[CHANGE] Restore the "old" color coding in table rows

See merge request allianceauth/allianceauth!1611
2024-03-21 09:12:25 +00:00
Peter Pfeufer
468c1de26b [CHANGE] restore the "old" color coding in table rows 2024-03-20 19:22:03 +01:00
Ariel Rin
22ef5ac0e5 raw file contents incase someone wgets 2024-03-16 15:44:39 +10:00
Ariel Rin
ef2dc08958 Version Bump 4.0.0 2024-03-16 14:17:29 +10:00
Ariel Rin
6b84ffa16c update pre-commit 2024-03-16 14:16:50 +10:00
Ariel Rin
d7a1096413 Merge branch 'translations_7f31a07ccd4e4a66b1dd7b6bc2dbddb5' into 'master'
Updates for project Alliance Auth

See merge request allianceauth/allianceauth!1595
2024-03-16 04:08:52 +00:00
Ariel Rin
93b94a8bc2 Updates for project Alliance Auth 2024-03-16 04:08:52 +00:00
Ariel Rin
9a95716105 Merge branch 'nav-active-passthrough' into 'master'
[Enhancement] Keep menu folders open when a sub item is active

See merge request allianceauth/allianceauth!1608
2024-03-16 04:00:06 +00:00
Aaron Kable
dbfcf5d87a [Enhancement] Keep menu folders open when a sub item is active 2024-03-16 04:00:06 +00:00
Ariel Rin
105d7d53b3 Merge branch 'no-perm-folders' into 'master'
[FIX] Hide empty folders in menu

See merge request allianceauth/allianceauth!1607
2024-03-16 03:59:54 +00:00
Aaron Kable
01cefe1457 [FIX] Hide empty folders in menu 2024-03-16 03:59:54 +00:00
Ariel Rin
7fe3db8017 drop pypy testing 2024-03-13 21:44:48 +10:00
32 changed files with 9955 additions and 6344 deletions

View File

@@ -5,7 +5,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
# Identify invalid files
- id: check-ast
@@ -54,7 +54,7 @@ repos:
)
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
rev: 2.7.3
hooks:
- id: editorconfig-checker
exclude: |
@@ -67,19 +67,19 @@ repos:
)
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v3.15.1
hooks:
- id: pyupgrade
args: [ --py38-plus ]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.14.0
rev: 1.16.0
hooks:
- id: django-upgrade
args: [--target-version=4.2]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.3.0
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
args: [ --include-version-classifiers ]

View File

@@ -5,7 +5,7 @@ manage online service access.
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
__version__ = '4.0.0rc1'
__version__ = '4.0.1'
__title__ = 'Alliance Auth'
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
NAME = f'{__title__} v{__version__}'

View File

@@ -9,6 +9,8 @@ from .utils import (
install_stat_tokens,
install_stat_users)
from allianceauth import __version__
logger = logging.getLogger(__name__)
BASE_URL = "https://www.google-analytics.com"
@@ -139,7 +141,7 @@ def send_ga_tracking_celery_event(
'client_id': AnalyticsIdentifier.objects.get(id=1).identifier.hex,
"user_properties": {
"allianceauth_version": {
"value": "allianceauth_version"
"value": __version__
}
},
'non_personalized_ads': True,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
{% endif %}>
</i>
<a
class="nav-link flex-fill align-self-center me-auto"
class="nav-link flex-fill align-self-center me-auto {% if item.navactive %}{% navactive request item.navactive|join:' ' %}{% endif %}"
{% if item.is_folder %}
type="button"
data-bs-toggle="collapse"

View File

@@ -10,7 +10,7 @@
<ul id="sidebar-menu" class="navbar-nav flex-column mb-auto overflow-auto pt-2">
<li class="d-flex flex-wrap m-2 p-2 pt-0 pb-0 mt-0 mb-0 me-0 pe-0">
<i class="nav-link fas fa-tachometer-alt fa-fw align-self-center me-3 {% navactive request 'authentication:dashboard' %}"></i>
<a class="nav-link flex-fill align-self-center" href="{% url 'authentication:dashboard' %}">
<a class="nav-link flex-fill align-self-center {% navactive request 'authentication:dashboard' %}" href="{% url 'authentication:dashboard' %}">
{% translate "Dashboard" %}
</a>
</li>

View File

@@ -98,6 +98,10 @@ def render_menu(request: HttpRequest) -> List[RenderedMenuItem]:
if item.is_app_item:
rendered_item = _render_app_item(request, hook_items, item, bs5_template)
if rendered_item.html == "":
# If there is no content dont render it.
# This item has probably been hidden by permissions
continue
elif item.is_link_item:
rendered_item = _render_link_item(request, item, bs5_template)
elif item.is_folder:

View File

@@ -19,6 +19,11 @@ def create_user(permissions=None, **kwargs) -> User:
return user
def create_menu_item_hook_class(**kwargs) -> MenuItemHook:
num = next(counter_menu_item_hook)
return type(f"GeneratedMenuItem{num}", (MenuItemHook,), {})
def create_menu_item_hook(**kwargs) -> MenuItemHook:
num = next(counter_menu_item_hook)
new_class = type(f"GeneratedMenuItem{num}", (MenuItemHook,), {})

View File

@@ -14,6 +14,7 @@ from allianceauth.menu.tests.factories import (
create_folder_menu_item,
create_link_menu_item,
create_menu_item_from_hook,
create_menu_item_hook_class,
create_menu_item_hook_function,
create_rendered_menu_item,
)
@@ -177,6 +178,44 @@ class TestRenderDefaultMenu(TestCase):
self.assertEqual(menu[0].menu_item.text, "Alpha")
self.assertEqual(menu[1].menu_item.text, "Bravo")
def test_should_remove_empty_folders_with_items_hidden(self, mock_get_hooks):
# given
class TestHook(create_menu_item_hook_class()):
text = "Dummy App No Data"
classes = "fa-solid fa-users-gear"
url_name = "groupmanagement:management"
def render(Self, request):
# simulate no perms
return ""
params = {
"text": "Alpha",
"classes": "fa-solid fa-users-gear",
"url_name": "groupmanagement:management",
}
alpha = TestHook(**params)
hooks = [lambda: alpha]
mock_get_hooks.return_value = hooks
folder = create_folder_menu_item(text="Folder", order=2)
create_menu_item_from_hook(hooks[0], parent=folder)
create_link_menu_item(text="Bravo", order=3) # this is all that should show
request = self.factory.get("/")
# when
result = render_menu(request)
# then
menu = list(result)
self.assertEqual(len(menu), 1)
self.assertEqual(menu[0].menu_item.text, "Bravo")
def test_should_not_include_hidden_items(self, mock_get_hooks):
# given
mock_get_hooks.return_value = []
@@ -196,7 +235,6 @@ class TestRenderDefaultMenu(TestCase):
self.assertEqual(menu[1].menu_item.text, "Charlie")
def test_should_not_render_hidden_folders(self, mock_get_hooks):
# given
# given
menu = [
create_menu_item_hook_function(text="Charlie", count=42),

View File

@@ -98,23 +98,27 @@
<script>
(() => {
// TODO Extend this to the groups in the sidebar too.
// TODO Move to own JS file
const sidebar = document.getElementById('sidebar');
sidebar.addEventListener("shown.bs.collapse", () => {
localStorage.removeItem("sidebar_" + sidebar.id);
sidebar.addEventListener('shown.bs.collapse', () => {
localStorage.removeItem('sidebar_' + sidebar.id);
});
sidebar.addEventListener("hidden.bs.collapse", () => {
localStorage.setItem("sidebar_" + sidebar.id, true);
sidebar.addEventListener('hidden.bs.collapse', () => {
localStorage.setItem('sidebar_' + sidebar.id, 'closed');
});
if (localStorage.getItem("sidebar_" + sidebar.id) === "true") {
sidebar.classList.remove("show")
if (localStorage.getItem('sidebar_' + sidebar.id) === 'closed') {
sidebar.classList.remove('show')
} else {
sidebar.classList.add("show")
}
const activeChildMenuItem = document.querySelector('#sidebar-menu li ul li a.active');
if (activeChildMenuItem) {
activeChildMenuItem.parentElement.parentElement.classList.add('show');
}
})();
</script>

View File

@@ -19,9 +19,9 @@
{% for timer in timers %}
{% if timer.important == True %}
<tr class="danger">
<tr class="table-danger">
{% else %}
<tr class="info">
<tr class="table-info">
{% endif %}
<td style="width: 150px;" class="text-center">

View File

@@ -1,7 +1,7 @@
PROTOCOL=https://
AUTH_SUBDOMAIN=%AUTH_SUBDOMAIN%
DOMAIN=%DOMAIN%
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.0.0rc1
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.0.1
# Nginx Proxy Manager
PROXY_HTTP_PORT=80

View File

@@ -1,5 +1,5 @@
FROM python:3.11-slim
ARG AUTH_VERSION=v4.0.0rc1
ARG AUTH_VERSION=v4.0.1
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
ENV AUTH_USER=allianceauth
ENV AUTH_GROUP=allianceauth

View File

@@ -23,7 +23,7 @@ Take a complete backup of your local.py, docker-compose and SQL database.
`docker compose down`
Replace your conf/nginx.conf with the contents of <https://gitlab.com/allianceauth/allianceauth/-/blob/v4.x/docker/conf/nginx.conf>
Replace your conf/nginx.conf with the contents of <https://gitlab.com/allianceauth/allianceauth/-/raw/v4.x/docker/conf/nginx.conf>
Replace your docker-compose.yml with the contents of <https://gitlab.com/allianceauth/allianceauth/-/raw/v4.x/docker/docker-compose.yml>

View File

@@ -2,7 +2,7 @@
isolated_build = True
skipsdist = true
usedevelop = true
envlist = py{38,39,310,311,312,py}-{all,core}, docs
envlist = py{38,39,310,311,312}-{all,core}, docs
[testenv]
setenv =
@@ -14,7 +14,6 @@ basepython =
py310: python3.10
py311: python3.11
py312: python3.12
pypy: pypy3
deps=
coverage
install_command = pip install -e ".[test]" -U {opts} {packages}