Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
700e209
Add a dummy template for not found tailwind classes
hmpf Mar 20, 2025
27df94b
Add function to prettyprint lists
hmpf Mar 20, 2025
c9d01f5
Fix logic in frontend timeslot save
johannaengland Mar 20, 2025
6b4d8de
Improve time recurrence __str__
hmpf Mar 20, 2025
c50386f
Add borders between table rows
podliashanyk Mar 24, 2025
df80043
Use accent color a lot less
hmpf Mar 24, 2025
2f46a6e
Deprecate API v1
hmpf Mar 25, 2025
f8b3d18
Remove validation requiring tags to exist
stveit Mar 25, 2025
ee3576d
Make status badges represent error and success across themes
podliashanyk Mar 25, 2025
83a7730
Prettify fields in timeslot form (name field)
podliashanyk Mar 20, 2025
322b6f7
Add border to time recurrences
stveit Mar 20, 2025
1df0cb0
Prettify fields in recurrence formset
podliashanyk Mar 20, 2025
6bd6288
Make days multi-select dropdown
johannaengland Mar 20, 2025
53bfd9e
Make dropdown multiselect field styles overrideable
podliashanyk Mar 20, 2025
79a178a
Prettify the days selector field
podliashanyk Mar 20, 2025
264e5e5
Use text type for timeinput
stveit Mar 20, 2025
71a83fb
Add function to describe timeslot with prose
hmpf Mar 20, 2025
b4abc22
Rearrange timeslot form
podliashanyk Mar 20, 2025
6d30b4e
Rearrange fields in timeslot time recurrence
podliashanyk Mar 20, 2025
d096083
Make all timeslot change messages end in period
johannaengland Mar 20, 2025
f5454d2
Prevent showing 'No recurrences' error on all changes
johannaengland Mar 20, 2025
f984387
Avoid going into unused loop by having different sequence names
johannaengland Mar 20, 2025
9858620
Use simpler template for timeslot name
hmpf Mar 21, 2025
17a1e50
Fix update of time recurrence
hmpf Mar 21, 2025
99871d5
Fix messaging for deletion of non-existent timeslot
hmpf Mar 21, 2025
7623926
Get rid of console warning when deleting timeslot
hmpf Mar 21, 2025
8c2add5
Make "Delete timeslot button" a modal
stveit Mar 20, 2025
61cb1b6
Show creation form for timeslot in timeslot list
podliashanyk Mar 21, 2025
832bf37
Display unsaved time recurrence differently
hmpf Mar 21, 2025
4c937ef
Use correct partial URL when updating recurrence days
podliashanyk Mar 21, 2025
783662e
Check with form for new time recurrences, not qs
hmpf Mar 24, 2025
8ede260
Add changelog fragment for cooperative coding jam session
hmpf Mar 25, 2025
9d9af88
Update styles.css after jam session
hmpf Mar 25, 2025
4a39a75
Merge branch 'improve-timeslots-page'
hmpf Mar 25, 2025
7027f34
stop
hmpf Mar 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.d/+deprecate-api-v1.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NOTE! Version v1 of the API is hereby deprecated! It *will* be removed one day.
Update your glue services, please.
2 changes: 2 additions & 0 deletions changelog.d/+improve-timeslots-page.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improved the looks and UX of the timeslots page greatly. There are still
remaining issues.
5 changes: 5 additions & 0 deletions changelog.d/+use-less-accent-color.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Several of our easily accessible users didn't like the frequent use of the
reddish color as an accent in the "argus" theme, they prefer reserving reddish
hues for extra important things. We've cut down on the accent-color everywhere:
in the incidents page we now use the primary color instead, everywhere else we
will fall back to the default for the tailwind/daisy class.
1 change: 1 addition & 0 deletions changelog.d/1253.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add borders between table rows.
1 change: 1 addition & 0 deletions changelog.d/1294.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The color of the status badges to better represent either error or success state. The colors are universal across the themes.
1 change: 1 addition & 0 deletions changelog.d/1302.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show empty list instead of error if tags do not match any incidents.
11 changes: 6 additions & 5 deletions docs/reference/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ API Endpoints
Endpoints, API v1
=================

.. warning::

v1 of the API is deprecated and will be removed.



Authorization
-------------

Expand Down Expand Up @@ -882,11 +888,6 @@ Notification profile endpoints
Endpoints, API v2
=================

.. note::

v2 of the API is not stable yet.


Authorization
-------------

Expand Down
9 changes: 4 additions & 5 deletions src/argus/auth/V1/urls.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from django.urls import path
from rest_framework import routers

from . import views as views_V1
from .. import views
from . import views as views


router = routers.SimpleRouter()
router.register(r"phone-number", views_V1.PhoneNumberViewV1, basename="phone_number")
router.register(r"phone-number", views.PhoneNumberViewV1, basename="phone_number")


app_name = "auth"
urlpatterns = [
# path("login/", django_views.LoginView.as_view(redirect_authenticated_user=True), name="login"),
path("user/", views_V1.CurrentUserViewV1.as_view(), name="current-user"),
path("users/<int:pk>/", views.BasicUserDetail.as_view(), name="user"),
path("user/", views.CurrentUserViewV1.as_view(), name="current-user"),
path("users/<int:pk>/", views.BasicUserDetailV1.as_view(), name="user"),
] + router.urls
14 changes: 13 additions & 1 deletion src/argus/auth/V1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,37 @@
from argus.drf.permissions import IsOwner
from argus.notificationprofile.models import DestinationConfig
from argus.notificationprofile.serializers import RequestDestinationConfigSerializer

from ..views import BasicUserDetail
from .serializers import RequestPhoneNumberSerializerV1, ResponsePhoneNumberSerializerV1, UserSerializerV1


PHONE_NUMBERS_DEPRECATED = (
"Phone numbers are now accessible through the destinations API. See /api/v2/notificationprofiles/destinations/."
)

# deprecated views unchanged from V2


@extend_schema_view(get=extend_schema(deprecated=True))
class BasicUserDetailV1(BasicUserDetail):
pass


# overridden views


class CurrentUserViewV1(APIView):
permission_classes = [IsAuthenticated]
serializer_class = UserSerializerV1

@extend_schema(deprecated=True)
def get(self, request, *args, **kwargs):
serializer = self.serializer_class(request.user)
return Response(serializer.data)


@extend_schema_view(
deprecated=True,
list=extend_schema(
deprecated=True,
description=PHONE_NUMBERS_DEPRECATED,
Expand Down
13 changes: 3 additions & 10 deletions src/argus/htmx/incident/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class IncidentFilterForm(forms.Form):
widget=forms.TextInput(
attrs={
"placeholder": "key=value, ...",
"class": "input input-accent input-bordered input-md border overflow-y-auto min-h-8 h-auto max-h-16 max-w-xs leading-tight",
"class": "input input-primary input-bordered input-md border overflow-y-auto min-h-8 h-auto max-h-16 max-w-xs leading-tight",
}
),
required=False,
Expand Down Expand Up @@ -79,18 +79,11 @@ def clean_tags(self):
return None

try:
tags_list = set(tag.strip() for tag in tags.split(","))
tags_qss = Tag.objects.parse(*tags_list)
for tag in tags.split(","):
Tag.split(tag.strip())
except ValueError:
raise forms.ValidationError("Tags need to have the format key=value, key2=value2")

existing_tags = set()
for tags_qs in tags_qss:
existing_tags.update(set(str(tag) for tag in tags_qs))
missing_tags = tags_list - existing_tags
if missing_tags:
raise forms.ValidationError(f"The following tags could not be found: {', '.join(missing_tags)}")

return tags

def _tristate(self, onkey, offkey):
Expand Down
2 changes: 1 addition & 1 deletion src/argus/htmx/notificationprofile/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

self.fields["timeslot"].queryset = Timeslot.objects.filter(user=self.user)
self.fields["active"].widget.attrs["class"] = "checkbox checkbox-sm checkbox-accent border"
self.fields["active"].widget.attrs["class"] = "checkbox checkbox-sm border"
self.fields["active"].widget.attrs["autocomplete"] = "off"
self.fields["name"].widget.attrs["class"] = "input input-bordered"

Expand Down
Loading