Commit f71ed512 authored by Mike Kozono's avatar Mike Kozono

Show secondary-only setting on only on secondaries

Also on the new feature-flagged Vue form.
parent 6ed40ca0
---
title: 'Geo: Show secondary-only setting on only on secondaries'
merge_request: 26029
author:
type: fixed
...@@ -35,14 +35,6 @@ export default { ...@@ -35,14 +35,6 @@ export default {
key: 'filesMaxCapacity', key: 'filesMaxCapacity',
conditional: 'secondary', conditional: 'secondary',
}, },
{
id: 'node-verification-capacity-field',
label: __('Verification capacity'),
description: __(
'Control the maximum concurrency of verification operations for this Geo node',
),
key: 'verificationMaxCapacity',
},
{ {
id: 'node-container-repository-capacity-field', id: 'node-container-repository-capacity-field',
label: __('Container repositories sync capacity'), label: __('Container repositories sync capacity'),
...@@ -50,6 +42,15 @@ export default { ...@@ -50,6 +42,15 @@ export default {
'Control the maximum concurrency of container repository operations for this Geo node', 'Control the maximum concurrency of container repository operations for this Geo node',
), ),
key: 'containerRepositoriesMaxCapacity', key: 'containerRepositoriesMaxCapacity',
conditional: 'secondary',
},
{
id: 'node-verification-capacity-field',
label: __('Verification capacity'),
description: __(
'Control the maximum concurrency of verification operations for this Geo node',
),
key: 'verificationMaxCapacity',
}, },
{ {
id: 'node-reverification-interval-field', id: 'node-reverification-interval-field',
......
...@@ -52,18 +52,18 @@ ...@@ -52,18 +52,18 @@
= form.number_field :files_max_capacity, class: 'form-control col-sm-2', min: 0 = form.number_field :files_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of LFS/attachment backfill for this secondary node') .form-text.text-muted= s_('Geo|Control the maximum concurrency of LFS/attachment backfill for this secondary node')
.form-row.form-group.js-hide-if-geo-primary{ class: ('hidden' unless geo_node.secondary?) }
.col-sm-8
= form.label :container_repositories_max_capacity, s_('Geo|Container repositories sync capacity'), class: 'font-weight-bold'
= form.number_field :container_repositories_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of container repository operations for this Geo node')
.form-row.form-group .form-row.form-group
.col-sm-8 .col-sm-8
= form.label :verification_max_capacity, s_('Geo|Verification capacity'), class: 'font-weight-bold' = form.label :verification_max_capacity, s_('Geo|Verification capacity'), class: 'font-weight-bold'
= form.number_field :verification_max_capacity, class: 'form-control col-sm-2', min: 0 = form.number_field :verification_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of verification operations for this Geo node') .form-text.text-muted= s_('Geo|Control the maximum concurrency of verification operations for this Geo node')
.form-row.form-group
.col-sm-8
= form.label :container_repositories_max_capacity, s_('Geo|Container repositories sync capacity'), class: 'font-weight-bold'
= form.number_field :container_repositories_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of container repository operations for this Geo node')
.form-row.form-group.js-hide-if-geo-secondary{ class: ('hidden' unless geo_node.primary?) } .form-row.form-group.js-hide-if-geo-secondary{ class: ('hidden' unless geo_node.primary?) }
.col-sm-8 .col-sm-8
= form.label :minimum_reverification_interval, s_('Geo|Re-verification interval'), class: 'font-weight-bold' = form.label :minimum_reverification_interval, s_('Geo|Re-verification interval'), class: 'font-weight-bold'
......
...@@ -22,17 +22,17 @@ describe('GeoNodeFormCapacities', () => { ...@@ -22,17 +22,17 @@ describe('GeoNodeFormCapacities', () => {
const findGeoNodeFormRepositoryCapacityField = () => const findGeoNodeFormRepositoryCapacityField = () =>
wrapper.find('#node-repository-capacity-field'); wrapper.find('#node-repository-capacity-field');
const findGeoNodeFormFileCapacityField = () => wrapper.find('#node-file-capacity-field'); const findGeoNodeFormFileCapacityField = () => wrapper.find('#node-file-capacity-field');
const findGeoNodeFormVerificationCapacityField = () =>
wrapper.find('#node-verification-capacity-field');
const findGeoNodeFormContainerRepositoryCapacityField = () => const findGeoNodeFormContainerRepositoryCapacityField = () =>
wrapper.find('#node-container-repository-capacity-field'); wrapper.find('#node-container-repository-capacity-field');
const findGeoNodeFormVerificationCapacityField = () =>
wrapper.find('#node-verification-capacity-field');
const findGeoNodeFormReverificationIntervalField = () => const findGeoNodeFormReverificationIntervalField = () =>
wrapper.find('#node-reverification-interval-field'); wrapper.find('#node-reverification-interval-field');
describe('template', () => { describe('template', () => {
describe.each` describe.each`
primaryNode | showRepoCapacity | showFileCapacity | showVerificationCapacity | showContainerCapacity | showReverificationInterval primaryNode | showRepoCapacity | showFileCapacity | showVerificationCapacity | showContainerCapacity | showReverificationInterval
${true} | ${false} | ${false} | ${true} | ${true} | ${true} ${true} | ${false} | ${false} | ${true} | ${false} | ${true}
${false} | ${true} | ${true} | ${true} | ${true} | ${false} ${false} | ${true} | ${true} | ${true} | ${true} | ${false}
`( `(
`conditional fields`, `conditional fields`,
...@@ -40,8 +40,8 @@ describe('GeoNodeFormCapacities', () => { ...@@ -40,8 +40,8 @@ describe('GeoNodeFormCapacities', () => {
primaryNode, primaryNode,
showRepoCapacity, showRepoCapacity,
showFileCapacity, showFileCapacity,
showVerificationCapacity,
showContainerCapacity, showContainerCapacity,
showVerificationCapacity,
showReverificationInterval, showReverificationInterval,
}) => { }) => {
beforeEach(() => { beforeEach(() => {
...@@ -57,14 +57,6 @@ describe('GeoNodeFormCapacities', () => { ...@@ -57,14 +57,6 @@ describe('GeoNodeFormCapacities', () => {
expect(findGeoNodeFormFileCapacityField().exists()).toBe(showFileCapacity); expect(findGeoNodeFormFileCapacityField().exists()).toBe(showFileCapacity);
}); });
it(`it ${
showVerificationCapacity ? 'shows' : 'hides'
} the Verification Capacity Field`, () => {
expect(findGeoNodeFormVerificationCapacityField().exists()).toBe(
showVerificationCapacity,
);
});
it(`it ${ it(`it ${
showContainerCapacity ? 'shows' : 'hides' showContainerCapacity ? 'shows' : 'hides'
} the Container Repository Capacity Field`, () => { } the Container Repository Capacity Field`, () => {
...@@ -73,6 +65,14 @@ describe('GeoNodeFormCapacities', () => { ...@@ -73,6 +65,14 @@ describe('GeoNodeFormCapacities', () => {
); );
}); });
it(`it ${
showVerificationCapacity ? 'shows' : 'hides'
} the Verification Capacity Field`, () => {
expect(findGeoNodeFormVerificationCapacityField().exists()).toBe(
showVerificationCapacity,
);
});
it(`it ${ it(`it ${
showReverificationInterval ? 'shows' : 'hides' showReverificationInterval ? 'shows' : 'hides'
} the Reverification Interval Field`, () => { } the Reverification Interval Field`, () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment