-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df320d0
commit 9f85b9c
Showing
23 changed files
with
605 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
{ | ||
"cSpell.words": [ | ||
"cmps" | ||
"btns", | ||
"cmps", | ||
"Creds", | ||
"cryptr", | ||
"Fridman", | ||
"fullName", | ||
"Loggedin", | ||
"puki", | ||
"Signup" | ||
], | ||
"files.autoSave": "onWindowChange" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,60 @@ | ||
[ | ||
{ | ||
"_id": "2DAMr", | ||
"title": "bug bug bug", | ||
"title": "remove bug", | ||
"description": "", | ||
"severity": 2, | ||
"createdAt": 1719175921925, | ||
"labels": [ | ||
"critical", | ||
"need-CR" | ||
] | ||
}, | ||
{ | ||
"_id": "j1k2l3", | ||
"title": "Update documentation", | ||
"description": "Updating the project documentation for new release.", | ||
"severity": 3, | ||
"createdAt": 1625400000000, | ||
"labels": [ | ||
"need-CR" | ||
] | ||
}, | ||
{ | ||
"_id": "m4n5o6", | ||
"title": "Refactor codebase", | ||
"description": "Refactoring the codebase for better readability and maintenance.", | ||
"severity": 4, | ||
"createdAt": 1625486400000, | ||
"severity": 1, | ||
"createdAt": 1719475554079, | ||
"labels": [ | ||
"dev-branch" | ||
] | ||
], | ||
"owner": { | ||
"_id": "hVgTr", | ||
"fullName": "Avi Fridman" | ||
}, | ||
"_id": "0wxix" | ||
}, | ||
{ | ||
"_id": "p7q8r9", | ||
"title": "Fix security issue", | ||
"description": "Addressing the security vulnerability identified in the audit.", | ||
"severity": 5, | ||
"createdAt": 1625572800000, | ||
"title": "update book", | ||
"description": "", | ||
"severity": 4, | ||
"createdAt": 1719475593863, | ||
"labels": [ | ||
"critical", | ||
"need-CR" | ||
] | ||
], | ||
"owner": { | ||
"_id": "hVgTr", | ||
"fullName": "Avi Fridman" | ||
}, | ||
"_id": "LRBIW" | ||
}, | ||
{ | ||
"title": "critical", | ||
"title": "add book", | ||
"description": "", | ||
"severity": 7, | ||
"createdAt": 1719145297585, | ||
"severity": 1, | ||
"createdAt": 1719475629762, | ||
"labels": [ | ||
"critical" | ||
"need-CR" | ||
], | ||
"_id": "nTLX4" | ||
"owner": { | ||
"_id": "hVgTr", | ||
"fullName": "Avi Fridman" | ||
}, | ||
"_id": "FLxP6" | ||
}, | ||
{ | ||
"_id": "dsLh6", | ||
"title": "bagin", | ||
"title": "get books", | ||
"description": "", | ||
"severity": 3, | ||
"createdAt": 1719245951212, | ||
"createdAt": 1719475764771, | ||
"labels": [ | ||
"critical", | ||
"need-CR" | ||
] | ||
}, | ||
{ | ||
"title": "", | ||
"description": "", | ||
"severity": 0, | ||
"createdAt": 1719328488572, | ||
"labels": [], | ||
"_id": "la15X" | ||
"need-CR", | ||
"critical" | ||
], | ||
"owner": { | ||
"_id": "tcgSM", | ||
"fullName": "puki" | ||
}, | ||
"_id": "RitB3" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
{ | ||
"username": "Avi Fridman", | ||
"password": "1234", | ||
"fullName": "Avi Fridman", | ||
"_id": "hVgTr", | ||
"isAdmin": true | ||
}, | ||
{ | ||
"username": "puki", | ||
"password": "1234", | ||
"fullName": "puki", | ||
"_id": "tcgSM" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.login-signup { | ||
|
||
} | ||
|
||
.login-signup input { | ||
padding: .5em; | ||
border: 0; | ||
border-radius: 3em; | ||
} | ||
|
||
.login-signup input:focus { | ||
outline: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,53 @@ | ||
const { NavLink } = ReactRouterDOM | ||
const { useEffect } = React | ||
const {Link, NavLink } = ReactRouterDOM | ||
const { useNavigate } = ReactRouter | ||
const { useState } = React | ||
|
||
import { showErrorMsg } from '../services/event-bus.service.js' | ||
import { userService } from '../services/user.service.js' | ||
import { LoginSignup } from './LoginSignup.jsx' | ||
import { UserMsg } from './UserMsg.jsx' | ||
|
||
export function AppHeader() { | ||
useEffect(() => { | ||
// component did mount when dependancy array is empty | ||
}, []) | ||
const [user, setUser] = useState(userService.getLoggedinUser()) | ||
|
||
const navigate = useNavigate() | ||
|
||
function onLogout() { | ||
userService | ||
.logout() | ||
.then(() => { | ||
onSetUser(null) | ||
}) | ||
.catch(err => { | ||
showErrorMsg('OOPs try again') | ||
}) | ||
} | ||
|
||
function onSetUser(user) { | ||
setUser(user) | ||
// navigate('/') | ||
} | ||
console.log('user:', user) | ||
return ( | ||
<header className="main-layout"> | ||
<div className="header-container"> | ||
<section className="header-container"> | ||
<UserMsg /> | ||
<h1>Bugs are Forever</h1> | ||
<nav> | ||
<NavLink to="/">Home</NavLink> |<NavLink to="/bug">Bugs</NavLink> | | ||
<NavLink to="/about">About</NavLink> | ||
</nav> | ||
</div> | ||
</section> | ||
{user ? ( | ||
<section> | ||
<button onClick={onLogout}>Logout</button> | ||
<Link to={`/user/${user._id}`}>{`Hello ${user.fullName}`}</Link> | ||
</section> | ||
) : ( | ||
<section> | ||
<LoginSignup onSetUser={onSetUser} /> | ||
</section> | ||
)} | ||
</header> | ||
) | ||
} |
Oops, something went wrong.