Skip to content

Branching install pages

LizBaker edited this page Jan 19, 2023 · 3 revisions

✨ This doc is a work in progress to help outline some of the logic in our install pages

Overrides

Types of overrides

Currently we have 3 types of overrides:

Type Result Syntax
replace This will replace an existing step when a given option is selected
overrides:
- filePath: 'src/install/java/download/maven.mdx'
selectedOptions:
- optionType: deployment
options:
- value: 'maven'
skip This will skip (remove) an existing step when a given option is selected
overrides:
- skip: true
selectedOptions:
- optionType: deployment
options:
- value: 'maven'
isConditionalStep This will keep a step hidden until a given option is selected
overrides:
- isConditionalStep: true
selectedOptions:
- optionType: deployment
options:
- value: 'maven'

Override AND/OR logic

OR

Two different optionTypes

Here we have two different overrides and either one can trigger a skip or in this case conditionalStep appearing

- filePath: 'src/install/demo/dropdown2/addStep.mdx'
  overrides:
    - isConditionalStep: true
      selectedOptions:
        - optionType: dropdown2
          options:
            - value: 'thirdOption'
    - isConditionalStep: true
      selectedOptions:
        - optionType: dropdown1
          options:
            - value: 'secondOption'

One option type multiple options

Here we have multiple options under one optionType which acts as an OR because you can only ever select a single option from a given dropdown

- filePath: 'src/install/demo/dropdown2/addStep.mdx'
  overrides:
    - isConditionalStep: true
      selectedOptions:
        - optionType: dropdown2
          options:
            - value: 'thirdOption'
            - value: 'fourthOption'

AND

Here we have a single override with multiple optionTypes and all of these options will need to be selected to trigger the skip or conditional step

- filePath: 'src/install/demo/dropdown2/addStep.mdx'
  overrides:
    - skip: true
      selectedOptions:
        - optionType: dropdown2
          options:
            - value: 'thirdOption'
        - optionType: dropdown1
          options:
            - value: 'secondOption'