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

Rewrite interview using React and Redux #941

Draft
wants to merge 54 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ec8f53f
Add project_interview view and refactor webpack config
jochenklar Mar 12, 2024
f9da944
Add lint script to package.json
jochenklar Mar 14, 2024
168bea8
Move Pending container to core/assets
jochenklar Mar 14, 2024
f51c16e
Add react/redux setup for interview
jochenklar Mar 14, 2024
8591118
Add breadcrumb, overview, progress, buttons and navigation to interview
jochenklar Mar 15, 2024
22401df
Add location handling and refactor
jochenklar Mar 25, 2024
5e1f513
Add TemplateAPI and help to sidebar in interview
jochenklar Apr 2, 2024
0fdf1b1
Add Page, Question, QuestionSet and widgets components
jochenklar Apr 2, 2024
537ba81
Add Widgets and refactor actions and front end data model
jochenklar Apr 23, 2024
8508da6
Fix DateWidget
jochenklar Apr 26, 2024
551eaf1
Fix focus for multiple questions
jochenklar Apr 26, 2024
6fd71f8
Add CREATE_VALUE action and fix range, file and checkbox widget
jochenklar Apr 26, 2024
6b4d81f
Refactor value filtering and remove _attribute from serializer again
jochenklar Apr 29, 2024
8b50a25
Move AddValue and RemoveValue components and add useFocusEffect
jochenklar Apr 29, 2024
57c3b4a
Implement QuestionSets in react front-end (and more...)
jochenklar Apr 29, 2024
bb21d7c
Add link to new interview
jochenklar Apr 29, 2024
2840a82
Add isDefault to new front-end and reorganize files
jochenklar Apr 29, 2024
5355f24
Add QuestionEraseValue component
jochenklar Apr 29, 2024
ee251d1
Add optional badge
jochenklar Apr 30, 2024
444dacf
Reorganize interview store, components and add read_only view
jochenklar Apr 30, 2024
9e9c899
Add "done" page to interview
jochenklar Apr 30, 2024
02bf82a
Add option providers into new react front end and add markdown
jochenklar May 1, 2024
96eb512
Add set_collection to react front end
jochenklar May 1, 2024
9f36026
Add component for project errors
jochenklar May 1, 2024
7dbfa68
Add error handling to react front end
jochenklar May 1, 2024
670434e
Restore project_questions.scss
jochenklar May 1, 2024
89fb666
Fix navigation tests
jochenklar May 1, 2024
82a5277
Move widget directory in interview app
jochenklar May 3, 2024
8dec431
Refactor styles in interview and fix range widget
jochenklar May 3, 2024
aefaaf6
Refactor file widget
jochenklar May 3, 2024
b364eab
Update date picker in interview
jochenklar May 3, 2024
09c0bb2
Submit PageHeadFormModal when pressing enter
jochenklar May 3, 2024
4868cb8
Add back flag to fetchPage action
jochenklar May 3, 2024
04e05d0
Check isManager in interview
jochenklar May 3, 2024
7c00512
Cleanup components
jochenklar May 3, 2024
7c3e4d0
Update project progress in interview
jochenklar May 3, 2024
33eaee0
Fetch navigation after storeValue etc in interview
jochenklar May 3, 2024
8c0b6a6
Add resolve conditions to new front-end
jochenklar May 4, 2024
a256fca
Fix navigation style
jochenklar May 4, 2024
31c949e
Refactor Widgets again and add units to interview
jochenklar May 4, 2024
d6d524b
Add async mode to SelectWidget and remove AutocompleteInput
jochenklar May 5, 2024
98fe65c
Fix SelectWidget
jochenklar May 6, 2024
8ad5475
Add createable select to replace freeautocomplete
jochenklar May 6, 2024
00440cb
Add refresh to storeValue and deleteValue
jochenklar May 6, 2024
91d3ca3
Fix file input
jochenklar May 13, 2024
533d9b3
Store unit and value_type in new front-end
jochenklar May 13, 2024
222448c
Fix page issues and add error handling for page values
jochenklar May 13, 2024
cbe6077
Fix navigation in interview
jochenklar May 13, 2024
1cc1e01
Store default values when fetching page
jochenklar May 13, 2024
80db890
Handle delete value and set errors
jochenklar May 14, 2024
ee638be
Update delete set api to delete descendants values
jochenklar May 14, 2024
e483d7e
Fix init page and storing of default values
jochenklar May 14, 2024
73a5f1c
Fix focus in interview
jochenklar May 17, 2024
4878a6a
Disable onMenuOpen in interview for now
jochenklar May 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
504 changes: 495 additions & 9 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "rdmo",
"scripts": {
"build:prod": "webpack --config webpack/prod.config.js --mode production",
"build": "webpack --config webpack/dev.config.js --mode development",
"watch": "webpack --config webpack/dev.config.js --mode development --watch"
"build:prod": "webpack --config webpack.config.js --mode production",
"build": "webpack --config webpack.config.js --mode development",
"watch": "webpack --config webpack.config.js --mode development --watch",
"lint": "eslint --ext .js rdmo/"
},
"author": "RDMO Arbeitsgemeinschaft <rdmorganiser.github.io>",
"license": "Apache-2.0",
Expand All @@ -17,22 +18,27 @@
"@uiw/react-codemirror": "^4.19.9",
"bootstrap-sass": "^3.4.1",
"classnames": "^2.3.2",
"date-fns": "^3.6.0",
"font-awesome": "4.7.0",
"html-to-text": "^9.0.5",
"jquery": "^3.6.0",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"prop-types": "^15.7.2",
"react": "^18.2.0",
"react-bootstrap": "0.33.1",
"react-datepicker": "^6.9.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-redux": "^7.2.4",
"react-select": "^5.7.0",
"redux": "^4.1.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
"redux-thunk": "^2.3.0",
"use-debounce": "^10.0.0"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
Expand Down
8 changes: 8 additions & 0 deletions rdmo/accounts/viewsets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from django.contrib.auth import get_user_model

