Skip to content

Commit

Permalink
use faeture flags when hide form control
Browse files Browse the repository at this point in the history
  • Loading branch information
znamenskii-ilia committed Oct 30, 2024
1 parent 5458e89 commit 7f833e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/client/src/pages/Editor/FormControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import TemplateMenu from "PluginActionEditor/components/PluginActionForm/compone
import { SQL_DATASOURCES } from "constants/QueryEditorConstants";
import type { Datasource, DatasourceStructure } from "entities/Datasource";
import { getCurrentEditingEnvironmentId } from "ee/selectors/environmentSelectors";
import { selectFeatureFlags } from "ee/selectors/featureFlagsSelectors";

export interface FormControlProps {
config: ControlProps;
Expand All @@ -48,6 +49,7 @@ function FormControl(props: FormControlProps) {

const dispatch = useDispatch();
const currentEditingEnvId = useSelector(getCurrentEditingEnvironmentId);
const featureFlags = useSelector(selectFeatureFlags);

// adding this to prevent excessive rerendering
const [convertFormToRaw, setConvertFormToRaw] = useState(false);
Expand All @@ -60,7 +62,11 @@ function FormControl(props: FormControlProps) {
.datasourceStorages[currentEditingEnvId];
}

const hidden = isHidden(formValueForEvaluatingHiddenObj, props.config.hidden);
const hidden = isHidden(
formValueForEvaluatingHiddenObj,
props.config.hidden,
featureFlags,
);
const configErrors: EvaluationError[] = useSelector(
(state: AppState) =>
getConfigErrors(state, {
Expand Down

0 comments on commit 7f833e9

Please sign in to comment.