1414 * limitations under the License.
1515 */
1616import { List } from 'immutable' ;
17- import { Filter } from '@labkey/api' ;
17+ import { Filter , QueryKey } from '@labkey/api' ;
1818
1919import { JsonType } from '../components/domainproperties/PropDescType' ;
2020import {
@@ -24,10 +24,6 @@ import {
2424 isRelativeDateFilterValue ,
2525} from '../util/Date' ;
2626
27- // N.B. the dollar sign should always be last here to avoid double-decoding (see getLegalIdentifier)
28- const QUERY_KEY_CHAR_DECODED = [ '/' , '&' , '}' , '~' , ',' , '.' , '$' ] ;
29- const QUERY_KEY_CHAR_ENCODED = [ '$S' , '$A' , '$B' , '$T' , '$C' , '$P' , '$D' ] ;
30-
3127export const CONCEPT_COLUMN_FILTER_TYPES = [
3228 Filter . Types . HAS_ANY_VALUE ,
3329 Filter . Types . EQUAL ,
@@ -78,10 +74,7 @@ export function getLegalIdentifier(columnName: string, tableAlias?: string): str
7874 columnNameParts . forEach ( part => {
7975 if ( part ) {
8076 let decodedPart = part . replace ( / " / g, '""' ) ;
81- QUERY_KEY_CHAR_ENCODED . forEach ( ( encoded , ind ) => {
82- const reg = new RegExp ( '\\' + encoded , 'g' ) ;
83- decodedPart = decodedPart . replace ( reg , QUERY_KEY_CHAR_DECODED [ ind ] ) ;
84- } ) ;
77+ decodedPart = QueryKey . decodePart ( decodedPart ) ;
8578 formattedParts . push ( '"' + decodedPart + '"' ) ;
8679 }
8780 } ) ;
0 commit comments