Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Achintha Isuru authored May 6, 2024
2 parents 44e39dd + 25632d9 commit c935939
Show file tree
Hide file tree
Showing 134 changed files with 38,353 additions and 16,143 deletions.
3 changes: 3 additions & 0 deletions b2b-sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ Select `Email`, `First Name`, `Last Name`, and `Username` from the list of attri
>| Authorized redirect URLs | `http://localhost:3001/api/auth/callback/wso2isAdmin` and `http://localhost:3001` |
>| Allowed origin | `http://localhost:3001` |
Also, On the User Attributes tab, click on + Add User Attributes.
Select `Email`, `First Name`, `Last Name`, and `Username` from the list of attributes.

- Navigate to the **Shared Access** tab of both created application.
- Select **Share with all organizations**, if you want to share your application with all existing organizations and every organization that will be created future.
- If you want to share the application with only a set of organizations when the organizations are onboarded, chose **Share with only selected organizations** option and select the required organizations.
Expand Down
2 changes: 1 addition & 1 deletion etc/sample-post-authentication-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
javax.servlet.http,
org.apache.commons.logging,
org.osgi.framework,
org.osgi.service.component,
org.osgi.service.component.*;version="${osgi.service.component.imp.pkg.version.range}",
org.wso2.carbon.identity.application.authentication.framework.config,
org.wso2.carbon.identity.application.authentication.framework.config.model,
org.wso2.carbon.identity.application.authentication.framework.context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@

package org.wso2.carbon.identity.post.authn.handler.disclaimer;

