From 66db2d61d3e58514e9d36fb7754abbdd2735b173 Mon Sep 17 00:00:00 2001 From: Alexey Timin Date: Mon, 16 Dec 2024 08:23:52 +0100 Subject: [PATCH] RS-554: Add hard quota to bucket settings (#72) * add hard quota to bucket settings * update CHANGELOG --- CHANGELOG.md | 4 +++ .../Bucket/BucketSettingsForm.test.tsx | 26 +++++++++++++++++++ src/Components/Bucket/BucketSettingsForm.tsx | 1 + 3 files changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e99bf3..69481a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- RS-554: add forgotten HARD quota type to bucket settings, [PR-72](https://github.com/reductstore/web-console/pull/72) + ## [1.8.0] - 2024-11-06 ### Added diff --git a/src/Components/Bucket/BucketSettingsForm.test.tsx b/src/Components/Bucket/BucketSettingsForm.test.tsx index d2bbb2d..6ed0e4a 100644 --- a/src/Components/Bucket/BucketSettingsForm.test.tsx +++ b/src/Components/Bucket/BucketSettingsForm.test.tsx @@ -313,4 +313,30 @@ describe("Bucket::BucketSettingsForm", () => { const inputEditable = wrapperEditable.find("#InputName").at(0); expect(inputEditable.props().disabled).toBeFalsy(); }); + + it.each(["NONE", "FIFO", "HARD"])( + "should show all available quota types", + async (quotaType: string) => { + bucket.getSettings = jest.fn().mockResolvedValue({ + maxBlockSize: 64_000_001n, + maxBlockRecords: 1024, + quotaSize: 1000n, + quotaType: QuotaType[quotaType as keyof typeof QuotaType], + }); + + const wrapper = mount( + console.log("")} + />, + ); + + await waitUntilFind(wrapper, { name: "quotaType" }); + const input = wrapper.find({ name: "quotaType" }).at(0); + console.log(input.debug()); + expect(input.props().initialValue).toEqual(quotaType); + }, + ); }); diff --git a/src/Components/Bucket/BucketSettingsForm.tsx b/src/Components/Bucket/BucketSettingsForm.tsx index 9eb4b6f..619f8d0 100644 --- a/src/Components/Bucket/BucketSettingsForm.tsx +++ b/src/Components/Bucket/BucketSettingsForm.tsx @@ -258,6 +258,7 @@ class BucketSettingsForm extends React.Component<