Skip to content

Commit

Permalink
Merge pull request #414 from communityconnectlabs/fix/triggers-calendar
Browse files Browse the repository at this point in the history
Fix: Triggers calendar
  • Loading branch information
teehamaral authored Nov 6, 2024
2 parents 3a0997e + ffc6c91 commit 9b210d8
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/owasp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
poetry run python manage.py runserver > rapidpro.log &
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.4.0
uses: zaproxy/action-full-scan@v0.11.0
with:
target: 'http://127.0.0.1:8000'
rules_file_name: '.zap/rules.tsv'
Expand Down
138 changes: 73 additions & 65 deletions templates/triggers/trigger_list.haml
Original file line number Diff line number Diff line change
Expand Up @@ -77,74 +77,75 @@
%input(type='hidden' name='status' value='{{request.REQUEST.status}}')

-block trigger-list
%table.list.trigger-list.lined{class: '{% if org_perms.flows.flow_update %}selectable{% endif %}'}
%tbody
-for obj in object_list
%tr.trigger.object-row{ data-object-id: "{{ obj.id }}", onrowclick:"updateTrigger(event, {{obj.id}})" }
- if org_perms.triggers.trigger_update
%td.trigger.checkbox.object-row-checkbox
%temba-checkbox{onclick:"handleRowSelection(this)"}
%td.w-full
-if obj.trigger_type == 'K'
-trans "The keyword"
%b
{{obj.keyword}}
-elif obj.trigger_type == 'M'
-trans "A missed call"
-elif obj.trigger_type == 'C'
-trans "An uncaught message"
-elif obj.trigger_type == 'V'
-trans "An inbound call"
-elif obj.trigger_type == 'N'
-trans "A new conversation"
-if obj.channel
-trans "on"
.table-scroll.overflow-x-auto
%table.list.trigger-list.lined{class: '{% if org_perms.flows.flow_update %}selectable{% endif %}'}
%tbody
-for obj in object_list
%tr.trigger.object-row{ data-object-id: "{{ obj.id }}", onrowclick:"updateTrigger(event, {{obj.id}})" }
- if org_perms.triggers.trigger_update
%td.trigger.checkbox.object-row-checkbox
%temba-checkbox{onclick:"handleRowSelection(this)"}
%td.w-full
-if obj.trigger_type == 'K'
-trans "The keyword"
%b
%a{href:'{%url "channels.channel_read" obj.channel.uuid %}'}= obj.channel

-elif obj.trigger_type == 'R'
-trans "The referrer id"
%b
{{obj.referrer_id}}
-if obj.channel
-trans "on the channel"
.linked.inline{onclick:"goto(event)", href:'{%url "channels.channel_read" obj.channel.uuid %}'}
{{obj.channel}}

-elif obj.trigger_type == 'T'
-trans "A closed ticket"

-if obj.schedule
-trans "Start"
-else
-trans "starts"
.linked.inline(onclick="goto(event)" href='{%url "flows.flow_editor" obj.flow.uuid %}')<
{{obj.flow}}

-if obj.schedule
-if obj.schedule.next_fire and not obj.is_archived
{{ obj.schedule.get_display }}
-else
-trans "is not scheduled"

-if obj.extra
|
-trans "Contains "
- if org_perms.triggers.trigger_update
%a.update-trigger{ data-object-id: "{{ obj.id }}", onclick:"updateTrigger(event, {{obj.id}})" }
-trans "flow parameters"
- else
-trans "Contains flow parameters"

%td(onclick="handleRowSelection(this)" width="250px")
-include "includes/recipients.haml" with groups=obj.groups.all contacts=obj.contacts.all
{{obj.keyword}}
-elif obj.trigger_type == 'M'
-trans "A missed call"
-elif obj.trigger_type == 'C'
-trans "An uncaught message"
-elif obj.trigger_type == 'V'
-trans "An inbound call"
-elif obj.trigger_type == 'N'
-trans "A new conversation"
-if obj.channel
-trans "on"
%b
%a{href:'{%url "channels.channel_read" obj.channel.uuid %}'}= obj.channel

-elif obj.trigger_type == 'R'
-trans "The referrer id"
%b
{{obj.referrer_id}}
-if obj.channel
-trans "on the channel"
.linked.inline{onclick:"goto(event)", href:'{%url "channels.channel_read" obj.channel.uuid %}'}
{{obj.channel}}

-empty
%tr.empty_list
%td{colspan:3}
-trans "No matching triggers."
-elif obj.trigger_type == 'T'
-trans "A closed ticket"

-block extra-rows
-if obj.schedule
-trans "Start"
-else
-trans "starts"
.linked.inline(onclick="goto(event)" href='{%url "flows.flow_editor" obj.flow.uuid %}')<
{{obj.flow}}

-if obj.schedule
-if obj.schedule.next_fire and not obj.is_archived
{{ obj.schedule.get_display }}
-else
-trans "is not scheduled"

-if obj.extra
|
-trans "Contains "
- if org_perms.triggers.trigger_update
%a.update-trigger{ data-object-id: "{{ obj.id }}", onclick:"updateTrigger(event, {{obj.id}})" }
-trans "flow parameters"
- else
-trans "Contains flow parameters"

%td(onclick="handleRowSelection(this)" width="250px")
-include "includes/recipients.haml" with groups=obj.groups.all contacts=obj.contacts.all

-empty
%tr.empty_list
%td{colspan:3}
-trans "No matching triggers."

-block extra-rows

-block paginator
.mt-3
Expand All @@ -164,3 +165,10 @@
modal.open = true;
}

-block extra-style
{{ block.super }}

:css
.table-scroll {
max-height: calc(100vh - 480px);
}

0 comments on commit 9b210d8

Please sign in to comment.