Skip to content

Commit

Permalink
Merge branch 'main' into base_list_template
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Oct 18, 2024
2 parents 72257f5 + 518117a commit 9d80e65
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v9.3.75 (2024-10-17)
-------------------------
* Add Shortcuts UI
* Normal menu navigation for tickets

v9.3.74 (2024-10-17)
-------------------------
* Remove pre-spa days code from flow list view
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.108.7",
"@nyaruka/temba-components": "0.109.0",
"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.74"
version = "9.3.75"
description = "Hosted service for visually building interactive messaging applications"
authors = ["Nyaruka <[email protected]>"]

Expand Down
6 changes: 0 additions & 6 deletions static/js/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,6 @@ function handleMenuClicked(event) {
return;
}

if (!item.popup && selection.length > 1 && selection[0] == 'ticket') {
if (window.handleTicketsMenuChanged) {
handleTicketsMenuChanged(item);
}
}

// posterize if called for
if (item.href && item.posterize) {
posterize(item.href);
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.74"
__version__ = "9.3.75"

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
Expand Down
2 changes: 1 addition & 1 deletion temba/tickets/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def test_menu(self):
"My Tickets (2)",
"Unassigned (1)",
"All (3)",
# "Shortcuts (0)",
"Shortcuts (0)",
"Export",
"New Topic",
"General (3)",
Expand Down
20 changes: 11 additions & 9 deletions temba/tickets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,19 +278,20 @@ def derive_menu(self):
"name": folder.name,
"icon": folder.icon,
"count": counts[folder.id],
"href": f"/ticket/{folder.id}/open/",
}
)

menu.append(self.create_divider())
# menu.append(
# self.create_menu_item(
# menu_id="shortcuts",
# name=_("Shortcuts"),
# icon="shortcut",
# count=org.shortcuts.filter(is_active=True).count(),
# href="tickets.shortcut_list",
# )
# )
menu.append(
self.create_menu_item(
menu_id="shortcuts",
name=_("Shortcuts"),
icon="shortcut",
count=org.shortcuts.filter(is_active=True).count(),
href="tickets.shortcut_list",
)
)
menu.append(self.create_modax_button(_("Export"), "tickets.ticket_export", icon="export"))
menu.append(
self.create_modax_button(_("New Topic"), "tickets.topic_create", icon="add", on_submit="refreshMenu()")
Expand All @@ -307,6 +308,7 @@ def derive_menu(self):
"name": topic.name,
"icon": "topic",
"count": counts[topic],
"href": f"/ticket/{topic.uuid}/open/",
}
)

Expand Down
1 change: 1 addition & 0 deletions templates/frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
fields="/api/v2/fields.json"
groups="/api/v2/groups.json"
workspace="/api/v2/workspace.json"
shortcuts="/api/internal/shortcuts.json"
users="/api/v2/users.json">
</temba-store>
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions templates/msgs/broadcast_create_compose.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{{ block.super }}
<style>
temba-compose {
--textarea-min-height: 6em;
--temba-textinput-padding: 1em 1em;
--shortcuts-height: 6em;
--textarea-min-height: 9em;
}
</style>
{% endblock extra-style %}
Expand Down
17 changes: 15 additions & 2 deletions templates/tickets/shortcut_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@
{% block table-body %}
{% for obj in object_list %}
<tr onclick="showUpdateShortcutModal({{ obj.id }})" class="hover-linked update">
<td style="min-width: 50px">{{ obj.name }}</td>
<td class="whitespace-nowrap"
style="min-width: 50px;
max-width:150px;
overflow: hidden;
text-overflow: ellipsis">{{ obj.name }}</td>
<td>
<div class="break-all">{{ obj.text|truncatechars:100 }}</div>
<div style="overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
line-height: 16px;
max-height: 16px;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical">{{ obj.text }}</div>
</td>
<td class="w-10">
{% if org_perms.tickets.shortcut_delete %}
Expand All @@ -39,6 +49,9 @@
{% block extra-script %}
{{ block.super }}
<script>
// refresh our cached shortcuts in case we just created one
document.querySelector("temba-store").refreshShortcuts();

function showUpdateShortcutModal(id) {
var modax = document.querySelector('#update-shortcut');
modax.endpoint = `/shortcut/update/${id}/`;
Expand Down
1 change: 1 addition & 0 deletions templates/tickets/shortcut_update.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "tickets/shortcut_create.html" %}
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/temba-components@0.108.7":
version "0.108.7"
resolved "https://registry.yarnpkg.com/@nyaruka/temba-components/-/temba-components-0.108.7.tgz#f3f4187d21c3c6c346bf135ec94cb33f521fe472"
integrity sha512-2pbzXPWJ1vpjll5iqTTbbWaK/Q+xmK2UO/4bDoiYFOr87YTiuVOee471k/8L2V/OWzLa+vGNvB06sMuZUG1bTw==
"@nyaruka/temba-components@0.109.0":
version "0.109.0"
resolved "https://registry.yarnpkg.com/@nyaruka/temba-components/-/temba-components-0.109.0.tgz#a7aef7c222719b55cb2f09f371b814aad9f05d8d"
integrity sha512-ctSRjGIlDi9otTkvw59acU1Ji0nh1RpxJkHufnxuqXguSTdJauNTYGAgwukpVrpOII5ehWgdl6ACPgpg41F+vw==
dependencies:
"@lit/localize" "^0.12.1"
color-hash "^2.0.2"
Expand Down

0 comments on commit 9d80e65

Please sign in to comment.