Made Fields immutable for Applications (#20799)

* Made dropdown immutable for input field

* added tests

* removed test
This commit is contained in:
Dhruv Parmar 2025-04-15 14:32:15 +05:30 committed by GitHub
parent 9bd67915b4
commit 72b4ac486d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 1 deletions

View File

@ -50,6 +50,7 @@ import {
elasticsearchToJsonLogic,
getJsonTreeFromQueryFilter,
jsonLogicToElasticsearch,
READONLY_SETTINGS,
} from '../../../../../../utils/QueryBuilderUtils';
import { getExplorePath } from '../../../../../../utils/RouterUtils';
import searchClassBase from '../../../../../../utils/SearchClassBase';
@ -268,6 +269,10 @@ const QueryBuilderWidget: FC<WidgetProps> = ({
<Builder {...props} />
</div>
)}
settings={{
...config.settings,
...(props.readonly ? READONLY_SETTINGS : {}),
}}
value={treeInternal}
onChange={handleChange}
/>

View File

@ -50,6 +50,11 @@
}
.query-builder-form-field {
.ant-select-disabled.ant-select:not(.ant-select-customize-input)
.ant-select-selector {
color: @black;
background-color: @background-color;
}
.hide--line.one--child {
margin-top: 0;
padding-top: 16px;

View File

@ -114,7 +114,14 @@ export const getSelectEqualsNotEqualsProperties = (
},
};
};
export const READONLY_SETTINGS = {
immutableGroupsMode: true,
immutableFieldsMode: true,
immutableOpsMode: true,
immutableValuesMode: true,
canRegroup: false,
canRemove: false,
};
export const getSelectAnyInProperties = (
parentPath: Array<string>,
termObjects: Array<EsTerm>