Commit 5171469d authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 9f2038c5 6050de19
......@@ -279,14 +279,10 @@ export default class Clusters {
this.store.acknowledgeSuccessfulUpdate(appId);
}
toggleIngressDomainHelpText(ingressPreviousState, ingressNewState) {
const { externalIp, status } = ingressNewState;
const helpTextHidden = status !== APPLICATION_STATUS.INSTALLED || !externalIp;
const domainSnippetText = `${externalIp}${INGRESS_DOMAIN_SUFFIX}`;
if (ingressPreviousState.status !== status) {
this.ingressDomainHelpText.classList.toggle('hide', helpTextHidden);
this.ingressDomainSnippet.textContent = domainSnippetText;
toggleIngressDomainHelpText({ externalIp }, { externalIp: newExternalIp }) {
if (externalIp !== newExternalIp) {
this.ingressDomainHelpText.classList.toggle('hide', !newExternalIp);
this.ingressDomainSnippet.textContent = `${newExternalIp}${INGRESS_DOMAIN_SUFFIX}`;
}
}
......
......@@ -290,7 +290,7 @@ export default class SSHMirror {
this.setSSHPublicKey(data.import_data_attributes.ssh_public_key);
})
.catch(() => {
Flash(_('Unable to regenerate public ssh key.'));
Flash(__('Unable to regenerate public ssh key.'));
});
}
......
import axios from '../../lib/utils/axios_utils';
import statusCodes from '../../lib/utils/http_status';
import { backOff } from '../../lib/utils/common_utils';
import { s__ } from '../../locale';
import { s__, __ } from '../../locale';
const MAX_REQUESTS = 3;
......@@ -15,7 +15,7 @@ function backOffRequest(makeRequestCallback) {
if (requestCounter < MAX_REQUESTS) {
next();
} else {
stop(new Error('Failed to connect to the prometheus server'));
stop(new Error(__('Failed to connect to the prometheus server')));
}
} else {
stop(resp);
......
import { __ } from '~/locale';
export const mrStates = {
merged: 'merged',
closed: 'closed',
};
export const humanMRStates = {
merged: 'Merged',
closed: 'Closed',
open: 'Open',
merged: __('Merged'),
closed: __('Closed'),
open: __('Open'),
};
import { __ } from '~/locale';
const viewers = {
image: {
id: 'image',
},
markdown: {
id: 'markdown',
previewTitle: 'Preview Markdown',
previewTitle: __('Preview Markdown'),
},
};
......
---
title: Fix base domain help text update
merge_request: 27746
author:
type: fixed
......@@ -4804,6 +4804,9 @@ msgstr ""
msgid "Failed to check related branches."
msgstr ""
msgid "Failed to connect to the prometheus server"
msgstr ""
msgid "Failed to create repository via gitlab-shell"
msgstr ""
......
......@@ -6,7 +6,7 @@ import { loadHTMLFixture } from 'helpers/fixtures';
import { setTestTimeout } from 'helpers/timeout';
import $ from 'jquery';
const { INSTALLING, INSTALLABLE, INSTALLED, NOT_INSTALLABLE } = APPLICATION_STATUS;
const { INSTALLING, INSTALLABLE, INSTALLED } = APPLICATION_STATUS;
describe('Clusters', () => {
setTestTimeout(1000);
......@@ -317,13 +317,12 @@ describe('Clusters', () => {
let ingressNewState;
beforeEach(() => {
ingressPreviousState = { status: INSTALLABLE };
ingressNewState = { status: INSTALLED, externalIp: '127.0.0.1' };
ingressPreviousState = { externalIp: null };
ingressNewState = { externalIp: '127.0.0.1' };
});
describe(`when ingress application new status is ${INSTALLED}`, () => {
describe(`when ingress have an external ip assigned`, () => {
beforeEach(() => {
ingressNewState.status = INSTALLED;
cluster.toggleIngressDomainHelpText(ingressPreviousState, ingressNewState);
});
......@@ -338,31 +337,11 @@ describe('Clusters', () => {
});
});
describe(`when ingress application new status is different from ${INSTALLED}`, () => {
describe(`when ingress does not have an external ip assigned`, () => {
it('hides custom domain help text', () => {
ingressNewState.status = NOT_INSTALLABLE;
cluster.ingressDomainHelpText.classList.remove('hide');
cluster.toggleIngressDomainHelpText(ingressPreviousState, ingressNewState);
expect(cluster.ingressDomainHelpText.classList.contains('hide')).toEqual(true);
});
});
describe('when ingress application new status and old status are the same', () => {
it('does not display custom domain help text', () => {
ingressPreviousState.status = INSTALLED;
ingressNewState.status = ingressPreviousState.status;
cluster.toggleIngressDomainHelpText(ingressPreviousState, ingressNewState);
expect(cluster.ingressDomainHelpText.classList.contains('hide')).toEqual(true);
});
});
describe(`when ingress new status is ${INSTALLED} and there isn’t an ip assigned`, () => {
it('does not display custom domain help text', () => {
ingressPreviousState.externalIp = '127.0.0.1';
ingressNewState.externalIp = null;
cluster.ingressDomainHelpText.classList.remove('hide');
cluster.toggleIngressDomainHelpText(ingressPreviousState, ingressNewState);
......
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