Skip to content

Commit

Permalink
Add project_interview_sidebar template
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Nov 14, 2024
1 parent 87aa8c5 commit fbbe3dc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions rdmo/core/assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ metadata {
.page h2:nth-child(2) {
margin-top: 0;
}
.sidebar h2:first-child,
.sidebar .import-buttons {
.sidebar > *:first-child {
margin-top: 70px;
}

Expand Down
1 change: 1 addition & 0 deletions rdmo/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
'projects/project_interview_progress_help.html',
'projects/project_interview_question_help.html',
'projects/project_interview_questionset_help.html',
'projects/project_interview_sidebar.html',
]

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Expand Down
5 changes: 3 additions & 2 deletions rdmo/projects/assets/js/interview/components/main/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { isEmpty, isNil, pick, truncate } from 'lodash'
import ProjectApi from '../../api/ProjectApi'
import ValueApi from '../../api/ValueApi'

const Search = ({ attribute, setAttribute, values, setValues, collection = false }) => {
const Search = ({ page, attribute, values, setValues, collection = false }) => {
// create a key for the first AsyncSelect, to reset the loaded values when project or snapshot changes
const key = (values.project ? values.project.id : '') + (values.snapshot ? '-all' : '')

const handleLoadValues = useDebouncedCallback((search, callback) => {
ValueApi.searchValues({
attribute,
set_attribute: setAttribute,
set_attribute: page && page.is_collection && page.attribute,
search,
project: values.project ? values.project.id : '',
snapshot: values.snapshot ? 'all' : '',
Expand Down Expand Up @@ -136,6 +136,7 @@ const Search = ({ attribute, setAttribute, values, setValues, collection = false
}

Search.propTypes = {
page: PropTypes.number.isRequired,
attribute: PropTypes.number.isRequired,
setAttribute: PropTypes.number,
values: PropTypes.object.isRequired,
Expand Down
7 changes: 5 additions & 2 deletions rdmo/projects/assets/js/interview/containers/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { connect } from 'react-redux'

import { isReady } from '../utils/interview'

import Html from 'rdmo/core/assets/js/components/Html'

import Buttons from '../components/sidebar/Buttons'
import Navigation from '../components/sidebar/Navigation'
import Overview from '../components/sidebar/Overview'
Expand All @@ -18,7 +20,7 @@ import * as interviewActions from '../actions/interviewActions'
const Sidebar = ({ config, settings, templates, user, project, interview, configActions, interviewActions }) => {
if (isReady(interview)) {
return (
<div>
<>
<Overview
overview={project.overview}
help={templates.project_interview_overview_help}/>
Expand All @@ -35,7 +37,8 @@ const Sidebar = ({ config, settings, templates, user, project, interview, config
navigation={interview.navigation}
help={templates.project_interview_navigation_help}
fetchPage={interviewActions.fetchPage} />
</div>
<Html html={templates.project_interview_sidebar} />
</>
)
}

Expand Down
Empty file.

0 comments on commit fbbe3dc

Please sign in to comment.