Skip to content

Commit

Permalink
Merge branch 'develop' into feature/MAT-7723/remove-extra-whitespace-…
Browse files Browse the repository at this point in the history
…beneath-measure-cql-editor
  • Loading branch information
etan-sb authored Nov 5, 2024
2 parents 5ed074a + c0b617f commit 930020f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
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 @@ export default function CqlBuilderPanel({
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 @@ -145,9 +135,7 @@ export default function CqlBuilderPanel({
<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

0 comments on commit 930020f

Please sign in to comment.