Skip to content

Commit

Permalink
Tiny UI corrections (#1957)
Browse files Browse the repository at this point in the history
* Missing n of respondents needed in Cockpit

 fixes #1947

* Change new panel survey wave icon

closes #1948

* Workaround: no pagination of surveys in panel survey

We just fake it for now.
  • Loading branch information
ysbaddaden authored Oct 5, 2021
1 parent db3b779 commit adc5abf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/static/js/components/charts/QueueSize.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class QueueSize extends Component<Props, State> {
<path style={{display: needed ? 'auto' : 'none'}} className='dottedLine' d={this.connector(left.x1, left.y1, left.x2, left.y2, weight - (left.x1 > left.x2 && right.x1 > right.x2 ? corner : 0), corner)} />
<path style={{display: needed ? 'auto' : 'none'}} className='dottedLine' d={this.connector(right.x1, right.y1, right.x2, right.y2, weight, corner)} />
<g ref='content'>
<text className='needed'>{t('{{respondentsNeeded}} respondents needed', {needed: toKilo(needed)})}</text>
<text className='needed'>{t('{{respondentsNeeded}} respondents needed', {respondentsNeeded: toKilo(needed)})}</text>
<text className='multiplier' y={18}>{t('to have {{additionalCompletes}} additional completes', {additionalCompletes: additionalCompletes ? toKilo(additionalCompletes) : 0})}</text>
{additionalRespondents ? <text className='missing' y={54} ><tspan className='icon'>warning</tspan>{t('Add {{additionalRespondents}} additional respondents', {additionalRespondents: toKilo(additionalRespondents)})}</text> : null}
</g>
Expand Down
4 changes: 3 additions & 1 deletion web/static/js/components/surveys/PanelSurveyShow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ const mapStateToProps = (state, ownProps) => {
const name = panelSurvey && panelSurvey.name || t('Untitled panel survey')

const occurrences = panelSurvey ? panelSurvey.occurrences : null

// NOTE: we fake pagination (backend doesn't paginate, yet)
let totalCount = occurrences ? occurrences.length : 0
const pageIndex = 0
const pageSize = 0
const pageSize = totalCount
const startIndex = Math.min(totalCount, pageIndex + 1)
const endIndex = Math.min(pageIndex + pageSize, totalCount)

Expand Down
2 changes: 1 addition & 1 deletion web/static/js/components/ui/RepeatButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Tooltip } from '.'
import classNames from 'classnames/bind'

export const RepeatButton = ({ text, onClick, disabled }) => {
const icon = <i className='material-icons'>replay</i>
const icon = <i className='material-icons'>repeat_one</i>
const baseClassNames = 'btn-floating btn-large right mtop primary-button'
const button = disabled
? <a className={classNames(baseClassNames)} disabled>{icon}</a>
Expand Down

0 comments on commit adc5abf

Please sign in to comment.