summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/badges
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/badges')
-rw-r--r--app/assets/javascripts/badges/components/badge.vue26
-rw-r--r--app/assets/javascripts/badges/components/badge_form.vue53
-rw-r--r--app/assets/javascripts/badges/components/badge_list.vue27
-rw-r--r--app/assets/javascripts/badges/components/badge_list_row.vue25
-rw-r--r--app/assets/javascripts/badges/components/badge_settings.vue13
5 files changed, 32 insertions, 112 deletions
diff --git a/app/assets/javascripts/badges/components/badge.vue b/app/assets/javascripts/badges/components/badge.vue
index ca1662313c2..ae6029142fe 100644
--- a/app/assets/javascripts/badges/components/badge.vue
+++ b/app/assets/javascripts/badges/components/badge.vue
@@ -65,12 +65,7 @@ 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">
<img
:src="imageUrlWithRetries"
class="project-badge"
@@ -80,15 +75,9 @@ export default {
/>
</a>
- <gl-loading-icon
- v-show="isLoading"
- :inline="true"
- />
+ <gl-loading-icon v-show="isLoading" :inline="true" />
- <div
- v-show="hasError"
- class="btn-group"
- >
+ <div v-show="hasError" class="btn-group">
<div class="btn btn-default btn-sm disabled">
<icon
:size="16"
@@ -97,9 +86,7 @@ export default {
aria-hidden="true"
/>
</div>
- <div
- class="btn btn-default btn-sm disabled"
- >
+ <div class="btn btn-default btn-sm disabled">
<span class="prepend-left-8 append-right-8">{{ s__('Badges|No badge image') }}</span>
</div>
</div>
@@ -112,10 +99,7 @@ export default {
type="button"
@click="reloadImage"
>
- <icon
- :size="16"
- name="retry"
- />
+ <icon :size="16" name="retry" />
</button>
</div>
</template>
diff --git a/app/assets/javascripts/badges/components/badge_form.vue b/app/assets/javascripts/badges/components/badge_form.vue
index 0eff922d93c..85a15b38de1 100644
--- a/app/assets/javascripts/badges/components/badge_form.vue
+++ b/app/assets/javascripts/badges/components/badge_form.vue
@@ -155,10 +155,7 @@ export default {
@submit.prevent.stop="onSubmit"
>
<div class="form-group">
- <label
- for="badge-link-url"
- class="label-bold"
- >{{ s__('Badges|Link') }}</label>
+ <label for="badge-link-url" class="label-bold">{{ s__('Badges|Link') }}</label>
<p v-html="helpText"></p>
<input
id="badge-link-url"
@@ -168,19 +165,12 @@ export default {
required
@input="debouncedPreview"
/>
- <div class="invalid-feedback">
- {{ s__('Badges|Please fill in a valid URL') }}
- </div>
- <span class="form-text text-muted">
- {{ badgeLinkUrlExample }}
- </span>
+ <div class="invalid-feedback">{{ s__('Badges|Please fill in a valid URL') }}</div>
+ <span class="form-text text-muted"> {{ badgeLinkUrlExample }} </span>
</div>
<div class="form-group">
- <label
- for="badge-image-url"
- class="label-bold"
- >{{ s__('Badges|Badge image URL') }}</label>
+ <label for="badge-image-url" class="label-bold">{{ s__('Badges|Badge image URL') }}</label>
<p v-html="helpText"></p>
<input
id="badge-image-url"
@@ -190,12 +180,8 @@ export default {
required
@input="debouncedPreview"
/>
- <div class="invalid-feedback">
- {{ s__('Badges|Please fill in a valid URL') }}
- </div>
- <span class="form-text text-muted">
- {{ badgeImageUrlExample }}
- </span>
+ <div class="invalid-feedback">{{ s__('Badges|Please fill in a valid URL') }}</div>
+ <span class="form-text text-muted"> {{ badgeImageUrlExample }} </span>
</div>
<div class="form-group">
@@ -206,37 +192,22 @@ export default {
:image-url="renderedImageUrl"
:link-url="renderedLinkUrl"
/>
- <p v-show="isRendering">
- <gl-loading-icon
- :inline="true"
- />
+ <p v-show="isRendering"><gl-loading-icon :inline="true" /></p>
+ <p v-show="!renderedBadge && !isRendering" class="disabled-content">
+ {{ s__('Badges|No image to preview') }}
</p>
- <p
- v-show="!renderedBadge && !isRendering"
- class="disabled-content"
- >{{ s__('Badges|No image to preview') }}</p>
</div>
- <div
- v-if="isEditing"
- class="row-content-block"
- >
+ <div v-if="isEditing" class="row-content-block">
<loading-button
:loading="isSaving"
:label="s__('Badges|Save changes')"
type="submit"
container-class="btn btn-success"
/>
- <button
- class="btn btn-cancel"
- type="button"
- @click="onCancel"
- >{{ __('Cancel') }}</button>
+ <button class="btn btn-cancel" type="button" @click="onCancel">{{ __('Cancel') }}</button>
</div>
- <div
- v-else
- class="form-group"
- >
+ <div v-else class="form-group">
<loading-button
:loading="isSaving"
:label="s__('Badges|Add badge')"
diff --git a/app/assets/javascripts/badges/components/badge_list.vue b/app/assets/javascripts/badges/components/badge_list.vue
index 5b64ea1080c..d2767dd6c64 100644
--- a/app/assets/javascripts/badges/components/badge_list.vue
+++ b/app/assets/javascripts/badges/components/badge_list.vue
@@ -26,32 +26,15 @@ export default {
<div class="card">
<div class="card-header">
{{ s__('Badges|Your badges') }}
- <span
- v-show="!isLoading"
- class="badge badge-pill"
- >{{ badges.length }}</span>
+ <span v-show="!isLoading" class="badge badge-pill">{{ badges.length }}</span>
</div>
- <gl-loading-icon
- v-show="isLoading"
- :size="2"
- class="card-body"
- />
- <div
- v-if="hasNoBadges"
- class="card-body"
- >
+ <gl-loading-icon v-show="isLoading" :size="2" class="card-body" />
+ <div v-if="hasNoBadges" class="card-body">
<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">
+ <badge-list-row v-for="badge in badges" :key="badge.id" :badge="badge" />
</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 d01465232a7..9051be1e102 100644
--- a/app/assets/javascripts/badges/components/badge_list_row.vue
+++ b/app/assets/javascripts/badges/components/badge_list_row.vue
@@ -50,20 +50,14 @@ export default {
<span class="badge badge-pill">{{ badgeKindText }}</span>
</div>
<div class="table-section section-15 table-button-footer">
- <div
- v-if="canEditBadge"
- class="table-action-buttons">
+ <div v-if="canEditBadge" class="table-action-buttons">
<button
:disabled="badge.isDeleting"
class="btn btn-default append-right-8"
type="button"
- @click="editBadge(badge)"
+ @click="editBadge(badge);"
>
- <icon
- :size="16"
- :aria-label="__('Edit')"
- name="pencil"
- />
+ <icon :size="16" :aria-label="__('Edit')" name="pencil" />
</button>
<button
:disabled="badge.isDeleting"
@@ -71,18 +65,11 @@ export default {
type="button"
data-toggle="modal"
data-target="#delete-badge-modal"
- @click="updateBadgeInModal(badge)"
+ @click="updateBadgeInModal(badge);"
>
- <icon
- :size="16"
- :aria-label="__('Delete')"
- name="remove"
- />
+ <icon :size="16" :aria-label="__('Delete')" name="remove" />
</button>
- <gl-loading-icon
- v-show="badge.isDeleting"
- :inline="true"
- />
+ <gl-loading-icon v-show="badge.isDeleting" :inline="true" />
</div>
</div>
</div>
diff --git a/app/assets/javascripts/badges/components/badge_settings.vue b/app/assets/javascripts/badges/components/badge_settings.vue
index cc47e56dd1e..75a522efe7e 100644
--- a/app/assets/javascripts/badges/components/badge_settings.vue
+++ b/app/assets/javascripts/badges/components/badge_settings.vue
@@ -46,7 +46,8 @@ export default {
:header-title-text="s__('Badges|Delete badge?')"
:footer-primary-button-text="s__('Badges|Delete badge')"
footer-primary-button-variant="danger"
- @submit="onSubmitModal">
+ @submit="onSubmitModal"
+ >
<div class="well">
<badge
:image-url="badgeInModal ? badgeInModal.renderedImageUrl : ''"
@@ -56,15 +57,9 @@ export default {
<p v-html="deleteModalText"></p>
</gl-modal>
- <badge-form
- v-show="isEditing"
- :is-editing="true"
- />
+ <badge-form v-show="isEditing" :is-editing="true" />
- <badge-form
- v-show="!isEditing"
- :is-editing="false"
- />
+ <badge-form v-show="!isEditing" :is-editing="false" />
<badge-list v-show="!isEditing" />
</div>
</template>