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 {
key: 'filesMaxCapacity',
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',
label: __('Container repositories sync capacity'),
......@@ -50,6 +42,15 @@ export default {
'Control the maximum concurrency of container repository operations for this Geo node',
),
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',
......
......@@ -52,18 +52,18 @@
= 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-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
.col-sm-8
= 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-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?) }
.col-sm-8
= form.label :minimum_reverification_interval, s_('Geo|Re-verification interval'), class: 'font-weight-bold'
......
......@@ -22,17 +22,17 @@ describe('GeoNodeFormCapacities', () => {
const findGeoNodeFormRepositoryCapacityField = () =>
wrapper.find('#node-repository-capacity-field');
const findGeoNodeFormFileCapacityField = () => wrapper.find('#node-file-capacity-field');
const findGeoNodeFormVerificationCapacityField = () =>
wrapper.find('#node-verification-capacity-field');
const findGeoNodeFormContainerRepositoryCapacityField = () =>
wrapper.find('#node-container-repository-capacity-field');
const findGeoNodeFormVerificationCapacityField = () =>
wrapper.find('#node-verification-capacity-field');
const findGeoNodeFormReverificationIntervalField = () =>
wrapper.find('#node-reverification-interval-field');
describe('template', () => {
describe.each`
primaryNode | showRepoCapacity | showFileCapacity | showVerificationCapacity | showContainerCapacity | showReverificationInterval
${true} | ${false} | ${false} | ${true} | ${true} | ${true}
${true} | ${false} | ${false} | ${true} | ${false} | ${true}
${false} | ${true} | ${true} | ${true} | ${true} | ${false}
`(
`conditional fields`,
......@@ -40,8 +40,8 @@ describe('GeoNodeFormCapacities', () => {
primaryNode,
showRepoCapacity,
showFileCapacity,
showVerificationCapacity,
showContainerCapacity,
showVerificationCapacity,
showReverificationInterval,
}) => {
beforeEach(() => {
......@@ -57,14 +57,6 @@ describe('GeoNodeFormCapacities', () => {
expect(findGeoNodeFormFileCapacityField().exists()).toBe(showFileCapacity);
});
it(`it ${
showVerificationCapacity ? 'shows' : 'hides'
} the Verification Capacity Field`, () => {
expect(findGeoNodeFormVerificationCapacityField().exists()).toBe(
showVerificationCapacity,
);
});
it(`it ${
showContainerCapacity ? 'shows' : 'hides'
} the Container Repository Capacity Field`, () => {
......@@ -73,6 +65,14 @@ describe('GeoNodeFormCapacities', () => {
);
});
it(`it ${
showVerificationCapacity ? 'shows' : 'hides'
} the Verification Capacity Field`, () => {
expect(findGeoNodeFormVerificationCapacityField().exists()).toBe(
showVerificationCapacity,
);
});
it(`it ${
showReverificationInterval ? 'shows' : 'hides'
} 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