Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mat 7830 remove feature flags #371

Merged
merged 2 commits into from
Nov 5, 2024
Merged
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
20 changes: 4 additions & 16 deletions src/CqlBuilderPanel/CqlBuilderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,21 @@
makeExpanded,
}) {
const featureFlags = useFeatureFlags();
const {
QDMValueSetSearch,
CQLBuilderDefinitions,
CQLBuilderIncludes,
qdmCodeSearch,
CQLBuilderParameters,
} = featureFlags;
const { CQLBuilderDefinitions, CQLBuilderIncludes, CQLBuilderParameters } =
featureFlags;
// we have multiple flags and need to select a starting value based off of what's available and canEdit.
const getStartingPage = (() => {
// if cqlBuilderIncludes -> includes
// if BuilderDefs -> definitions
// if QDM, then
// if qdmValueSetSearch -> valueSets
// else, codes
// if QDM -> valueSets
if (CQLBuilderIncludes) {
return "includes";
}
if (CQLBuilderDefinitions) {
return "definitions";
}
if (measureModel?.includes("QDM")) {
if (QDMValueSetSearch) {
return "valueSets";
}
return "codes";
return "valueSets";
}
})();

Expand Down Expand Up @@ -137,7 +127,7 @@
});
}
}
}, [measureModel, measureStoreCql]);

Check warning on line 130 in src/CqlBuilderPanel/CqlBuilderPanel.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

React Hook useEffect has missing dependencies: 'fhirElmTranslationServiceApi' and 'qdmElmTranslationServiceApi'. Either include them or remove the dependency array

return (
<div className="right-panel">
Expand All @@ -145,9 +135,7 @@
<CqlBuilderSectionPanelNavTabs
activeTab={activeTab}
setActiveTab={setActiveTab}
QDMValueSetSearch={QDMValueSetSearch}
CQLBuilderDefinitions={CQLBuilderDefinitions}
qdmCodeSearch={qdmCodeSearch}
isQDM={measureModel?.includes("QDM")}
CQLBuilderParameters={CQLBuilderParameters}
CQLBuilderIncludes={CQLBuilderIncludes}
Expand Down
8 changes: 2 additions & 6 deletions src/CqlBuilderPanel/CqlBuilderSectionPanelNavTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ export interface NavTabProps {
setActiveTab: (value: string) => void;
CQLBuilderIncludes: boolean;
CQLBuilderParameters: boolean;
QDMValueSetSearch: boolean;
CQLBuilderDefinitions: boolean;
qdmCodeSearch: boolean;
isQDM: boolean;
}

export default function CqlBuilderSectionPanelNavTabs(props: NavTabProps) {
const {
activeTab,
setActiveTab,
QDMValueSetSearch,
CQLBuilderDefinitions,
CQLBuilderIncludes,
CQLBuilderParameters,
qdmCodeSearch,
isQDM,
} = props;

Expand All @@ -42,7 +38,7 @@ export default function CqlBuilderSectionPanelNavTabs(props: NavTabProps) {
value="includes"
/>
)}
{QDMValueSetSearch && isQDM && (
{isQDM && (
<Tab
tabIndex={0}
aria-label="Value Sets"
Expand All @@ -52,7 +48,7 @@ export default function CqlBuilderSectionPanelNavTabs(props: NavTabProps) {
value="valueSets"
/>
)}
{qdmCodeSearch && isQDM && (
{isQDM && (
<Tab
tabIndex={0}
aria-label="Codes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ jest.mock("../api/axios-instance");
jest.mock("@madie/madie-util", () => ({
useFeatureFlags: jest.fn(() => {
return {
QDMValueSetSearch: true,
CQLBuilderDefinitions: true,
CQLBuilderIncludes: true,
qdmCodeSearch: true,
};
}),
useOktaTokens: () => ({
Expand Down
2 changes: 0 additions & 2 deletions src/madie-madie-util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ declare module "@madie/madie-util" {

interface FeatureFlags {
CQLBuilderIncludes: boolean;
QDMValueSetSearch: boolean;
CQLBuilderDefinitions: boolean;
CQLBuilderParameters: boolean;
qdmCodeSearch: boolean;
}

export const useOktaTokens: (storageKey?: string) => {
Expand Down
Loading