-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(create-forms): 🎉 update create forms
- Loading branch information
1 parent
0b350c9
commit 67bec98
Showing
13 changed files
with
387 additions
and
203 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/components/CreateEnvironmentFormStep1Tour/CreateEnvironmentFormStep1Tour.tsx
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,21 @@ | ||
import { ReactElement } from "react"; | ||
import { getGuideItem } from "../../functions/handleGuide"; | ||
import TourGuide from "../TourGuide/TourGuide"; | ||
|
||
export default function CreateEnvironmentFormStep1Tour(): ReactElement { | ||
return ( | ||
<TourGuide | ||
hiddenButton | ||
type="createRobotStep1" | ||
tourConfig={[ | ||
getGuideItem("[data-tut='create-application-step1-name']"), | ||
getGuideItem( | ||
"[data-tut='create-application-step1-environment-selector']", | ||
), | ||
getGuideItem("[data-tut='create-robot-step1-storage']"), | ||
getGuideItem("[data-tut='create-environment-vdi-session-count']"), | ||
getGuideItem("[data-tut='create-environment-gpu-resource']"), | ||
]} | ||
/> | ||
); | ||
} |
74 changes: 74 additions & 0 deletions
74
src/components/CreateFormStep2Tour/CreateFormStep2Tour.tsx
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,74 @@ | ||
import { ReactElement } from "react"; | ||
import { getGuideItem } from "../../functions/handleGuide"; | ||
import { envOnPremiseRobot } from "../../helpers/envProvider"; | ||
import TourGuide from "../TourGuide/TourGuide"; | ||
|
||
export default function CreateFormStep2Tour(): ReactElement { | ||
return ( | ||
<TourGuide | ||
hiddenButton | ||
type="createRobotStep2" | ||
tourConfig={ | ||
envOnPremiseRobot | ||
? [ | ||
getGuideItem("[data-tut='create-robot-step2-workspaces']"), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-add-button']", | ||
), | ||
getGuideItem("[data-tut='create-robot-step2-workspace-name']"), | ||
|
||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-delete-button']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repositories']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-repository-add-button']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-name']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-url']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-branch']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-delete-button']", | ||
), | ||
] | ||
: [ | ||
getGuideItem("[data-tut='create-robot-step2-workspaces']"), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-add-button']", | ||
), | ||
getGuideItem("[data-tut='create-robot-step2-workspace-name']"), | ||
getGuideItem("[data-tut='create-robot-step2-workspace-distro']"), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-delete-button']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repositories']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-repository-add-button']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-name']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-url']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-branch']", | ||
), | ||
getGuideItem( | ||
"[data-tut='create-robot-step2-workspace-repository-delete-button']", | ||
), | ||
] | ||
} | ||
/> | ||
); | ||
} |
22 changes: 22 additions & 0 deletions
22
src/components/CreateFormStep3Tour/CreateFormStep3Tour.tsx
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,22 @@ | ||
import React, { ReactElement } from "react"; | ||
import TourGuide from "../TourGuide/TourGuide"; | ||
import { getGuideItem } from "../../functions/handleGuide"; | ||
|
||
export default function CreateFormStep3Tour(): ReactElement { | ||
return ( | ||
<TourGuide | ||
hiddenButton | ||
type="createRobotStep3" | ||
tourConfig={[ | ||
getGuideItem("[data-tut='create-robot-step3-name']"), | ||
getGuideItem("[data-tut='create-robot-step3-steps']"), | ||
getGuideItem("[data-tut='create-robot-step3-build-add-button']"), | ||
getGuideItem("[data-tut='create-robot-build-step-name']"), | ||
getGuideItem("[data-tut='create-robot-build-step-workspace']"), | ||
getGuideItem("[data-tut='create-robot-build-step-code-type']"), | ||
getGuideItem("[data-tut='create-robot-build-step-code']"), | ||
getGuideItem("[data-tut='create-robot-build-step-scope']"), | ||
]} | ||
/> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/components/CreateFormStep4Tour /CreateFormStep4Tour .tsx
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 @@ | ||
import { ReactElement } from "react"; | ||
import { getGuideItem } from "../../functions/handleGuide"; | ||
import TourGuide from "../TourGuide/TourGuide"; | ||
|
||
export default function CreateFormStep4Tour(): ReactElement { | ||
return ( | ||
<TourGuide | ||
hiddenButton | ||
type="createRobotStep4" | ||
tourConfig={[ | ||
getGuideItem("[data-tut='create-robot-step4-name']"), | ||
getGuideItem("[data-tut='create-robot-step4-workspace']"), | ||
getGuideItem("[data-tut='create-robot-step4-code']"), | ||
getGuideItem("[data-tut='create-robot-build-step-scope']"), | ||
getGuideItem("[data-tut='create-robot-step4-environments']"), | ||
getGuideItem("[data-tut='create-robot-step4-environments-add-button']"), | ||
]} | ||
/> | ||
); | ||
} |
37 changes: 37 additions & 0 deletions
37
src/components/CreateFormTourSwither/CreateFormTourSwither.tsx
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,37 @@ | ||
import React, { Fragment, ReactElement } from "react"; | ||
import CreateRobotFormStep1Tour from "../CreateRobotFormStep1Tour/CreateRobotFormStep1Tour"; | ||
import CreateEnvironmentFormStep1Tour from "../CreateEnvironmentFormStep1Tour/CreateEnvironmentFormStep1Tour"; | ||
import CreateFormStep3Tour from "../CreateFormStep3Tour/CreateFormStep3Tour"; | ||
import CreateFormStep2Tour from "../CreateFormStep2Tour/CreateFormStep2Tour"; | ||
import CreateFormStep4Tour from "../CreateFormStep4Tour /CreateFormStep4Tour "; | ||
|
||
interface ICreateFormTourSwither { | ||
isLoading?: boolean; | ||
type: "step1-robot" | "step1-app" | "workspace" | "build" | "launch"; | ||
} | ||
|
||
export default function CreateFormTourSwither({ | ||
isLoading, | ||
type, | ||
}: ICreateFormTourSwither): ReactElement { | ||
return ( | ||
<Fragment> | ||
{(() => { | ||
if (!isLoading) { | ||
switch (type) { | ||
case "step1-robot": | ||
return <CreateRobotFormStep1Tour />; | ||
case "step1-app": | ||
return <CreateEnvironmentFormStep1Tour />; | ||
case "workspace": | ||
return <CreateFormStep2Tour />; | ||
case "build": | ||
return <CreateFormStep3Tour />; | ||
case "launch": | ||
return <CreateFormStep4Tour />; | ||
} | ||
} | ||
})()} | ||
</Fragment> | ||
); | ||
} |
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
Oops, something went wrong.