Skip to content

Commit

Permalink
fix: 🐛 the data contract changed, we need script instead
Browse files Browse the repository at this point in the history
  • Loading branch information
hvilander committed Aug 28, 2023
1 parent a77cd32 commit 1bf8ec4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/SQFormTransferTool/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default function StepRendering({
);
}

// for scripting steps, if the condition is not met we do not want to render anything
if (type === 'scripting' && isConditionMet) {
// for script steps, if the condition is not met we do not want to render anything
if (type === 'script' && isConditionMet) {
return <ScriptedText text={text} key={`script_${id}`} sx={styles.script} />;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/SQFormTransferTool/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type QuestionStep = BaseStep & {
};

export type ScriptingStep = BaseStep & {
type: 'scripting';
type: 'script';
text: string;
options: null;
};
Expand Down
4 changes: 2 additions & 2 deletions stories/SQFormTransferTool.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const questionStepFour: Step = {
};

const stepScriptOne: Step = {
type: 'scripting',
type: 'script',
id: MOCK_IDs.SCRIPTING_ONE_ID,
text: 'Question 3 demonstrates AND logic, pick no for question one AND "an option" for question two',
options: null,
Expand All @@ -147,7 +147,7 @@ const stepScriptThree: Step = {
const stepScriptFour: Step = {
...stepScriptOne,
id: MOCK_IDs.SCRIPTING_FOUR_ID,
text: 'Scripting steps are also conditional, this script is shown on the same condition that enables question 4',
text: 'Script steps are also conditional, this script is shown on the same condition that enables question 4',
condition: questionStepFour.condition,
};

Expand Down

0 comments on commit 1bf8ec4

Please sign in to comment.