-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Authoring): Allow adding branch from add step button (#1935)
Co-authored-by: Hiroki Terashima <honchikun@gmail.com> Co-authored-by: Jonathan Lim-Breitbart <breity10@gmail.com>
- Loading branch information
1 parent
400a4be
commit 13dd769
Showing
86 changed files
with
4,993 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export class AddStepTarget { | ||
branchNodeId?: string; | ||
firstNodeIdInBranchPath?: string; | ||
importProjectId?: number; | ||
node?: any; | ||
targetId?: string; | ||
type: 'in' | 'after' | 'firstStepInBranchPath'; | ||
|
||
constructor( | ||
type: 'in' | 'after' | 'firstStepInBranchPath', | ||
targetId: string, | ||
branchNodeId?: string, | ||
firstNodeIdInBranchPath?: string | ||
) { | ||
this.type = type; | ||
this.targetId = targetId; | ||
this.branchNodeId = branchNodeId; | ||
this.firstNodeIdInBranchPath = firstNodeIdInBranchPath; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export const CHOICE_CHOSEN_VALUE = 'choiceChosen'; | ||
export const RANDOM_VALUE = 'random'; | ||
export const SCORE_VALUE = 'score'; | ||
export const WORKGROUP_ID_VALUE = 'workgroupId'; | ||
|
||
export interface BranchCriteria { | ||
text: string; | ||
value: string; | ||
} | ||
|
||
export const BRANCH_CRITERIA: BranchCriteria[] = [ | ||
{ | ||
text: $localize`Workgroup ID`, | ||
value: WORKGROUP_ID_VALUE | ||
}, | ||
{ | ||
text: $localize`Score`, | ||
value: SCORE_VALUE | ||
}, | ||
{ | ||
text: $localize`Choice Chosen`, | ||
value: CHOICE_CHOSEN_VALUE | ||
}, | ||
{ | ||
text: $localize`Random`, | ||
value: RANDOM_VALUE | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { copy } from '../../assets/wise5/common/object/object'; | ||
import { TransitionLogic } from '../../assets/wise5/common/TransitionLogic'; | ||
|
||
export function expectTransitionLogic(node: any, transitionLogic: TransitionLogic) { | ||
expect(copy(node.transitionLogic)).toEqual(copy(transitionLogic)); | ||
} | ||
|
||
export function expectConstraint( | ||
constraint: any, | ||
expectedAction: string, | ||
expectedTargetId: string, | ||
expectedRemovalCriteria: any[] | ||
) { | ||
expect(constraint.action).toEqual(expectedAction); | ||
expect(constraint.targetId).toEqual(expectedTargetId); | ||
for (let i = 0; i < expectedRemovalCriteria.length; i++) { | ||
expect(copy(constraint.removalCriteria[i])).toEqual(copy(expectedRemovalCriteria[i])); | ||
} | ||
} |
Oops, something went wrong.