mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Merge pull request #421 from dbeaver/fix/filtered-values-quotes
fix(plugin-data-spreadsheet-new): CB-1018, CB-1019 remove single quot…
This commit is contained in:
+4
-3
@@ -96,13 +96,14 @@ export class DataGridContextMenuFilterService {
|
||||
const val = typeof value === 'function' ? value() : value;
|
||||
const stringifyValue = format.toDisplayString(val);
|
||||
const wrappedValue = wrapOperationArgument(operation.id, stringifyValue);
|
||||
const clippeddValue = replaceMiddle(wrappedValue, ' ... ', 8, 30);
|
||||
return `${columnLabel} ${operation.expression} ${clippeddValue}`;
|
||||
const clippedValue = replaceMiddle(wrappedValue, ' ... ', 8, 30);
|
||||
return `${columnLabel} ${operation.expression} ${clippedValue}`;
|
||||
},
|
||||
icon,
|
||||
onClick: async () => {
|
||||
const val = typeof value === 'function' ? value() : value;
|
||||
await this.applyFilter(model, resultIndex, column, operation.id, val);
|
||||
const wrappedValue = wrapOperationArgument(operation.id, val);
|
||||
await this.applyFilter(model, resultIndex, column, operation.id, wrappedValue);
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
+2
-5
@@ -254,14 +254,11 @@ export function getNextOrder(order: Order): Order {
|
||||
}
|
||||
|
||||
export function wrapOperationArgument(operationId: string, argument: any): string {
|
||||
let result = argument;
|
||||
if (operationId === 'LIKE') {
|
||||
result = `%${result} %`;
|
||||
return `%${argument}%`;
|
||||
}
|
||||
|
||||
result = `'${result}'`;
|
||||
|
||||
return result;
|
||||
return argument;
|
||||
}
|
||||
|
||||
export function isFilterConstraint(constraint: SqlDataFilterConstraint): boolean {
|
||||
|
||||
Reference in New Issue
Block a user