From 6573b52be1bc76107921f4ff8af0fbf1eac6440c Mon Sep 17 00:00:00 2001 From: Dasuni Geeganage Date: Thu, 2 May 2024 12:08:58 +0530 Subject: [PATCH 1/3] Delete petcare-sample/b2c/web-app/petdesk/web/react/src/app.css --- .../b2c/web-app/petdesk/web/react/src/app.css | 728 ------------------ 1 file changed, 728 deletions(-) delete mode 100644 petcare-sample/b2c/web-app/petdesk/web/react/src/app.css diff --git a/petcare-sample/b2c/web-app/petdesk/web/react/src/app.css b/petcare-sample/b2c/web-app/petdesk/web/react/src/app.css deleted file mode 100644 index 4aa29d98f..000000000 --- a/petcare-sample/b2c/web-app/petdesk/web/react/src/app.css +++ /dev/null @@ -1,728 +0,0 @@ -/** - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - - -body { - margin: 0; - padding: 0; - text-align: center; - color: #2A2A2A; - background-color: #ffffff; - /* background-imagrgb(255, 255, 255)"https://user-images.githubusercontent.com/35829027/230572364-20406db8-6f8e-4f52-9b50-d776765bd1fd.png"); */ - font-family: 'Montserrat', sans-serif; -} - -h1, h2, h3, h4, h5 { - font-weight: 300; -} - -h1 b, h2 b, h3 b, h4 b, h5 b { - font-weight: 400; -} - -b { - font-weight: 500; -} - -a { - color: #f47421; -} - -a:hover { - text-decoration: none; - ; -} - -.mb-0 { - margin-bottom: 0 !important; -} - -.mt-4 { - margin-top: 40px !important; -} - -.my-4 { - margin: 40px auto 40px auto; -} - -.home-image { - vertical-align: middle; - margin-bottom: 50px; -} - -.home-image .logo { - width: 150px; - vertical-align: middle; -} - -.home-image .logo-plus { - display: inline-block; - font-size: 50px; - margin: 0 15px 0 30px; - vertical-align: middle; -} - -img.footer-image { - width: 50px; - margin: 30px auto; - opacity: .8; -} - -img.logo-image { - width: 200px; - margin-top: 100px; -} - -code { - background: #272822; - padding: 4px; - font-size: 90%; - color: #fd971f; -} - -.code { - background: #272822; - display: block; - word-break: break-all; - padding: 20px; - text-align: left; - border-radius: 4px; -} - -.code .id-token-0 { - color: #cc6633; -} - -.code .id-token-1 { - color: #f9f8f5; -} - -.code .id-token-2 { - color: #fd971f; -} - -.row { - width: 100%; - display: flex; - text-align: left; -} - -.row>.column { - flex: 40%; - margin-right: 15px; -} - -.row>.column:last-child { - flex: 60%; - margin-right: 0; -} - -@media screen and (max-width: 600px) { - .column { - width: 100%; - margin-right: 0; - } -} - -.container { - border: 1px solid #e2e2e2; - /* width: 470px; - height: 580px; */ - margin: 0 auto; - margin-top: 0px; - border-radius: 0px; - position: absolute; - top: 0; right: 0; bottom: 0; left: 0; - min-width: 97%; - min-height: 97%; - overflow-x: hidden; - overflow-y: hidden; -} - -.json { - text-align: left; - display: block; - overflow: auto; - word-break: break-all; -} - -.json .pretty-json-container.object-container { - padding: 20px; -} - -.header-title { - background-color: #ffffff; - color: #ffffff; - /* padding: 20px; */ - /* border-radius: 10px 10px 0 0; */ - min-width: 100%; - max-width: 100%; -} - -.content { - padding: 0px; - background-color: #f7f6f8; - min-width: 100vw; - min-height:100vh; - height: 100vh; - position: absolute; - overflow: hidden; - background-color: #ffffff; - /* background-image: url("https://user-images.githubusercontent.com/35829027/230468155-2e1ac5d7-b35c-4392-b9fe-40cfb7fea7d8.png"); - background-repeat: no-repeat; - -webkit-background-size: contain; - -moz-background-size: contain; - -o-background-size: contain; - background-size: contain; */ -} - -.content .spa-app-description { - line-height: 1.7; -} - -.btn.primary, .btn.primary:active, .btn.primary:focus { - background-color: #4AD6DB; - border-radius: 3px; - border: none; - color: #ffffff; - display: inline-block; - font-size: 1.14285714rem; - text-align: center; - text-decoration: none; - width: 150px; - cursor: pointer; - -webkit-text-size-adjust: none; - padding: .78571429em 1.5em .78571429em; - margin-top: 30px; - outline: none; -} - -.btn.secondary { - background-color: white; - border-radius: 3px; - border: none; - color: #4AD6DB; - display: inline-block; - font-size: 1.14285714rem; - text-align: center; - text-decoration: none; - width: 150px; - cursor: pointer; - -webkit-text-size-adjust: none; - padding: .78571429em 1.5em .78571429em; - margin-top: 30px; - outline: none; -} - -.sub-title { - margin-top: 0; -} - -.inline-code-block { - border-radius: 6px; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - padding: 3px 5px; - border: 1px solid #cdcdcd; - background-color: white; - font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; -} - -.inline-code-block a { - text-decoration: none !important; -} - -.pointer { - cursor: pointer; -} - -.ui.attached.negative.message, -.ui.negative.message { - background-color: #fff6f6; - color: #9f3a38; - box-shadow: 0 0 0 1px #e0b4b4 inset, 0 0 0 0 transparent; - padding: 1em 1.5em; -} - -.asg-json-viewer { - background-color: #272822 !important; - padding: 20px; -} - -.header { - padding: 1vw; - background: #69A2F4; - font-size: 16px; - height: 4vh; - max-width: 100vW; - justify-content: center; - flex-direction: column; - display: flex; - } - -.username { - position: absolute; - right: 200px; - color: #ffffff; - top:3%; -} - -.horizontal-right { - margin: 0; - position: absolute; - right: 30px; - top:3%; - -ms-transform: translateY(-50%); - transform: translateY(-50%); - } - -.add-pet-right { - position: absolute; - top: 65vh; - left: 70vw; - text-align: left; -} - -.table-view { - position:absolute; - transform: translate(-50%, 8vh); - left: 50%; - color: white; - top:80%; - width: 63vw; -} - -.rowStyle { - background-color: #f5f5f1; - padding: 100px; -} - -.home-page-title-style { - font-weight: bold; - font-size: 30px; - color: black; - text-align: center; -} - -.app-title-style { - width:400px; - text-align: left; - color: white; - font-weight: bold; - font-size: 20px; - position: absolute; - left: 4vw; -} - -.pet-logo-image { - width: 170px; -} - -.grid-item { - min-width:30vw; - min-height: 35vw; - align-items: center; - height: fit-content; - width: fit-content; -} - -.user-menu-div { - width: 350px; - right: 20px; - position:absolute; - height: 100px; -} - -.menu-btn { - background-color: #69A2F4; - width: 10vw; - height: 5vh; - border: none; -} - -.arrow-down { - border: solid rgb(255, 255, 255); - border-width: 0 0.5vh 0.5vh 0; - display: inline-block; - padding: 0.8vh; - transform: rotate(45deg); - -webkit-transform: rotate(45deg); - right: 0px; - position: absolute; - height: 1px; -} - -.usename-label { - padding: 0px; - color: rgb(255, 255, 255); - font-size: 16px; - position: absolute; - right: 1vw; - width: 20vw; - text-align: center; - font-family: 'montserrat'; -} - -.list-style { - width: 12vw; - position: absolute; - padding: 5px 10px 5px 15px !important; - margin: 20px; -} - -.nav-list-item { - padding: 10px; - margin: 10px; -} - -.menu-style { - position: absolute; - top: 50px; - right:100px; -} - -.settings-div { - width: 45vw; - height: 55vh; - background-color: white; - margin-top: 7%; - top: 10%; - left: 30%; - right:30%; - outline: 2px solid #bcbebf; - border-radius: 10px; - position: absolute; - align-items: left; - overflow: hidden; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - -.billing-div { - width: 35vw; - height: 57vh; - background-color: white; - margin-top: 7%; - top: 10%; - left: 30%; - right:30%; - outline: 2px solid #bcbebf; - border-radius: 10px; - position: absolute; - align-items: left; - overflow: hidden; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - -.notification-div { - border-radius: 10px; - width: 37vw; - height: 27vh; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - -} - -.billing-form-div { - border-radius: 10px; - width: 39vw; - height: 30vh; - position: absolute; - top: 50%; - left: 55%; - transform: translate(-50%, -50%); - -} - -.settings-panel { - width: 100%; - align-items: center; -} - -.settings-title-style { - font-size:32px; - font-family: 'Montserrat', sans-serif; -} - -.settings-grid { - position: absolute; - width: 30vw; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -30%); -} - -.settings-save-btn { - border: none; - width: 200px; - position: absolute; - top: 53%; - left: 50%; - transform: translate(-50%, 18vh); - font-size: 2vh; - height: 45px; - font-size: 18px; - border-radius: 22px; - box-shadow: none; - font-size: 1rem; - font-weight: 400; - padding: 14px 24px; - background-color: #69A2F4; - color: #ffffff; -} - -.test { - background-color: #561414; - min-width: 100%; - min-height: 100%; - overflow: hidden; - overflow-block: hidden; -} - -.get-started-btn { - height: 45px; - font-size: 18px; - border-radius: 22px; - box-shadow: none; - font-size: 1rem; - font-weight: 400; - padding: 14px 24px; - background-color: #69A2F4; - color: #ffffff; - border-color: #e2e2e2; - border-width: 0; - width: 200px; -} - -.home-wording { - font-size: 22px; - font-family: 'Montserrat', sans-serif; -} - -.wording-div { - /* position: absolute; */ - /* top: 15%; */ - left: 22%; - text-align: left; -} - -.home-wording-sec { - font-weight: bold; - font-size: 20px; - font-family: 'Montserrat', sans-serif; - text-align: left; - color: rgb(131, 133, 131); -} - -.add-pet-btn { - height: 45px; - font-size: 18px; - border-radius: 22px; - border: none; - font-size: 1rem; - font-weight: 400; - padding: 14px 24px; - background-color: #69A2F4; - color: #ffffff; - width: 200px; -} - -.my-pets { - margin-top: 10px; - position: absolute; - top: 65vh; - margin-left: 10%; - text-align: center; - width: 100%; - display: flex; - justify-content: space-evenly; -} - -.notification-label { - font-size: 16px; - color: rgb(114, 112, 112); - text-align: left; - position: absolute; - left: 2vw; - top: 3vh; - font-family: 'Montserrat', sans-serif; -} - -.enable-label { - position: absolute; - /* top: 1vh; - left: 9vw; */ - font-size: 16px; -} - -.email-label { - position: absolute; - /* top: 8.4vh; - left: 5vw; */ - font-size: 2.7vh; -} - -.alerts-div { - position: absolute; - top: 50px; - left: 50px; -} - -.cover-div { - position: absolute; - left: 0px; - /* background-image: url("../src/images/basic_cover.png"); */ - padding: 0px; - min-width: 100%; - min-height:40vh; - height: 50vh; - overflow-x: hidden; - /* -webkit-background-size: cover; - -moz-background-size: cover; - -o-background-size: cover; - background-size: cover; */ - background-color: #d7dfee4a; - margin: 10px; - padding: 20px; -} - -.cover-row { - display: flex; - -} - -.cover-column-left { - width: 60%; - display: flex; - flex-direction: column; - align-items: center; -} - -.cover-column-right { - width: 40%; -} - -.logo-div { - position: absolute; - top: 10vh; - left: 4vw; - width: 20vw; - height: 10vh; -} - -.get-started-wording { - color: white; - font-weight: bold; - font-size: 4vw; - font-family: 'Montserrat', sans-serif; -} - -.get-started-wording-div { - position: absolute; - width: 30vw; - height: 20vh; - top:30vh; - left: 6vw; - text-align: left; -} - -.dog-img { - position: absolute; - top: 30vh; - right: 20vw; -} - -.cat-img { - position: absolute; - top: 11vh; - right: 5vw; -} - -.rabbit-img { - position: absolute; - top: 60vh; - right: 5vw; -} - -.quarter-circle { - width: 70vh; - height: 70vh; - border-radius: 300vh 0 0 0; - background: linear-gradient(to right, #F4B24E, #FFDE59); - position: absolute; - bottom: 0vh; - right: 0vw; -} - -.switch-style { - width: 40vw; - height: 2vh; -} - -.cover-img { - position: absolute; - top: 15vh; - right: 5vw; - width:20vw; - height: 19vw; -} - -.cover-wording { - position: absolute; - top: 20vh; - left: 10vw; -} - -.wording-style { - font-size: 16px; - color: #ffffff; - font-family: 'Montserrat', sans-serif; -} - -.list-text { - font-size: 30%; - color: #de3f67; - font-weight: bolder; - font-family: 'Montserrat', sans-serif; -} - -.signInDiv { - padding: 5rem 2rem; - background-color: #ffffff; - /* width: 25vw; */ - /* padding: 10rem 2rem; */ - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - flex-wrap: nowrap; - flex: 1; -} - -.tagline { - width: 60%; - color: #939B9B; -} \ No newline at end of file From b426237ec7d61cfd3a1da0488016849ecb37af19 Mon Sep 17 00:00:00 2001 From: Dasuni Geeganage Date: Thu, 2 May 2024 12:10:13 +0530 Subject: [PATCH 2/3] Delete petcare-sample/b2c/web-app/petdesk/web/react/src/app.tsx Delete duplicate file --- .../b2c/web-app/petdesk/web/react/src/app.tsx | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 petcare-sample/b2c/web-app/petdesk/web/react/src/app.tsx diff --git a/petcare-sample/b2c/web-app/petdesk/web/react/src/app.tsx b/petcare-sample/b2c/web-app/petdesk/web/react/src/app.tsx deleted file mode 100644 index b7c74b426..000000000 --- a/petcare-sample/b2c/web-app/petdesk/web/react/src/app.tsx +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { AuthProvider, useAuthContext } from "@asgardeo/auth-react"; -import React, { FunctionComponent, ReactElement } from "react"; -import { createRoot } from "react-dom/client"; -import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; -import "./app.css"; -import { ErrorBoundary } from "./error-boundary"; -import { HomePage, NotFoundPage } from "./pages"; -import { default as authConfig } from "../../../web/react/config.json"; - -const AppContent: FunctionComponent = (): ReactElement => { - const { error } = useAuthContext(); - - return ( - - - - } /> - } /> - - - - ) -}; - -const App = () => ( - - - -); - -const root = createRoot(document.getElementById("root")); -root.render(); From aebbbff4eeefcfac6403a8125a13790ed0e60f7e Mon Sep 17 00:00:00 2001 From: Dasuni Geeganage Date: Fri, 3 May 2024 06:43:04 +0530 Subject: [PATCH 3/3] Add session management config --- .../b2c/web-app/petdesk/web/react/src/util/getConfig.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx b/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx index b576204b2..9da48d6d8 100644 --- a/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx +++ b/petcare-sample/b2c/web-app/petdesk/web/react/src/util/getConfig.tsx @@ -26,6 +26,7 @@ interface Config { petManagementServiceURL: string; billingServerURL: string; salesforceServerURL: string; + enableOIDCSessionManagement: boolean; } declare global { @@ -43,7 +44,8 @@ const authConfig = { petManagementServiceURL: window.config.petManagementServiceURL, billingServerURL: window.config.billingServerURL, salesforceServerURL: window.config.salesforceServerURL, - scope: ["openid", "profile", "email", "acr"], + enableOIDCSessionManagement: true, + scope: ["openid", "profile", "email", "acr"] }; export function getConfig() {