diff --git a/src/actions/event-actions.js b/src/actions/event-actions.js
index 07e88c9d7..58b78f9c6 100644
--- a/src/actions/event-actions.js
+++ b/src/actions/event-actions.js
@@ -959,7 +959,7 @@ export const getEvent = (eventId) => async (dispatch, getState) => {
const params = {
access_token: accessToken,
expand:
- "creator,speakers,moderator,sponsors,groups,type,type.allowed_media_upload_types,type.allowed_media_upload_types.type, slides, links, videos, media_uploads, tags, media_uploads.media_upload_type, media_uploads.media_upload_type.type,extra_questions,selection_plan,selection_plan.extra_questions, selection_plan.extra_questions.values,selection_plan.track_chair_rating_types,selection_plan.track_chair_rating_types.score_types,created_by,track_chair_scores_avg.ranking_type,actions,allowed_ticket_types",
+ "creator,speakers,moderator,sponsors,groups,type,type.allowed_media_upload_types,type.allowed_media_upload_types.type, slides, links, videos, media_uploads, tags, media_uploads.media_upload_type, media_uploads.media_upload_type.type,extra_questions,selection_plan,selection_plan.extra_questions, selection_plan.extra_questions.values,selection_plan.track_chair_rating_types,selection_plan.track_chair_rating_types.score_types,created_by,track_chair_scores_avg.ranking_type,actions,allowed_ticket_types,allowed_badge_features_types",
fields: "allowed_ticket_types.id,allowed_ticket_types.name"
};
diff --git a/src/actions/summit-actions.js b/src/actions/summit-actions.js
index f60fb0fa7..129fefde4 100644
--- a/src/actions/summit-actions.js
+++ b/src/actions/summit-actions.js
@@ -72,6 +72,7 @@ export const getSummitById = (summitId) => async (dispatch) => {
"selection_plans," +
"ticket_types," +
"badge_types," +
+ "badge_features," +
"badge_features_types," +
"badge_access_level_types," +
"badge_view_types," +
diff --git a/src/components/forms/extra-question-form/index.js b/src/components/forms/extra-question-form/index.js
index a87ab116b..6491dd923 100644
--- a/src/components/forms/extra-question-form/index.js
+++ b/src/components/forms/extra-question-form/index.js
@@ -448,11 +448,11 @@ class ExtraQuestionForm extends React.Component {
>
diff --git a/src/pages/sponsors/edit-sponsor-extra-question-page.js b/src/pages/sponsors/edit-sponsor-extra-question-page.js
index 7baea8d34..07f9579ea 100644
--- a/src/pages/sponsors/edit-sponsor-extra-question-page.js
+++ b/src/pages/sponsors/edit-sponsor-extra-question-page.js
@@ -87,6 +87,7 @@ function EditSponsorExtraQuestionPage({
{currentSummit && (
{currentSummit && (
{
const { type, payload } = action;
switch (type) {
case LOGOUT_USER:
- {
- // we need this in case the token expired while editing the form
- if (payload.hasOwnProperty("persistStore")) {
- return state;
- } else {
- return { ...state, entity: { ...DEFAULT_ENTITY }, errors: {} };
- }
+ // we need this in case the token expired while editing the form
+ if (payload.hasOwnProperty("persistStore")) {
+ return state;
}
- break;
+ return { ...state, entity: { ...DEFAULT_ENTITY }, errors: {} };
case SET_CURRENT_SUMMIT:
case RESET_SELECTION_PLAN_EXTRA_QUESTION_FORM:
- {
- return { ...state, entity: { ...DEFAULT_ENTITY }, errors: {} };
- }
- break;
- case RECEIVE_SELECTION_PLAN_EXTRA_QUESTION_META:
- {
- let allClasses = payload.response;
+ return { ...state, entity: { ...DEFAULT_ENTITY }, errors: {} };
+ case RECEIVE_SELECTION_PLAN_EXTRA_QUESTION_META: {
+ const allClasses = payload.response;
- return { ...state, allClasses: allClasses };
- }
- break;
+ return { ...state, allClasses };
+ }
case UPDATE_SELECTION_PLAN_EXTRA_QUESTION:
- {
- return { ...state, entity: { ...payload }, errors: {} };
- }
- break;
+ return { ...state, entity: { ...payload }, errors: {} };
case SELECTION_PLAN_EXTRA_QUESTION_ADDED:
- case RECEIVE_SELECTION_PLAN_EXTRA_QUESTION:
- {
- let entity = { ...payload.response };
+ case RECEIVE_SELECTION_PLAN_EXTRA_QUESTION: {
+ const entity = { ...payload.response };
- for (var key in entity) {
- if (entity.hasOwnProperty(key)) {
- entity[key] = entity[key] == null ? "" : entity[key];
- }
+ for (const key in entity) {
+ if (entity.hasOwnProperty(key)) {
+ entity[key] = entity[key] == null ? "" : entity[key];
}
-
- return { ...state, entity: { ...DEFAULT_ENTITY, ...entity } };
}
- break;
+
+ return { ...state, entity: { ...DEFAULT_ENTITY, ...entity } };
+ }
case SELECTION_PLAN_EXTRA_QUESTION_UPDATED:
- {
- return state;
+ return state;
+ case SELECTION_PLAN_EXTRA_QUESTION_VALUE_ADDED: {
+ const entity = { ...payload.response };
+ let values = [...state.entity.values];
+ if (entity.is_default) {
+ // reset all other values
+ values = values.map((v) => ({ ...v, is_default: false }));
}
- break;
- case SELECTION_PLAN_EXTRA_QUESTION_VALUE_ADDED:
- {
- let entity = { ...payload.response };
- let values = [...state.entity.values];
- if (entity.is_default) {
- // reset all other values
- values = values.map((v) => ({ ...v, is_default: false }));
- }
- return {
- ...state,
- entity: { ...state.entity, values: [...values, entity] }
- };
+ return {
+ ...state,
+ entity: { ...state.entity, values: [...values, entity] }
+ };
+ }
+ case SELECTION_PLAN_EXTRA_QUESTION_VALUE_UPDATED: {
+ const entity = { ...payload.response };
+ let values_tmp = state.entity.values.filter((v) => v.id !== entity.id);
+ if (entity.is_default) {
+ // reset all other values
+ values_tmp = values_tmp.map((v) => ({ ...v, is_default: false }));
}
- break;
- case SELECTION_PLAN_EXTRA_QUESTION_VALUE_UPDATED:
- {
- let entity = { ...payload.response };
- let values_tmp = state.entity.values.filter((v) => v.id !== entity.id);
- if (entity.is_default) {
- // reset all other values
- values_tmp = values_tmp.map((v) => ({ ...v, is_default: false }));
- }
- let values = [...values_tmp, entity];
+ const values = [...values_tmp, entity];
- values.sort((a, b) =>
- a.order > b.order ? 1 : a.order < b.order ? -1 : 0
- );
+ values.sort((a, b) =>
+ a.order > b.order ? 1 : a.order < b.order ? -1 : 0
+ );
- return { ...state, entity: { ...state.entity, values: values } };
- }
- break;
- case SELECTION_PLAN_EXTRA_QUESTION_VALUE_DELETED:
- {
- let { valueId } = payload;
- return {
- ...state,
- entity: {
- ...state.entity,
- values: state.entity.values.filter((v) => v.id !== valueId)
- }
- };
- }
- break;
+ return { ...state, entity: { ...state.entity, values } };
+ }
+ case SELECTION_PLAN_EXTRA_QUESTION_VALUE_DELETED: {
+ const { valueId } = payload;
+ return {
+ ...state,
+ entity: {
+ ...state.entity,
+ values: state.entity.values.filter((v) => v.id !== valueId)
+ }
+ };
+ }
case VALIDATE:
- {
- return { ...state, errors: payload.errors };
- }
- break;
+ return { ...state, errors: payload.errors };
default:
return state;
}