Skip to content

Commit

Permalink
Merge pull request #446 from digitalgreenorg/FSPROD-1278
Browse files Browse the repository at this point in the history
FSPROD-1278 Participant Onboarding issue resolved.
  • Loading branch information
i-am-waseem authored Feb 20, 2023
2 parents 8c2b311 + 50f676b commit 5e054ac
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
48 changes: 28 additions & 20 deletions src/Components/signup/OrgRightside.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export default function OrgRightside(props) {
// // const [orgdeserror, serorgdeserror] = useState(false);
const [orgdesc, setorgdesc] = useState("");
const [isLoader, setIsLoader] = useState(false);
console.log( props.validOrgNumber, "KAKAKSANDKJDHBUDSBJVDSIUVBFSUYCBDSIUVDWBVDSBCVISDJFVYUDBDSIU")
console.log(
props.validOrgNumber,
"KAKAKSANDKJDHBUDSBJVDSIUVBFSUYCBDSIUVDWBVDSBCVISDJFVYUDBDSIU"
);

const [editorValue, setEditorValue] = React.useState(
RichTextEditor.createValueFromString(orgdesc, "html")
Expand Down Expand Up @@ -79,38 +82,38 @@ export default function OrgRightside(props) {
)
.then((response) => {
setIsLoader(false);
console.log("org data: ", response.data);
// let addressdata=JSON.parse(response.data.organization.address)
if (response.data.organization) {
props.setOrgName(response.data.organization.name);
props.setOrgName(response?.data?.organization?.name);
props.setOrgMail(response?.data?.organization?.org_email);
props.setOrgWebsite(response?.data?.organization?.website);
props.setOrgAddress(response?.data?.organization?.address?.address || JSON.parse(response?.data?.organization?.address)?.address);
props.setCountryValue(response?.data?.organization?.address?.country || JSON.parse(response?.data?.organization?.address)?.country)
props.setValidOrgnumber(response?.data?.user?.phone_number);
props.setOrgPincode(response?.data?.organization?.address?.pincode || JSON.parse(response?.data?.organization?.address)?.pincode)
if (
response.data.organization.name &&
response.data.organization.name.trim().length > 0
) {
props.setisOrgnameerror(false);
}
props.setOrgMail(response.data.organization.org_email);
if (
response.data.organization.org_email &&
response.data.organization.org_email.trim().length > 0
) {
props.setisOrgmailerror(false);
props.setOrgemailbtn(true);
}
props.setOrgWebsite(response.data.organization.website);

if (
response.data.organization.website &&
response.data.organization.website.trim().length > 0
) {
props.isOrgWebsiteerror(false);
}
props.setValidOrgnumber(response.data.organization.phone_number ? response.data.organization.phone_number : "");

if (response.data.organization.address) {
props.setOrgAddress(response.data.organization.address.address);
props.setOrgCity(response.data.organization.address.city);
props.setCountryValue(response.data.organization.address.country);
props.setOrgPincode(response.data.organization.address.pincode);

if (
response.data.organization.address.address &&
response.data.organization.address.address.trim().length > 0
Expand Down Expand Up @@ -606,7 +609,8 @@ export default function OrgRightside(props) {
value={props.countryvalue}
onChange={props.countrychangeHandler}
isSearchable={true}
label="Country">
label="Country"
>
{options.map((rowData, index) => (
<MenuItem value={rowData.label}>{rowData.label}</MenuItem>
))}
Expand Down Expand Up @@ -635,16 +639,16 @@ export default function OrgRightside(props) {
style={{ width: "420px", zIndex: 0 }}
value={props.orgPincode}
onKeyUp={() =>
props.orgPincode == ""
props.orgPincode === ""
? props.setispincodeerror(true)
: props.setispincodeerror(false)
}
onKeyDown={(e) => {
if (
e.key == "-" ||
e.key == "e" ||
e.key == "E" ||
e.key == "+"
e.key === "-" ||
e.key === "e" ||
e.key === "E" ||
e.key === "+"
) {
e.preventDefault();
}
Expand Down Expand Up @@ -726,7 +730,8 @@ export default function OrgRightside(props) {
fontWeight: "400",
fontSize: "12px",
lineHeight: "16px",
}}>
}}
>
{props.orgDescriptionErrorMessage
? props.orgDescriptionErrorMessage
: ""}
Expand Down Expand Up @@ -813,7 +818,8 @@ export default function OrgRightside(props) {
onClick={props.handleOrgSubmit}
variant="contained"
className="orgbtn"
type="submit">
type="submit"
>
<span className="signupbtnname">Next</span>
</Button>
) : (
Expand All @@ -828,7 +834,8 @@ export default function OrgRightside(props) {
variant="outlined"
className="finishlaterorgbtn"
type="button"
onClick={props.finishLaterOrgScreen}>
onClick={props.finishLaterOrgScreen}
>
Finish later
</Button>
</div>
Expand All @@ -840,7 +847,8 @@ export default function OrgRightside(props) {
width={150}
height={127}
fill="none"
xmlns="http://www.w3.org/2000/svg">
xmlns="http://www.w3.org/2000/svg"
>
<g opacity={0.1} fill="#E7B100">
<circle cx={5.814} cy={5.728} r={5.728} />
<circle cx={40.181} cy={5.728} r={5.728} />
Expand Down
7 changes: 2 additions & 5 deletions src/Views/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import RegexConstants from "../../Constants/RegexConstants";
import LeftintroParticipant from "../../Components/intros/LeftIntroParticipant";
import LocalStorageConstants from "../../Constants/LocalStorageConstants";
import AddingCategory from "../../Components/Catergories/AddingCategory";
import { ConsoleSqlOutlined } from "@ant-design/icons";
export default function Login(props) {
const [button, setButton] = useState(false);
const email = useRef();
Expand Down Expand Up @@ -593,10 +594,9 @@ export default function Login(props) {
// );
const [textEditorValue, settextEditorValue] = useState("");

const [validOrgNumber, setValidOrgnumber] = useState("");
const [validOrgNumber, setValidOrgnumber] = useState('');
const [orgfile, setorgfile] = useState(null);
const [orgmail, setOrgMail] = useState("");

const [Orgnamebtn, setOrgnamebtn] = useState(false);
const [Orgemailbtn, setOrgemailbtn] = useState(false);
const [Orgaddressbtn, setOrgaddressbtn] = useState(false);
Expand Down Expand Up @@ -650,7 +650,6 @@ export default function Login(props) {

// const pinCode = pincode.current.value;
const finalpinCode = orgPincode;

var id = getUserLocal();
console.log("user id", id);

Expand Down Expand Up @@ -795,8 +794,6 @@ export default function Login(props) {
};

const handleOrgnumber = (value) => {
console.log(value);

setValidOrgnumber(value ? value : "");
};

Expand Down

0 comments on commit 5e054ac

Please sign in to comment.