import org.apache.commons.codec.digest.DigestUtils;
import org.wso2.carbon.identity.application.authentication.framework.config.ConfigurationFacade;
import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.PostAuthenticationFailedException;
import org.wso2.carbon.identity.application.authentication.framework.handler.request.AbstractPostAuthnHandler;
import org.wso2.carbon.identity.application.authentication.framework.handler.request.PostAuthnHandlerFlowStatus;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand All @@ -54,15 +55,20 @@ public PostAuthnHandlerFlowStatus handle(HttpServletRequest httpServletRequest,
}
} else {
try {
String urlEncodedApplicationName = new URI(null, null, authenticationContext
.getSequenceConfig().getApplicationConfig().getApplicationName(), null).toASCIIString();

httpServletResponse.sendRedirect
(ConfigurationFacade.getInstance().getAuthenticationEndpointURL().replace("/login.do", ""
) + "/disclaimer" + ".jsp?sessionDataKey=" + authenticationContext.getContextIdentifier() +
"&application=" + authenticationContext
.getSequenceConfig().getApplicationConfig().getApplicationName());
(ConfigurationFacade.getInstance().getAuthenticationEndpointURL().replace("/login.do", "") +
"/disclaimer.jsp?sessionDataKey=" + authenticationContext.getContextIdentifier() +
"&application=" + urlEncodedApplicationName);
setConsentPoppedUpState(authenticationContext);
return PostAuthnHandlerFlowStatus.INCOMPLETE;
} catch (IOException e) {
throw new PostAuthenticationFailedException("Invalid Consent", "Error while redirecting", e);
} catch (URISyntaxException e) {
throw new PostAuthenticationFailedException("Invalid Application Name",
"Error encoding application name", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* New grant type for Identity Server
Expand Down Expand Up @@ -158,22 +160,21 @@ public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx)


/**
* TODO
*
* You need to implement how to validate the mobile number
*
* @param mobileNumber
* @return
* @param mobileNumber Mobile number of the user.
* @return true if the mobile number is valid, otherwise false.
*/
private boolean isValidMobileNumber(String mobileNumber){

// just demo validation

if(mobileNumber.startsWith("033")){
return true;
}

return false;
// Regular expression to match 10 digits, with optional country code
String pattern = "^(\\+\\d{1,3})?\\d{10}$";
// Create a Pattern object
Pattern r = Pattern.compile(pattern);
// Create Matcher object
Matcher m = r.matcher(mobileNumber);
// Check if the pattern matches
return m.matches();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import Image from "next/image";
import { FlexboxGrid } from "rsuite";
import GetStartedText from "./otherComponents/getStartedText";
import getStartedImage from "../../../../../../libs/business-admin-app/ui/ui-assets/src/lib/images/getStarted.svg";
import getStartedImage from "../../../../../../libs/business-admin-app/ui/ui-assets/src/lib/images/getStarted.png";

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default function GetStartedSectionComponentForAdmin(props: GetStartedSect
filteredCount["nutrition"])

],
backgroundColor: [ "#4e40ed", "#4e5ded", "#4e7eed", "#4e9bed", "#77b0ed" ]
backgroundColor: [ "#", "#4e5ded", "#4e7eed", "#4e9bed", "#77b0ed" ]
}
]
},
Expand Down Expand Up @@ -229,7 +229,11 @@ export default function GetStartedSectionComponentForAdmin(props: GetStartedSect
<div className={ styles.welcomeMainDiv }>
<AccountCircleIcon style={ { width: "8vh", height: "8vh" } }/>
<div className={ styles. welcomeDiv }>
{ "Welcome, " + session.user?.name.givenName + " " + session.user?.name.familyName + "!" }
{ "Welcome, " }
<b>{ session.user?.name.givenName }</b>
{ " " }
<b>{ session.user?.name.familyName }</b>
{ "!" }
</div>
<div className={ styles.tagLine }>
{ "Taking Veterinary Care to the Next Level of Excellence" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default function GetStartedSectionComponentForDoctor(props: GetStartedSec
datasets: [
{
data: [ filteredCount["confirmed"], filteredCount["completed"] ],
backgroundColor: [ "#4e40ed", "#4e7eed" ]
backgroundColor: [ "#69A2F4", "#4e7eed" ]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function GetStartedSectionComponentForPetOwner(props: GetStartedS
filteredCount["rabbit"],
petList?.length-
(filteredCount["dog"]+ filteredCount["cat"]+filteredCount["rabbit"]) ],
backgroundColor: [ "#4e40ed", "#4e5ded", "#4e7eed", "#4e9bed" ]
backgroundColor: [ "#69A2F4", "#4e5ded", "#4e7eed", "#4e9bed" ]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { LogoComponent } from "@pet-management-webapp/business-admin-app/ui/ui-c
import PagePreviousIcon from "@rsuite/icons/PagePrevious";
import Image from "next/image";
import { Button, Panel, Stack } from "rsuite";
import getStartedWelcomeImage from
"../../../../../../../libs/business-admin-app/ui/ui-assets/src/lib/images/getStartedWelcome.svg";
import styles from "../../../../../styles/Settings.module.css";

export default function GetStartedText() {
Expand All @@ -31,23 +29,18 @@ export default function GetStartedText() {

<Stack direction="column" spacing={ 50 } justifyContent="center">

<Image src={ getStartedWelcomeImage } alt="profile image" width={ 150 } />

<Stack direction="column" spacing={ 10 } justifyContent="center">
<p><strong>Welcome to</strong></p>
<LogoComponent imageSize="medium" />
</Stack>

<p className={ styles.getStartedSectionComponentGetStartedTextP }>
Welcome to Pet Care – the ultimate companion for every pet owner!
Our app is designed with a deep understanding of the unique bond between you and
your furry friends. Whether you have a playful pup, a curious cat, or any other beloved pet,
Pet Care is here to simplify and enhance every aspect of pet ownership.
Schedule appointments & keep your furry friend healthy all at your fingertips.
</p>

<Stack direction="column" spacing={ 20 } justifyContent="center">
<h4>Select one of the settings to get started</h4>
<Button appearance="ghost" size="lg">
<Button appearance="ghost" size="lg" className={ styles.getStartedButton }>
<Stack spacing={ 3 } justifyContent="center" alignItems="center">
<PagePreviousIcon />
<p>Get Started</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function PetCard(props: PetCardProps) {
/>
) : (
<Image
style={ { borderRadius: "10%", height: "100%", width: "100%" } }
style={ { borderRadius: "10%", height: "70%", width: "70%" } }
src={ PET_IMAGE }
alt="pet-thumbnail"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default function DoctorProfileSection(props: DoctorProfileSectionProps) {
<p>{ "Profile Information of the doctor" }</p>
</Stack>
<Button
className={ styles.buttonCircular }
appearance="primary"
size="lg"
onClick={ onEditProfileClick }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function FileUploadSingle(props: FileUploadProps) {
appearance="primary"
style={ {
border: "none",
borderRadius: "5px",
borderRadius: "22px",
boxShadow: "7px 6px 28px 1px rgba(0, 0, 0, 0.24)",
color: "#fff",
cursor: "pointer",
Expand All @@ -109,7 +109,7 @@ function FileUploadSingle(props: FileUploadProps) {
appearance="primary"
style={ {
border: "none",
borderRadius: "5px",
borderRadius: "22px",
boxShadow: "7px 6px 28px 1px rgba(0, 0, 0, 0.24)",
color: "#fff",
cursor: "pointer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ export default function ManageDoctorsSection(props: ManageDoctorsSectionProps) {
<p>{ "Manage doctors in the organization" }</p>
</Stack>
<Button
appearance="primary"
size="lg"
className={ styles.buttonCircular }
onClick={ onAddDoctorClick }
>
Add Doctor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import { Button } from "rsuite";
import styles from "../../../../../../styles/app.module.css";

interface AddUserButtonProps {
onClick : ()=>void
Expand All @@ -28,8 +29,7 @@ export default function AddUserButton(props : AddUserButtonProps) {

return (
<Button
appearance="primary"
size="lg"
className={ styles.buttonCircular }
onClick={ onClick }>
Add User
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function EmailAsMFA(props: EmailAsMFAProps) {
: (
<FlexboxGrid.Item colspan={ 6 }>
<Button
style={ { width: "125%", opacity:"0.9" } }
style={ { width: "125%", opacity:"0.9", borderRadius: "22px" } }
appearance="primary"
onClick={ onAddToLoginFlowClick }>
Add to the Login Flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function SmsAsMFA(props: SmsAsMFAProps) {
: (
<FlexboxGrid.Item colspan={ 6 }>
<Button
style={ { width: "125%", opacity:"0.9" } }
style={ { width: "125%", opacity:"0.9", borderRadius: "22px" } }
appearance="primary"
onClick={ onAddToLoginFlowClick }>
Add to the Login Flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function TotpAsMFA(props: TotpAsMFAProps) {
: (
<FlexboxGrid.Item colspan={ 6 }>
<Button
style={ { width: "125%", opacity:"0.9" } }
style={ { width: "125%", opacity:"0.9", borderRadius: "22px" } }
appearance="primary"
onClick={ onAddToLoginFlowClick }>
Add to the Login Flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default function PersonalizationSectionComponent(props: PersonalizationSe
/>
<Divider style={ { background: "#bebebe" } }/>
<Button
style={ { background: "rgba(255, 0, 0, 0.8)", width: "25%" } }
className={ styles["revertButton"] }
size="lg"
appearance="primary"
onClick={ onRevert } >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { IndexHomeComponent } from "@pet-management-webapp/shared/ui/ui-componen
import { NextRouter, useRouter } from "next/router";
import React, { useEffect } from "react";
import "rsuite/dist/rsuite.min.css";
import homeImage from "../../../libs/business-admin-app/ui/ui-assets/src/lib/images/businessAdminHome.jpeg";
import homeImage from "../../../libs/business-admin-app/ui/ui-assets/src/lib/images/businessAdminHome.png";
import { getPersonalization } from "../APICalls/GetPersonalization/get-personalization";
import personalize from "../components/sections/sections/settingsSection/personalizationSection/personalize";
import { Personalization } from "../types/personalization";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function Org(props : OrgProps) {
useEffect(() => {
getDoctor(session.accessToken, session.user.emails[0])
.catch((err) => {
if (err.response.status === 404 && session.group === "doctor") {
if (err.response?.status === 404 && session.group === "doctor") {
const payload: DoctorInfo = {
address: "",
availability: [],
Expand All @@ -106,7 +106,7 @@ export default function Org(props : OrgProps) {
personalize(response.data);
})
.catch(async (err) => {
if (err.response.status === 404 && session.group === "admin") {
if (err.response?.status === 404 && session.group === "admin") {
const res: BrandingPreference =
(await controllerDecodeGetBrandingPreference(session) as BrandingPreference);
const activeTheme: string = res["preference"]["theme"]["activeTheme"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
.welcomeDiv {
margin-top: -8vh;
margin-left: 9vh;
font-weight: bold;
font-weight: 200;
font-size: 3vh;
}

Expand All @@ -194,7 +194,7 @@
.tagLine {
margin-top: 0vh;
margin-left: 9vh;
font-size: 2vh;
font-size: 16px;
}

.upcomingBookingsDivForUser {
Expand Down Expand Up @@ -230,8 +230,6 @@

.orgInfoInputStyle {
width: 25vw;
font-size: 2vh;
margin-bottom: 1.5vh;
/* padding: 0.1vh;
margin-bottom: 1vh; */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,32 @@
justify-content: center;
align-items: center;
padding: 10px;
border: none;
}

/* getStartedSectionComponent-GetStartedText-P */
.getStartedSectionComponentGetStartedTextP {
text-align: center ;
}

.revertButton{
width: 25%;
height: 50px;
font-size: 18px;
border-radius: 22px;
box-shadow: none;
font-size: 1rem;
font-weight: 400;
padding: 14px 24px;
background-color: rgba(255, 0, 0, 0.8);
color: #ffffff;
border-color: #e2e2e2;
border-width: 0;
}

.getStartedButton{
height: 50px;
font-size: 18px;
border-radius: 22px;
}

Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,17 @@
background: #fafafa;
cursor: pointer;
}

.buttonCircular {
height: 50px;
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;
}
Loading

0 comments on commit c935939

Please sign in to comment.