Skip to content

Commit cd7e42f

Browse files
authored
Merge pull request #1025 from topcoder-platform/feat/new-review-app-init
New Review App UI Prototype (Reviewer Flow)
2 parents 7af80d9 + 2eaafa9 commit cd7e42f

File tree

163 files changed

+7590
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+7590
-18
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ The following summarizes the various [apps](#adding-a-new-platform-ui-applicatio
556556
- [Gamification Admin](#gamification-admin)
557557
- [Learn](#learn)
558558
- [Self Service](#self-service)
559+
- [Review](#review)
559560
560561
## Platform App
561562
@@ -599,3 +600,10 @@ Application that allows customers to submit/start challenges self-service.
599600
600601
[Work README TBD](./src/apps/self-service/README.md)
601602
[Work Routes](./src/apps/self-service/src/self-service.routes.tsx)
603+
604+
## Review
605+
606+
The application that allows managing the review submissions.
607+
608+
[Review README TBD](./src/apps/review/README.md)
609+
[Review Routes](./src/apps/review/src/review-app.routes.tsx)

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@storybook/react": "7.6.10",
2929
"@stripe/react-stripe-js": "1.13.0",
3030
"@stripe/stripe-js": "1.41.0",
31+
"@types/codemirror": "^5.60.15",
3132
"apexcharts": "^3.36.0",
3233
"axios": "^1.7.9",
3334
"browser-cookies": "^1.2.0",
@@ -43,6 +44,7 @@
4344
"draft-js-export-html": "^1.2.0",
4445
"draft-js-markdown-shortcuts-plugin": "^0.3.0",
4546
"draft-js-plugins-editor": "^2.0.3",
47+
"easymde": "^2.20.0",
4648
"express": "^4.21.2",
4749
"express-fileupload": "^1.4.0",
4850
"express-interceptor": "^1.2.0",
@@ -92,9 +94,12 @@
9294
"redux-promise": "^0.6.0",
9395
"redux-promise-middleware": "^6.1.3",
9496
"redux-thunk": "^2.4.1",
97+
"rehype-raw": "^7.0.0",
98+
"rehype-stringify": "^10.0.1",
9599
"remark-breaks": "^3.0.2",
96100
"remark-frontmatter": "^4.0.1",
97101
"remark-gfm": "^3.0.1",
102+
"remark-parse": "^11.0.0",
98103
"remove": "^0.1.5",
99104
"sanitize-html": "^2.12.1",
100105
"sass": "^1.79.0",

src/apps/platform/src/platform.routes.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { walletRoutes } from '~/apps/wallet'
1212
import { walletAdminRoutes } from '~/apps/wallet-admin'
1313
import { copilotsRoutes } from '~/apps/copilots'
1414
import { adminRoutes } from '~/apps/admin'
15+
import { reviewRoutes } from '~/apps/review'
1516

1617
const Home: LazyLoadedComponent = lazyLoad(
1718
() => import('./routes/home'),
@@ -41,6 +42,7 @@ export const platformRoutes: Array<PlatformRoute> = [
4142
...walletAdminRoutes,
4243
...accountsRoutes,
4344
...skillsManagerRoutes,
45+
...reviewRoutes,
4446
...homeRoutes,
4547
...adminRoutes,
4648
]

src/apps/review/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Instructions For Running The Review Locally
2+
3+
### Build and run:
4+
5+
- Run this script to start the app, you may have to type the admin password for the `sudo` command:
6+
7+
```bash
8+
nvm use
9+
export NVM_DIR=~/.nvm
10+
yarn install
11+
sudo yarn start
12+
```
13+
14+
- If you have any problem when running the above script, please check `README.md` in the root of the project for more info.
15+
- After running successfully, please open `https://local.topcoder-dev.com/review` in the browser to start the admin app
16+
17+
### Configuration:
18+
19+
- Configuration files are under src/apps/review/src/config
20+
21+
### Mock data:
22+
23+
- Mock data files are under src/apps/review/src/mock-datas

src/apps/review/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'

src/apps/review/src/ReviewApp.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* The review app.
3+
*/
4+
import { FC, useContext, useEffect, useMemo } from 'react'
5+
import { Outlet, Routes } from 'react-router-dom'
6+
7+
import { routerContext, RouterContextData } from '~/libs/core'
8+
9+
import { Layout, SWRConfigProvider } from './lib'
10+
import { toolTitle } from './review-app.routes'
11+
import './lib/styles/index.scss'
12+
13+
const ReviewApp: FC = () => {
14+
const { getChildRoutes }: RouterContextData = useContext(routerContext)
15+
// eslint-disable-next-line react-hooks/exhaustive-deps -- missing dependency: getChildRoutes
16+
const childRoutes = useMemo(() => getChildRoutes(toolTitle), [])
17+
18+
useEffect(() => {
19+
document.body.classList.add('review-app')
20+
return () => {
21+
document.body.classList.remove('review-app')
22+
}
23+
}, [])
24+
25+
return (
26+
<SWRConfigProvider>
27+
<Layout>
28+
<Outlet />
29+
<Routes>{childRoutes}</Routes>
30+
</Layout>
31+
</SWRConfigProvider>
32+
)
33+
}
34+
35+
export default ReviewApp
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Common config for ui.
3+
*/
4+
5+
import { InputSelectOption } from '~/libs/ui'
6+
7+
export const CHALLENGE_TYPE_SELECT_OPTIONS: InputSelectOption[] = [
8+
{
9+
label: 'All',
10+
value: '',
11+
},
12+
...[
13+
'Design',
14+
'Code',
15+
'Bug Hunt',
16+
'Test Suite',
17+
'Copilot Opportunity',
18+
'Marathon Match',
19+
'First2Finish',
20+
'Other',
21+
].map(item => ({ label: item, value: item })),
22+
]
23+
export const QUESTION_YES_NO_OPTIONS: InputSelectOption[] = ['Yes', 'No'].map(
24+
item => ({ label: item, value: item }),
25+
)
26+
export const QUESTION_RESPONSE_OPTIONS: InputSelectOption[] = [
27+
{
28+
label: 'Comment',
29+
value: 'COMMENT',
30+
},
31+
{
32+
label: 'Required',
33+
value: 'REQUIRED',
34+
},
35+
{
36+
label: 'Recommended',
37+
value: 'RECOMMENDED',
38+
},
39+
]
40+
export const QUESTION_RESPONSE_TYPE_MAPPING_DISPLAY: { [key: string]: string }
41+
= {
42+
COMMENT: 'Comment',
43+
RECOMMENDED: 'Recommended',
44+
REQUIRED: 'Required',
45+
}
46+
export const TABLE_DATE_FORMAT = 'MMM DD, HH:mm A'
47+
export const THRESHOLD_SHORT_TIME = 2 * 60 * 60 * 1000 // in miliseconds
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Common config for routes in review app.
3+
*/
4+
import { AppSubdomain, EnvironmentConfig } from '~/config'
5+
6+
export const rootRoute: string
7+
= EnvironmentConfig.SUBDOMAIN === AppSubdomain.review
8+
? ''
9+
: `/${AppSubdomain.review}`
10+
11+
export const activeReviewAssigmentsRouteId = 'active-review-assigments'
12+
export const openOpportunitiesRouteId = 'open-opportunities'
13+
export const pastReviewAssignmentsRouteId = 'past-review-assignments'

src/apps/review/src/declarations.d.ts

Whitespace-only changes.

src/apps/review/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { reviewRoutes } from './review-app.routes'
2+
export { rootRoute as reviewRootRoute } from './config/routes.config'

0 commit comments

Comments
 (0)