Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Make launch state and components generic #100

Merged
merged 5 commits into from
Oct 5, 2020

Conversation

schottra
Copy link
Contributor

@schottra schottra commented Oct 5, 2020

This is a refactoring step to prepare the launch state machine and components for being able to handle tasks as a source.
I separated the state machine into a base config that is composed into more specific machines for workflow and task launching.

The form components and state hook were also made generic and now accept the xstate state/service generated by interpreting either a workflow or task machine. The base LaunchForm component will now conditionally render the correct form component based on the props passed to it.

Copy link

@podehnal podehnal left a comment

Choose a reason for hiding this comment

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

👍

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2020

Codecov Report

Merging #100 into single-task-execution will increase coverage by 0.17%.
The diff coverage is 87.50%.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           single-task-execution     #100      +/-   ##
=========================================================
+ Coverage                  67.71%   67.89%   +0.17%     
=========================================================
  Files                        374      377       +3     
  Lines                       6078     6108      +30     
  Branches                     947      946       -1     
=========================================================
+ Hits                        4116     4147      +31     
+ Misses                      1962     1961       -1     
Impacted Files Coverage Δ
src/components/Launch/LaunchForm/BlobInput.tsx 75.00% <ø> (ø)
...c/components/Launch/LaunchForm/CollectionInput.tsx 19.35% <ø> (ø)
src/components/Launch/LaunchForm/DatetimeInput.tsx 66.66% <ø> (ø)
...omponents/Launch/LaunchForm/SearchableSelector.tsx 92.63% <ø> (ø)
src/components/Launch/LaunchForm/SimpleInput.tsx 96.55% <ø> (ø)
.../components/Launch/LaunchForm/UnsupportedInput.tsx 100.00% <ø> (ø)
...unch/LaunchForm/UnsupportedRequiredInputsError.tsx 94.11% <ø> (ø)
src/components/Launch/LaunchForm/constants.ts 100.00% <ø> (ø)
src/components/Launch/LaunchForm/getInputs.ts 96.15% <ø> (ø)
.../components/Launch/LaunchForm/inputHelpers/blob.ts 93.18% <ø> (ø)
... and 38 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5462f6...8aa7a77. Read the comment docs.

@schottra schottra merged commit 2254ef6 into single-task-execution Oct 5, 2020
@schottra schottra deleted the launch-tasks branch October 5, 2020 18:10
schottra added a commit that referenced this pull request Oct 8, 2020
* refactor: make workflow details generic so it can be used for tasks (#96)

* refactor: make workflow details generic so it can be used for tasks

* chore: cleanup and moving tests over

* feat: adding route and navigation to the task details page (#97)

* Refactor Launch form to use a state machine (#99)

* refactor: filling out details of the state machine for launch

* refactor: checkpoint

* refactor: mostly finished wiring of machine to component state

* refactor: more work to get form component migrated to using machine

* refactor: cleaning up state for selectors

* fix: type error due to patch version upgrade

* refactor: trying a flat state structure

* fix: getting all tests passing again

* chore: cleanup and docs

* chore: pull request feedback

* refactor: Make launch state and components generic (#100)

* refactor: splitting launch machine into two separate types

* refactor: move shared state out to component

* refactor: use composition to create workflow form

* refactor: update usage of LaunchWorkflowForm -> LaunchForm

* chore: cleanup and fix tests

* feat: Add Task support to Launch form (#101)

* feat: add task support in launch components

* test: updating launch form tests to handle task cases

* fix: remaining broken tests

* Cleanup work for launching single task executions. (#102)

* feat: add support for launch tasks in entity details view

* fix: correctly map initial parameters when relaunching

* fix: correct parent name and back link in execution details page

* fix: pass through referenceExecution when relaunching

* test: check rendering of referenceExecution

* test: adding tests for relaunch flow
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