Skip to content
Snippets Groups Projects
Commit 8a3fdede authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 8e75748a
No related branches found
No related tags found
No related merge requests found
Showing
with 189 additions and 26 deletions
Loading
Loading
@@ -14,6 +14,11 @@ export default {
GlTooltip: GlTooltipDirective,
},
props: {
name: {
type: String,
required: false,
default: '',
},
imageUrl: {
type: String,
required: true,
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ import { mapActions, mapState } from 'vuex';
import createFlash from '~/flash';
import { s__, sprintf } from '~/locale';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import { GlLoadingIcon, GlFormInput, GlFormGroup } from '@gitlab/ui';
import createEmptyBadge from '../empty_badge';
import Badge from './badge.vue';
 
Loading
Loading
@@ -16,6 +16,8 @@ export default {
Badge,
LoadingButton,
GlLoadingIcon,
GlFormInput,
GlFormGroup,
},
props: {
isEditing: {
Loading
Loading
@@ -64,6 +66,18 @@ export default {
renderedLinkUrl() {
return this.renderedBadge ? this.renderedBadge.renderedLinkUrl : '';
},
name: {
get() {
return this.badge ? this.badge.name : '';
},
set(name) {
const badge = this.badge || createEmptyBadge();
this.updateBadgeInForm({
...badge,
name,
});
},
},
imageUrl: {
get() {
return this.badge ? this.badge.imageUrl : '';
Loading
Loading
@@ -154,6 +168,10 @@ export default {
novalidate
@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-group>
<div class="form-group">
<label for="badge-link-url" class="label-bold">{{ s__('Badges|Link') }}</label>
<p v-html="helpText"></p>
Loading
Loading
Loading
Loading
@@ -43,13 +43,14 @@ export default {
<badge
:image-url="badge.renderedImageUrl"
:link-url="badge.renderedLinkUrl"
class="table-section section-40"
class="table-section section-30"
/>
<span class="table-section section-30 str-truncated">{{ badge.linkUrl }}</span>
<div class="table-section section-15">
<div class="table-section section-30">
<label class="label-bold str-truncated mb-0">{{ badge.name }}</label>
<span class="badge badge-pill">{{ badgeKindText }}</span>
</div>
<div class="table-section section-15 table-button-footer">
<span class="table-section section-30 str-truncated">{{ badge.linkUrl }}</span>
<div class="table-section section-10 table-button-footer">
<div v-if="canEditBadge" class="table-action-buttons">
<button
:disabled="badge.isDeleting"
Loading
Loading
export default () => ({
name: '',
imageUrl: '',
isDeleting: false,
linkUrl: '',
Loading
Loading
import axios from '~/lib/utils/axios_utils';
import types from './mutation_types';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
 
export const transformBackendBadge = badge => ({
id: badge.id,
imageUrl: badge.image_url,
kind: badge.kind,
linkUrl: badge.link_url,
renderedImageUrl: badge.rendered_image_url,
renderedLinkUrl: badge.rendered_link_url,
...convertObjectPropsToCamelCase(badge, true),
isDeleting: false,
});
 
Loading
Loading
@@ -27,6 +23,7 @@ export default {
dispatch('requestNewBadge');
return axios
.post(endpoint, {
name: newBadge.name,
image_url: newBadge.imageUrl,
link_url: newBadge.linkUrl,
})
Loading
Loading
@@ -141,6 +138,7 @@ export default {
dispatch('requestUpdatedBadge');
return axios
.put(endpoint, {
name: badge.name,
image_url: badge.imageUrl,
link_url: badge.linkUrl,
})
Loading
Loading
Loading
Loading
@@ -72,7 +72,7 @@ export const truncate = (string, maxLength) => `${string.substr(0, maxLength - 3
* @param {String} sha
* @returns {String}
*/
export const truncateSha = sha => sha.substr(0, 8);
export const truncateSha = sha => sha.substring(0, 8);
 
const ELLIPSIS_CHAR = '';
export const truncatePathMiddleToLength = (text, maxWidth) => {
Loading
Loading
import Tracking from '~/tracking';
const trackDashboardLoad = ({ label, value }) =>
Tracking.event(document.body.dataset.page, 'dashboard_fetch', {
label,
property: 'count',
value,
});
export default trackDashboardLoad;
import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils';
import createFlash from '~/flash';
import trackDashboardLoad from '../monitoring_tracking_helper';
import statusCodes from '../../lib/utils/http_status';
import { backOff } from '../../lib/utils/common_utils';
import { s__, __ } from '../../locale';
Loading
Loading
@@ -45,7 +46,7 @@ export const requestMetricsDashboard = ({ commit }) => {
export const receiveMetricsDashboardSuccess = ({ commit, dispatch }, { response, params }) => {
commit(types.SET_ALL_DASHBOARDS, response.all_dashboards);
commit(types.RECEIVE_METRICS_DATA_SUCCESS, response.dashboard.panel_groups);
dispatch('fetchPrometheusMetrics', params);
return dispatch('fetchPrometheusMetrics', params);
};
export const receiveMetricsDashboardFailure = ({ commit }, error) => {
commit(types.RECEIVE_METRICS_DATA_FAILURE, error);
Loading
Loading
@@ -83,10 +84,12 @@ export const fetchDashboard = ({ state, dispatch }, params) => {
 
return backOffRequest(() => axios.get(state.dashboardEndpoint, { params }))
.then(resp => resp.data)
.then(response => {
dispatch('receiveMetricsDashboardSuccess', {
response,
params,
.then(response => dispatch('receiveMetricsDashboardSuccess', { response, params }))
.then(() => {
const dashboardType = state.currentDashboard === '' ? 'default' : 'custom';
return trackDashboardLoad({
label: `${dashboardType}_metrics_dashboard`,
value: state.metricsWithData.length,
});
})
.catch(error => {
Loading
Loading
<script>
import { __, sprintf } from '~/locale';
import { GlLink, GlTooltipDirective } from '@gitlab/ui';
import { truncateSha } from '~/lib/utils/text_utility';
import Icon from '~/vue_shared/components/icon.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import ExpandButton from '~/vue_shared/components/expand_button.vue';
export default {
name: 'EvidenceBlock',
components: {
ClipboardButton,
ExpandButton,
GlLink,
Icon,
},
directives: {
GlTooltip: GlTooltipDirective,
},
props: {
release: {
type: Object,
required: true,
},
},
computed: {
evidenceTitle() {
return sprintf(__('%{tag}-evidence.json'), { tag: this.release.tag_name });
},
evidenceUrl() {
return this.release.assets && this.release.assets.evidence_file_path;
},
shortSha() {
return truncateSha(this.sha);
},
sha() {
return this.release.evidence_sha;
},
},
};
</script>
<template>
<div>
<div class="card-text prepend-top-default">
<b>
{{ __('Evidence collection') }}
</b>
</div>
<div class="d-flex align-items-baseline">
<gl-link
v-gl-tooltip
class="monospace"
:title="__('Download evidence JSON')"
:download="evidenceTitle"
:href="evidenceUrl"
>
<icon name="review-list" class="align-top append-right-4" /><span>{{ evidenceTitle }}</span>
</gl-link>
<expand-button>
<template slot="short">
<span class="js-short monospace">{{ shortSha }}</span>
</template>
<template slot="expanded">
<span class="js-expanded monospace gl-pl-1">{{ sha }}</span>
</template>
</expand-button>
<clipboard-button
:title="__('Copy commit SHA')"
:text="sha"
css-class="btn-default btn-transparent btn-clipboard"
/>
</div>
</div>
</template>
Loading
Loading
@@ -11,10 +11,12 @@ import { getLocationHash } from '~/lib/utils/url_utility';
import { scrollToElement } from '~/lib/utils/common_utils';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ReleaseBlockFooter from './release_block_footer.vue';
import EvidenceBlock from './evidence_block.vue';
 
export default {
name: 'ReleaseBlock',
components: {
EvidenceBlock,
GlLink,
GlBadge,
GlButton,
Loading
Loading
@@ -70,6 +72,9 @@ export default {
hasAuthor() {
return !_.isEmpty(this.author);
},
hasEvidence() {
return Boolean(this.release.evidence_sha);
},
shouldRenderMilestones() {
return !_.isEmpty(this.release.milestones);
},
Loading
Loading
@@ -81,6 +86,9 @@ export default {
this.glFeatures.releaseEditPage && this.release._links && this.release._links.edit_url,
);
},
shouldShowEvidence() {
return this.glFeatures.releaseEvidenceCollection;
},
shouldShowFooter() {
return this.glFeatures.releaseIssueSummary;
},
Loading
Loading
@@ -217,6 +225,8 @@ export default {
</div>
</div>
 
<evidence-block v-if="hasEvidence && shouldShowEvidence" :release="release" />
<div class="card-text prepend-top-default">
<div v-html="release.description_html"></div>
</div>
Loading
Loading
<script>
import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
 
Loading
Loading
@@ -15,6 +16,7 @@ import Icon from '~/vue_shared/components/icon.vue';
export default {
name: 'ExpandButton',
components: {
GlButton,
Icon,
},
data() {
Loading
Loading
@@ -39,15 +41,25 @@ export default {
</script>
<template>
<span>
<button
<gl-button
v-show="isCollapsed"
:aria-label="ariaLabel"
type="button"
class="text-expander btn-blank"
class="js-text-expander-prepend text-expander btn-blank"
@click="onClick"
>
<icon :size="12" name="ellipsis_h" />
</button>
</gl-button>
<span v-if="isCollapsed"> <slot name="short"></slot> </span>
<span v-if="!isCollapsed"> <slot name="expanded"></slot> </span>
<gl-button
v-show="!isCollapsed"
:aria-label="ariaLabel"
type="button"
class="js-text-expander-append text-expander btn-blank"
@click="onClick"
>
<icon :size="12" name="ellipsis_h" />
</gl-button>
</span>
</template>
Loading
Loading
@@ -274,12 +274,6 @@
height: 24px;
}
 
.git-clone-holder {
.btn {
height: auto;
}
}
.dropdown-toggle,
.clone-dropdown-btn {
.fa {
Loading
Loading
Loading
Loading
@@ -8,6 +8,7 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action do
push_frontend_feature_flag(:release_edit_page, project, default_enabled: true)
push_frontend_feature_flag(:release_issue_summary, project)
push_frontend_feature_flag(:release_evidence_collection, project)
end
before_action :authorize_update_release!, only: %i[edit update]
 
Loading
Loading
Loading
Loading
@@ -22,6 +22,8 @@ class Badge < ApplicationRecord
 
scope :order_created_at_asc, -> { reorder(created_at: :asc) }
 
scope :with_name, ->(name) { where(name: name) }
validates :link_url, :image_url, addressable_url: true
validates :type, presence: true
 
Loading
Loading
---
title: Add evidence collection for Releases
merge_request: 18874
author:
type: changed
---
title: Add snowplow events for monitoring dashboard
merge_request: 19455
author:
type: added
---
title: Fix issue trying to edit weight with collapsed sidebar as guest
merge_request: 20431
author:
type: fixed
---
title: Add badge name field
merge_request: 16998
author: Lee Tickett
type: added
# frozen_string_literal: true
class AddNameToBadges < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :badges, :name, :string, null: true, limit: 255
end
end
Loading
Loading
@@ -498,6 +498,7 @@ ActiveRecord::Schema.define(version: 2019_11_19_023952) do
t.integer "project_id"
t.integer "group_id"
t.string "type", null: false
t.string "name", limit: 255
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.index ["group_id"], name: "index_badges_on_group_id"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment