summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue')
-rw-r--r--app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue37
1 files changed, 28 insertions, 9 deletions
diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue b/app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue
index 3b312e78d11..64d4414eb94 100644
--- a/app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue
+++ b/app/assets/javascripts/pipelines/components/pipelines_list/empty_state/ci_templates.vue
@@ -12,15 +12,31 @@ export default {
},
mixins: [Tracking.mixin()],
inject: ['pipelineEditorPath', 'suggestedCiTemplates'],
+ props: {
+ disabled: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
+ filterTemplates: {
+ type: Array,
+ required: false,
+ default: () => [],
+ },
+ },
data() {
- const templates = this.suggestedCiTemplates.map(({ name, logo }) => {
- return {
- name,
- logo,
- link: mergeUrlParams({ template: name }, this.pipelineEditorPath),
- description: sprintf(this.$options.i18n.description, { name }),
- };
- });
+ const templates = this.suggestedCiTemplates
+ .filter(
+ (template) => !this.filterTemplates.length || this.filterTemplates.includes(template.name),
+ )
+ .map(({ name, logo, title }) => {
+ return {
+ name: title || name,
+ logo,
+ link: mergeUrlParams({ template: name }, this.pipelineEditorPath),
+ description: sprintf(this.$options.i18n.description, { name: title || name }),
+ };
+ });
return {
templates,
@@ -34,7 +50,9 @@ export default {
},
},
i18n: {
- description: s__('Pipelines|CI/CD template to test and deploy your %{name} project.'),
+ description: s__(
+ 'Pipelines|Continuous integration and deployment template to test and deploy your %{name} project.',
+ ),
cta: s__('Pipelines|Use template'),
},
AVATAR_SHAPE_OPTION_RECT,
@@ -67,6 +85,7 @@ export default {
</div>
</div>
<gl-button
+ :disabled="disabled"
category="primary"
variant="confirm"
:href="template.link"