Skip to content

Commit

Permalink
Merge pull request #486 from GurukiranP/ES-393
Browse files Browse the repository at this point in the history
Added console logs for debug purpose
  • Loading branch information
ase-101 authored Nov 28, 2023
2 parents e4b68b8 + 03db079 commit 31ad5bc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
3 changes: 2 additions & 1 deletion oidc-ui/src/components/Background.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export default function Background({

// check if background logo is needed or not,
// create div according to the environment variable
console.log("REACT_APP_BACKGROUND_LOGO", getBooleanValue("REACT_APP_BACKGROUND_LOGO"))
const backgroundLogoDiv =
getBooleanValue(process.env.REACT_APP_BACKGROUND_LOGO) ? (
getBooleanValue("REACT_APP_BACKGROUND_LOGO") ? (
<div className="flex justify-center m-10 lg:mt-20 mb:mt-0 lg:w-1/2 md:w-1/2 md:block sm:w-1/2 sm:block hidden w-5/6 mt-20 mb-10 md:mb-0">
<img
className="background-logo object-contain rtl:scale-x-[-1]"
Expand Down
5 changes: 3 additions & 2 deletions oidc-ui/src/components/Consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Consent({
const [cancelPopup, setCancelPopup] = useState(false);

const slideToggleClass = getBooleanValue(
process.env.REACT_APP_NO_OUTLINE_TOGGLE
"REACT_APP_NO_OUTLINE_TOGGLE"
)
? "toggle-no-outline"
: "toggle-outline";
Expand Down Expand Up @@ -406,8 +406,9 @@ export default function Consent({

// check if background logo is needed or not,
// create div according to the environment variable
console.log("REACT_APP_BACKGROUND_LOGO_CONSENT", getBooleanValue("REACT_APP_BACKGROUND_LOGO"))
const backgroundLogoDiv =
getBooleanValue(process.env.REACT_APP_BACKGROUND_LOGO) ? (
getBooleanValue("REACT_APP_BACKGROUND_LOGO") ? (
<div className="flex justify-center m-10 lg:mt-20 mb:mt-0 lg:w-1/2 md:w-1/2 md:block sm:w-1/2 sm:block hidden w-5/6 mt-20 mb-10 md:mb-0">
<img
className="background-logo object-contain rtl:scale-x-[-1]"
Expand Down
3 changes: 2 additions & 1 deletion oidc-ui/src/components/EsignetDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export default function EsignetDetails({ i18nKeyPrefix = "esignetDetails" }) {

// check if background logo is needed or not,
// create div according to the environment variable
console.log("REACT_APP_BACKGROUND_LOGO_ESIGNETDETAILS", getBooleanValue("REACT_APP_BACKGROUND_LOGO"))
const backgroundLogoDiv =
getBooleanValue(process.env.REACT_APP_BACKGROUND_LOGO) ? (
getBooleanValue("REACT_APP_BACKGROUND_LOGO") ? (
<div className="flex justify-center m-10 lg:mt-20 mb:mt-0 lg:w-1/2 md:w-1/2 md:block sm:w-1/2 sm:block hidden w-5/6 mt-20 mb-10 md:mb-0">
<img
className="background-logo object-contain rtl:scale-x-[-1]"
Expand Down
5 changes: 4 additions & 1 deletion oidc-ui/src/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { useTranslation } from "react-i18next";
import { getBooleanValue } from "../services/utilService";

export default function Footer({ i18nKeyPrefix = "footer" }) {
const footerCheck = getBooleanValue(process.env.REACT_APP_FOOTER);
console.log(process.env.REACT_APP_FOOTER)
console.log(typeof process.env.REACT_APP_FOOTER)
console.log("REACT_APP_FOOTER", getBooleanValue("REACT_APP_FOOTER"))
const footerCheck = getBooleanValue("REACT_APP_FOOTER");

const { t } = useTranslation("translation", {
keyPrefix: i18nKeyPrefix,
Expand Down
2 changes: 1 addition & 1 deletion oidc-ui/src/components/NavHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function NavHeader({ langOptions, i18nKeyPrefix = "header" }) {
i18n.changeLanguage(e.value);
};

const removeIndicatorPipe = getBooleanValue(process.env.REACT_APP_REMOVE_INDICATOR_PIPE);
const removeIndicatorPipe = getBooleanValue("REACT_APP_REMOVE_INDICATOR_PIPE");

const customStyles = {
control: (base) => ({
Expand Down
9 changes: 7 additions & 2 deletions oidc-ui/src/services/utilService.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const getBooleanValue = (inputValue) => {
if (typeof(inputValue) === 'undefined' || inputValue === null || inputValue === '') {
var val = process.env[inputValue]
console.log(inputValue, val)
console.log(typeof val)
if (typeof(val) === 'undefined' || val === null || val === '') {
console.log("no input provided", inputValue)
return false;
}
return /^true$/i.test(inputValue);
console.log("valid input provided", inputValue)
return /^true$/i.test(val);
}

export { getBooleanValue };

0 comments on commit 31ad5bc

Please sign in to comment.