from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.viewsets import ReadOnlyModelViewSet

from django_filters.rest_framework import DjangoFilterBackend
Expand Down Expand Up @@ -40,3 +43,8 @@ def get_queryset(self):
'role__member', 'role__manager',
'role__editor', 'role__reviewer',
'memberships')

@action(detail=False, permission_classes=(IsAuthenticated, ))
def current(self, request):
serializer = UserSerializer(request.user)
return Response(serializer.data)
Binary file added rdmo/core/assets/fonts/DroidSans-Bold.ttf
Binary file not shown.
Binary file added rdmo/core/assets/fonts/DroidSans.ttf
Binary file not shown.
Binary file added rdmo/core/assets/fonts/DroidSansMono.ttf
Binary file not shown.
Binary file added rdmo/core/assets/fonts/DroidSerif-Bold.ttf
Binary file not shown.
Binary file added rdmo/core/assets/fonts/DroidSerif-BoldItalic.ttf
Binary file not shown.
Binary file added rdmo/core/assets/fonts/DroidSerif-Italic.ttf
Binary file not shown.
Binary file added rdmo/core/assets/fonts/DroidSerif.ttf
Binary file not shown.
Binary file added rdmo/core/assets/img/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
260 changes: 260 additions & 0 deletions rdmo/core/assets/img/rdmo-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions rdmo/core/assets/js/actions/actionTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const UPDATE_CONFIG = 'UPDATE_CONFIG'
export const DELETE_CONFIG = 'DELETE_CONFIG'

export const FETCH_SETTINGS_ERROR = 'FETCH_SETTINGS_ERROR'
export const FETCH_SETTINGS_INIT = 'FETCH_SETTINGS_INIT'
export const FETCH_SETTINGS_SUCCESS = 'FETCH_SETTINGS_SUCCESS'

export const FETCH_TEMPLATES_ERROR = 'FETCH_TEMPLATES_ERROR'
export const FETCH_TEMPLATES_INIT = 'FETCH_TEMPLATES_INIT'
export const FETCH_TEMPLATES_SUCCESS = 'FETCH_TEMPLATES_SUCCESS'

export const FETCH_CURRENT_USER_ERROR = 'FETCH_CURRENT_USER_ERROR'
export const FETCH_CURRENT_USER_INIT = 'FETCH_CURRENT_USER_INIT'
export const FETCH_CURRENT_USER_SUCCESS = 'FETCH_CURRENT_USER_SUCCESS'
13 changes: 13 additions & 0 deletions rdmo/core/assets/js/actions/configActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { setConfigInLocalStorage, deleteConfigInLocalStorage } from '../utils/config'

import { UPDATE_CONFIG, DELETE_CONFIG } from './actionTypes'

export function updateConfig(prefix, path, value) {
setConfigInLocalStorage(prefix, path, value)
return {type: UPDATE_CONFIG, path, value}
}

export function deleteConfig(prefix, path) {
deleteConfigInLocalStorage(prefix, path)
return {type: DELETE_CONFIG, path}
}
25 changes: 25 additions & 0 deletions rdmo/core/assets/js/actions/settingsActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import CoreApi from '../api/CoreApi'

import { FETCH_SETTINGS_ERROR, FETCH_SETTINGS_INIT, FETCH_SETTINGS_SUCCESS } from './actionTypes'

export function fetchSettings() {
return function(dispatch) {
dispatch(fetchSettingsInit())

return CoreApi.fetchSettings()
.then((settings) => dispatch(fetchSettingsSuccess(settings)))
.catch((errors) => dispatch(fetchSettingsError(errors)))
}
}

export function fetchSettingsInit() {
return {type: FETCH_SETTINGS_INIT}
}

export function fetchSettingsSuccess(settings) {
return {type: FETCH_SETTINGS_SUCCESS, settings}
}

export function fetchSettingsError(errors) {
return {type: FETCH_SETTINGS_ERROR, errors}
}