Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/client/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export type INJECTED_CONFIGS = {
disableTelemetry: boolean;
cloudServicesBaseUrl: string;
googleRecaptchaSiteKey: string;
onboardingFormEnabled: boolean;
supportEmail: string;
};
declare global {
Expand Down Expand Up @@ -120,7 +119,6 @@ const getConfigsFromEnvVars = (): INJECTED_CONFIGS => {
cloudServicesBaseUrl: process.env.REACT_APP_CLOUD_SERVICES_BASE_URL || "",
googleRecaptchaSiteKey:
process.env.REACT_APP_GOOGLE_RECAPTCHA_SITE_KEY || "",
onboardingFormEnabled: !!process.env.REACT_APP_SHOW_ONBOARDING_FORM,
supportEmail: process.env.APPSMITH_SUPPORT_EMAIL || "support@appsmith.com",
};
};
Expand Down Expand Up @@ -285,7 +283,6 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => {
cloudServicesBaseUrl:
ENV_CONFIG.cloudServicesBaseUrl ||
APPSMITH_FEATURE_CONFIGS.cloudServicesBaseUrl,
onboardingFormEnabled: ENV_CONFIG.onboardingFormEnabled,
appsmithSupportEmail: ENV_CONFIG.supportEmail,
};
};
1 change: 0 additions & 1 deletion app/client/src/configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,5 @@ export type AppsmithUIConfigs = {
enabled: boolean;
apiKey: string;
};
onboardingFormEnabled: boolean;
appsmithSupportEmail: string;
};
43 changes: 0 additions & 43 deletions app/client/src/pages/Applications/OnboardingForm.tsx

This file was deleted.

63 changes: 13 additions & 50 deletions app/client/src/pages/Applications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ import AnalyticsUtil from "utils/AnalyticsUtil";
import { createOrganizationSubmitHandler } from "../organization/helpers";
import UserApi from "api/UserApi";
import ImportApplicationModal from "./ImportApplicationModal";
import OnboardingForm from "./OnboardingForm";
import { getAppsmithConfigs } from "configs";
import { SIGNUP_SUCCESS_URL } from "constants/routes";
import {
setOnboardingFormInProgress,
getOnboardingFormInProgress,
} from "utils/storage";

import { getIsSafeRedirectURL } from "utils/helpers";

Expand Down Expand Up @@ -899,7 +893,6 @@ const getIsFromSignup = () => {
return window.location?.pathname === SIGNUP_SUCCESS_URL;
};

const { onboardingFormEnabled } = getAppsmithConfigs();
class Applications extends Component<
ApplicationProps,
{ selectedOrgId: string; showOnboardingForm: boolean }
Expand All @@ -916,29 +909,12 @@ class Applications extends Component<
componentDidMount() {
PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK);
PerformanceTracker.stopTracking(PerformanceTransactionName.SIGN_UP);
this.props.getAllApplication();
window.addEventListener("message", this.handleTypeFormMessage, false);
this.showOnboardingForm();
}

componentWillUnmount() {
window.removeEventListener("message", this.handleTypeFormMessage);
}

showOnboardingForm = async () => {
const isFromSignUp = getIsFromSignup();
const isOnboardingFormInProgress = await getOnboardingFormInProgress();
const showOnboardingForm =
onboardingFormEnabled && (isFromSignUp || isOnboardingFormInProgress);
this.setState({
showOnboardingForm: !!showOnboardingForm,
});

// Redirect directly in case we're not showing the onboarding form
if (isFromSignUp && !onboardingFormEnabled) {
if (isFromSignUp) {
this.redirectUsingQueryParam();
}
};
this.props.getAllApplication();
}

redirectUsingQueryParam = () => {
const urlObject = new URL(window.location.href);
Expand All @@ -954,32 +930,19 @@ class Applications extends Component<
}
};

handleTypeFormMessage = (event: any) => {
if (event?.data?.type === "form-submit" && this.state.showOnboardingForm) {
setOnboardingFormInProgress();
this.redirectUsingQueryParam();
}
};

public render() {
return (
<PageWrapper displayName="Applications">
{this.state.showOnboardingForm ? (
<OnboardingForm />
) : (
<>
<ProductUpdatesModal />
<LeftPane />
<SubHeader
search={{
placeholder: "Search for apps...",
queryFn: this.props.searchApplications,
defaultValue: this.props.searchKeyword,
}}
/>
<ApplicationsSection searchKeyword={this.props.searchKeyword} />
</>
)}
<ProductUpdatesModal />
<LeftPane />
<SubHeader
search={{
placeholder: "Search for apps...",
queryFn: this.props.searchApplications,
defaultValue: this.props.searchKeyword,
}}
/>
<ApplicationsSection searchKeyword={this.props.searchKeyword} />
</PageWrapper>
);
}
Expand Down
23 changes: 0 additions & 23 deletions app/client/src/utils/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,26 +207,3 @@ export const getCommentsIntroSeen = async () => {
log.error(error);
}
};

export const setOnboardingFormInProgress = async (flag?: boolean) => {
try {
await store.setItem(STORAGE_KEYS.ONBOARDING_FORM_IN_PROGRESS, flag);
return true;
} catch (error) {
log.error("An error occurred when setting ONBOARDING_FORM_IN_PROGRESS");
log.error(error);
return false;
}
};

export const getOnboardingFormInProgress = async () => {
try {
const onboardingFormInProgress = await store.getItem(
STORAGE_KEYS.ONBOARDING_FORM_IN_PROGRESS,
);
return onboardingFormInProgress;
} catch (error) {
log.error("An error occurred while fetching ONBOARDING_FORM_IN_PROGRESS");
log.error(error);
}
};