Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

feat(branching): add support to edit branch step properties #1087

Merged
merged 3 commits into from
Jan 12, 2023

Conversation

kahboom
Copy link
Collaborator

@kahboom kahboom commented Jan 11, 2023

Description

This PR adds support for editing branch step properties. It should have been two separate PRs, but making properties viewable without ability to edit would have been more effort than it was worth.

  • Adds a utility method (flattenSteps) to flatten steps to quickly find a deeply nested step, which is used when you select a branch step and is set as the main selected step
  • Creates a new store for all nested steps, which only stores the step's UUID, its origin parent UUID (the root step), and the path to that step, for quick reference throughout the app
  • Adds a utility method (extractNestedSteps) to extract all nested steps into an array, used in the store
  • Updates insertStep and replaceStep methods to regenerate the nested steps store on change, to check the nested step store to determine if the step is nested, and to handle it separately if it is

Screen Shot 2023-01-10 at 4 56 56 pm

resolves #784

chore(test): also test for falsey value before flattening array in test

chore(viz): add function for building branch info separately

chore(viz): refactor to include branchInfo in steps

add utility to find path to deeply nested structures

chore(branching): add store for lookup table for all nested steps

chore(test): update test for utils

chore(branching): add function to extract nested steps, add test

chore(branching): update nested steps store after regenerating UUIDs

chore(branching): check if step is nested prior to saving config

fix(branching): allow typing into properties field of nested step

chore(utils): add pathToString for fetching deeply nested values

feat(branching): use path to update deeply nested portion of step

chore(utils): add utility to modify deeply nested portion of step
@kahboom kahboom requested a review from a team January 11, 2023 17:47
src/utils/index.ts Fixed Show fixed Hide fixed
@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #1087 (c7f643c) into main (f98be9f) will increase coverage by 0.70%.
The diff coverage is 54.94%.

@@            Coverage Diff             @@
##             main    #1087      +/-   ##
==========================================
+ Coverage   43.19%   43.90%   +0.70%     
==========================================
  Files          49       51       +2     
  Lines        1498     1574      +76     
  Branches      325      340      +15     
==========================================
+ Hits          647      691      +44     
- Misses        808      838      +30     
- Partials       43       45       +2     
Impacted Files Coverage Δ
src/types/index.ts 100.00% <ø> (ø)
src/components/Visualization.tsx 39.83% <14.28%> (-1.99%) ⬇️
src/store/integrationJsonStore.tsx 24.63% <15.00%> (-3.15%) ⬇️
src/store/nestedStepsStore.tsx 25.00% <25.00%> (ø)
src/services/visualizationService.ts 83.22% <100.00%> (+2.37%) ⬆️
src/store/data/kamelet.nested-branch.steps.ts 100.00% <100.00%> (ø)
src/store/index.ts 100.00% <100.00%> (ø)
src/utils/index.ts 63.15% <100.00%> (+13.15%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sonarcloud
Copy link

sonarcloud bot commented Jan 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kahboom kahboom merged commit c2b6545 into KaotoIO:main Jan 12, 2023
@kahboom kahboom deleted the branch-step-props branch January 12, 2023 13:15
kahboom added a commit to kahboom/kaoto-ui that referenced this pull request Jan 17, 2023
…1087)

* chore(viz): use findStepIdxWithUuid instead of native find, to find step to select

* feat(viz): adds ability to view branch step properties

chore(test): also test for falsey value before flattening array in test

chore(viz): add function for building branch info separately

chore(viz): refactor to include branchInfo in steps

add utility to find path to deeply nested structures

chore(branching): add store for lookup table for all nested steps

chore(test): update test for utils

chore(branching): add function to extract nested steps, add test

chore(branching): update nested steps store after regenerating UUIDs

chore(branching): check if step is nested prior to saving config

fix(branching): allow typing into properties field of nested step

chore(utils): add pathToString for fetching deeply nested values

feat(branching): use path to update deeply nested portion of step

chore(utils): add utility to modify deeply nested portion of step

* feat(branching): handle deeply nested steps in saveConfig
kahboom added a commit to kahboom/kaoto-ui that referenced this pull request Jan 17, 2023
…1087)

* chore(viz): use findStepIdxWithUuid instead of native find, to find step to select

* feat(viz): adds ability to view branch step properties

chore(test): also test for falsey value before flattening array in test

chore(viz): add function for building branch info separately

chore(viz): refactor to include branchInfo in steps

add utility to find path to deeply nested structures

chore(branching): add store for lookup table for all nested steps

chore(test): update test for utils

chore(branching): add function to extract nested steps, add test

chore(branching): update nested steps store after regenerating UUIDs

chore(branching): check if step is nested prior to saving config

fix(branching): allow typing into properties field of nested step

chore(utils): add pathToString for fetching deeply nested values

feat(branching): use path to update deeply nested portion of step

chore(utils): add utility to modify deeply nested portion of step

* feat(branching): handle deeply nested steps in saveConfig
mmelko pushed a commit to mmelko/kaoto-ui that referenced this pull request Jan 23, 2023
…1087)

* chore(viz): use findStepIdxWithUuid instead of native find, to find step to select

* feat(viz): adds ability to view branch step properties

chore(test): also test for falsey value before flattening array in test

chore(viz): add function for building branch info separately

chore(viz): refactor to include branchInfo in steps

add utility to find path to deeply nested structures

chore(branching): add store for lookup table for all nested steps

chore(test): update test for utils

chore(branching): add function to extract nested steps, add test

chore(branching): update nested steps store after regenerating UUIDs

chore(branching): check if step is nested prior to saving config

fix(branching): allow typing into properties field of nested step

chore(utils): add pathToString for fetching deeply nested values

feat(branching): use path to update deeply nested portion of step

chore(utils): add utility to modify deeply nested portion of step

* feat(branching): handle deeply nested steps in saveConfig
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Branching: Ability to view and edit branch step properties
1 participant