-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize interview store, components and add read_only view
- Loading branch information
1 parent
ee251d1
commit 444dacf
Showing
30 changed files
with
351 additions
and
270 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
38 changes: 38 additions & 0 deletions
38
rdmo/projects/assets/js/interview/actions/projectActions.js
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,38 @@ | ||
import ProjectApi from '../api/ProjectApi' | ||
|
||
import projectId from '../utils/projectId' | ||
|
||
import { | ||
FETCH_OVERVIEW_ERROR, | ||
FETCH_OVERVIEW_SUCCESS, | ||
FETCH_PROGRESS_ERROR, | ||
FETCH_PROGRESS_SUCCESS, | ||
} from './actionTypes' | ||
|
||
export function fetchOverview() { | ||
return (dispatch) => ProjectApi.fetchOverview(projectId) | ||
.then((overview) => dispatch(fetchOverviewSuccess(overview))) | ||
.catch((errors) => dispatch(fetchOverviewError(errors))) | ||
} | ||
|
||
export function fetchOverviewSuccess(overview) { | ||
return {type: FETCH_OVERVIEW_SUCCESS, overview} | ||
} | ||
|
||
export function fetchOverviewError(errors) { | ||
return {type: FETCH_OVERVIEW_ERROR, errors} | ||
} | ||
|
||
export function fetchProgress() { | ||
return (dispatch) => ProjectApi.fetchProgress(projectId) | ||
.then((progress) => dispatch(fetchProgressSuccess(progress))) | ||
.catch((errors) => dispatch(fetchProgressError(errors))) | ||
} | ||
|
||
export function fetchProgressSuccess(progress) { | ||
return {type: FETCH_PROGRESS_SUCCESS, progress} | ||
} | ||
|
||
export function fetchProgressError(errors) { | ||
return {type: FETCH_PROGRESS_ERROR, errors} | ||
} |
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
9 changes: 7 additions & 2 deletions
9
rdmo/projects/assets/js/interview/components/main/question/QuestionDefault.js
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,11 +1,16 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const QuestionDefault = () => { | ||
return ( | ||
const QuestionDefault = ({ isDefault }) => { | ||
return isDefault && ( | ||
<div className="badge badge-default" title={gettext('This is a default answer that can be customized.')}> | ||
{gettext('Default')} | ||
</div> | ||
) | ||
} | ||
|
||
QuestionDefault.propTypes = { | ||
isDefault: PropTypes.bool.isRequired | ||
} | ||
|
||
export default QuestionDefault |
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
7 changes: 5 additions & 2 deletions
7
rdmo/projects/assets/js/interview/components/main/question/QuestionRemoveValue.js
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
Oops, something went wrong.