Skip to content

Commit

Permalink
Bugs resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakPawar95 committed Feb 23, 2021
1 parent fd59294 commit fd81240
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 40 deletions.
1 change: 1 addition & 0 deletions Backend/web/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_ENABLE_TEST_CONNECTION = 1
46 changes: 28 additions & 18 deletions Backend/web/src/app/components/Pages/Authentication/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,23 @@ const AuthenticationPage = ({
title: "Connection Established",
showConfirmButton: true,
confirmButtonColor: "#3D476E"
}).then(()=>window.location.reload());
}).then(() => window.location.reload());

return response;
} catch (error) {
if(!(error.toString()==="TypeError: Cannot read property '0' of undefined"||error.toString()==="TypeError: result.value is undefined"))
Swal.fire({
icon: "error",
title: "Connection not Established",
showConfirmButton: true,
confirmButtonColor: "#3D476E"
});

if (
!(
error.toString() ===
"TypeError: Cannot read property '0' of undefined" ||
error.toString() === "TypeError: result.value is undefined"
)
)
Swal.fire({
icon: "error",
title: "Connection not Established",
showConfirmButton: true,
confirmButtonColor: "#3D476E"
});
}
})
.catch(() => {
Expand Down Expand Up @@ -155,7 +160,7 @@ const AuthenticationPage = ({
<Input
placeholder="BNKXXXXX"
id="username"
onChange={e =>
onChange={(e) =>
setUsername(e.target.value.trim())
}
/>
Expand All @@ -173,7 +178,7 @@ const AuthenticationPage = ({
placeholder="Enter your password"
type="password"
id="password"
onChange={e =>
onChange={(e) =>
setPassword(e.target.value)
}
/>
Expand All @@ -195,14 +200,19 @@ const AuthenticationPage = ({
<div className="text-center pt-4 text-black-50">
Don't have an account?{" "}
<Link to={routes.app.authentication.signup}>
Click here to Sign Up
Click here to Sign Up
</Link>
</div>
<div className="text-center pt-4 text-black-50">
<Button onClick={onTestConnection} color="link">
Test Connection?
</Button>
</div>
{!!+process.env.REACT_APP_ENABLE_TEST_CONNECTION!&& (
<div className="text-center pt-4 text-black-50">
<Button
onClick={onTestConnection}
color="link"
>
Test Connection?
</Button>
</div>
)}
</div>
</div>
</Col>
Expand Down
3 changes: 1 addition & 2 deletions Backend/web/src/app/components/Pages/EditUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import {
FormGroup,
Label,
Input,
Button,
UncontrolledTooltip
Button
} from "reactstrap";
import LoadingBar from "../LoadingBar";
import routes from "../../routes";
Expand Down
110 changes: 110 additions & 0 deletions Backend/web/src/app/components/Sidebar/SafeSecurityLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import React from "react";
import { withRouter } from "react-router-dom";

const Logo = () => (
<svg width={150} height={50} xmlns="http://www.w3.org/2000/svg">
<defs>
<style>{".prefix__cls-2{fill:#ffffff}"}</style>
</defs>
<title>{"Artboard 2for skg"}</title>
<title>{"background"}</title>
<path fill="none" id="prefix__canvas_background" d="M-1-1h152v52H-1z" />
<g>
<title>{"Layer 1"}</title>
<g stroke="null" id="prefix__svg_16">
<path
stroke="null"
id="prefix__svg_1"
fill="#999eb0"
d="M30.362 37.927l7.258-5.336-17.026-4.702-9.418 4.908 19.186 5.13z"
/>
<path
stroke="null"
id="prefix__svg_2"
className="prefix__cls-2"
d="M9 24.681l2.176 8.116 9.418-4.908L40.59 17.487 44.02 1.08 9 24.681z"
/>
<path
stroke="null"
id="prefix__svg_3"
className="prefix__cls-2"
d="M37.62 32.59l-7.258 5.337L15.67 48.695v.016l20.504-9.227 1.445-6.893z"
/>
<path
stroke="null"
id="prefix__svg_4"
d="M67.24 34.02a1.048 1.048 0 00-.349-.238 2.16 2.16 0 00-.397-.175l-.46-.206a1.128 1.128 0 01-.35-.239.524.524 0 01-.127-.349.508.508 0 01.207-.429.858.858 0 01.555-.159 2.096 2.096 0 01.525.08 3.304 3.304 0 01.476.206l.222-.444a2.382 2.382 0 00-.571-.255 2.541 2.541 0 00-.731-.095 1.302 1.302 0 00-.667.159 1.08 1.08 0 00-.445.397 1.064 1.064 0 00-.174.588 1.175 1.175 0 00.11.492 1.445 1.445 0 00.287.334 3.176 3.176 0 00.397.222l.413.175a1.954 1.954 0 01.413.19.778.778 0 01.301.254.524.524 0 01.111.366.588.588 0 01-.127.413.826.826 0 01-.333.222.89.89 0 01-.397 0 1.7 1.7 0 01-.397 0l-.397-.159-.334-.19-.254.444a2.35 2.35 0 00.397.223 2.255 2.255 0 001.032.238 1.684 1.684 0 00.763-.159 1.175 1.175 0 00.476-.445 1.223 1.223 0 00.175-.62 1.286 1.286 0 00-.095-.523.953.953 0 00-.254-.318z"
className="prefix__cls-2"
/>
<path
stroke="null"
id="prefix__svg_5"
className="prefix__cls-2"
d="M119.033 31.733h.588v4.336h-.588z"
/>
<path
stroke="null"
id="prefix__svg_6"
className="prefix__cls-2"
d="M127.34 32.289h1.143v3.78h.572v-3.78h1.175v-.556h-2.89v.556z"
/>
<path
stroke="null"
id="prefix__svg_7"
className="prefix__cls-2"
d="M140.585 31.733l-1.175 2.224-1.207-2.224h-.715l1.604 2.89v1.446h.588v-1.445l1.62-2.891h-.715z"
/>
<path
stroke="null"
id="prefix__svg_8"
d="M110.631 34.036a1.27 1.27 0 00.238-.46 1.779 1.779 0 000-.493 1.382 1.382 0 00-.11-.588 1.191 1.191 0 00-.334-.413 1.255 1.255 0 00-.477-.254 1.954 1.954 0 00-.62-.095h-1.143v4.288h.588v-1.588h.778l1.08 1.588h.667l-1.08-1.747a1.493 1.493 0 00.413-.238zm-1.16-.111h-.619v-1.588h.667a.953.953 0 01.382.079.667.667 0 01.254.206.46.46 0 01.143.255.874.874 0 010 .27 1.588 1.588 0 010 .27.89.89 0 01-.143.27.937.937 0 01-.27.206 1.08 1.08 0 01-.413.032z"
className="prefix__cls-2"
/>
<path
stroke="null"
id="prefix__svg_9"
className="prefix__cls-2"
d="M75.944 34.163h2.001v-.556h-2V32.29h2.239v-.556h-2.828v4.336h2.907v-.556h-2.319v-1.35z"
/>
<path
stroke="null"
id="prefix__svg_10"
d="M99.688 34.528a1.048 1.048 0 01-1.064 1.033.953.953 0 01-.524-.143.953.953 0 01-.524-.89v-2.795h-.572v2.827a1.461 1.461 0 00.222.826 1.43 1.43 0 00.572.54 1.89 1.89 0 001.588 0 1.477 1.477 0 00.588-.54 1.588 1.588 0 00.222-.826v-2.827h-.571l.063 2.795z"
className="prefix__cls-2"
/>
<path
stroke="null"
id="prefix__svg_11"
d="M88.602 35.465a1.588 1.588 0 01-.587.096 1.7 1.7 0 01-.651-.127 1.382 1.382 0 01-.509-.35 1.715 1.715 0 01-.317-.524 2.144 2.144 0 01-.112-.651 1.763 1.763 0 01.128-.651 1.715 1.715 0 01.333-.54 1.81 1.81 0 01.508-.35 1.588 1.588 0 01.604-.127 1.239 1.239 0 01.556.111l.444.223.223-.54a2.128 2.128 0 00-.54-.238 1.985 1.985 0 00-.715-.112 2.176 2.176 0 00-1.588.636 2.35 2.35 0 00-.445.714 2.78 2.78 0 00-.159.906 2.208 2.208 0 00.16.841 2.065 2.065 0 00.428.683 1.89 1.89 0 00.683.477 2.446 2.446 0 00.921.175 2.017 2.017 0 00.54 0 1.7 1.7 0 00.429-.143l.302-.16-.255-.523a1.795 1.795 0 01-.38.174z"
className="prefix__cls-2"
/>
<path
stroke="null"
id="prefix__svg_12"
className="prefix__cls-2"
d="M111.266 25.936h2.335v-4.654h4.4v-2.255h-4.4v-2.684h5.067v-2.255h-7.402v11.848z"
/>
<path
stroke="null"
id="prefix__svg_13"
className="prefix__cls-2"
d="M135.328 23.68v-2.556h5.083v-2.256h-5.083v-2.525h5.75v-2.255h-8.084v11.848h8.306v-2.255h-5.972z"
/>
<path
stroke="null"
id="prefix__svg_14"
d="M68.21 16.407a2.001 2.001 0 011.127-.302 3.97 3.97 0 011.302.238 8.878 8.878 0 011.382.604l.89-1.78a7.576 7.576 0 00-1.589-.81 6.702 6.702 0 00-2.318-.333 4.415 4.415 0 00-1.938.493 3.494 3.494 0 00-1.302 1.19 3.462 3.462 0 00-.445 1.795 3.081 3.081 0 00.302 1.446 3.288 3.288 0 00.825.984 6.353 6.353 0 001.096.667l1.128.477a4.606 4.606 0 01.842.413 2.414 2.414 0 01.635.54.953.953 0 01.238.635 1.096 1.096 0 01-.286.81 1.588 1.588 0 01-.714.413 2.986 2.986 0 01-.842.111 3.256 3.256 0 01-.905-.127 6.258 6.258 0 01-1.001-.35 8.513 8.513 0 01-.905-.54l-1.033 1.811a7.56 7.56 0 001.303.731 8.942 8.942 0 001.366.413 8.465 8.465 0 001.397.127 4.765 4.765 0 002.208-.46 3.669 3.669 0 001.382-1.255 3.32 3.32 0 00.46-1.684 3.732 3.732 0 00-.238-1.43 2.732 2.732 0 00-.651-.984 3.272 3.272 0 00-.905-.651 7.306 7.306 0 00-1.017-.477 8.386 8.386 0 01-1.096-.46 3.176 3.176 0 01-.857-.588 1.016 1.016 0 01-.318-.746 1.064 1.064 0 01.476-.921z"
className="prefix__cls-2"
/>
<path
stroke="null"
id="prefix__svg_15"
className="prefix__cls-2"
d="M86.109 25.936h2.303l2.986-7.179 2.986 7.179h2.302l-5.145-11.848h-.286l-5.146 11.848z"
/>
</g>
</g>
</svg>
);

export default withRouter(Logo);
4 changes: 1 addition & 3 deletions Backend/web/src/app/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import themeSlice from "../../slices/ThemeSlice";
import { ThemeState } from "../../store/ReduxState";
// @ts-ignore
import RouterLink from "./ReactMetismenuRouterLink";
import LucideusLogo from "./LucideusLogo";
import LucideusLogo from "./SafeSecurityLogo";

interface Props extends RouteComponentProps<any> {
theme: ThemeState;
Expand Down Expand Up @@ -97,7 +97,6 @@ class SidebarHeader extends Component {
return (
<Fragment>
<div className="app-sidebar--header ">
{/* <div className="nav-logo"> */}
<Link
to={routes.app.dashboard}
title=""
Expand All @@ -106,7 +105,6 @@ class SidebarHeader extends Component {
<LucideusLogo />
</Link>
</div>
{/* </div> */}
</Fragment>
);
}
Expand Down
3 changes: 1 addition & 2 deletions Backend/web/src/app/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let ipAddress = localStorage.getItem("ipAddress");
let port = localStorage.getItem("port");
let url = "http://localhost/api";
let url = `http://${window.location.hostname}/api`;
if (ipAddress && port) url = "http://" + ipAddress + ":" + port + "/api";
const dev = {
api: {
Expand All @@ -15,7 +15,6 @@ const prod = {
};

const config = process.env.NODE_ENV === "production" ? prod : dev;

export default {
// Add common config values here
MAX_ATTACHMENT_SIZE: 5000000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@ import deleteBeneficiarySlice from "../../slices/DeleteBeneficiarySlice";
import Swal from "sweetalert2";
import { getHeaders } from "../configHelper";

const handleDeleteBeneficiary = (alias: string, otpResponse: string, token: string) => (dispatch: Dispatch) => {
console.log("called");
const handleDeleteBeneficiary = (
alias: string,
otpResponse: string,
token: string
) => (dispatch: Dispatch) => {
axios
.post(routes.api.beneficiary.deleteBeneficiary, {
requestBody: {
timestamp: new Date(),
data: {
alias: alias,
otp_response: otpResponse
.post(
routes.api.beneficiary.deleteBeneficiary,
{
requestBody: {
timestamp: new Date(),
data: {
alias: alias,
otp_response: otpResponse
}
}
}
},getHeaders(token))
.then(response => {
},
getHeaders(token)
)
.then((response) => {
if (response.data.status !== "Failed") {
dispatch(deleteBeneficiarySlice.actions.setisSuccessful(true));

Expand All @@ -39,7 +46,9 @@ const handleDeleteBeneficiary = (alias: string, otpResponse: string, token: stri
});
}
})
.catch(res => toast.error("Backend Server is unresponsive.", { position: "top-center" }));
.catch((res) =>
toast.error("Backend Server is unresponsive.", { position: "top-center" })
);
};

export default handleDeleteBeneficiary;
2 changes: 1 addition & 1 deletion Backend/web/src/app/thunks/Loan/handleApplyLoanThunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const handleApplyLoanThunk = ({
getHeaders(token)
)
.then((response) => {
console.log(response);

if (response.data.status !== "Failed") {
setTimeout(() => {
setShowModal(true);
Expand Down
1 change: 0 additions & 1 deletion Backend/web/src/app/thunks/handleChangePasswordThunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const handleEditUserProfileThunk = ({
}
},getHeaders(token))
.then((response) => {
console.log(response);
if (response.data.status !== "Failed") {
setShowModal(true);
} else {
Expand Down
2 changes: 1 addition & 1 deletion Backend/web/src/app/thunks/handleContactUsThunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const handleContactUsThunk = ({
getHeaders(token)
)
.then((response) => {
console.log(response);

if (response.data.status !== "Failed") {
setShowModal(true);
setModalMessage(response.data.message);
Expand Down

0 comments on commit fd81240

Please sign in to comment.