Skip to content

Commit

Permalink
Revert "feat: changes made to authentication (#1047)"
Browse files Browse the repository at this point in the history
This reverts commit f362d61.
  • Loading branch information
tamalCodes committed Aug 31, 2023
1 parent f362d61 commit ce5aa1d
Show file tree
Hide file tree
Showing 26 changed files with 1,135 additions and 912 deletions.
Binary file added .DS_Store
Binary file not shown.
128 changes: 1 addition & 127 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
node_modules

# dependencies
/node_modules
/.pnp
Expand All @@ -15,138 +14,13 @@ node_modules

# misc
.DS_Store
*.pem

# local env files
.env*.local
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# vercel
.vercel

# typescript cache
*.tsbuildinfo

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Output of 'npm pack'
*.tgz

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/pnp.js
.env
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

# What is Milan ?

Milan is a hub to **connect** NGOs, Charities, and the world to **collaborate** and **build** a better tomorrow. Sign up as an organization/user and be a cause for change. Don't forget to drop a star ⭐.
Milan is a hub to **connect** NGOs, Charities, and the world to **collaborate** and **build** a better tommorow. Sign up as a organization/user and be a cause for change. Don't forget to drop a star ⭐.

<br/>



<div align="center" >

<div align="center" >

<a href="https://beta.milanhub.org/"><img alt="C" src="https://img.shields.io/badge/Beta%20Release-FFA116?style=for-the-badge&logo=vercel&logoColor=white"></a> <a href="https://milanhub.org/"><img alt="C" src="https://img.shields.io/badge/Production%20Release-07C160?style=for-the-badge&logo=vercel&logoColor=white"></a>



</div>

<img alt="Milan Readme Banner" src="https://raw.githubusercontent.com/MilanCommunity/Milan/beta/.github/MilanReadmeBanner.png" width="700px"/>

</div>
Expand Down
64 changes: 25 additions & 39 deletions cypress/e2e/milanTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,42 @@
/// <reference types="cypress" />

// change cypress viewport size to 1
// https://on.cypress.io/viewport
Cypress.config("viewportWidth", 1280);
Cypress.config("viewportHeight", 720);

// set a new env for cypress
// https://on.cypress.io/environment-variables
Cypress.env("CI", false);

describe("Checking if the backend is working properly or not", () => {
it("GET request for users", () => {
cy.request("https://api.milanhub.org/display/users").then((response) => {
expect(response.status).to.eq(200);
});
});
});

describe("Auth checks", () => {
it("Checking Login", () => {
cy.visit("/auth/login");
cy.get('[ data-cy="email"]').type("gyansujan69@gmail.com", {
describe("All auth checks", () => {
it("Checking Club logins", () => {
cy.visit("/clubs/login");
cy.get('[ data-cy="desktop-club-email"]').type("rotary@gmail.com", {
force: true,
});
cy.get('[ data-cy="password"]').type("tamaldas69", {
cy.get('[ data-cy="desktop-club-password"]').type("rotary", {
force: true,
});
cy.get('[data-cy="loginbutton"]').scrollIntoView();
cy.get('[data-cy="loginbutton"]').click({ force: true });
cy.getCookie("isLoggedIn");
cy.visit("/");
cy.get(".login-btn").scrollIntoView();
cy.get(".login-btn").click({ force: true });
cy.getCookie("clubToken");
});
});

describe("Navigation to other pages", () => {
it("Checking Navigation to Home", () => {
cy.visit("/");
cy.get("nav").contains("Home").click();
cy.url().should("include", "/");
});

it("Checking Navigation to Clubs", () => {
cy.visit("/");
cy.get("nav").contains("Clubs").click();
cy.url().should("include", "/clubs");
});

it("Checking Navigation to Events", () => {
cy.visit("/");
cy.get("nav").contains("Events").click();
cy.url().should("include", "/events");
it("Checking User logins", () => {
cy.visit("/user/login");
cy.get("#desktopUserEmail").type("gyansujan69@gmail.com", { force: true });
cy.get("#desktopUserPassword").type("tamaldas69", { force: true });
cy.get(".login-btn").scrollIntoView();
cy.get(".login-btn").click({ force: true });
cy.getCookie("token ");
});
});

it("Checking Navigation to Shop", () => {
cy.visit("/");
cy.get("nav").contains("Shop").click();
cy.url().should("include", "/shop");
describe("Checking if the backend is working properly or not", () => {
it("Check if the backend is working", () => {
cy.request("https://api.milanhub.org/display/users").then((response) => {
expect(response.status).to.eq(200);
});
});
});
12 changes: 4 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"use-places-autocomplete": "^4.0.0",
"vite-plugin-svgr": "^2.2.2",
"web-vitals": "^3.3.1",
"zustand": "^4.4.1"
"zustand": "^4.3.8"
},
"scripts": {
"dev": "vite --port 3000",
Expand Down
56 changes: 40 additions & 16 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import {
Home,
UserRegister,
UserLogin,
UserProfile,
ClubRegister,
ClubLogin,
ClubProfile,
Clubs,
Events,
Shop,
Error404,
ContactUs,
Donate,
} from "./pages/route";
import MilanState from "./context/MilanState";
import "./styles/App.css";
import BacktoTop from "../src/components/Button/BacktoTop/BacktoTop.jsx";
import routesConfig from "./utils/routesConfig";

const App = () => {
return (
<MilanState>
<Router>
<Routes>
{routesConfig.map((route, index) => (
<Route
key={index}
exact
path={route?.path}
element={route?.element}
/>
))}
</Routes>
</Router>
<BacktoTop />
</MilanState>
<>
<MilanState>
<Router>
<Routes>
<Route exact path="/" element={<Home />} />
<Route exact path="/user/register" element={<UserRegister />} />
<Route exact path="/user/login" element={<UserLogin />} />
<Route exact path="/user/profile" element={<UserProfile />} />

<Route exact path="/clubs" element={<Clubs />} />
<Route exact path="/clubs/login" element={<ClubLogin />} />
<Route exact path="/clubs/register" element={<ClubRegister />} />
<Route exact path="/clubs/profile" element={<ClubProfile />} />
<Route exact path="/events" element={<Events />} />

<Route exact path="/shop" element={<Shop />} />

<Route exact path="/contact" element={<ContactUs />} />
<Route exact path="/donateus" element={<Donate />} />
<Route path={"/*"} element={<Error404 />} />
</Routes>
</Router>
<BacktoTop />
</MilanState>
</>
);
};

Expand Down
7 changes: 5 additions & 2 deletions src/components/Banners/HomeBanner.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from "react";
import React, { useContext } from "react";
import "./Banner.css";
import Cookies from "js-cookie";
import { ImGithub } from "react-icons/im";
import MilanContext from "../../context/MilanContext";
import Button from "../Button/GlobalButton/Button";

const HomeBanner = () => {
const { toggleSignUpModal } = useContext(MilanContext);

return (
<>
<div className="container">
Expand Down Expand Up @@ -65,7 +68,7 @@ const HomeBanner = () => {
<div className="banner_btn_div">
<Button
className="banner_signup_btn"
action="signup"
onClick={toggleSignUpModal}
data-cy="landingpage-club-signup"
id="landingpage-club-signup"
variant="outline"
Expand Down
Loading

0 comments on commit ce5aa1d

Please sign in to comment.