Skip to content
Merged
Changes from all commits
Commits
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
47 changes: 21 additions & 26 deletions app/services/flow/flow_state_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ def update
step = current_step
result = flow.handle(step)

if @analytics_id
increment_step_name_counts
analytics.public_send(
flow.step_handler(step).analytics_submitted_event,
**result.to_h.merge(analytics_properties),
)
end
increment_step_name_counts
analytics.public_send(
flow.step_handler(step).analytics_submitted_event,
**result.to_h.merge(analytics_properties),
)

register_update_step(step, result)
if flow.json
Expand All @@ -50,13 +48,12 @@ def current_step
end

def track_step_visited
if @analytics_id
increment_step_name_counts
analytics.public_send(
flow.step_handler(current_step).analytics_visited_event,
**analytics_properties,
)
end
increment_step_name_counts
analytics.public_send(
flow.step_handler(current_step).analytics_visited_event,
**analytics_properties,
)

Funnel::DocAuth::RegisterStep.new(user_id, issuer).call(current_step, :view, true)
end

Expand Down Expand Up @@ -128,18 +125,16 @@ def call_optional_show_step(optional_step)
return unless optional_show_step
result = optional_show_step.new(@flow).base_call

if @analytics_id
optional_show_step_name = optional_show_step.to_s.demodulize.underscore
optional_properties = result.to_h.merge(
step: optional_show_step_name,
analytics_id: @analytics_id,
)

analytics.public_send(
optional_show_step.analytics_optional_step_event,
**optional_properties,
)
end
optional_show_step_name = optional_show_step.to_s.demodulize.underscore
optional_properties = result.to_h.merge(
step: optional_show_step_name,
analytics_id: @analytics_id,
)

analytics.public_send(
optional_show_step.analytics_optional_step_event,
**optional_properties,
)

if next_step.to_s != optional_step
if next_step_is_url
Expand Down