Skip to content

Commit

Permalink
Merge branch 'offset-message' of github.com:Aiven-Open/klaw into offs…
Browse files Browse the repository at this point in the history
…et-message
  • Loading branch information
muralibasani committed Nov 23, 2023
2 parents d8d799b + 5d263ec commit 658aa69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ describe("useMessagesFilters.tsx", () => {
expect(isValid).toBe(false);

expect(result.current.filterErrors).toStrictEqual({
customOffsetFilters: "Please enter an offset",
customOffsetFilters:
"Please enter the number of recent offsets you want to view",
partitionIdFilters: null,
});
});
Expand All @@ -269,7 +270,8 @@ describe("useMessagesFilters.tsx", () => {
expect(isValid).toBe(false);

expect(result.current.filterErrors).toStrictEqual({
customOffsetFilters: "Max offset: 100",
customOffsetFilters:
"Entered value exceeds the view limit for offsets: 100",
partitionIdFilters: null,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function useMessagesFilters(): OffsetFilters {
: null;
const customOffsetFiltersError =
getCustomOffset() === "" || getCustomOffset() === null
? "Please enter an offset"
? "Please enter the number of recent offsets you want to view"
: Number(getCustomOffset()) > 100
? "Max offset: 100"
? "Entered value exceeds the view limit for offsets: 100"
: null;

setFilterErrors({
Expand Down Expand Up @@ -117,7 +117,8 @@ function useMessagesFilters(): OffsetFilters {
if (customOffset.length === 0) {
setFilterErrors((prev) => ({
...prev,
customOffsetFilters: "Please enter an offset",
customOffsetFilters:
"Please enter the number of recent offsets you want to view",
}));
deleteCustomOffset();
return;
Expand All @@ -126,9 +127,9 @@ function useMessagesFilters(): OffsetFilters {
...prev,
customOffsetFilters:
customOffset === ""
? "Please enter an offset"
? "Please enter the number of recent offsets you want to view"
: Number(customOffset) > 100
? "Max offset: 100"
? "Entered value exceeds the view limit for offsets: 100"
: null,
}));
searchParams.set(NAMES.customOffset, customOffset);
Expand Down

0 comments on commit 658aa69

Please sign in to comment.