diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/assets/javascripts/badges | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/badges')
4 files changed, 29 insertions, 7 deletions
diff --git a/app/assets/javascripts/badges/components/badge.vue b/app/assets/javascripts/badges/components/badge.vue index 53469ac8999..8bef972cc58 100644 --- a/app/assets/javascripts/badges/components/badge.vue +++ b/app/assets/javascripts/badges/components/badge.vue @@ -74,7 +74,14 @@ export default { <template> <div> - <a v-show="!isLoading && !hasError" :href="linkUrl" target="_blank" rel="noopener noreferrer"> + <a + v-show="!isLoading && !hasError" + :href="linkUrl" + target="_blank" + rel="noopener noreferrer" + data-qa-selector="badge_image_link" + :data-qa-link-url="linkUrl" + > <img :src="imageUrlWithRetries" class="project-badge" diff --git a/app/assets/javascripts/badges/components/badge_form.vue b/app/assets/javascripts/badges/components/badge_form.vue index 2c7e878f044..d1570e16639 100644 --- a/app/assets/javascripts/badges/components/badge_form.vue +++ b/app/assets/javascripts/badges/components/badge_form.vue @@ -182,7 +182,7 @@ export default { @submit.prevent.stop="onSubmit" > <gl-form-group :label="s__('Badges|Name')" label-for="badge-name"> - <gl-form-input id="badge-name" v-model="name" /> + <gl-form-input id="badge-name" v-model="name" data-qa-selector="badge_name_field" /> </gl-form-group> <div class="form-group"> @@ -191,6 +191,7 @@ export default { <input id="badge-link-url" v-model="linkUrl" + data-qa-selector="badge_link_url_field" type="URL" class="form-control gl-form-input" required @@ -206,6 +207,7 @@ export default { <input id="badge-image-url" v-model="imageUrl" + data-qa-selector="badge_image_url_field" type="URL" class="form-control gl-form-input" required @@ -246,7 +248,13 @@ export default { </gl-button> </div> <div v-else class="form-group"> - <gl-button :loading="isSaving" type="submit" variant="confirm" category="primary"> + <gl-button + :loading="isSaving" + type="submit" + variant="confirm" + category="primary" + data-qa-selector="add_badge_button" + > {{ s__('Badges|Add badge') }} </gl-button> </div> diff --git a/app/assets/javascripts/badges/components/badge_list.vue b/app/assets/javascripts/badges/components/badge_list.vue index 86c7b4c7a6e..76625fe9a60 100644 --- a/app/assets/javascripts/badges/components/badge_list.vue +++ b/app/assets/javascripts/badges/components/badge_list.vue @@ -34,8 +34,14 @@ export default { <span v-if="isGroupBadge">{{ s__('Badges|This group has no badges') }}</span> <span v-else>{{ s__('Badges|This project has no badges') }}</span> </div> - <div v-else class="card-body"> - <badge-list-row v-for="badge in badges" :key="badge.id" :badge="badge" /> + <div v-else class="card-body" data-qa-selector="badge_list_content"> + <badge-list-row + v-for="badge in badges" + :key="badge.id" + :badge="badge" + data-qa-selector="badge_list_row" + :data-qa-badge-name="badge.name" + /> </div> </div> </template> diff --git a/app/assets/javascripts/badges/components/badge_list_row.vue b/app/assets/javascripts/badges/components/badge_list_row.vue index d8525c15087..4c2b700c7ff 100644 --- a/app/assets/javascripts/badges/components/badge_list_row.vue +++ b/app/assets/javascripts/badges/components/badge_list_row.vue @@ -1,5 +1,5 @@ <script> -import { GlLoadingIcon, GlButton, GlModalDirective } from '@gitlab/ui'; +import { GlLoadingIcon, GlButton, GlModalDirective, GlBadge } from '@gitlab/ui'; import { mapActions, mapState } from 'vuex'; import { s__ } from '~/locale'; import { PROJECT_BADGE } from '../constants'; @@ -11,6 +11,7 @@ export default { Badge, GlLoadingIcon, GlButton, + GlBadge, }, directives: { GlModal: GlModalDirective, @@ -49,7 +50,7 @@ export default { /> <div class="table-section section-30"> <label class="label-bold str-truncated mb-0">{{ badge.name }}</label> - <span class="badge badge-pill">{{ badgeKindText }}</span> + <gl-badge size="sm">{{ badgeKindText }}</gl-badge> </div> <span class="table-section section-30 str-truncated">{{ badge.linkUrl }}</span> <div class="table-section section-10 table-button-footer"> |