|
@@ -198,6 +198,14 @@ class Home extends Component<PropsType, StateType> {
|
|
|
urlParams.delete("gh_oauth");
|
|
urlParams.delete("gh_oauth");
|
|
|
this.getProjects(defaultProjectId);
|
|
this.getProjects(defaultProjectId);
|
|
|
this.getMetadata();
|
|
this.getMetadata();
|
|
|
|
|
+
|
|
|
|
|
+ if (
|
|
|
|
|
+ !this.context.hasFinishedOnboarding &&
|
|
|
|
|
+ this.props.history.location.pathname &&
|
|
|
|
|
+ !this.props.history.location.pathname.includes("onboarding")
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.context.setCurrentModal("RedirectToOnboardingModal");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async checkIfProjectHasBilling(projectId: number) {
|
|
async checkIfProjectHasBilling(projectId: number) {
|
|
@@ -223,9 +231,6 @@ class Home extends Component<PropsType, StateType> {
|
|
|
const res = await api.getOnboardingState("<token>", {}, { project_id });
|
|
const res = await api.getOnboardingState("<token>", {}, { project_id });
|
|
|
|
|
|
|
|
if (res?.data && res?.data.current_step !== "clean_up") {
|
|
if (res?.data && res?.data.current_step !== "clean_up") {
|
|
|
- if (!window.location.pathname.includes("/onboarding")) {
|
|
|
|
|
- this.context.setCurrentModal("RedirectToOnboardingModal");
|
|
|
|
|
- }
|
|
|
|
|
this.context.setHasFinishedOnboarding(false);
|
|
this.context.setHasFinishedOnboarding(false);
|
|
|
} else {
|
|
} else {
|
|
|
this.context.setHasFinishedOnboarding(true);
|
|
this.context.setHasFinishedOnboarding(true);
|
|
@@ -238,6 +243,14 @@ class Home extends Component<PropsType, StateType> {
|
|
|
// 2. Make sure switching projects shows appropriate initial view (dashboard || provisioner)
|
|
// 2. Make sure switching projects shows appropriate initial view (dashboard || provisioner)
|
|
|
// 3. Make sure initializing from URL (DO oauth) displays the appropriate initial view
|
|
// 3. Make sure initializing from URL (DO oauth) displays the appropriate initial view
|
|
|
componentDidUpdate(prevProps: PropsType) {
|
|
componentDidUpdate(prevProps: PropsType) {
|
|
|
|
|
+ if (
|
|
|
|
|
+ !this.context.hasFinishedOnboarding &&
|
|
|
|
|
+ prevProps.match.url !== this.props.match.url &&
|
|
|
|
|
+ this.props.history.location.pathname &&
|
|
|
|
|
+ !this.props.history.location.pathname.includes("onboarding")
|
|
|
|
|
+ ) {
|
|
|
|
|
+ this.context.setCurrentModal("RedirectToOnboardingModal");
|
|
|
|
|
+ }
|
|
|
if (prevProps.currentProject?.id !== this.props.currentProject?.id) {
|
|
if (prevProps.currentProject?.id !== this.props.currentProject?.id) {
|
|
|
this.checkOnboarding();
|
|
this.checkOnboarding();
|
|
|
this.checkIfProjectHasBilling(this?.context?.currentProject?.id)
|
|
this.checkIfProjectHasBilling(this?.context?.currentProject?.id)
|
|
@@ -402,11 +415,6 @@ class Home extends Component<PropsType, StateType> {
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
<ViewWrapper>
|
|
<ViewWrapper>
|
|
|
- <Navbar
|
|
|
|
|
- logOut={this.props.logOut}
|
|
|
|
|
- currentView={this.props.currentRoute} // For form feedback
|
|
|
|
|
- />
|
|
|
|
|
-
|
|
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Route
|
|
<Route
|
|
|
path="/new-project"
|
|
path="/new-project"
|
|
@@ -477,6 +485,10 @@ class Home extends Component<PropsType, StateType> {
|
|
|
/>
|
|
/>
|
|
|
<Route path={"*"} render={() => <Templates />} />
|
|
<Route path={"*"} render={() => <Templates />} />
|
|
|
</Switch>
|
|
</Switch>
|
|
|
|
|
+ <Navbar
|
|
|
|
|
+ logOut={this.props.logOut}
|
|
|
|
|
+ currentView={this.props.currentRoute} // For form feedback
|
|
|
|
|
+ />
|
|
|
</ViewWrapper>
|
|
</ViewWrapper>
|
|
|
|
|
|
|
|
<ConfirmOverlay
|
|
<ConfirmOverlay
|