mirror of https://github.com/apache/superset.git
fix: encode rison characters when searching (#16768)
This commit is contained in:
parent
5cb49d2de0
commit
4af5ae08f9
|
@ -77,7 +77,7 @@ flask==1.1.4
|
|||
# flask-openid
|
||||
# flask-sqlalchemy
|
||||
# flask-wtf
|
||||
flask-appbuilder==3.3.2
|
||||
flask-appbuilder==3.3.3
|
||||
# via apache-superset
|
||||
flask-babel==1.0.0
|
||||
# via flask-appbuilder
|
||||
|
@ -176,7 +176,7 @@ pgsanity==0.2.9
|
|||
# via apache-superset
|
||||
polyline==1.4.0
|
||||
# via apache-superset
|
||||
prison==0.1.3
|
||||
prison==0.2.1
|
||||
# via flask-appbuilder
|
||||
pyarrow==4.0.1
|
||||
# via apache-superset
|
||||
|
|
2
setup.py
2
setup.py
|
@ -75,7 +75,7 @@ setup(
|
|||
"cryptography>=3.3.2",
|
||||
"deprecation>=2.1.0, <2.2.0",
|
||||
"flask>=1.1.0, <2.0.0",
|
||||
"flask-appbuilder>=3.3.2, <4.0.0",
|
||||
"flask-appbuilder>=3.3.3, <4.0.0",
|
||||
"flask-caching>=1.10.0",
|
||||
"flask-compress",
|
||||
"flask-talisman",
|
||||
|
|
|
@ -51,7 +51,8 @@ export default function SearchFilter({
|
|||
const [value, setValue] = useState(initialValue || '');
|
||||
const handleSubmit = () => {
|
||||
if (value) {
|
||||
onSubmit(value.trim());
|
||||
// encode plus signs to prevent them from being converted into a space
|
||||
onSubmit(value.trim().replace(/\+/g, '%2B'));
|
||||
}
|
||||
};
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
|
|
|
@ -45,10 +45,11 @@ import {
|
|||
ViewModeType,
|
||||
} from './types';
|
||||
|
||||
// Define custom RisonParam for proper encoding/decoding
|
||||
// Define custom RisonParam for proper encoding/decoding; note that
|
||||
// plus symbols should be encoded to avoid being converted into a space
|
||||
const RisonParam: QueryParamConfig<string, any> = {
|
||||
encode: (data?: any | null) =>
|
||||
data === undefined ? undefined : rison.encode(data),
|
||||
data === undefined ? undefined : rison.encode(data).replace(/\+/g, '%2B'),
|
||||
decode: (dataStr?: string | string[]) =>
|
||||
dataStr === undefined || Array.isArray(dataStr)
|
||||
? undefined
|
||||
|
|
Loading…
Reference in New Issue