diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-15 18:08:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-15 18:08:32 +0300 |
commit | 9044365a91112d426fbbfba07eca595652bbe2df (patch) | |
tree | a46df8721ca37ef4336375c201f783b4392f385a /app | |
parent | 0820b29dca14bd22c2cee6d9ee2900b64385bfa6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
9 files changed, 49 insertions, 13 deletions
diff --git a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue index 62fd379aa4c..4e63e167260 100644 --- a/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue +++ b/app/assets/javascripts/error_tracking/components/stacktrace_entry.vue @@ -1,4 +1,5 @@ <script> +import _ from 'underscore'; import { GlTooltip } from '@gitlab/ui'; import { __, sprintf } from '~/locale'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; @@ -56,17 +57,36 @@ export default { collapseIcon() { return this.isExpanded ? 'chevron-down' : 'chevron-right'; }, - noCodeFn() { - return this.errorFn ? sprintf(__('in %{errorFn} '), { errorFn: this.errorFn }) : ''; + errorFnText() { + return this.errorFn + ? sprintf( + __(`%{spanStart}in%{spanEnd} %{errorFn}`), + { + errorFn: `<strong>${_.escape(this.errorFn)}</strong>`, + spanStart: `<span class="text-tertiary">`, + spanEnd: `</span>`, + }, + false, + ) + : ''; }, - noCodeLine() { + errorPositionText() { return this.errorLine - ? sprintf(__('at line %{errorLine}%{errorColumn}'), { - errorLine: this.errorLine, - errorColumn: this.errorColumn ? `:${this.errorColumn}` : '', - }) + ? sprintf( + __(`%{spanStart}at line%{spanEnd} %{errorLine}%{errorColumn}`), + { + errorLine: `<strong>${this.errorLine}</strong>`, + errorColumn: this.errorColumn ? `:<strong>${this.errorColumn}</strong>` : ``, + spanStart: `<span class="text-tertiary">`, + spanEnd: `</span>`, + }, + false, + ) : ''; }, + errorInfo() { + return `${this.errorFnText} ${this.errorPositionText}`; + }, }, methods: { isHighlighted(lineNum) { @@ -102,8 +122,7 @@ export default { <strong v-gl-tooltip :title="filePath" - class="file-title-name d-inline-block overflow-hidden text-truncate" - :class="{ 'limited-width': !hasCode }" + class="file-title-name d-inline-block overflow-hidden text-truncate limited-width" data-container="body" > {{ filePath }} @@ -113,7 +132,7 @@ export default { :text="filePath" css-class="btn-default btn-transparent btn-clipboard position-static" /> - <span v-if="!hasCode" class="text-tertiary">{{ noCodeFn }}{{ noCodeLine }}</span> + <span v-html="errorInfo"></span> </div> </div> diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index da263949b98..d755e7e8cdb 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -222,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => { // Disable form buttons while a form is submitting $body.on('ajax:complete, ajax:beforeSend, submit', 'form', function ajaxCompleteCallback(e) { - const $buttons = $('[type="submit"], .js-disable-on-submit', this); + const $buttons = $('[type="submit"], .js-disable-on-submit', this).not('.js-no-auto-disable'); switch (e.type) { case 'ajax:beforeSend': case 'submit': diff --git a/app/assets/javascripts/repository/components/tree_content.vue b/app/assets/javascripts/repository/components/tree_content.vue index c30d6f05c6a..92e33b013c3 100644 --- a/app/assets/javascripts/repository/components/tree_content.vue +++ b/app/assets/javascripts/repository/components/tree_content.vue @@ -5,6 +5,7 @@ import FileTable from './table/index.vue'; import getRefMixin from '../mixins/get_ref'; import getFiles from '../queries/getFiles.query.graphql'; import getProjectPath from '../queries/getProjectPath.query.graphql'; +import getVueFileListLfsBadge from '../queries/getVueFileListLfsBadge.query.graphql'; import FilePreview from './preview/index.vue'; import { readmeFile } from '../utils/readme'; @@ -20,6 +21,9 @@ export default { projectPath: { query: getProjectPath, }, + vueFileListLfsBadge: { + query: getVueFileListLfsBadge, + }, }, props: { path: { @@ -43,6 +47,7 @@ export default { blobs: [], }, isLoadingFiles: false, + vueFileListLfsBadge: false, }; }, computed: { @@ -77,6 +82,7 @@ export default { path: this.path || '/', nextPageCursor: this.nextPageCursor, pageSize: PAGE_SIZE, + vueLfsEnabled: this.vueFileListLfsBadge, }, }) .then(({ data }) => { diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js index ae6409a0ac9..2ef0c078f13 100644 --- a/app/assets/javascripts/repository/index.js +++ b/app/assets/javascripts/repository/index.js @@ -23,6 +23,7 @@ export default function setupVueRepositoryList() { projectPath, projectShortPath, ref, + vueFileListLfsBadge: gon?.features?.vueFileListLfsBadge, commits: [], }, }); diff --git a/app/assets/javascripts/repository/queries/getFiles.query.graphql b/app/assets/javascripts/repository/queries/getFiles.query.graphql index 2aaf5066b4a..01ad72ef752 100644 --- a/app/assets/javascripts/repository/queries/getFiles.query.graphql +++ b/app/assets/javascripts/repository/queries/getFiles.query.graphql @@ -14,6 +14,7 @@ query getFiles( $ref: String! $pageSize: Int! $nextPageCursor: String + $vueLfsEnabled: Boolean = false ) { project(fullPath: $projectPath) { repository { @@ -46,7 +47,7 @@ query getFiles( node { ...TreeEntry webUrl - lfsOid + lfsOid @include(if: $vueLfsEnabled) } } pageInfo { diff --git a/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql b/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql new file mode 100644 index 00000000000..3c3d14881da --- /dev/null +++ b/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql @@ -0,0 +1,3 @@ +query getProjectShortPath { + vueFileListLfsBadge @client +} diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index c2f6fbdc265..aba28e5c835 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -15,6 +15,10 @@ class Projects::TreeController < Projects::ApplicationController before_action :authorize_download_code! before_action :authorize_edit_tree!, only: [:create_dir] + before_action only: [:show] do + push_frontend_feature_flag(:vue_file_list_lfs_badge) + end + def show return render_404 unless @repository.commit(@ref) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 2df41bc2a07..bb3762c26f6 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -266,7 +266,7 @@ module Ci end before_transition on: :enqueue_preparing do |build| - build.any_unmet_prerequisites? # If false is returned, it stops the transition + !build.any_unmet_prerequisites? # If false is returned, it stops the transition end after_transition created: :scheduled do |build| diff --git a/app/services/clusters/applications/check_installation_progress_service.rb b/app/services/clusters/applications/check_installation_progress_service.rb index 1ce6e0c1cb0..7d064abfaa3 100644 --- a/app/services/clusters/applications/check_installation_progress_service.rb +++ b/app/services/clusters/applications/check_installation_progress_service.rb @@ -11,6 +11,8 @@ module Clusters def on_success app.make_installed! + + Gitlab::Tracking.event('cluster:applications', "cluster_application_#{app.name}_installed") ensure remove_installation_pod end |