Commit efe4875e authored by Zack Cuddy's avatar Zack Cuddy

Geo Form - Internal URL More Info

Adds a more information link
for the Internal URL field.

Renames the Performance section
to Tuning section.
parent 80d7ef87
......@@ -91,7 +91,7 @@ export default {
<template>
<div>
<h2 class="gl-font-size-h2 gl-my-5">{{ __('Performance and resource management') }}</h2>
<h2 class="gl-font-size-h2 gl-my-5">{{ __('Tuning settings') }}</h2>
<p class="gl-mb-5">
{{ sectionDescription }}
<gl-link :href="sectionLink" target="_blank">{{ __('More information') }}</gl-link>
......
......@@ -2,7 +2,11 @@
import { GlFormGroup, GlFormInput, GlSprintf, GlLink } from '@gitlab/ui';
import { mapActions, mapState } from 'vuex';
import { validateName, validateUrl } from '../validations';
import { VALIDATION_FIELD_KEYS, NODE_NAME_MORE_INFO } from '../constants';
import {
VALIDATION_FIELD_KEYS,
NODE_NAME_MORE_INFO,
NODE_INTERNAL_URL_MORE_INFO,
} from '../constants';
export default {
name: 'GeoNodeFormCore',
......@@ -31,6 +35,7 @@ export default {
},
},
NODE_NAME_MORE_INFO,
NODE_INTERNAL_URL_MORE_INFO,
};
</script>
......@@ -54,7 +59,12 @@ export default {
<code>{{ content }}</code>
</template>
<template #link="{ content }">
<gl-link :href="$options.NODE_NAME_MORE_INFO" target="_blank">{{ content }}</gl-link>
<gl-link
:href="$options.NODE_NAME_MORE_INFO"
target="_blank"
data-testid="nodeNameMoreInfo"
>{{ content }}</gl-link
>
</template>
</gl-sprintf>
</template>
......@@ -120,6 +130,24 @@ export default {
__('The URL defined on the primary node that secondary nodes should use to contact it.')
"
>
<template #description>
<gl-sprintf
:message="
__(
'The URL defined on the primary node that secondary nodes should use to contact it. %{linkStart}More information%{linkEnd}',
)
"
>
<template #link="{ content }">
<gl-link
:href="$options.NODE_INTERNAL_URL_MORE_INFO"
target="_blank"
data-testid="nodeInternalUrlMoreInfo"
>{{ content }}</gl-link
>
</template>
</gl-sprintf>
</template>
<div class="gl-display-flex gl-align-items-center">
<gl-form-input
id="node-internal-url-field"
......
......@@ -13,6 +13,9 @@ export const VALIDATION_FIELD_KEYS = {
export const NODE_NAME_MORE_INFO =
'https://docs.gitlab.com/ee/administration/geo/replication/configuration.html#step-3-add-the-secondary-node';
export const NODE_INTERNAL_URL_MORE_INFO =
'https://docs.gitlab.com/ee/user/admin_area/geo_nodes.html#using-a-different-url-for-synchronization';
export const SELECTIVE_SYNC_MORE_INFO =
'https://docs.gitlab.com/ee/administration/geo/replication/configuration.html#selective-synchronization';
......
---
title: Geo Form - Internal URL More Info Link
merge_request: 43876
author:
type: changed
import Vuex from 'vuex';
import { createLocalVue, mount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import GeoNodeFormCore from 'ee/geo_node_form/components/geo_node_form_core.vue';
import { VALIDATION_FIELD_KEYS, NODE_NAME_MORE_INFO } from 'ee/geo_node_form/constants';
import {
VALIDATION_FIELD_KEYS,
NODE_NAME_MORE_INFO,
NODE_INTERNAL_URL_MORE_INFO,
} from 'ee/geo_node_form/constants';
import { MOCK_NODE, STRING_OVER_255 } from '../mock_data';
const localVue = createLocalVue();
......@@ -46,9 +49,11 @@ describe('GeoNodeFormCore', () => {
});
const findGeoNodeFormNameField = () => wrapper.find('#node-name-field');
const findGeoNodeFormNameMoreInformation = () => wrapper.find(GlLink);
const findGeoNodeFormNameMoreInformation = () => wrapper.find('[data-testid="nodeNameMoreInfo"');
const findGeoNodeFormUrlField = () => wrapper.find('#node-url-field');
const findGeoNodeInternalUrlField = () => wrapper.find('#node-internal-url-field');
const findGeoNodeFormInternalUrlMoreInformation = () =>
wrapper.find('[data-testid="nodeInternalUrlMoreInfo"');
const findErrorMessage = () => wrapper.find('.invalid-feedback');
describe('template', () => {
......@@ -80,9 +85,18 @@ describe('GeoNodeFormCore', () => {
});
});
it(`it ${showInternalUrl ? 'shows' : 'hides'} the Internal URL Field`, () => {
it(`${showInternalUrl ? 'shows' : 'hides'} the Internal URL Field`, () => {
expect(findGeoNodeInternalUrlField().exists()).toBe(showInternalUrl);
});
it(`${showInternalUrl ? 'shows' : 'hides'} the Internal URL More Information Link`, () => {
expect(findGeoNodeFormInternalUrlMoreInformation().exists()).toBe(showInternalUrl);
if (showInternalUrl) {
expect(findGeoNodeFormInternalUrlMoreInformation().attributes('href')).toBe(
NODE_INTERNAL_URL_MORE_INFO,
);
}
});
});
});
......
......@@ -18518,9 +18518,6 @@ msgstr ""
msgid "Perform common operations on GitLab project"
msgstr ""
msgid "Performance and resource management"
msgstr ""
msgid "Performance optimization"
msgstr ""
......@@ -25338,6 +25335,9 @@ msgstr ""
msgid "The URL defined on the primary node that secondary nodes should use to contact it."
msgstr ""
msgid "The URL defined on the primary node that secondary nodes should use to contact it. %{linkStart}More information%{linkEnd}"
msgstr ""
msgid "The URL to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., \"http://localhost:9200, http://localhost:9201\")."
msgstr ""
......@@ -27222,6 +27222,9 @@ msgstr ""
msgid "Tuesday"
msgstr ""
msgid "Tuning settings"
msgstr ""
msgid "Turn Off"
msgstr ""
......
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