Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 27 additions & 29 deletions src/components/Forms/Components/QuestionViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,33 @@
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
<div className="row border border-primary m-2 p-3 bg-light">
<div className="input-group col">
<div className="row bg-info pl-1">
<label className="text-white">{data.label}</label>
</div>
{/* eslint-disable-next-line react/no-danger */}
<div className="row" dangerouslySetInnerHTML={{ __html: sanitizer(data.description) }} />
<div className="row">
{data.type === 'short_answer' && (
<input
className="form-control"
type="text"
id={data.id}
required={data.required}
onChange={e => handleAnswerChange(e, data.id)}
/>
)}
{data.type === 'paragraph' && (
<textarea
className="form-control"
id={data.id}
required={data.required}
onChange={e => handleAnswerChange(e, data.id)}
/>
)}
{(data.type === 'multi_select' || data.type === 'radio') && (
<OptionViewer data={data} SetFormAnswers={SetFormAnswers} formAnwers={formAnwers} />
)}
</div>
<div className="border border-primary m-2 p-3 bg-light">
<div className="mb-2 bg-info pl-1">
<label className="text-white mb-0">{data.label}</label>

Check warning on line 24 in src/components/Forms/Components/QuestionViewer.jsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'data.label' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=OneCommunityGlobal_HighestGoodNetworkApp&issues=AZ132ETiAuf7ECOylhQD&open=AZ132ETiAuf7ECOylhQD&pullRequest=5131
</div>
{/* eslint-disable-next-line react/no-danger */}
<div className="mb-2" dangerouslySetInnerHTML={{ __html: sanitizer(data.description) }} />

Check warning on line 27 in src/components/Forms/Components/QuestionViewer.jsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'data.description' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=OneCommunityGlobal_HighestGoodNetworkApp&issues=AZ132ETiAuf7ECOylhQE&open=AZ132ETiAuf7ECOylhQE&pullRequest=5131
<div>
{data.type === 'short_answer' && (
<input
className="form-control"
type="text"
id={data.id}
required={data.required}
onChange={e => handleAnswerChange(e, data.id)}
/>
)}
{data.type === 'paragraph' && (
<textarea
className="form-control"
id={data.id}
required={data.required}
onChange={e => handleAnswerChange(e, data.id)}
/>
)}
{(data.type === 'multi_select' || data.type === 'radio') && (
<OptionViewer data={data} SetFormAnswers={SetFormAnswers} formAnwers={formAnwers} />
)}
</div>
</div>
</>
Expand Down
2 changes: 2 additions & 0 deletions src/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ import { studentReducer } from './studentProfileReducer';
import { atomReducer } from './educationPortal/atomReducer';
import { weeklySummariesFiltersApi } from '../actions/weeklySummariesFilterAction';
import browseLessonPlanReducer from './educationPortal/broweLPReducer';
import formReducer from './formReducer';

// Kitchen and Inventory Management
import { kiCalendarApi } from '../actions/kiCalendarAction';
Expand Down Expand Up @@ -205,6 +206,7 @@ const localReducers = {

// Kitchen and Inventory Management
[kiCalendarApi.reducerPath]: kiCalendarApi.reducer,
form: formReducer,
};

const sessionReducers = {
Expand Down
2 changes: 1 addition & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const rootReducers = combineReducers({
const persistConfig = {
key: 'root',
storage,
whitelist: ['theme', 'role'], // Only persist theme settings
whitelist: ['theme', 'role', 'form'], // Persist theme settings and form builder draft
blacklist: ['auth', 'errors', ...Object.keys(sessionReducers)],
timeout: 0, // No timeout
writeFailHandler: (err) => {
Expand Down
Loading