Commit 578cdcfe authored by Zack Cuddy's avatar Zack Cuddy

Geo Nodes Form - Object Storage Beta Badge

This change adds a beta badge
to the Object Storage field
on the Geo Nodes Form.

This badge also links to
the documentation.

Changelog: changed
EE: true
parent fae78a06
<script> <script>
import { GlFormGroup, GlFormSelect, GlFormCheckbox, GlSprintf, GlLink } from '@gitlab/ui'; import { GlFormGroup, GlFormSelect, GlFormCheckbox, GlSprintf, GlLink, GlBadge } from '@gitlab/ui';
import { SELECTIVE_SYNC_MORE_INFO, OBJECT_STORAGE_MORE_INFO } from '../constants'; import {
SELECTIVE_SYNC_MORE_INFO,
OBJECT_STORAGE_MORE_INFO,
OBJECT_STORAGE_BETA,
} from '../constants';
import GeoNodeFormNamespaces from './geo_node_form_namespaces.vue'; import GeoNodeFormNamespaces from './geo_node_form_namespaces.vue';
import GeoNodeFormShards from './geo_node_form_shards.vue'; import GeoNodeFormShards from './geo_node_form_shards.vue';
...@@ -14,6 +18,7 @@ export default { ...@@ -14,6 +18,7 @@ export default {
GlFormCheckbox, GlFormCheckbox,
GlSprintf, GlSprintf,
GlLink, GlLink,
GlBadge,
}, },
props: { props: {
nodeData: { nodeData: {
...@@ -47,6 +52,7 @@ export default { ...@@ -47,6 +52,7 @@ export default {
}, },
SELECTIVE_SYNC_MORE_INFO, SELECTIVE_SYNC_MORE_INFO,
OBJECT_STORAGE_MORE_INFO, OBJECT_STORAGE_MORE_INFO,
OBJECT_STORAGE_BETA,
}; };
</script> </script>
...@@ -103,7 +109,15 @@ export default { ...@@ -103,7 +109,15 @@ export default {
@removeSyncOption="removeSyncOption" @removeSyncOption="removeSyncOption"
/> />
</gl-form-group> </gl-form-group>
<gl-form-group :label="__('Object Storage replication')" label-for="node-object-storage-field"> <gl-form-group>
<template #label>
<label for="node-object-storage-field" class="gl-mb-0">{{
__('Object Storage replication')
}}</label>
<gl-badge variant="info" size="sm" :href="$options.OBJECT_STORAGE_BETA" target="_blank">{{
__('Beta')
}}</gl-badge>
</template>
<template #description> <template #description>
<gl-sprintf <gl-sprintf
:message=" :message="
......
...@@ -29,6 +29,11 @@ export const OBJECT_STORAGE_MORE_INFO = helpPagePath( ...@@ -29,6 +29,11 @@ export const OBJECT_STORAGE_MORE_INFO = helpPagePath(
'administration/geo/replication/object_storage.html', 'administration/geo/replication/object_storage.html',
); );
export const OBJECT_STORAGE_BETA = helpPagePath(
'administration/geo/replication/object_storage.html',
{ anchor: 'enabling-gitlab-managed-object-storage-replication' },
);
export const REVERIFICATION_MORE_INFO = helpPagePath( export const REVERIFICATION_MORE_INFO = helpPagePath(
'administration/geo/disaster_recovery/background_verification.html', 'administration/geo/disaster_recovery/background_verification.html',
{ anchor: 'repository-re-verification' }, { anchor: 'repository-re-verification' },
......
import { GlFormGroup, GlSprintf } from '@gitlab/ui'; import { GlFormGroup, GlSprintf, GlBadge } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import GeoNodeFormNamespaces from 'ee/geo_node_form/components/geo_node_form_namespaces.vue'; import GeoNodeFormNamespaces from 'ee/geo_node_form/components/geo_node_form_namespaces.vue';
import GeoNodeFormSelectiveSync from 'ee/geo_node_form/components/geo_node_form_selective_sync.vue'; import GeoNodeFormSelectiveSync from 'ee/geo_node_form/components/geo_node_form_selective_sync.vue';
import GeoNodeFormShards from 'ee/geo_node_form/components/geo_node_form_shards.vue'; import GeoNodeFormShards from 'ee/geo_node_form/components/geo_node_form_shards.vue';
import { SELECTIVE_SYNC_MORE_INFO, OBJECT_STORAGE_MORE_INFO } from 'ee/geo_node_form/constants'; import {
SELECTIVE_SYNC_MORE_INFO,
OBJECT_STORAGE_MORE_INFO,
OBJECT_STORAGE_BETA,
} from 'ee/geo_node_form/constants';
import { MOCK_NODE, MOCK_SELECTIVE_SYNC_TYPES, MOCK_SYNC_SHARDS } from '../mock_data'; import { MOCK_NODE, MOCK_SELECTIVE_SYNC_TYPES, MOCK_SYNC_SHARDS } from '../mock_data';
describe('GeoNodeFormSelectiveSync', () => { describe('GeoNodeFormSelectiveSync', () => {
...@@ -39,6 +43,7 @@ describe('GeoNodeFormSelectiveSync', () => { ...@@ -39,6 +43,7 @@ describe('GeoNodeFormSelectiveSync', () => {
const findGeoNodeObjectStorageField = () => wrapper.find('#node-object-storage-field'); const findGeoNodeObjectStorageField = () => wrapper.find('#node-object-storage-field');
const findGeoNodeFormObjectStorageMoreInformation = () => const findGeoNodeFormObjectStorageMoreInformation = () =>
wrapper.find('[data-testid="objectStorageMoreInfo"]'); wrapper.find('[data-testid="objectStorageMoreInfo"]');
const findGeoNodeObjectStorageBetaBadge = () => wrapper.findComponent(GlBadge);
describe('template', () => { describe('template', () => {
beforeEach(() => { beforeEach(() => {
...@@ -69,6 +74,10 @@ describe('GeoNodeFormSelectiveSync', () => { ...@@ -69,6 +74,10 @@ describe('GeoNodeFormSelectiveSync', () => {
); );
}); });
it('renders Geo Node Form Object Beta Badge link correctly', () => {
expect(findGeoNodeObjectStorageBetaBadge().attributes('href')).toBe(OBJECT_STORAGE_BETA);
});
describe.each` describe.each`
syncType | showNamespaces | showShards syncType | showNamespaces | showShards
${MOCK_SELECTIVE_SYNC_TYPES.ALL} | ${false} | ${false} ${MOCK_SELECTIVE_SYNC_TYPES.ALL} | ${false} | ${false}
......
...@@ -5409,6 +5409,9 @@ msgstr "" ...@@ -5409,6 +5409,9 @@ msgstr ""
msgid "Below you will find all the groups that are public." msgid "Below you will find all the groups that are public."
msgstr "" msgstr ""
msgid "Beta"
msgstr ""
msgid "Bi-weekly code coverage" msgid "Bi-weekly code coverage"
msgstr "" 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