mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
feat: added new DEFAULT_QA_STORY_MODE feature flag (#2905)
Co-authored-by: Kim Gardner <kgardnr@gmail.com>
This commit is contained in:
co-authored by
Kim Gardner
parent
071666e8b8
commit
0f9b2ba114
@@ -1,6 +1,8 @@
|
||||
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";
|
||||
@@ -21,11 +23,17 @@ export const StorySettings: GQLStorySettingsTypeResolver<
|
||||
enabled: false,
|
||||
};
|
||||
},
|
||||
mode: s => {
|
||||
// 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;
|
||||
},
|
||||
experts: (s, input, ctx) => {
|
||||
|
||||
@@ -353,6 +353,11 @@ enum FEATURE_FLAG {
|
||||
ENABLE_QA when enabled will turn off Q&A features client side.
|
||||
"""
|
||||
ENABLE_QA
|
||||
|
||||
"""
|
||||
DEFAULT_QA_STORY_MODE will set the story mode to QA by default.
|
||||
"""
|
||||
DEFAULT_QA_STORY_MODE
|
||||
}
|
||||
|
||||
# The moderation mode of the site.
|
||||
|
||||
Reference in New Issue
Block a user