Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration : Frontend #77

Merged
merged 8 commits into from
Jul 18, 2023
Merged

Conversation

Nazi-pikachu
Copy link
Collaborator

@Nazi-pikachu Nazi-pikachu commented Jul 5, 2023

Description

To migrate the frontend from previous seperate repo to the main repo

Changes Made

Generated a react-app using nx

Related Issues

Testing Instructions

  1. Follow the setup readme
  2. run nx serve frontend

Screenshots (if applicable)

Current output
image

Additional Notes

Its an intial PR in which the frontend code has been migrated to frontend app follow test instructions to know how to run the frontend.

@Nazi-pikachu Nazi-pikachu marked this pull request as draft July 5, 2023 18:01
@gitguardian
Copy link

gitguardian bot commented Jul 5, 2023

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic Password caec5c4 apps/frontend/src/app/apis/index.js View secret
- Generic Password caec5c4 apps/frontend/src/app/apis/index.js View secret
- Generic Password 7cc3d87 apps/frontend/src/app/apis/index.js View secret
- Generic Password 7cc3d87 apps/frontend/src/app/apis/index.js View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

import { useNavigate } from "react-router-dom";

function Protect(props) {
let Cmp = props.Cmp;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use proper names for variables.

email: "[email protected]",
password: "test@123",
};
const baseUrl = "https://fa.chakshu-rd.samagra.io/api";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

access these from an env or app constants.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 8 to 19
console.log(
JSON.stringify({
registration: {
applicationId: "650c50b5-eae9-442e-88de-fc36be10a21b", // TO DO : Change this to env variable
},
user: {
name: "test",
email: "[email protected]",
password: "test@123",
},
})
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary logs

Comment on lines 1 to 67
@media (min-width: 1024px) {
.layout-dashboard .ant-layout-footer {
margin: 0 0 20px 20px;
}
.layout-dashboard .ant-layout-sider.sider-primary {
margin: 20px 0 0 20px;
padding: 13px 20px;
height: calc(100vh - 20px);
}
.layout-dashboard .ant-layout {
width: auto;
flex-shrink: 1;
margin-left: 270px;
}
.layout-dashboard .header-control .sidebar-toggler {
display: none;
}
}

@media (min-width: 768px) {
.layout-dashboard .ant-layout-header {
margin: 10px 20px;
}
.layout-dashboard .header-control {
margin-top: 0;
}
.layout-dashboard .header-control .header-search {
margin: 0 7px;
}
.layout-dashboard .header-control .btn-sign-in span {
display: inline;
}
.profile-nav-bg {
margin-top: -87.8px;
}
.card-profile-head {
margin: -53px 24px 24px;
}
}

@media (min-width: 992px) {
.card-billing-info.ant-card .ant-card-body {
display: flex;
}
.layout-dashboard-rtl {
overflow: auto;
}
.layout-dashboard-rtl .ant-layout-sider.sider-primary {
margin: 20px 20px 0 0;
height: calc(100vh - 20px);
}
.layout-dashboard-rtl .ant-layout-sider.sider-primary {
right: 0;
left: auto;
}
.layout-dashboard-rtl .ant-layout-sider.sider-primary {
right: 0;
left: auto;
}
.layout-dashboard-rtl .ant-layout {
margin-right: 270px;
margin-left: 0;
}
.layout-dashboard-rtl .ant-layout-footer {
margin: 0 20px 20px 0;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min widths should come in ascending order. e.x 768 then 992 then 1024.

margin-top: -87.8px;
}
.card-profile-head {
margin: -53px 24px 24px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

negative margins should be avoided.

Comment on lines 7 to 14
const [state, setState] = useState({
userID: "0fe6ff38-fc46-11ec-b939-0242ac120001",
url: "",
project: "0fe6ff38-fc46-11ec-b939-0242ac120002",
customHashId: nanoid(6),
titleImage: "",
urlImg: "",
description: "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be hardcoded like that.

count={12}
style={{ paddingTop: "10px" }}
/>
             
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find another way to add spaces. remove this  

@Nazi-pikachu
Copy link
Collaborator Author

Progress on this PR Till now

  • Frontend Migrated to monorepo
  • Migrated to react-router-dom v6
  • Fixed few pages for responsiveness
  • Refactored the entire Frontend as per the standards
  • Deployed to vercel to ease tracking

email: "[email protected]",
password: "test@123",
};
const baseUrl = "https://fa.chakshu-rd.samagra.io/api";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,21 @@
import React, { useEffect } from "react";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nazi-pikachu can we move this in folder name utils

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

return (
<div className="App">
<Routes>
<Route path="/sign-up" element={<SignUp />} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nazi-pikachu please create the constants folder for all the routes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@@ -0,0 +1 @@
/* Your styles goes here. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@@ -0,0 +1,30 @@
import { piedata } from "app/assets/constants/mockData";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nazi-pikachu please take the constants and styles folder out of it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@Shruti3004 Shruti3004 marked this pull request as ready for review July 18, 2023 13:45
@Shruti3004 Shruti3004 merged commit 439aaef into Samagra-Development:master Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants