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

Feat/backoffice #634

Merged
merged 169 commits into from
Sep 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
e2f4d7c
feat(codegen): add getPendingReviews query
khajornritdacha Feb 8, 2023
35a565c
feat(admin-web): setup apollo and add getPendingReviews api
khajornritdacha Feb 8, 2023
4449e39
feat: add override query in frontend
demonstem Feb 9, 2023
a5bd0f3
refactor: migrate apollo provider to AppProvider
khajornritdacha Feb 9, 2023
b0c3ab3
Configure pre-release mode
bombnp Feb 9, 2023
5402ab5
change sync workflow
bombnp Feb 9, 2023
46b44cc
Version Packages (#512)
github-actions[bot] Feb 9, 2023
6315594
install changeset in workflow
bombnp Feb 9, 2023
34b3e43
fix sync beta workflow
bombnp Feb 9, 2023
9d52990
add commit identity
bombnp Feb 9, 2023
64d1d3b
Enter pre-release mode
github-actions[bot] Feb 9, 2023
35065e7
fix transform packages
bombnp Feb 9, 2023
f9f7609
feat: add override query in frontend
demonstem Feb 9, 2023
608647b
fix: edit import path
khajornritdacha Feb 9, 2023
5676edd
feat: add HtmlSanitizer and Navbar
khajornritdacha Feb 9, 2023
4fe2b15
feat: add approvedReviews and GenEd Page
khajornritdacha Feb 9, 2023
b3c8dfb
Merge branch 'feat/backoffice' of https://github.com/thinc-org/cugetr…
khajornritdacha Feb 9, 2023
08640ed
ci: update pnpm-lock
khajornritdacha Feb 9, 2023
238fb3c
move transpile packages out of experimental
bombnp Feb 9, 2023
12c583e
refactor: migrate appProvider to context folder
khajornritdacha Feb 11, 2023
ed108a5
refactor: create pendingReviews page and remove api page
khajornritdacha Feb 11, 2023
d63a45e
ci(gitignore): remove .env from gitignore
khajornritdacha Feb 11, 2023
375008d
refactor: create genEd module
khajornritdacha Feb 11, 2023
e2727ce
refactor: migrate pendingReviews to its own module
khajornritdacha Feb 11, 2023
7448cf4
refactor: migrate approvedReviews to its own module
khajornritdacha Feb 11, 2023
9e9e045
refactor: remove unused codes
khajornritdacha Feb 11, 2023
0115ca1
fix(homePage): move router.push inside useEffect
khajornritdacha Feb 11, 2023
85d61e1
refactor(pendingReviews): remove unused codes
khajornritdacha Feb 11, 2023
68e8068
refactor(apollo): remove course search cache from apollo client
khajornritdacha Feb 11, 2023
f1d53c2
ci(env): remove unused variables
khajornritdacha Feb 11, 2023
0d9f7c3
feat: add MUI and create pendingReviews design
khajornritdacha Feb 11, 2023
c43c3b5
feat(pendingReviews): add skeleton
khajornritdacha Feb 11, 2023
39e278e
install mui
demonstem Feb 11, 2023
cc4185d
feat: add themeProvider
khajornritdacha Feb 12, 2023
ea9a139
feat: add Poppin and Prompts fonts
khajornritdacha Feb 12, 2023
1caf16c
feat: recreate Navbar with MUI's appbar
khajornritdacha Feb 12, 2023
6aecc94
feat: add styling to Navbar(Appbar)
khajornritdacha Feb 12, 2023
be03cdd
docs: add required environment variables to readme
khajornritdacha Feb 12, 2023
b6a2c7c
feat: Demo genEd table
demonstem Feb 12, 2023
daa4bd5
setup review with graphql
Nacnano Feb 8, 2023
2b96c2c
feat(admin-api): add override
Nacnano Feb 14, 2023
73d94ab
feat(admin-api): add get-all-reviews query
Nacnano Feb 14, 2023
6e5dabe
refactor(admin-api): remove unused codes and comments
Nacnano Feb 14, 2023
53c5b58
add graphql asset
Nacnano Feb 16, 2023
9b0b0e8
add enum graphql
Nacnano Feb 16, 2023
e1bed95
remove unused file
Nacnano Feb 16, 2023
e900a75
remove unused env from template and config
Nacnano Feb 18, 2023
b2312f0
fix lockfile broken
saenyakorn Feb 18, 2023
55ab307
add dashboard url to env
Nacnano Feb 18, 2023
ccd945b
fix env and config
Nacnano Feb 18, 2023
65b69e5
match dependencies version to api's
Nacnano Feb 20, 2023
67c8270
feat(sidebar): add sidebar
khajornritdacha Mar 22, 2023
3171fbd
feat(sidebar): decorate sidebar
khajornritdacha Mar 22, 2023
d77058c
feat: add fonts
khajornritdacha Mar 22, 2023
ad08ac5
feat: add theme palette
khajornritdacha Mar 22, 2023
731a6d7
feat: add highlight link when selected
khajornritdacha Mar 22, 2023
c0f4c85
fix(index): remove import .css
khajornritdacha Mar 22, 2023
fdc020e
feat: pendingReview header
demonstem Mar 22, 2023
70ddcac
feat: upper Review page
demonstem Mar 26, 2023
f5e51f0
feat: table header and card layout wip
demonstem Mar 27, 2023
0e99168
feat(pendingReviews): add html sanitize to content
khajornritdacha Mar 28, 2023
d344e6d
fix: padding
demonstem Mar 29, 2023
c0a5307
feat: WIP pendingReview
demonstem Mar 30, 2023
61987f0
setup auth to request id_token
Nacnano Mar 30, 2023
e0df465
feat: add Thai font
demonstem Mar 30, 2023
9d2f68a
feat: add mui icon
demonstem Mar 30, 2023
0676ce7
feat: polish pendingReview page
demonstem Mar 30, 2023
e1d740f
add config variable
Nacnano Apr 4, 2023
760f9aa
feat: add login page and generate token page
khajornritdacha Mar 30, 2023
7b45f38
add template env, validate token
Nacnano Apr 4, 2023
2c595e9
feat(auth): add protectedRoutes
khajornritdacha Apr 4, 2023
04b642b
Merge remote-tracking branch 'origin/beta' into feat/backoffice
leomotors Apr 4, 2023
3b7eabc
format: apply format
leomotors Apr 4, 2023
8ef0ebf
Merge branch 'feat/backoffice' of https://github.com/thinc-org/cugetr…
leomotors Apr 4, 2023
054d716
fix: update design to final WIP
demonstem Apr 4, 2023
a5099c0
Merge remote-tracking branch 'origin/beta' into feat/backoffice
leomotors Apr 5, 2023
7240ae7
format: format code
leomotors Apr 5, 2023
5422731
Merge remote-tracking branch 'origin/temptemptemptemp' into feat/back…
leomotors Apr 5, 2023
7833cda
fix: remove .env files from remote and add .env.example
khajornritdacha Apr 6, 2023
d673952
refactor: migrate code to its own module
khajornritdacha Apr 6, 2023
c675eb9
ci: config tsconfig.json
khajornritdacha Apr 6, 2023
1dbf985
feat(GenEd): decorate gened page
khajornritdacha Apr 6, 2023
d7a26c8
setup review with graphql
Nacnano Feb 8, 2023
d723571
feat(admin-api): add override
Nacnano Feb 14, 2023
3caec50
feat(admin-api): add get-all-reviews query
Nacnano Feb 14, 2023
e45b7a4
refactor(admin-api): remove unused codes and comments
Nacnano Feb 14, 2023
86d9fa1
add enum graphql
Nacnano Feb 16, 2023
18937ff
remove unused env from template and config
Nacnano Feb 18, 2023
a71260b
fix lockfile broken
saenyakorn Feb 18, 2023
f79d416
fix env and config
Nacnano Feb 18, 2023
1baedb6
match dependencies version to api's
Nacnano Feb 20, 2023
f57d082
setup auth to request id_token
Nacnano Mar 30, 2023
0ee5071
add config variable
Nacnano Apr 4, 2023
e0f9d5b
add template env, validate token
Nacnano Apr 4, 2023
adc4b90
Merge branch 'nac/backoffice' of https://github.com/thinc-org/cugetre…
Nacnano Apr 6, 2023
ee84eef
fix: tsconfig
demonstem Apr 6, 2023
3b2b708
refactor: change 'Topbar' component name to 'Sidebar'
khajornritdacha Apr 7, 2023
5f141d9
feat(gened): add topbar to gened page
khajornritdacha Apr 7, 2023
f45dff8
feat(sidebar): add cugetreg logo
khajornritdacha Apr 7, 2023
736d12b
add jwt module
Nacnano Apr 7, 2023
7c73e61
feat(pending reviews): add topbar
khajornritdacha Apr 7, 2023
97e06be
feat: cancel button
demonstem Apr 7, 2023
d0f7487
fix(topbar): center rightside buttons vertically
khajornritdacha Apr 7, 2023
54fe466
feat(pending reviews): add API for approve and reject reviews
khajornritdacha Apr 7, 2023
334b37f
feat: improve textfield
demonstem Apr 7, 2023
38b2eeb
feat: error handling pendingReview
demonstem Apr 7, 2023
d22d626
feat(gened): add delete button
khajornritdacha Apr 7, 2023
99b4f7b
feat(gened): add delete gened api
khajornritdacha Apr 7, 2023
69df464
fix: change dependecy installation scope
khajornritdacha Apr 7, 2023
0c0a302
feat(gened): add input for new gened course
khajornritdacha Apr 8, 2023
12e711e
change review and override schema
Nacnano Apr 8, 2023
e69a77c
add idToken validation, me and remove unused code
Nacnano Apr 8, 2023
f38bfde
feat(gened): add refresh button
khajornritdacha Apr 8, 2023
2a598bc
feat(gened): add react toast for gened page
khajornritdacha Apr 8, 2023
0fa838b
refactor: migrate toast config to /config
khajornritdacha Apr 8, 2023
23988d0
fix(sidebar): fix highlight current page bug
khajornritdacha Apr 8, 2023
7da2639
fix(gened): table head is now sticky
khajornritdacha Apr 8, 2023
9e61d55
Merge branch 'feat/backoffice' into nac/backoffice
khajornritdacha Apr 9, 2023
d8a3441
fix: make the program compilable
khajornritdacha Apr 10, 2023
cc72702
fix: fix sending code
khajornritdacha Apr 10, 2023
03a383e
feat: handle validating id_token and generate access_token
khajornritdacha Apr 10, 2023
8bd9641
feat: handle sending cookie both frontend and backend
khajornritdacha Apr 10, 2023
c59bc7e
feat: add auth guard
khajornritdacha Apr 10, 2023
ebe8bbd
feat: lazy query review
demonstem Apr 10, 2023
3457141
feat: add global auth guard
khajornritdacha Apr 10, 2023
8fdfc10
fix: first fetch
demonstem Apr 10, 2023
3f3ac0f
fix: fix circular structure by removing passthrough in res
khajornritdacha Apr 11, 2023
19f82ed
feat(frontend): add protected routes
khajornritdacha Apr 11, 2023
0233b3c
fix(frontend/generateToken): change from fetch to axios and add spinner
khajornritdacha Apr 11, 2023
d245306
refactor: remove unused code in backend auth
khajornritdacha Apr 11, 2023
7c1c7e8
feat: add logout feature
khajornritdacha Apr 11, 2023
ffb659b
feat(frontend): add authApi
khajornritdacha Apr 11, 2023
cbdce44
Merge branch 'nac/backoffice' into feat/backoffice
khajornritdacha Apr 11, 2023
beaa4cc
edit readme
khajornritdacha Apr 11, 2023
06d9d70
fix(backend-api): change cookie expiry date to 30 days
khajornritdacha Apr 11, 2023
e8102dc
fix(pendingReviews): fix select form type
khajornritdacha Apr 11, 2023
9dd92ff
refactor: remove unused code
khajornritdacha Apr 11, 2023
b61e5f1
feat: filter wip
demonstem Apr 12, 2023
51d15e8
feat: wip filter
demonstem Apr 15, 2023
64c2404
Merge branch 'beta' into feat/backoffice
bombnp May 22, 2023
13361cc
regenerate lockfile
bombnp May 22, 2023
1465201
fix admin-web
bombnp May 22, 2023
73c532e
Merge branch 'beta' into feat/backoffice
bombnp May 22, 2023
b4f731b
migrate changes from api to admin-api
bombnp May 22, 2023
9479396
Merge branch 'beta' into feat/backoffice
khajornritdacha Sep 9, 2023
4f2de48
fix(admin-api): setReviewStatus return type
khajornritdacha Sep 9, 2023
58fbb3e
fix(admin-api): authentication for graphql
khajornritdacha Sep 9, 2023
7291d03
feat(frontend): add login page
khajornritdacha Sep 10, 2023
0af2c2e
feat(frontend): add user feedback approve review
khajornritdacha Sep 10, 2023
b13687f
fix(frontend): redirect if login fail
khajornritdacha Sep 10, 2023
5ceca67
refactor(frontend): remove year and semester
khajornritdacha Sep 11, 2023
6b27df1
feat(api): add filter to overrides
khajornritdacha Sep 11, 2023
1a3e4df
ci(admin-api): add Dockerfile
khajornritdacha Sep 12, 2023
e28fe83
Merge branch 'beta' into feat/backoffice
khajornritdacha Sep 12, 2023
ec4d9e2
Merge branch 'feat/backoffice' into jo/feat/backoffice
khajornritdacha Sep 12, 2023
9b17334
Revert "ci(admin-api): add Dockerfile"
khajornritdacha Sep 12, 2023
45b6baf
ci(admin-web): add Dockerfile
khajornritdacha Sep 12, 2023
455a6f7
Merge branch 'jo/ci/backoffice-ops' into jo/feat/backoffice
khajornritdacha Sep 12, 2023
9fe0747
ci(admin-web): edit Dockerfile
khajornritdacha Sep 12, 2023
7e1173c
Merge branch 'jo/ci/backoffice-ops' into jo/feat/backoffice
khajornritdacha Sep 12, 2023
f62c64b
Merge remote-tracking branch 'origin/beta' into feat/backoffice
leomotors Sep 12, 2023
616abff
Merge branch 'feat/backoffice' into jo/feat/backoffice
khajornritdacha Sep 12, 2023
74e3342
Merge branch 'beta' into feat/backoffice
khajornritdacha Sep 12, 2023
b420be3
fix(admin-api): fix dashBoardUrl typo
khajornritdacha Sep 15, 2023
babd8e3
fix: add skip auth to health check path
khajornritdacha Sep 18, 2023
c169e54
Revert "fix: add skip auth to health check path"
khajornritdacha Sep 18, 2023
947dd90
Merge branch 'beta' into feat/backoffice
khajornritdacha Sep 18, 2023
40f3b78
fix: add skip auth in health check
khajornritdacha Sep 18, 2023
cb40111
ci: add changeset
khajornritdacha Sep 18, 2023
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
Prev Previous commit
Next Next commit
feat(frontend): add login page
  • Loading branch information
khajornritdacha committed Sep 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 7291d03eb83283fdc60fe64cad8266105ea16e17
6 changes: 5 additions & 1 deletion apps/admin-web/src/common/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Toaster } from 'react-hot-toast'

import { useRouter } from 'next/router'

import SideBar from '@admin-web/common/Sidebar'
import { toastConfig } from '@admin-web/config/toastConfig'

@@ -10,9 +12,11 @@ interface AppProviderProps {
}

export function Layout({ children }: AppProviderProps) {
const router = useRouter()
const disableSideBar = router.pathname.startsWith('/login')
return (
<LayoutContainer>
<SideBar />
{!disableSideBar && <SideBar />}
{children}
<Toaster position="top-center" reverseOrder={false} toastOptions={toastConfig} />
</LayoutContainer>
4 changes: 4 additions & 0 deletions apps/admin-web/src/context/AuthProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Dispatch, SetStateAction, createContext, useContext, useState } from 'react'

import { useRouter } from 'next/router'

import { UserDto } from '@admin-web/common/types/UserDto'
import { authApi } from '@admin-web/utils/authAxios'

@@ -25,12 +27,14 @@ export const AuthContext = createContext<IAuthContext | null>(null)

export default function AuthProvider({ children }: AuthProviderProps) {
const [user, setUser] = useState<UserDto | null>(null)
const router = useRouter()
const logout = async () => {
// TODO: send api for logging user out
try {
const res = await authApi.get('/logout')
console.log(res)
setUser(null)
router.push('/login')
} catch (err) {
console.log(`Error when logging user out: ${err}`)
}
2 changes: 1 addition & 1 deletion apps/admin-web/src/module/pendingReviews/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/rules-of-hooks */
import { Dispatch, SetStateAction, useState } from 'react'
import { useState } from 'react'

import PendingReviewsList from '@admin-web/module/pendingReviews/components/pendingReviewList'

15 changes: 11 additions & 4 deletions apps/admin-web/src/pages/login.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect } from 'react'

import { useRouter } from 'next/router'

export default function LoginPage() {
const router = useRouter()
useEffect(() => {

// TODO: decorate this page
const handleLogin = () => {
const auth_url = new URL(process.env.NEXT_PUBLIC_AUTHORIZE_URL || '')
const response_type = 'code'
const client_id = process.env.NEXT_PUBLIC_CLIENT_ID || ''
@@ -15,5 +15,12 @@ export default function LoginPage() {
auth_url.searchParams.append('scope', scope)
auth_url.searchParams.append('redirect_uri', redirect_uri)
router.push(auth_url)
}, [router])
}

return (
<div>
<h1>Login Page</h1>
<button onClick={handleLogin}>Login with authentik</button>
</div>
)
}