Skip to content

Commit 12bbe65

Browse files
committed
fix: ci
1 parent 6f44597 commit 12bbe65

7 files changed

Lines changed: 1851 additions & 1625 deletions

File tree

package-lock.json

Lines changed: 1834 additions & 1614 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/diracx-web-components/src/components/shared/DataTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ export function DataTable<T extends Record<string, unknown>>({
354354
},
355355
),
356356
}),
357-
[handleContextMenu],
357+
[handleContextMenu, disableCheckbox],
358358
);
359359

360360
function getLeftOffsetForColumn(column: Column<T, unknown>): number {

packages/diracx-web-components/src/components/shared/SearchBar/DatePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface CustomDateTimePickerProps
1515
onDateAccepted: (value: string | null) => void;
1616
handleArrowKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
1717
handleBackspaceKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
18-
inputRef?: React.Ref<HTMLInputElement | null>;
18+
inputRef?: React.Ref<HTMLInputElement>;
1919
}
2020

2121
/**

packages/diracx-web-components/src/components/shared/SearchBar/SearchBar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,15 @@ export function SearchBar<T extends string>({
206206
return () => {
207207
cancelled = true;
208208
};
209+
// eslint-disable-next-line react-hooks/exhaustive-deps
209210
}, [
210211
previousEquation,
211212
previousToken,
212213
createSuggestions,
213214
focusedTokenIndex,
214215
tokenEquations.length,
215216
// If the current input is not used, we don't want to trigger the suggestions for each letter typed
217+
// eslint-disable-next-line react-hooks/exhaustive-deps
216218
...(usesCurrentInput ? [inputValue] : []),
217219
]);
218220

packages/diracx-web-components/src/components/shared/SearchBar/SearchField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface SearchFieldProps {
3030
setInputValue: React.Dispatch<React.SetStateAction<string>>;
3131

3232
/** Reference to the input element */
33-
inputRef: React.RefObject<HTMLInputElement | null>;
33+
inputRef: React.RefObject<HTMLInputElement>;
3434

3535
/** The current token equations */
3636
tokenEquations: SearchBarTokenEquation[];

packages/diracx-web-components/src/components/shared/SearchBar/Utils.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ function handleEquationVerification(
9292

9393
case CategoryType.NUMBER:
9494
if (
95-
freeTextOperators.includes(tokenEquation.items[1].label as string) ||
96-
(tokenEquation.items[1].type === CategoryType.NUMBER &&
97-
tokenEquation.items[2].type === CategoryType.NUMBER &&
98-
!isNaN(Number(tokenEquation.items[2].label)))
95+
tokenEquation.items[1].type === CategoryType.NUMBER &&
96+
tokenEquation.items[2].type === CategoryType.NUMBER &&
97+
!isNaN(Number(tokenEquation.items[2].label))
9998
)
10099
tokenEquation.status = EquationStatus.VALID;
101100
else tokenEquation.status = EquationStatus.INVALID;
@@ -227,8 +226,13 @@ export function getTokenMetadata(
227226

228227
// If the value is in the suggestions list, return its metadata
229228
// If there is no suggestions for this category, then we allow every input
229+
// If the last token is an free text operator
230+
230231
const index = suggestions.items.indexOf(value);
231-
if (index >= 0 || suggestions.items.length === 0) {
232+
const isFreeTextOperator = Operators.getFreeTextOperators()
233+
.map((op) => op.getDisplay())
234+
.includes(String(lastToken?.label));
235+
if (index >= 0 || suggestions.items.length === 0 || isFreeTextOperator) {
232236
return {
233237
nature: suggestions.nature[index] ?? SearchBarTokenNature.VALUE,
234238
type: suggestions.type[index] ?? lastToken?.type ?? CategoryType.CUSTOM,

packages/diracx-web/test/e2e/jobMonitor.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,16 @@ describe("Job Monitor", () => {
441441
it("should handle filter editing", () => {
442442
cy.get("table").should("be.visible");
443443

444-
cy.get("[data-testid=search-field]").type("Name{enter}={enter}test{enter}");
444+
cy.get("[data-testid=search-field]").type("ID{enter}={enter}1{enter}");
445445

446446
cy.get("[data-testid=search-field]").type("{leftArrow}2{enter}");
447-
cy.get('[role="group"]').find("button").contains("test2").should("exist");
447+
cy.get('[role="group"]').find("button").contains("12").should("exist");
448448
});
449449

450450
it("should handle filter clear", () => {
451451
cy.get("table").should("be.visible");
452452

453-
cy.get("[data-testid=search-field]").type("Name{enter}={enter}test{enter}");
453+
cy.get("[data-testid=search-field]").type("ID{enter}={enter}1{enter}");
454454

455455
cy.get('[role="group"]').find("button").should("have.length", 5);
456456

0 commit comments

Comments
 (0)