Commit 7da88988 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents cd5225bb 858320c2
...@@ -140,16 +140,13 @@ export default { ...@@ -140,16 +140,13 @@ export default {
}, },
(line) => line.type, (line) => line.type,
), ),
lineContent: memoize( lineContent: (line) => {
(line) => { if (line.isConflictMarker) {
if (line.isConflictMarker) { return line.type === CONFLICT_MARKER_THEIR ? 'HEAD//our changes' : 'origin//their changes';
return line.type === CONFLICT_MARKER_THEIR ? 'HEAD//our changes' : 'origin//their changes'; }
}
return line.rich_text; return line.rich_text;
}, },
(line) => line.line_code,
),
CONFLICT_MARKER, CONFLICT_MARKER,
CONFLICT_MARKER_THEIR, CONFLICT_MARKER_THEIR,
CONFLICT_OUR, CONFLICT_OUR,
......
...@@ -6,28 +6,19 @@ import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../constants'; ...@@ -6,28 +6,19 @@ import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../constants';
const ALERT_DATA = { const ALERT_DATA = {
[INSTANCE_TYPE]: { [INSTANCE_TYPE]: {
title: s__(
'Runners|This runner is available to all groups and projects in your GitLab instance.',
),
message: s__( message: s__(
'Runners|Shared runners are available to every project in a GitLab instance. If you want a runner to build only specific projects, restrict the project in the table below. After you restrict a runner to a project, you cannot change it back to a shared runner.', 'Runners|This runner is available to all groups and projects in your GitLab instance.',
), ),
variant: 'success', variant: 'success',
anchor: 'shared-runners', anchor: 'shared-runners',
}, },
[GROUP_TYPE]: { [GROUP_TYPE]: {
title: s__('Runners|This runner is available to all projects and subgroups in a group.'), message: s__('Runners|This runner is available to all projects and subgroups in a group.'),
message: s__(
'Runners|Use Group runners when you want all projects in a group to have access to a set of runners.',
),
variant: 'success', variant: 'success',
anchor: 'group-runners', anchor: 'group-runners',
}, },
[PROJECT_TYPE]: { [PROJECT_TYPE]: {
title: s__('Runners|This runner is associated with specific projects.'), message: s__('Runners|This runner is associated with one or more projects.'),
message: s__(
'Runners|You can set up a specific runner to be used by multiple projects but you cannot make this a shared runner.',
),
variant: 'info', variant: 'info',
anchor: 'specific-runners', anchor: 'specific-runners',
}, },
...@@ -59,7 +50,7 @@ export default { ...@@ -59,7 +50,7 @@ export default {
}; };
</script> </script>
<template> <template>
<gl-alert v-if="alert" :variant="alert.variant" :title="alert.title" :dismissible="false"> <gl-alert v-if="alert" :variant="alert.variant" :dismissible="false">
{{ alert.message }} {{ alert.message }}
<gl-link :href="helpHref">{{ __('Learn more.') }}</gl-link> <gl-link :href="helpHref">{{ __('Learn more.') }}</gl-link>
</gl-alert> </gl-alert>
......
<script> <script>
import { GlTooltipDirective, GlLink } from '@gitlab/ui'; import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __ } from '~/locale';
import { isUserBusy } from '~/set_status_modal/utils'; import { isUserBusy } from '~/set_status_modal/utils';
import AssigneeAvatar from './assignee_avatar.vue'; import AssigneeAvatar from './assignee_avatar.vue';
...@@ -32,10 +32,9 @@ const generateAssigneeTooltip = ({ ...@@ -32,10 +32,9 @@ const generateAssigneeTooltip = ({
} }
if (tooltipHasName && statusInformation.length) { if (tooltipHasName && statusInformation.length) {
return sprintf(__('%{name} %{status}'), { const status = statusInformation.map(paranthesize).join(' ');
name,
status: statusInformation.map(paranthesize).join(' '), return `${name} ${status}`;
});
} }
return name; return name;
......
...@@ -733,9 +733,6 @@ msgstr "" ...@@ -733,9 +733,6 @@ msgstr ""
msgid "%{name_with_link} namespace has run out of Shared Runner Pipeline minutes. No new jobs or pipelines in its projects will run." msgid "%{name_with_link} namespace has run out of Shared Runner Pipeline minutes. No new jobs or pipelines in its projects will run."
msgstr "" msgstr ""
msgid "%{name} %{status}"
msgstr ""
msgid "%{name} (Busy)" msgid "%{name} (Busy)"
msgstr "" msgstr ""
...@@ -28604,6 +28601,9 @@ msgstr "" ...@@ -28604,6 +28601,9 @@ msgstr ""
msgid "Runners|Tags" msgid "Runners|Tags"
msgstr "" msgstr ""
msgid "Runners|This runner is associated with one or more projects."
msgstr ""
msgid "Runners|This runner is associated with specific projects." msgid "Runners|This runner is associated with specific projects."
msgstr "" msgstr ""
......
...@@ -23,10 +23,10 @@ describe('RunnerTypeAlert', () => { ...@@ -23,10 +23,10 @@ describe('RunnerTypeAlert', () => {
}); });
describe.each` describe.each`
type | exampleText | anchor | variant type | exampleText | anchor | variant
${INSTANCE_TYPE} | ${'Shared runners are available to every project'} | ${'#shared-runners'} | ${'success'} ${INSTANCE_TYPE} | ${'This runner is available to all groups and projects'} | ${'#shared-runners'} | ${'success'}
${GROUP_TYPE} | ${'Use Group runners when you want all projects in a group'} | ${'#group-runners'} | ${'success'} ${GROUP_TYPE} | ${'This runner is available to all projects and subgroups in a group'} | ${'#group-runners'} | ${'success'}
${PROJECT_TYPE} | ${'You can set up a specific runner to be used by multiple projects'} | ${'#specific-runners'} | ${'info'} ${PROJECT_TYPE} | ${'This runner is associated with one or more projects'} | ${'#specific-runners'} | ${'info'}
`('When it is an $type level runner', ({ type, exampleText, anchor, variant }) => { `('When it is an $type level runner', ({ type, exampleText, anchor, variant }) => {
beforeEach(() => { beforeEach(() => {
createComponent({ props: { type } }); createComponent({ props: { type } });
......
...@@ -81,30 +81,33 @@ describe('AssigneeAvatarLink component', () => { ...@@ -81,30 +81,33 @@ describe('AssigneeAvatarLink component', () => {
); );
describe.each` describe.each`
tooltipHasName | availability | canMerge | expected tooltipHasName | name | availability | canMerge | expected
${true} | ${'Busy'} | ${false} | ${'Root (Busy) (cannot merge)'} ${true} | ${"Rabbit O'Hare"} | ${''} | ${true} | ${"Rabbit O'Hare"}
${true} | ${'Busy'} | ${true} | ${'Root (Busy)'} ${true} | ${"Rabbit O'Hare"} | ${'Busy'} | ${false} | ${"Rabbit O'Hare (Busy) (cannot merge)"}
${true} | ${''} | ${false} | ${'Root (cannot merge)'} ${true} | ${'Root'} | ${'Busy'} | ${false} | ${'Root (Busy) (cannot merge)'}
${true} | ${''} | ${true} | ${'Root'} ${true} | ${'Root'} | ${'Busy'} | ${true} | ${'Root (Busy)'}
${false} | ${'Busy'} | ${false} | ${'Cannot merge'} ${true} | ${'Root'} | ${''} | ${false} | ${'Root (cannot merge)'}
${false} | ${'Busy'} | ${true} | ${''} ${true} | ${'Root'} | ${''} | ${true} | ${'Root'}
${false} | ${''} | ${false} | ${'Cannot merge'} ${false} | ${'Root'} | ${'Busy'} | ${false} | ${'Cannot merge'}
${false} | ${''} | ${true} | ${''} ${false} | ${'Root'} | ${'Busy'} | ${true} | ${''}
${false} | ${'Root'} | ${''} | ${false} | ${'Cannot merge'}
${false} | ${'Root'} | ${''} | ${true} | ${''}
`( `(
"with tooltipHasName=$tooltipHasName and availability='$availability' and canMerge=$canMerge", "with name=$name tooltipHasName=$tooltipHasName and availability='$availability' and canMerge=$canMerge",
({ tooltipHasName, availability, canMerge, expected }) => { ({ name, tooltipHasName, availability, canMerge, expected }) => {
beforeEach(() => { beforeEach(() => {
createComponent({ createComponent({
tooltipHasName, tooltipHasName,
user: { user: {
...userDataMock(), ...userDataMock(),
name,
can_merge: canMerge, can_merge: canMerge,
availability, availability,
}, },
}); });
}); });
it('sets tooltip to $expected', () => { it(`sets tooltip to "${expected}"`, () => {
expect(findTooltipText()).toBe(expected); expect(findTooltipText()).toBe(expected);
}); });
}, },
......
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