Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS-319: add downsampling options to Create/Update Replication form #69

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed:a
### Added:

- RS-319: add downsampling options to Create/Update Replication form, [PR-69](https://github.com/reductstore/web-console/pull/69)

### Changed:

- Update `antd` up to 5.18.3, [PR-68](https://github.com/reductstore/web-console/pull/68)

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.4",
"react-scripts": "5.0.1",
"reduct-js": "^1.9.2",
"reduct-js": "^1.10.1",
"stream-browserify": "^3.0.0",
"ts-jest": "^27.1.5",
"typescript": "^4.9.5",
Expand Down
18 changes: 18 additions & 0 deletions src/Components/Replication/CreatOrUpdate.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ describe("Replication::CreateOrUpdate", () => {
entries: ["entry1", "entry2"],
include: { label1: "value1" },
exclude: { label2: "value2" },
each_n: 10n,
each_s: 0.5,
});

const mockDiagnostics = Diagnostics.parse({
Expand Down Expand Up @@ -92,6 +94,8 @@ describe("Replication::CreateOrUpdate", () => {
expect(wrapper.find({ name: "dstToken" }).exists()).toBeTruthy();
expect(wrapper.find({ name: "entries" }).exists()).toBeTruthy();
expect(wrapper.find({ name: "recordSettings" }).exists()).toBeTruthy();
expect(wrapper.find({ name: "eachN" }).exists()).toBeTruthy();
expect(wrapper.find({ name: "eachS" }).exists()).toBeTruthy();
});

it("shows the replication name if it is provided", () => {
Expand Down Expand Up @@ -132,6 +136,20 @@ describe("Replication::CreateOrUpdate", () => {
expect(selectedOptionText.at(1).text()).toEqual("entry2");
});

it("shows the number of records to replicate every Nth record if it is provided", async () => {
await waitUntilFind(wrapper, { name: "eachN" });
expect(wrapper.find({ name: "eachN" }).find("input").prop("value")).toEqual(
"10",
);
});

it("shows timeinterval to replicate a record if it is provided", async () => {
await waitUntilFind(wrapper, { name: "eachS" });
expect(wrapper.find({ name: "eachS" }).find("input").prop("value")).toEqual(
"0.5",
);
});

it("disables record settings inputs and radios in read-only mode", () => {
wrapper = mount(
<MemoryRouter>
Expand Down
3 changes: 3 additions & 0 deletions src/Components/Replication/CreateOrUpdate.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ReplicationField {
margin-bottom: 5px;
}
Loading
Loading