* add branding for ce * add ce changes * update colorpicker ux * remove unsued flag * Add new email templates Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com> * add local appsmith logo * code review feedback fixes + qa fixes * remove forward slash in url of favicon * fix message * Fix tests Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com> * update messages * Fix tests (again) Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com> * update messages * fix cypress tests * skipping app layout test cases * fix cypress tests * remove it.only * try moving test * use stable DS version * remove __diff Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com> Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com> Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
36 lines
1.1 KiB
TypeScript
Executable File
36 lines
1.1 KiB
TypeScript
Executable File
import React from "react";
|
|
import { AppState } from "@appsmith/reducers";
|
|
import { getCurrentUser, getUserAuthError } from "selectors/usersSelectors";
|
|
import { connect } from "react-redux";
|
|
import { ANONYMOUS_USERNAME, User } from "constants/userConstants";
|
|
import { Redirect } from "react-router";
|
|
import { APPLICATIONS_URL, AUTH_LOGIN_URL, BASE_URL } from "constants/routes";
|
|
import PageLoadingBar from "pages/common/PageLoadingBar";
|
|
import ServerUnavailable from "pages/common/ErrorPages/ServerUnavailable";
|
|
|
|
type Props = {
|
|
user?: User;
|
|
authError: string;
|
|
};
|
|
|
|
function LandingScreen(props: Props) {
|
|
if (props.user && window.location.pathname === BASE_URL) {
|
|
if (props.user.email === ANONYMOUS_USERNAME) {
|
|
return <Redirect to={AUTH_LOGIN_URL} />;
|
|
} else {
|
|
return <Redirect to={APPLICATIONS_URL} />;
|
|
}
|
|
}
|
|
if (props.authError && props.authError.length) {
|
|
return <ServerUnavailable />;
|
|
}
|
|
return <PageLoadingBar />;
|
|
}
|
|
|
|
const mapStateToProps = (state: AppState) => ({
|
|
user: getCurrentUser(state),
|
|
authError: getUserAuthError(state),
|
|
});
|
|
|
|
export default connect(mapStateToProps)(LandingScreen);
|