Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
mynotes.md
27 changes: 0 additions & 27 deletions ui/.eslintrc

This file was deleted.

6 changes: 6 additions & 0 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
"extends": [
"react-app",
"react-app/jest"
]
}
58 changes: 58 additions & 0 deletions ui/package-lock.json

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

2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"eslint": "^8.17.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand All @@ -19,6 +20,7 @@
"build": "react-scripts build --mode=production",
"test-watch": "react-scripts test --coverage",
"test": "react-scripts test --watchAll=false",
"update-test": "react-scripts test -- -u",
"eject": "react-scripts eject",
"ci: lighthouse": "lhci autorun"
},
Expand Down
16 changes: 4 additions & 12 deletions ui/src/App.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import Dashboard from "./Components/Dashboard/Dashboard";
import Footer from "./Components/Footer/Footer";
import { FEATURE_FLAGS, FEATURE_FLAGS_HEADERS} from "./Mock/featureFlags";
import RootRoute from './Routes/Route';

function App() {
return (
<main
className='flex flex-col items-center'
>
<Dashboard
featureFlags={FEATURE_FLAGS}
headers={FEATURE_FLAGS_HEADERS}
/>
<Footer />
</main>
<>
<RootRoute />
</>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import PreviousMap from "postcss/lib/previous-map";
import { camelCaseToNormal } from "../../../../Utils/helpers";
import SortCursor from "./SortCursor";
import { TABLE } from "../../../../Constant/constant";
Expand Down
4 changes: 2 additions & 2 deletions ui/src/Components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default function Footer(){
return(
<footer className="my-8 w-screen flex justify-center text-xs">
<span className="ml-2">{FOOTER.COPYRIGHT}</span>
<a href="#" className="ml-2 hover:underline">{FOOTER.RDS_WEBSITE}</a>
<a href="#" className="ml-2 hover:underline">{FOOTER.DISCORD_SERVER}</a>
<a href="http://www.google.com" className="ml-2 hover:underline">{FOOTER.RDS_WEBSITE}</a>
<a href="http://www.google.com" className="ml-2 hover:underline">{FOOTER.DISCORD_SERVER}</a>
</footer>
)
}
2 changes: 1 addition & 1 deletion ui/src/Components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Header({ user }) {
/>

<h1 className='text-lg'>
{user.github_display_name}
{user.github_display_name}
</h1>

<Button
Expand Down
19 changes: 19 additions & 0 deletions ui/src/Components/Layout/Layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Header from '../Header/Header';
import Footer from '../Footer/Footer';
import Navigation from '../Navigation/Navigation';
import { USER } from '../../test/Fixtures/user';

export default function Layout(props){
return(
<>
<Header user={USER} />
<main className='flex flex-row my-4'>
<Navigation />
<section>
{props.children}
</section>
</main>
<Footer />
</>
)
}
22 changes: 22 additions & 0 deletions ui/src/Components/Navigation/Navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NavLink } from "react-router-dom";
import { NAV } from '../../Constant/routes';

export default function LeftNav(){
const createNavigation = () => {
return NAV.map((item, key) => {
if(item.visible){
return <li key={key} className='text-blue-600 hover:underline text-sm py-1'>
<NavLink to={item.path}>{item.name}</NavLink>
</li>
}
return null;
})
}
return(
<nav className='px-3'>
<ul>
{createNavigation()}
</ul>
</nav>
)
}
2 changes: 0 additions & 2 deletions ui/src/Constant/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ export const FOOTER = {
"DISCORD_SERVER":"Discord server"
}


export const TABLE = {
"ASCENDING":"ascending",
"DESCENDING":"descending",
"ENABLED":"Enabled",
}

45 changes: 45 additions & 0 deletions ui/src/Constant/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Home from '../Pages/Home/Home';
import Docs from '../Pages/Docs/Docs';
import Sdk from '../Pages/Sdk/Sdk';
import Users from '../Pages/Users/Users';
import Flags from '../Pages/Flags/Flags';
import NotFound from '../Pages/NotFound/NotFound';

export const NAV = [
{
name: 'Home',
path: '/',
element: <Home />,
visible: true
},
{
name: "Create Users",
path: "/users",
element: <Users />,
visible: true

},
{
name: "Flags",
path: "/flags",
element: <Flags />,
visible: true
},
{
name: "SDK",
path: "/SDK",
element: <Sdk />,
visible: true
},
{
name: "Docs",
path: "/docs",
element: <Docs />,
visible: true
},
{
path: "*",
element: <NotFound />,
visible: false
}
]
9 changes: 9 additions & 0 deletions ui/src/Pages/Docs/Docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Layout from "../../Components/Layout/Layout";

export default function Docs(){
return(
<Layout>
<h1>Docs</h1>
</Layout>
)
}
9 changes: 9 additions & 0 deletions ui/src/Pages/Flags/Flags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Layout from "../../Components/Layout/Layout";

export default function Flags(){
return(
<Layout>
<h1>Flags</h1>
</Layout>
)
}
17 changes: 17 additions & 0 deletions ui/src/Pages/Home/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Dashboard from "../../Components/Dashboard/Dashboard";
import Layout from "../../Components/Layout/Layout";
import { FEATURE_FLAGS, FEATURE_FLAGS_HEADERS} from "../../Mock/featureFlags";

export default function Home(){
return(
<Layout>
<Dashboard
featureFlags={FEATURE_FLAGS}
headers={FEATURE_FLAGS_HEADERS}
/>
</Layout>
)
}



10 changes: 10 additions & 0 deletions ui/src/Pages/NotFound/NotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Layout from "../../Components/Layout/Layout";
import { Link} from "react-router-dom";

export default function NotFound(){
return(
<Layout>
<h1>Not found. Go back to <Link to="/">Home</Link></h1>
</Layout>
)
}
9 changes: 9 additions & 0 deletions ui/src/Pages/Sdk/Sdk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Layout from "../../Components/Layout/Layout";

export default function Sdk(){
return(
<Layout>
<h1>Sdk</h1>
</Layout>
)
}
9 changes: 9 additions & 0 deletions ui/src/Pages/Users/Users.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Layout from "../../Components/Layout/Layout";

export default function Users(){
return(
<Layout>
<h1>Users</h1>
</Layout>
)
}
18 changes: 18 additions & 0 deletions ui/src/Routes/Route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { NAV } from "../Constant/routes";

export default function RootRoute(){
const createNavigation = () => {
return NAV.map((item, key) => {
const Element = item.element;
return <Route path={item.path} element={Element} />;
})
}
return(
<BrowserRouter>
<Routes>
{createNavigation()}
</Routes>
</BrowserRouter>
)
}
Loading