Skip to content

Conversation

@bencalegari
Copy link
Contributor

@bencalegari bencalegari commented Dec 23, 2025

Ticket

FFS-3566

Context for reviewers

  • I wanted to break up the commits to get all the way through to adding income successfully. Right now you can add a job through Argyle, see the summary, and advance to the page asking if you've added everything.
  • I did a bad thing in #find_flow. We shouldn't have to check CbvFlow then ActivityFlow but I was struggling coming up with a way to infer it, the session is not present and we're exclusively relying on data from the web hooks. Any advice on avoiding that hack would be appreciated.
  • I didn't add any new controller tests. In theory they don't care, but some of them might? The activity hub journey test is driving this out, and there's a lot of unhappy path stuff that's not tested.
  • Advancing through employer search takes your from /activites/income/employer_search to /cbv/<path>. We should have unique paths here. I'm getting an itch that there's probably a refactor to be done to create distinct controllers that inherit from the same one a la FlowController.

Acceptance testing

  • No acceptance testing needed
    • This change will not affect the user experience (bugfix, dependency updates, etc.)

@bencalegari bencalegari changed the title FFS-3566: Show employer search page in activity hub FFS-3566: Advance through /add_job in activity hub Dec 24, 2025
Copy link
Contributor

@tdooner tdooner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Some early feedback.

end
end

def find_flow(user_id) # TODO: Find a better way to determine flow type, maybe inherited controllers?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah, I see the problem. Not sure a better option unless we broke out a new table for argyle_users that had polymorphic foreign keys back to the flow (i.e. flow_id, flow_type). Seems a bit heavy here, I think this is ok because these argyle_user_ids are UUIDs and should never collide between the CbvFlow and ActivityFlows.


def set_flow_session(flow_id, type)
session[:flow_id] = flow_id
session[:flow_id] = flow_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It never hurts to set a variable twice just to make sure 🙃

Comment on lines +105 to +106
def flow_class(symbol = nil)
(symbol || session[:flow_type]&.to_sym) == :activity ? ActivityFlow : CbvFlow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: symbol and flow_param are not great names to me since ideally they would convey a bit more meaning. I think symbol is actually something like flow_type.

Suggested change
def flow_class(symbol = nil)
(symbol || session[:flow_type]&.to_sym) == :activity ? ActivityFlow : CbvFlow
def flow_class(flow_type = session[:flow_type])
flow_type.to_sym == :activity ? ActivityFlow : CbvFlow

<% if activity_type_enabled?(:income) %>
<section>
<%= button_to t("activities.income.add"), activities_flow_income_employer_search_path, class: "btn btn-primary usa-button margin-y-5", method: :get %>
</section>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For your own sanity (avoiding merge conflicts) I recommend splitting these reformattings into a separate PR.

end

def invitation_id
activity_flow_invitation_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think this could be defined via the belongs_to by adding an as: :invitation option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants