hmcts / flex-ui

A collection of tools to help speed up development of ExUI.
MIT License
0 stars 1 forks source link

Extracting out ET journeys into base journeys #86

Closed JackReevies closed 1 year ago

JackReevies commented 1 year ago

What would you like to change?

A demo of FlexUI is happening next tuesday to other TechLeads in team where the expectation is to have other teams run FlexUI and report back on issues.

In it's current state, FlexUI is not usable by other teams as there are zero journeys outside of the ET folder. There will need to be work done by other teams wishing to integration FlexUI to translate ET journeys into their own.

We can cut down on this initial discover by extracting out some of our journeys into more generic ones that don't actually modify configs. For example, the ET journeys for upserting new types call mostly on generic code, but have since become much more tightly integrated with ET specific code by suggesting default values and auto complete lists etc...

This is an exploratory issue to find out how easy it would be to extract out those common components. Would it be possible for Teams to use a "base journey" and then add their extra bells and whistles (like we have).

JackReevies commented 1 year ago

My initial thoughts are to introduce a Team env var that can be used to specify what team to load journeys/data from (ie, "et" team would read from "dist/journeys/et" and "dist/et") and having a "base" folder for loading base journeys.

Journeys can then be "overridden" by alias. For example, "Restore a previous session" is mostly common, but ET runs an extra command after this to reload from config directories. Under this proposal, FlexUI will read in the base journey SessionRestore first, and then replace it with the file inside the et journeys folder. The end result on the main menu is unchanged, but functionality is now ET specific.

see https://github.com/hmcts/flex-ui/commit/fe6c2f786b5b10138b4b7fed22e20481d4fb1d87 for an example where sessionRestore has been overridden by the one in the et folder, and sessionNew + sessionSetName remain unchanged but have moved to the base journey (these two don't do anything et specific)

https://github.com/hmcts/flex-ui/commit/37801f1185a4b249ac60b93a66bc0aaf8400a58f is the previous commit setting up the Team env var. Here, team specific setup logic has been moved to /${TEAM}/init.,ts