Skip to content

Commit

Permalink
Add feature flag for enabling/disabling anonymous question posting
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorginaFraire committed Dec 13, 2023
1 parent a3527d5 commit ce5c900
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/components/QuestionForm/QuestionForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import { ContentState, convertFromRaw, EditorState } from 'draft-js';
import { markdownToDraft } from 'markdown-draft-js';
import { RiArrowRightSFill } from 'react-icons/ri';
import { requireEmployeeAssigned } from 'app/config/flags.json';
import { requireEmployeeAssigned, postAnonymousQuestions } from 'app/config/flags.json';

import {
DEFAULT_LOCATION,
Expand Down Expand Up @@ -321,13 +321,15 @@ function QuestionForm({
onInputChange={onInputChange}
submitElement={(
<Styled.Submit disabled={askBtnClass}>
{ postAnonymousQuestions && (
<p style={{ float: 'left' }}>
<span>Ask anonymously</span>
<Switch
checked={state.isAnonymous}
onChange={onAnonymousChange}
/>
</p>
)}
<InputCounter
currentLength={getQuestionLength(state.inputValue)}
maxLength={MAXIMUM_QUESTION_LENGTH}
Expand Down
3 changes: 2 additions & 1 deletion app/config/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"sendEmailOnQuestionReassigned": true,
"sendManagersEmailReminder": true,
"sendEmployeesEmailReminder": true,
"requestEmbeddingOnAnswer": true
"requestEmbeddingOnAnswer": true,
"postAnonymousQuestions": false
}

0 comments on commit ce5c900

Please sign in to comment.