Merged PR 587: added environment variable switch for login
added environement variable switch for login Related work items: #6574
This commit is contained in:
@@ -31,3 +31,4 @@ SASKEYNAME = "testpedwhcpolicy"
|
||||
|
||||
|
||||
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||
SHOWLOGIN = "true"
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import Inspectorate from "./homepage/inspectorate";
|
||||
import CaseComment from "./homepage/casecomment";
|
||||
import Dns from "./homepage/dns";
|
||||
|
||||
export default function Home({ children, pages }) {
|
||||
export default function MainHome({ children, pages, showLogin }) {
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -28,7 +28,7 @@ export default function Home({ children, pages }) {
|
||||
<CaseSearch />
|
||||
<CaseComment />
|
||||
<Dns />
|
||||
<Login />
|
||||
{showLogin == "true" && <Login />}
|
||||
{/* <Inspectorate /> */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+15
-2
@@ -17,7 +17,7 @@ import { getIncidents } from "../actions";
|
||||
import { parseCookies } from "nookies";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
const { footerLinks, pages, showLogin } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -78,7 +78,7 @@ const Home = (props) => {
|
||||
<Header courseName="Appeals Casework Portal" />
|
||||
<div className="govuk-width-container">
|
||||
<ServiceBanner />
|
||||
<Main pages={pages} />
|
||||
<Main pages={pages} showLogin={showLogin} />
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
</div>
|
||||
@@ -86,4 +86,17 @@ const Home = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
|
||||
console.log("Show login module: ", showLoginCheck);
|
||||
|
||||
return {
|
||||
props: { showLogin: showLoginCheck },
|
||||
};
|
||||
}
|
||||
);
|
||||
export default Home; //connect(mapStateToProps)(Home);
|
||||
|
||||
Reference in New Issue
Block a user