-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
536 additions
and
315 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
class SubmissionEventsController < ApplicationController | ||
SUBMISSION_EVENT_ICONS = { | ||
'view_form' => 'eye', | ||
'start_form' => 'player_play', | ||
'complete_form' => 'check', | ||
'send_email' => 'mail_forward', | ||
'click_email' => 'hand_click', | ||
'api_complete_form' => 'check', | ||
'send_reminder_email' => 'mail_forward', | ||
'send_2fa_sms' => '2fa', | ||
'send_sms' => 'send', | ||
'phone_verified' => 'phone_check', | ||
'click_sms' => 'hand_click', | ||
'decline_form' => 'x', | ||
'start_verification' => 'player_play', | ||
'complete_verification' => 'check', | ||
'invite_party' => 'user_plus' | ||
}.freeze | ||
|
||
load_and_authorize_resource :submission | ||
|
||
def index; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" stroke-width="2"> | ||
<path d="M7 16h-4l3.47 -4.66a2 2 0 1 0 -3.47 -1.54"></path> | ||
<path d="M10 16v-8h4"></path> <path d="M10 12l3 0"></path> | ||
<path d="M17 16v-6a2 2 0 0 1 4 0v6"></path> | ||
<path d="M17 13l4 0"></path> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> | ||
<path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /> | ||
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" stroke-width="2"> | ||
<path d="M8 13v-8.5a1.5 1.5 0 0 1 3 0v7.5"></path> | ||
<path d="M11 11.5v-2a1.5 1.5 0 0 1 3 0v2.5"></path> | ||
<path d="M14 10.5a1.5 1.5 0 0 1 3 0v1.5"></path> | ||
<path d="M17 11.5a1.5 1.5 0 0 1 3 0v4.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7l-.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"></path> | ||
<path d="M5 3l-1 -1"></path> | ||
<path d="M4 7h-1"></path> | ||
<path d="M14 3l1 -1"></path> | ||
<path d="M15 6h1"></path> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" stroke-width="2"> | ||
<path d="M4 12h.01"></path> | ||
<path d="M4 6h.01"></path> | ||
<path d="M4 18h.01"></path> | ||
<path d="M8 18h2"></path> | ||
<path d="M8 12h2"></path> | ||
<path d="M8 6h2"></path> | ||
<path d="M14 6h6"></path> | ||
<path d="M14 12h6"></path> | ||
<path d="M14 18h6"></path> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" stroke-width="2"> | ||
<path d="M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"></path> | ||
<path d="M15 6l2 2l4 -4"></path> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" stroke-width="2"> | ||
<path d="M7 4v16l13 -8z"></path> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<% event_colors = %w[bg-red-200 bg-sky-200 bg-emerald-200 bg-yellow-200 bg-purple-200 bg-pink-200 bg-cyan-200 bg-orange-200 bg-lime-200 bg-indigo-200] %> | ||
<% submitters_uuids = (@submission.template_submitters || @submission.template.submitters).pluck('uuid') %> | ||
<%= render 'shared/turbo_modal_large', title: t('event_log') do %> | ||
<div class="pl-8 pr-4 py-4"> | ||
<ol class="relative border-s border-base-300 space-y-6"> | ||
<li class="ml-7"> | ||
<span class="absolute flex items-center justify-center w-7 h-7 rounded-full -start-3.5 ring-8 ring-base-100 text-base-content bg-gray-200"> | ||
<%= svg_icon('file_text', class: 'w-4 h-4') %> | ||
</span> | ||
<p class="text-sm leading-none text-base-content/60 pt-1.5"> | ||
<%= l(@submission.created_at.in_time_zone(current_account.timezone), format: :long, locale: current_account.locale) %> | ||
</p> | ||
<p class="text-base-content/80 mt-1"> | ||
<% if @submission.source == 'invite' %> | ||
<%= t('submission_created_by_email_html', email: @submission.created_by_user.email) %> | ||
<% elsif @submission.created_by_user %> | ||
<%= t('submission_created_by_email_via_source_html', email: @submission.created_by_user.email, source: t("submission_sources.#{@submission.source}")) %> | ||
<% else %> | ||
<%= t('submission_created_via_source_html', source: t("submission_sources.#{@submission.source}")) %> | ||
<% end %> | ||
</p> | ||
</li> | ||
<% @submission.submission_events.order(:event_timestamp).each do |event| %> | ||
<% submitter = @submission.submitters.find { |e| e.id == event.submitter_id } %> | ||
<% bg_class = event_colors[submitters_uuids.index(submitter.uuid) % event_colors.length] %> | ||
<% submitter_name = event.event_type.include?('sms') || event.event_type.include?('phone') ? (event.data['phone'] || submitter.phone) : (submitter.name || submitter.email || submitter.phone) %> | ||
<li class="ml-7"> | ||
<span class="absolute flex items-center justify-center w-7 h-7 rounded-full -start-3.5 ring-8 ring-base-100 text-base-content <%= bg_class %>"> | ||
<%= svg_icon(SubmissionEventsController::SUBMISSION_EVENT_ICONS.fetch(event.event_type, 'circle_dot'), class: 'w-4 h-4') %> | ||
</span> | ||
<p class="text-sm leading-none text-base-content/60 pt-1.5"> | ||
<%= l(event.event_timestamp.in_time_zone(current_account.timezone), format: :long, locale: current_account.locale) %> | ||
</p> | ||
<p class="text-base-content/80 mt-1"> | ||
<% if event.event_type == 'complete_verification' %> | ||
<%= t('submission_event_names.complete_verification_by_html', provider: event.data['method'], submitter_name:) %> | ||
<% elsif event.event_type == 'invite_party' && (invited_submitter = @submission.submitters.find { |e| e.uuid == event.data['uuid'] }) && (name = @submission.template_submitters.find { |e| e['uuid'] == event.data['uuid'] }&.dig('name')) %> | ||
<%= t('submission_event_names.invite_party_by_html', invited_submitter_name: [invited_submitter.name || invited_submitter.email || invited_submitter.phone, name].join(' '), submitter_name:) %> | ||
<% elsif event.event_type.include?('send_') %> | ||
<%= t("submission_event_names.#{event.event_type}_to_html", submitter_name:) %> | ||
<% else %> | ||
<%= t("submission_event_names.#{event.event_type}_by_html", submitter_name:) %> | ||
<% end %> | ||
</p> | ||
</li> | ||
<% end %> | ||
</ol> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= render partial: 'submissions/annotation', collection: annots, as: :annot %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.