From 3523007301733be6712eb4d7502cb8b94be81090 Mon Sep 17 00:00:00 2001 From: shmck Date: Mon, 27 Jul 2020 19:09:21 -0700 Subject: [PATCH 1/2] admin mode review page styles Signed-off-by: shmck --- .../containers/Tutorial/containers/Review.tsx | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/web-app/src/containers/Tutorial/containers/Review.tsx b/web-app/src/containers/Tutorial/containers/Review.tsx index 30789307..b8618efc 100644 --- a/web-app/src/containers/Tutorial/containers/Review.tsx +++ b/web-app/src/containers/Tutorial/containers/Review.tsx @@ -93,16 +93,19 @@ const ReviewPage = (props: Props) => { return show(step.status) ? (
{adminMode && ( -
- -
+ <> +
+ +
+
+ )} Date: Mon, 27 Jul 2020 20:18:16 -0700 Subject: [PATCH 2/2] fix return from tutorial completed Signed-off-by: shmck --- web-app/src/containers/Tutorial/formatLevels.ts | 3 +++ web-app/src/services/state/machine.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web-app/src/containers/Tutorial/formatLevels.ts b/web-app/src/containers/Tutorial/formatLevels.ts index 90557746..0b520ba2 100644 --- a/web-app/src/containers/Tutorial/formatLevels.ts +++ b/web-app/src/containers/Tutorial/formatLevels.ts @@ -37,6 +37,7 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output stepIndex = levels[levelIndex].steps.length } + // current level const levelUI: T.LevelUI = { ...currentLevel, status: progress.levels[position.levelId] ? 'COMPLETE' : 'ACTIVE', @@ -80,6 +81,7 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output }), } + // flag all levels before as complete const completed: T.LevelUI[] = levels.slice(0, levelIndex).map((level: TT.Level) => ({ ...level, status: 'COMPLETE', @@ -90,6 +92,7 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output })), })) + // flag all levels after as incomplete const incompleted: T.LevelUI[] = levels.slice(levelIndex + 1, levels.length).map((level: TT.Level) => ({ ...level, status: 'INCOMPLETE', diff --git a/web-app/src/services/state/machine.ts b/web-app/src/services/state/machine.ts index 284de98b..7ba98d74 100644 --- a/web-app/src/services/state/machine.ts +++ b/web-app/src/services/state/machine.ts @@ -141,6 +141,12 @@ export const createMachine = (options: any) => { Tutorial: { id: 'tutorial', initial: 'Level', + on: { + RUN_RESET_TO_POSITION: { + actions: ['runResetToPosition'], + target: 'Tutorial.Level', + }, + }, states: { Level: { initial: 'Load', @@ -171,9 +177,6 @@ export const createMachine = (options: any) => { RUN_RESET: { actions: ['runReset'], }, - RUN_RESET_TO_POSITION: { - actions: ['runResetToPosition'], - }, KEY_PRESS_ENTER: { actions: ['runTest'], },