Skip to content

Commit d7d94fb

Browse files
fix: Autocomplete for bool values (#1072)
Fix workflows query autocomplete to suggest the correct tokens for boolean values Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
1 parent 4c6b6a1 commit d7d94fb

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-autocomplete-suggestions.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ describe('getAutocompleteSuggestions', () => {
3232
});
3333

3434
it('suggests logical operators after a complete boolean value', () => {
35-
const suggestionsAfterBoolean = getAutocompleteSuggestions('IsCron = TRUE');
35+
const suggestionsAfterBoolean =
36+
getAutocompleteSuggestions('IsCron = "true"');
3637
expect(suggestionsAfterBoolean).toEqual(LOGICAL_OPERATORS);
3738
});
3839

src/views/shared/workflows-header/workflows-query-input/helpers/__tests__/get-updated-query-text-with-suggestions.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ describe('getUpdatedQueryTextWithSuggestion', () => {
2525
expect(result).toBe('WorkflowID = "foo" AND ');
2626
});
2727

28-
it('appends suggestion after boolean value TRUE', () => {
29-
const result = getUpdatedQueryTextWithSuggestion('IsCron = TRUE', 'AND');
30-
expect(result).toBe('IsCron = TRUE AND ');
28+
it('appends suggestion after boolean value "true"', () => {
29+
const result = getUpdatedQueryTextWithSuggestion('IsCron = "true" ', 'AND');
30+
expect(result).toBe('IsCron = "true" AND ');
3131
});
3232

33-
it('appends suggestion after boolean value FALSE', () => {
34-
const result = getUpdatedQueryTextWithSuggestion('IsCron = FALSE', 'AND');
35-
expect(result).toBe('IsCron = FALSE AND ');
33+
it('appends suggestion after boolean value "false"', () => {
34+
const result = getUpdatedQueryTextWithSuggestion('IsCron = "false"', 'AND');
35+
expect(result).toBe('IsCron = "false" AND ');
3636
});
3737

3838
it('appends suggestion after BETWEEN operator', () => {

src/views/shared/workflows-header/workflows-query-input/workflows-query-input.constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const STATUSES = [
4747
'"timed_out"',
4848
];
4949

50-
export const BOOLEAN_VALUES = ['TRUE', 'FALSE'];
50+
export const BOOLEAN_VALUES = ['"true"', '"false"'];
5151

5252
export const TIME_FORMAT = '"YYYY-MM-DDTHH:MM:SS±HH:MM"';
5353

0 commit comments

Comments
 (0)