Skip to content

Commit bdcefdc

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 9f31f06 commit bdcefdc

File tree

85 files changed

+1278
-652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1278
-652
lines changed

.rubocop_todo/rspec/feature_category.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3311,7 +3311,6 @@ RSpec/FeatureCategory:
33113311
- 'spec/models/ci/persistent_ref_spec.rb'
33123312
- 'spec/models/ci/pipeline_schedule_variable_spec.rb'
33133313
- 'spec/models/ci/resource_spec.rb'
3314-
- 'spec/models/ci/trigger_request_spec.rb'
33153314
- 'spec/models/ci/unit_test_failure_spec.rb'
33163315
- 'spec/models/ci/unit_test_spec.rb'
33173316
- 'spec/models/clusters/agents/activity_event_spec.rb'

app/assets/javascripts/ci/pipeline_editor/components/drawer/pipeline_editor_drawer.vue

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,23 @@ import { DRAWER_Z_INDEX } from '~/lib/utils/constants';
44
import { getContentWrapperHeight } from '~/lib/utils/dom_utils';
55
import { __ } from '~/locale';
66
import { EDITOR_APP_DRAWER_NONE } from '~/ci/pipeline_editor/constants';
7-
import FirstPipelineCard from './cards/first_pipeline_card.vue';
8-
import GettingStartedCard from './cards/getting_started_card.vue';
9-
import GitlabUniversityCard from './cards/gitlab_university_card.vue';
10-
import PipelineConfigReferenceCard from './cards/pipeline_config_reference_card.vue';
11-
import VisualizeAndLintCard from './cards/visualize_and_lint_card.vue';
12-
13-
const DRAWER_CARD_STYLES = ['gl-border-b-0', '!gl-pt-6', '!gl-pb-0', 'gl-leading-20'];
7+
import FirstPipelineSection from './sections/first_pipeline_section.vue';
8+
import GettingStartedSection from './sections/getting_started_section.vue';
9+
import GitlabUniversitySection from './sections/gitlab_university_section.vue';
10+
import PipelineConfigReferenceSection from './sections/pipeline_config_reference_section.vue';
11+
import VisualizeAndLintSection from './sections/visualize_and_lint_section.vue';
1412
1513
export default {
16-
DRAWER_CARD_STYLES,
1714
i18n: {
1815
title: __('Help'),
1916
},
2017
components: {
21-
FirstPipelineCard,
22-
GettingStartedCard,
23-
GitlabUniversityCard,
18+
FirstPipelineSection,
19+
GettingStartedSection,
20+
GitlabUniversitySection,
2421
GlDrawer,
25-
PipelineConfigReferenceCard,
26-
VisualizeAndLintCard,
22+
PipelineConfigReferenceSection,
23+
VisualizeAndLintSection,
2724
},
2825
props: {
2926
isVisible: {
@@ -60,11 +57,11 @@ export default {
6057
<h2 class="gl-m-0 gl-text-lg">{{ $options.i18n.title }}</h2>
6158
</template>
6259
<div class="gl-mb-5">
63-
<getting-started-card :class="$options.DRAWER_CARD_STYLES" />
64-
<first-pipeline-card :class="$options.DRAWER_CARD_STYLES" />
65-
<visualize-and-lint-card :class="$options.DRAWER_CARD_STYLES" />
66-
<pipeline-config-reference-card :class="$options.DRAWER_CARD_STYLES" />
67-
<gitlab-university-card :class="$options.DRAWER_CARD_STYLES" />
60+
<getting-started-section />
61+
<first-pipeline-section />
62+
<visualize-and-lint-section />
63+
<pipeline-config-reference-section />
64+
<gitlab-university-section />
6865
</div>
6966
</gl-drawer>
7067
</template>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script>
2+
export default {
3+
props: {
4+
emoji: {
5+
type: String,
6+
required: true,
7+
},
8+
title: {
9+
type: String,
10+
required: true,
11+
},
12+
},
13+
};
14+
</script>
15+
<template>
16+
<div class="gl-pb-6 gl-leading-20">
17+
<span class="gl-flex gl-items-baseline">
18+
<gl-emoji class="gl-mr-3" :data-name="emoji" data-testid="title-emoji" />
19+
<h4 class="gl-text-lg">{{ title }}</h4>
20+
</span>
21+
<slot></slot>
22+
</div>
23+
</template>

app/assets/javascripts/ci/pipeline_editor/components/drawer/cards/first_pipeline_card.vue renamed to app/assets/javascripts/ci/pipeline_editor/components/drawer/sections/first_pipeline_section.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { s__ } from '~/locale';
44
import Tracking from '~/tracking';
55
import { DOCS_URL } from 'jh_else_ce/lib/utils/url_utility';
66
import { pipelineEditorTrackingOptions } from '../../../constants';
7+
import PipelineEditorDrawerSection from '../pipeline_editor_drawer_section.vue';
78
89
export default {
910
i18n: {
10-
title: s__('PipelineEditorTutorial|🚀 Run your first pipeline'),
11+
title: s__('PipelineEditorTutorial|Run your first pipeline'),
1112
firstParagraph: s__(
1213
'PipelineEditorTutorial|This template creates a simple test pipeline. To use it:',
1314
),
@@ -27,6 +28,7 @@ export default {
2728
components: {
2829
GlLink,
2930
GlSprintf,
31+
PipelineEditorDrawerSection,
3032
},
3133
mixins: [Tracking.mixin()],
3234
methods: {
@@ -39,8 +41,7 @@ export default {
3941
};
4042
</script>
4143
<template>
42-
<div>
43-
<h3 class="gl-mb-5 gl-mt-0 gl-text-lg">{{ $options.i18n.title }}</h3>
44+
<pipeline-editor-drawer-section emoji="rocket" :title="$options.i18n.title">
4445
<p class="gl-mb-3">{{ $options.i18n.firstParagraph }}</p>
4546
<ol class="gl-mb-3">
4647
<li v-for="(item, i) in $options.i18n.listItems" :key="`li-${i}`">{{ item }}</li>
@@ -54,5 +55,5 @@ export default {
5455
</template>
5556
</gl-sprintf>
5657
</p>
57-
</div>
58+
</pipeline-editor-drawer-section>
5859
</template>

app/assets/javascripts/ci/pipeline_editor/components/drawer/cards/getting_started_card.vue renamed to app/assets/javascripts/ci/pipeline_editor/components/drawer/sections/getting_started_section.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import { GlSprintf } from '@gitlab/ui';
33
import { s__ } from '~/locale';
4+
import PipelineEditorDrawerSection from '../pipeline_editor_drawer_section.vue';
45
56
export default {
67
i18n: {
@@ -14,12 +15,12 @@ export default {
1415
},
1516
components: {
1617
GlSprintf,
18+
PipelineEditorDrawerSection,
1719
},
1820
};
1921
</script>
2022
<template>
21-
<div>
22-
<h3 class="gl-mb-5 gl-mt-0 gl-text-lg">{{ $options.i18n.title }}</h3>
23+
<pipeline-editor-drawer-section emoji="wave" :title="$options.i18n.title">
2324
<p class="gl-mb-3">{{ $options.i18n.firstParagraph }}</p>
2425
<p class="gl-mb-0">
2526
<gl-sprintf :message="$options.i18n.secondParagraph">
@@ -28,5 +29,5 @@ export default {
2829
</template>
2930
</gl-sprintf>
3031
</p>
31-
</div>
32+
</pipeline-editor-drawer-section>
3233
</template>

app/assets/javascripts/ci/pipeline_editor/components/drawer/cards/gitlab_university_card.vue renamed to app/assets/javascripts/ci/pipeline_editor/components/drawer/sections/gitlab_university_section.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ import { GlLink, GlSprintf } from '@gitlab/ui';
33
import { s__ } from '~/locale';
44
import Tracking from '~/tracking';
55
import { GITLAB_UNIVERSITY_LINK, pipelineEditorTrackingOptions } from '../../../constants';
6+
import PipelineEditorDrawerSection from '../pipeline_editor_drawer_section.vue';
67
78
export default {
89
name: 'GitLabUniversityCard',
910
GITLAB_UNIVERSITY_LINK,
1011
GITLAB_UNIVERSITY_URL: 'https://university.gitlab.com/pages/ci-cd-content',
1112
i18n: {
12-
title: s__('PipelineEditorTutorial|🎓 Learn CI/CD with GitLab University'),
13+
title: s__('PipelineEditorTutorial|Learn CI/CD with GitLab University'),
1314
body: s__(
14-
'PipelineEditorTutorial|Learn how to set up and use GitLab CI/CD with guided tutorials, videos, and best practices in %{linkStart}GitLab University%{linkEnd}.',
15+
'PipelineEditorTutorial|Learn how to set up and use GitLab CI/CD with guided tutorials, videos, and best practices in %{linkStart}GitLab University.%{linkEnd}',
1516
),
1617
},
1718
components: {
1819
GlLink,
1920
GlSprintf,
21+
PipelineEditorDrawerSection,
2022
},
2123
mixins: [Tracking.mixin()],
2224
methods: {
@@ -28,8 +30,7 @@ export default {
2830
};
2931
</script>
3032
<template>
31-
<div>
32-
<h3 class="gl-mb-5 gl-mt-0 gl-text-lg">{{ $options.i18n.title }}</h3>
33+
<pipeline-editor-drawer-section emoji="mortar_board" :title="$options.i18n.title">
3334
<p class="gl-mb-0">
3435
<gl-sprintf :message="$options.i18n.body">
3536
<template #link="{ content }">
@@ -43,5 +44,5 @@ export default {
4344
</template>
4445
</gl-sprintf>
4546
</p>
46-
</div>
47+
</pipeline-editor-drawer-section>
4748
</template>

app/assets/javascripts/ci/pipeline_editor/components/drawer/cards/pipeline_config_reference_card.vue renamed to app/assets/javascripts/ci/pipeline_editor/components/drawer/sections/pipeline_config_reference_section.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import {
99
CI_YAML_LINK,
1010
pipelineEditorTrackingOptions,
1111
} from '../../../constants';
12+
import PipelineEditorDrawerSection from '../pipeline_editor_drawer_section.vue';
1213
1314
export default {
1415
CI_EXAMPLES_LINK,
1516
CI_HELP_LINK,
1617
CI_NEEDS_LINK,
1718
CI_YAML_LINK,
1819
i18n: {
19-
title: s__('PipelineEditorTutorial|⚙️ Pipeline configuration reference'),
20+
title: s__('PipelineEditorTutorial|Pipeline configuration reference'),
2021
firstParagraph: s__('PipelineEditorTutorial|Resources to help with your CI/CD configuration:'),
2122
browseExamples: s__(
2223
'PipelineEditorTutorial|Browse %{linkStart}CI/CD examples and templates%{linkEnd}',
@@ -34,6 +35,7 @@ export default {
3435
components: {
3536
GlLink,
3637
GlSprintf,
38+
PipelineEditorDrawerSection,
3739
},
3840
mixins: [Tracking.mixin()],
3941
inject: ['ciExamplesHelpPagePath', 'ciHelpPagePath', 'needsHelpPagePath', 'ymlHelpPagePath'],
@@ -46,8 +48,7 @@ export default {
4648
};
4749
</script>
4850
<template>
49-
<div>
50-
<h3 class="gl-mb-5 gl-mt-0 gl-text-lg">{{ $options.i18n.title }}</h3>
51+
<pipeline-editor-drawer-section emoji="gear" :title="$options.i18n.title">
5152
<p class="gl-mb-3">{{ $options.i18n.firstParagraph }}</p>
5253
<ul class="gl-mb-0">
5354
<li>
@@ -56,6 +57,7 @@ export default {
5657
<gl-link
5758
:href="ciExamplesHelpPagePath"
5859
target="_blank"
60+
data-testid="ci-examples-link"
5961
@click="trackHelpPageClick($options.CI_EXAMPLES_LINK)"
6062
>
6163
{{ content }}
@@ -69,6 +71,7 @@ export default {
6971
<gl-link
7072
:href="ymlHelpPagePath"
7173
target="_blank"
74+
data-testid="ci-yaml-link"
7275
@click="trackHelpPageClick($options.CI_YAML_LINK)"
7376
>
7477
{{ content }}
@@ -82,6 +85,7 @@ export default {
8285
<gl-link
8386
:href="ciHelpPagePath"
8487
target="_blank"
88+
data-testid="ci-help-link"
8589
@click="trackHelpPageClick($options.CI_HELP_LINK)"
8690
>
8791
{{ content }}
@@ -95,6 +99,7 @@ export default {
9599
<gl-link
96100
:href="needsHelpPagePath"
97101
target="_blank"
102+
data-testid="ci-needs-link"
98103
@click="trackHelpPageClick($options.CI_NEEDS_LINK)"
99104
>
100105
{{ content }}
@@ -103,5 +108,5 @@ export default {
103108
</gl-sprintf>
104109
</li>
105110
</ul>
106-
</div>
111+
</pipeline-editor-drawer-section>
107112
</template>
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<script>
22
import { s__ } from '~/locale';
3+
import PipelineEditorDrawerSection from '../pipeline_editor_drawer_section.vue';
34
45
export default {
56
i18n: {
6-
title: s__('PipelineEditorTutorial|💡 Tip: Visualize and validate your pipeline'),
7+
title: s__('PipelineEditorTutorial|Tip: Visualize and validate your pipeline'),
78
firstParagraph: s__(
89
'PipelineEditorTutorial|Use the Visualize and Lint tabs in the pipeline editor to visualize your pipeline and check for any errors or warnings before committing your changes.',
910
),
1011
},
12+
components: {
13+
PipelineEditorDrawerSection,
14+
},
1115
};
1216
</script>
1317
<template>
14-
<div>
15-
<h3 class="gl-mb-5 gl-mt-0 gl-text-lg">{{ $options.i18n.title }}</h3>
18+
<pipeline-editor-drawer-section emoji="bulb" :title="$options.i18n.title">
1619
<p class="gl-mb-0">{{ $options.i18n.firstParagraph }}</p>
17-
</div>
20+
</pipeline-editor-drawer-section>
1821
</template>

app/assets/javascripts/emoji/components/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { chunk, memoize, uniq } from 'lodash';
22
import { getCookie, removeCookie } from '~/lib/utils/common_utils';
3-
import { initEmojiMap, getEmojiCategoryMap, getAllEmoji, loadCustomEmojiWithNames } from '~/emoji';
3+
import { initEmojiMap, getEmojiCategoryMap, getAllEmoji, getEmojisForCategory } from '~/emoji';
44
import {
55
EMOJIS_PER_ROW,
66
EMOJI_ROW_HEIGHT,
@@ -35,8 +35,8 @@ export const getFrequentlyUsedEmojis = async () => {
3535
swapCookieToLocalStorage();
3636
}
3737

38-
const customEmoji = await loadCustomEmojiWithNames();
39-
const possibleEmojiNames = [...customEmoji.names, ...getAllEmoji().map((e) => e.n)];
38+
const customEmoji = await getEmojisForCategory('custom');
39+
const possibleEmojiNames = [...customEmoji.map((e) => e.name), ...getAllEmoji().map((e) => e.n)];
4040

4141
const emojis = chunk(
4242
uniq(savedEmojis.split(',')).filter((name) => possibleEmojiNames.includes(name)),

app/assets/javascripts/emoji/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,9 @@ export function glEmojiTag(inputName, options) {
331331
name,
332332
)}"></gl-emoji>`;
333333
}
334+
335+
export const getEmojisForCategory = async (category) => {
336+
await initEmojiMap.promise;
337+
338+
return Object.values(emojiMap).filter((e) => e.c === category);
339+
};

0 commit comments

Comments
 (0)