Skip to content

Commit

Permalink
Merge branch 'main' into ticket_counts_v2_pt5
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour authored Oct 31, 2024
2 parents d21dfe4 + 2bbcb1a commit 0462bf2
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v9.3.88 (2024-10-31)
-------------------------
* Fix browsing definitions API endpoint docs
* Fix the My Tickets icon, wasn't always accurate
* Prevent deletion of non-empty teams
* Start reading from new ticket counts

v9.3.87 (2024-10-31)
-------------------------
* Make shortcuts an optional attribute on compose
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@nyaruka/flow-editor": "1.35.2",
"@nyaruka/temba-components": "0.110.0",
"@nyaruka/temba-components": "0.110.3",
"codemirror": "5.18.2",
"colorette": "1.2.2",
"fa-icons": "0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "temba"
version = "9.3.87"
version = "9.3.88"
description = "Hosted service for visually building interactive messaging applications"
authors = ["Nyaruka <[email protected]>"]

Expand Down
2 changes: 1 addition & 1 deletion temba/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "9.3.87"
__version__ = "9.3.88"

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
Expand Down
5 changes: 5 additions & 0 deletions temba/api/v2/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,11 @@ def test_definitions(self):
raw=lambda j: len(j["flows"]) == 1 and j["flows"][0]["spec_version"] == Flow.CURRENT_SPEC_VERSION,
)

# test fetching docs anonymously
self.client.logout()
response = self.client.get(reverse("api.v2.definitions"))
self.assertContains(response, "Deprecated endpoint")

@override_settings(ORG_LIMIT_DEFAULTS={"fields": 10})
def test_fields(self):
endpoint_url = reverse("api.v2.fields") + ".json"
Expand Down
3 changes: 3 additions & 0 deletions temba/api/v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,9 @@ class Depends(Enum):
all = 2

def get(self, request, *args, **kwargs):
if self.is_docs():
return Response({})

org = request.org
params = request.query_params
flow_uuids = params.getlist("flow")
Expand Down
6 changes: 6 additions & 0 deletions temba/tickets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ class TicketFolder(metaclass=ABCMeta):
icon = None
verbose_name = None

def get_icon(self, count) -> str:
return self.icon

def get_queryset(self, org, user, *, ordered: bool):
qs = org.tickets.all()

Expand Down Expand Up @@ -375,6 +378,9 @@ class MineFolder(TicketFolder):
name = _("My Tickets")
icon = "tickets_mine"

def get_icon(self, count) -> str:
return self.icon if count else "tickets_mine_done"

def get_queryset(self, org, user, *, ordered: bool):
return super().get_queryset(org, user, ordered=ordered).filter(assignee=user)

Expand Down
2 changes: 1 addition & 1 deletion temba/tickets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def derive_menu(self):
{
"id": folder.slug,
"name": folder.name,
"icon": folder.icon,
"icon": folder.get_icon(counts[folder.slug]),
"count": counts[folder.slug],
"href": f"/ticket/{folder.slug}/open/",
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@
serialize-javascript "^6.0.2"
tiny-lru "^11.2.5"

"@nyaruka/[email protected].0":
version "0.110.0"
resolved "https://registry.yarnpkg.com/@nyaruka/temba-components/-/temba-components-0.110.0.tgz#bdb6fb20fe1d073e086fcc39d940f3d279dec82f"
integrity sha512-PGPNTV09tKUu7FoQUnEhdn7tVt8xNRM+ZBPjDvjKibNM1QAfHPcTK2RfnTt1ZI4HU/LlDHiVqjid8F9EgXnV1Q==
"@nyaruka/[email protected].3":
version "0.110.3"
resolved "https://registry.yarnpkg.com/@nyaruka/temba-components/-/temba-components-0.110.3.tgz#a20bb373f426ec659db71a2b9811de009e33970b"
integrity sha512-UlLsPvcIBRrfyHvfQA7p8jllMRtNp17gr/siTDE/dKsQp0fJmiU8LanRXCB2B85J5Cr227HM/CzZW89X1ajiiQ==
dependencies:
"@lit/localize" "^0.12.1"
color-hash "^2.0.2"
Expand Down

0 comments on commit 0462bf2

Please sign in to comment.