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

Disable editing for media type questions with uploads #4725

Merged
merged 6 commits into from Nov 14, 2023
Merged
Changes from all commits
Commits
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
17 changes: 15 additions & 2 deletions jsapp/js/components/modalForms/bulkEditSubmissionsForm.es6
Expand Up @@ -212,6 +212,12 @@ class BulkEditSubmissionsForm extends React.Component {
}
}

isEditDisabled(questionType) {
return ['audio', 'background-audio', 'video', 'image', 'file'].includes(
questionType
);
}

renderRow(questionData, itemIndex) {
let question = questionData;
if (typeof questionData.refIndex !== 'undefined') {
Expand Down Expand Up @@ -253,8 +259,15 @@ class BulkEditSubmissionsForm extends React.Component {

<bem.SimpleTable__cell>
<bem.KoboTextButton
m='blue'
onClick={this.selectQuestion.bind(this, question)}
m={this.isEditDisabled(question.type) ? 'grey' : 'blue'}
onClick={(event) => {
if (!this.isEditDisabled(question.type)) {
this.selectQuestion(question);
} else {
event.preventDefault();
}
}}
aria-disabled={this.isEditDisabled(question.type)}
>
{t('Edit')}
</bem.KoboTextButton>
Expand Down