[CORL-1156] Q&A Feature Flag Fix (#3000)

* fix: fixed bug with feature flag handling

* chore: version bump
This commit is contained in:
Wyatt Johnson
2020-06-25 18:59:03 +00:00
committed by GitHub
parent 9022532525
commit bf04b4c2a6
9 changed files with 719 additions and 709 deletions
@@ -1,11 +1,6 @@
import * as story from "coral-server/models/story";
import { hasFeatureFlag } from "coral-server/models/tenant";
import {
GQLFEATURE_FLAG,
GQLSTORY_MODE,
GQLStorySettingsTypeResolver,
} from "../schema/__generated__/types";
import { GQLStorySettingsTypeResolver } from "../schema/__generated__/types";
import { LiveConfigurationInput } from "./LiveConfiguration";
@@ -35,18 +30,7 @@ export const StorySettings: GQLStorySettingsTypeResolver<StorySettingsInput> = {
};
},
// FEATURE_FLAG:ENABLE_QA
mode: (s, input, ctx) => {
if (s.mode) {
return s.mode;
}
// FEATURE_FLAG:DEFAULT_QA_STORY_MODE
if (hasFeatureFlag(ctx.tenant, GQLFEATURE_FLAG.DEFAULT_QA_STORY_MODE)) {
return GQLSTORY_MODE.QA;
}
return GQLSTORY_MODE.COMMENTS;
},
mode: (s, input, ctx) => story.resolveStoryMode(s, ctx.tenant),
experts: (s, input, ctx) => {
if (s.expertIDs) {
return ctx.loaders.Users.user.loadMany(s.expertIDs);