diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-06 15:11:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-06 15:11:40 +0300 |
commit | 0d1b0d5d03389eea2a4435eea47ec0a37cce9b26 (patch) | |
tree | f1e693f29ed5cdcebaf9424b1b98ffe12030ad13 /app | |
parent | b02d831a00f9f87b95174806b4d04a800001dc38 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
27 files changed, 192 insertions, 89 deletions
diff --git a/app/assets/javascripts/related_issues/components/add_issuable_form.vue b/app/assets/javascripts/related_issues/components/add_issuable_form.vue index 4deb93e4b30..545263a9e37 100644 --- a/app/assets/javascripts/related_issues/components/add_issuable_form.vue +++ b/app/assets/javascripts/related_issues/components/add_issuable_form.vue @@ -205,7 +205,7 @@ export default { :disabled="isSubmitButtonDisabled" :loading="isSubmitting" type="submit" - class="js-add-issuable-form-add-button float-left" + class="float-left" data-qa-selector="add_issue_button" > {{ __('Add') }} diff --git a/app/assets/javascripts/related_issues/components/issue_token.vue b/app/assets/javascripts/related_issues/components/issue_token.vue index 840a6750cd2..abbd612d3ec 100644 --- a/app/assets/javascripts/related_issues/components/issue_token.vue +++ b/app/assets/javascripts/related_issues/components/issue_token.vue @@ -111,7 +111,6 @@ export default { :disabled="removeDisabled" data-testid="removeBtn" type="button" - class="js-issue-token-remove-button" @click="onRemoveRequest" > <gl-icon name="close" /> diff --git a/app/assets/javascripts/related_issues/components/related_issuable_input.vue b/app/assets/javascripts/related_issues/components/related_issuable_input.vue index 46b97370d66..270d4632a54 100644 --- a/app/assets/javascripts/related_issues/components/related_issuable_input.vue +++ b/app/assets/javascripts/related_issues/components/related_issuable_input.vue @@ -107,9 +107,6 @@ export default { onAutoCompleteToggled(isOpen) { this.isAutoCompleteOpen = isOpen; }, - onInputWrapperClick() { - this.$refs.input.focus(); - }, onInput() { const { value } = this.$refs.input; const caretPos = this.$refs.input.selectionStart; @@ -185,26 +182,23 @@ export default { <div ref="issuableFormWrapper" :class="{ focus: isInputFocused }" - class="add-issuable-form-input-wrapper form-control gl-field-error-outline" + class="add-issuable-form-input-wrapper form-control gl-field-error-outline gl-h-auto gl-p-3 gl-pb-2" role="button" @click="onIssuableFormWrapperClick" > - <ul class="add-issuable-form-input-token-list"> - <!-- - We need to ensure this key changes any time the pendingReferences array is updated - else two consecutive pending ref strings in an array with the same name will collide - and cause odd behavior when one is removed. - --> + <ul + class="gl-display-flex gl-flex-wrap gl-align-items-baseline gl-list-style-none gl-m-0 gl-p-0" + > <li v-for="(reference, index) in references" - :key="`related-issues-token-${reference}`" - class="js-add-issuable-form-token-list-item add-issuable-form-token-list-item" + :key="reference" + class="gl-max-w-full gl-mb-2 gl-mr-2" > <issue-token :id-key="index" :display-reference="reference.text || reference" - :can-remove="true" - :is-condensed="true" + can-remove + is-condensed :path-id-separator="pathIdSeparator" event-namespace="pendingIssuable" @pendingIssuableRemoveRequest=" @@ -214,14 +208,15 @@ export default { " /> </li> - <li class="add-issuable-form-input-list-item"> + <li class="gl-mb-2 gl-flex-grow-1"> <input :id="inputId" ref="input" :value="inputValue" :placeholder="inputPlaceholder" + :aria-label="inputPlaceholder" type="text" - class="js-add-issuable-form-input add-issuable-form-input" + class="gl-w-full gl-border-none gl-outline-0" data-qa-selector="add_issue_field" autocomplete="off" @input="onInput" diff --git a/app/assets/javascripts/repository/components/preview/index.vue b/app/assets/javascripts/repository/components/preview/index.vue index 54e67c5ab5c..c6e461b10e0 100644 --- a/app/assets/javascripts/repository/components/preview/index.vue +++ b/app/assets/javascripts/repository/components/preview/index.vue @@ -1,5 +1,5 @@ <script> -import { GlIcon, GlLink, GlLoadingIcon } from '@gitlab/ui'; +import { GlIcon, GlLink, GlLoadingIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import $ from 'jquery'; import '~/behaviors/markdown/render_gfm'; import { handleLocationHash } from '~/lib/utils/common_utils'; @@ -22,6 +22,9 @@ export default { GlLink, GlLoadingIcon, }, + directives: { + SafeHtml, + }, props: { blob: { type: Object, @@ -59,11 +62,7 @@ export default { </div> <div class="blob-viewer" data-qa-selector="blob_viewer_content" itemprop="about"> <gl-loading-icon v-if="loading > 0" size="md" color="dark" class="my-4 mx-auto" /> - <div - v-else-if="readme" - ref="readme" - v-html="readme.html /* eslint-disable-line vue/no-v-html */" - ></div> + <div v-else-if="readme" ref="readme" v-safe-html="readme.html"></div> </div> </article> </template> diff --git a/app/assets/javascripts/runner/components/cells/runner_type_cell.vue b/app/assets/javascripts/runner/components/cells/runner_type_cell.vue index f186a8daf72..c8cb0bf6088 100644 --- a/app/assets/javascripts/runner/components/cells/runner_type_cell.vue +++ b/app/assets/javascripts/runner/components/cells/runner_type_cell.vue @@ -1,11 +1,18 @@ <script> -import { GlBadge } from '@gitlab/ui'; +import { GlTooltipDirective } from '@gitlab/ui'; import RunnerTypeBadge from '../runner_type_badge.vue'; +import RunnerStateLockedBadge from '../runner_state_locked_badge.vue'; +import RunnerStatePausedBadge from '../runner_state_paused_badge.vue'; +import { I18N_LOCKED_RUNNER_DESCRIPTION, I18N_PAUSED_RUNNER_DESCRIPTION } from '../../constants'; export default { components: { - GlBadge, RunnerTypeBadge, + RunnerStateLockedBadge, + RunnerStatePausedBadge, + }, + directives: { + GlTooltip: GlTooltipDirective, }, props: { runner: { @@ -24,19 +31,17 @@ export default { return !this.runner.active; }, }, + i18n: { + I18N_LOCKED_RUNNER_DESCRIPTION, + I18N_PAUSED_RUNNER_DESCRIPTION, + }, }; </script> <template> <div> <runner-type-badge :type="runnerType" size="sm" /> - - <gl-badge v-if="locked" variant="warning" size="sm"> - {{ s__('Runners|locked') }} - </gl-badge> - - <gl-badge v-if="paused" variant="danger" size="sm"> - {{ s__('Runners|paused') }} - </gl-badge> + <runner-state-locked-badge v-if="locked" size="sm" /> + <runner-state-paused-badge v-if="paused" size="sm" /> </div> </template> diff --git a/app/assets/javascripts/runner/components/runner_state_locked_badge.vue b/app/assets/javascripts/runner/components/runner_state_locked_badge.vue new file mode 100644 index 00000000000..458526010bc --- /dev/null +++ b/app/assets/javascripts/runner/components/runner_state_locked_badge.vue @@ -0,0 +1,25 @@ +<script> +import { GlBadge, GlTooltipDirective } from '@gitlab/ui'; +import { I18N_LOCKED_RUNNER_DESCRIPTION } from '../constants'; + +export default { + components: { + GlBadge, + }, + directives: { + GlTooltip: GlTooltipDirective, + }, + i18n: { + I18N_LOCKED_RUNNER_DESCRIPTION, + }, +}; +</script> +<template> + <gl-badge + v-gl-tooltip="$options.i18n.I18N_LOCKED_RUNNER_DESCRIPTION" + variant="warning" + v-bind="$attrs" + > + {{ s__('Runners|locked') }} + </gl-badge> +</template> diff --git a/app/assets/javascripts/runner/components/runner_state_paused_badge.vue b/app/assets/javascripts/runner/components/runner_state_paused_badge.vue new file mode 100644 index 00000000000..d1e6fa05e4d --- /dev/null +++ b/app/assets/javascripts/runner/components/runner_state_paused_badge.vue @@ -0,0 +1,25 @@ +<script> +import { GlBadge, GlTooltipDirective } from '@gitlab/ui'; +import { I18N_PAUSED_RUNNER_DESCRIPTION } from '../constants'; + +export default { + components: { + GlBadge, + }, + directives: { + GlTooltip: GlTooltipDirective, + }, + i18n: { + I18N_PAUSED_RUNNER_DESCRIPTION, + }, +}; +</script> +<template> + <gl-badge + v-gl-tooltip="$options.i18n.I18N_PAUSED_RUNNER_DESCRIPTION" + variant="danger" + v-bind="$attrs" + > + {{ s__('Runners|paused') }} + </gl-badge> +</template> diff --git a/app/assets/javascripts/runner/components/runner_type_badge.vue b/app/assets/javascripts/runner/components/runner_type_badge.vue index c2f43daa899..1a61b80184b 100644 --- a/app/assets/javascripts/runner/components/runner_type_badge.vue +++ b/app/assets/javascripts/runner/components/runner_type_badge.vue @@ -1,20 +1,30 @@ <script> -import { GlBadge } from '@gitlab/ui'; +import { GlBadge, GlTooltipDirective } from '@gitlab/ui'; import { s__ } from '~/locale'; -import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../constants'; +import { + INSTANCE_TYPE, + GROUP_TYPE, + PROJECT_TYPE, + I18N_INSTANCE_RUNNER_DESCRIPTION, + I18N_GROUP_RUNNER_DESCRIPTION, + I18N_PROJECT_RUNNER_DESCRIPTION, +} from '../constants'; const BADGE_DATA = { [INSTANCE_TYPE]: { variant: 'success', text: s__('Runners|shared'), + tooltip: I18N_INSTANCE_RUNNER_DESCRIPTION, }, [GROUP_TYPE]: { variant: 'success', text: s__('Runners|group'), + tooltip: I18N_GROUP_RUNNER_DESCRIPTION, }, [PROJECT_TYPE]: { variant: 'info', text: s__('Runners|specific'), + tooltip: I18N_PROJECT_RUNNER_DESCRIPTION, }, }; @@ -22,6 +32,9 @@ export default { components: { GlBadge, }, + directives: { + GlTooltip: GlTooltipDirective, + }, props: { type: { type: String, @@ -40,7 +53,7 @@ export default { }; </script> <template> - <gl-badge v-if="badge" :variant="badge.variant" v-bind="$attrs"> + <gl-badge v-if="badge" v-gl-tooltip="badge.tooltip" :variant="badge.variant" v-bind="$attrs"> {{ badge.text }} </gl-badge> </template> diff --git a/app/assets/javascripts/runner/components/runner_type_help.vue b/app/assets/javascripts/runner/components/runner_type_help.vue index 70456b3ab65..2326f66ebb8 100644 --- a/app/assets/javascripts/runner/components/runner_type_help.vue +++ b/app/assets/javascripts/runner/components/runner_type_help.vue @@ -1,18 +1,36 @@ <script> -import { GlBadge } from '@gitlab/ui'; -import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../constants'; +import { + INSTANCE_TYPE, + GROUP_TYPE, + PROJECT_TYPE, + I18N_INSTANCE_RUNNER_DESCRIPTION, + I18N_GROUP_RUNNER_DESCRIPTION, + I18N_PROJECT_RUNNER_DESCRIPTION, + I18N_LOCKED_RUNNER_DESCRIPTION, + I18N_PAUSED_RUNNER_DESCRIPTION, +} from '../constants'; import RunnerTypeBadge from './runner_type_badge.vue'; +import RunnerStateLockedBadge from './runner_state_locked_badge.vue'; +import RunnerStatePausedBadge from './runner_state_paused_badge.vue'; export default { components: { - GlBadge, RunnerTypeBadge, + RunnerStateLockedBadge, + RunnerStatePausedBadge, }, runnerTypes: { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE, }, + i18n: { + I18N_INSTANCE_RUNNER_DESCRIPTION, + I18N_GROUP_RUNNER_DESCRIPTION, + I18N_PROJECT_RUNNER_DESCRIPTION, + I18N_LOCKED_RUNNER_DESCRIPTION, + I18N_PAUSED_RUNNER_DESCRIPTION, + }, }; </script> @@ -32,27 +50,23 @@ export default { <ul> <li> <runner-type-badge :type="$options.runnerTypes.INSTANCE_TYPE" size="sm" /> - - {{ __('Runs jobs from all unassigned projects.') }} + - {{ $options.i18n.I18N_INSTANCE_RUNNER_DESCRIPTION }} </li> <li> <runner-type-badge :type="$options.runnerTypes.GROUP_TYPE" size="sm" /> - - {{ __('Runs jobs from all unassigned projects in its group.') }} + - {{ $options.i18n.I18N_GROUP_RUNNER_DESCRIPTION }} </li> <li> <runner-type-badge :type="$options.runnerTypes.PROJECT_TYPE" size="sm" /> - - {{ __('Runs jobs from assigned projects.') }} + - {{ $options.i18n.I18N_PROJECT_RUNNER_DESCRIPTION }} </li> <li> - <gl-badge variant="warning" size="sm"> - {{ s__('Runners|locked') }} - </gl-badge> - - {{ __('Cannot be assigned to other projects.') }} + <runner-state-locked-badge size="sm" /> + - {{ $options.i18n.I18N_LOCKED_RUNNER_DESCRIPTION }} </li> <li> - <gl-badge variant="danger" size="sm"> - {{ s__('Runners|paused') }} - </gl-badge> - - {{ __('Not available to run jobs.') }} + <runner-state-paused-badge size="sm" /> + - {{ $options.i18n.I18N_PAUSED_RUNNER_DESCRIPTION }} </li> </ul> </div> diff --git a/app/assets/javascripts/runner/constants.js b/app/assets/javascripts/runner/constants.js index 46e55b322c7..a2fb9d9efd8 100644 --- a/app/assets/javascripts/runner/constants.js +++ b/app/assets/javascripts/runner/constants.js @@ -7,6 +7,14 @@ export const GROUP_RUNNER_COUNT_LIMIT = 1000; export const I18N_FETCH_ERROR = s__('Runners|Something went wrong while fetching runner data.'); export const I18N_DETAILS_TITLE = s__('Runners|Runner #%{runner_id}'); +export const I18N_INSTANCE_RUNNER_DESCRIPTION = s__('Runners|Available to all projects'); +export const I18N_GROUP_RUNNER_DESCRIPTION = s__( + 'Runners|Available to all projects and subgroups in the group', +); +export const I18N_PROJECT_RUNNER_DESCRIPTION = s__('Runners|Associated with one or more projects'); +export const I18N_LOCKED_RUNNER_DESCRIPTION = s__('Runners|You cannot assign to other projects'); +export const I18N_PAUSED_RUNNER_DESCRIPTION = s__('Runners|Not available to run jobs'); + export const RUNNER_TAG_BADGE_VARIANT = 'info'; export const RUNNER_TAG_BG_CLASS = 'gl-bg-blue-100'; diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue b/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue index 5d8541cf5e8..1347586c738 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue @@ -160,7 +160,12 @@ export default { wclass="report-block-list" class="report-block-container" > - <li v-for="data in fullData" :key="data.id" class="gl-display-flex gl-align-items-center"> + <li + v-for="data in fullData" + :key="data.id" + class="gl-display-flex gl-align-items-center" + data-testid="extension-list-item" + > <status-icon v-if="data.icon" :icon-name="data.icon.name" :size="12" /> <div class="gl-mt-2 gl-mb-2 gl-flex-wrap gl-align-self-center gl-display-flex"> <div v-safe-html="data.text" class="gl-mr-4"></div> diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index c4df2e102bd..6296b023e90 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -746,33 +746,14 @@ } } -.add-issuable-form-input-token-list { - display: flex; - flex-wrap: wrap; - align-items: baseline; - list-style: none; - margin-bottom: 0; - padding-left: 0; -} - -.add-issuable-form-token-list-item { - max-width: 100%; - margin-bottom: $gl-vert-padding; - margin-right: 5px; -} - -.add-issuable-form-input-list-item { - flex: 1; - min-width: 200px; - margin-bottom: $gl-vert-padding; -} - -.add-issuable-form-input { - width: 100%; - border: 0; +.add-issuable-form-input-wrapper { + &.focus { + border-color: $blue-300; + box-shadow: 0 0 4px $dropdown-input-focus-shadow; + } - &:focus { - outline: none; + .gl-show-field-errors &.form-control:not(textarea) { + height: auto; } } diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb index 94b0473e1f3..02d36c3353d 100644 --- a/app/controllers/projects/tags_controller.rb +++ b/app/controllers/projects/tags_controller.rb @@ -18,17 +18,21 @@ class Projects::TagsController < Projects::ApplicationController params[:sort] = params[:sort].presence || sort_value_recently_updated @sort = params[:sort] - @tags = TagsFinder.new(@repository, params).execute - @tags = Kaminari.paginate_array(@tags).page(params[:page]) + @tags, @tags_loading_error = TagsFinder.new(@repository, params).execute + + @tags = Kaminari.paginate_array(@tags).page(params[:page]) tag_names = @tags.map(&:name) @tags_pipelines = @project.ci_pipelines.latest_successful_for_refs(tag_names) + @releases = project.releases.where(tag: tag_names) @tag_pipeline_statuses = Ci::CommitStatusesFinder.new(@project, @repository, current_user, @tags).execute respond_to do |format| - format.html - format.atom { render layout: 'xml.atom' } + status = @tags_loading_error ? :service_unavailable : :ok + + format.html { render status: status } + format.atom { render layout: 'xml.atom', status: status } end end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7ebd93d4a5d..89767915d7f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -284,9 +284,9 @@ class ProjectsController < Projects::ApplicationController end if find_tags && @repository.tag_count.nonzero? - tags = TagsFinder.new(@repository, params).execute.take(100).map(&:name) + tags, _ = TagsFinder.new(@repository, params).execute - options['Tags'] = tags + options['Tags'] = tags.take(100).map(&:name) end # If reference is commit id - we should add it to branch/tag selectbox diff --git a/app/finders/tags_finder.rb b/app/finders/tags_finder.rb index d9848d027cf..0ccbbdc1b87 100644 --- a/app/finders/tags_finder.rb +++ b/app/finders/tags_finder.rb @@ -7,6 +7,9 @@ class TagsFinder < GitRefsFinder def execute tags = repository.tags_sorted_by(sort) - by_search(tags) + + [by_search(tags), nil] + rescue Gitlab::Git::CommandError => e + [[], e] end end diff --git a/app/models/ci/resource_group.rb b/app/models/ci/resource_group.rb index 946fce3473f..6d25f747a9d 100644 --- a/app/models/ci/resource_group.rb +++ b/app/models/ci/resource_group.rb @@ -32,7 +32,7 @@ module Ci end def upcoming_processables - if unordered? || Feature.disabled?(:ci_resource_group_process_modes, project, default_enabled: :yaml) + if unordered? processables.waiting_for_resource elsif oldest_first? processables.waiting_for_resource_or_upcoming diff --git a/app/views/authentication/_authenticate.html.haml b/app/views/authentication/_authenticate.html.haml index 5a2ae3f44c2..7dcec50573f 100644 --- a/app/views/authentication/_authenticate.html.haml +++ b/app/views/authentication/_authenticate.html.haml @@ -1,14 +1,17 @@ #js-authenticate-token-2fa %a.gl-button.btn.btn-block.btn-confirm#js-login-2fa-device{ href: '#' }= _("Sign in via 2FA code") +-# haml-lint:disable InlineJavaScript %script#js-authenticate-token-2fa-in-progress{ type: "text/template" } %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") +-# haml-lint:disable InlineJavaScript %script#js-authenticate-token-2fa-error{ type: "text/template" } %div %p <%= error_message %> (<%= error_name %>) %a.btn.btn-default.gl-button.btn-block#js-token-2fa-try-again= _("Try again?") +-# haml-lint:disable InlineJavaScript %script#js-authenticate-token-2fa-authenticated{ type: "text/template" } %div %p= _("We heard back from your device. You have been authenticated.") diff --git a/app/views/authentication/_register.html.haml b/app/views/authentication/_register.html.haml index 678fd3c8e8c..5eed969ed35 100644 --- a/app/views/authentication/_register.html.haml +++ b/app/views/authentication/_register.html.haml @@ -1,8 +1,10 @@ #js-register-token-2fa +-# haml-lint:disable InlineJavaScript %script#js-register-2fa-message{ type: "text/template" } %p <%= message %> +-# haml-lint:disable InlineJavaScript %script#js-register-token-2fa-setup{ type: "text/template" } - if current_user.two_factor_otp_enabled? .row.gl-mb-3 @@ -17,12 +19,14 @@ .col-md-8 %p= _("You need to register a two-factor authentication app before you can set up a device.") +-# haml-lint:disable InlineJavaScript %script#js-register-token-2fa-error{ type: "text/template" } %div %p %span <%= error_message %> (<%= error_name %>) %a.btn.btn-default.gl-button#js-token-2fa-try-again= _("Try again?") +-# haml-lint:disable InlineJavaScript %script#js-register-token-2fa-registered{ type: "text/template" } .row.gl-mb-3 .col-md-12 diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index 3678ec748f7..02a37dac158 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -21,6 +21,7 @@ %li %h2.breadcrumbs-sub-title{ data: { qa_selector: 'breadcrumb_sub_title_content' } } = link_to @breadcrumb_title, breadcrumb_title_link + -# haml-lint:disable InlineJavaScript %script{ type: 'application/ld+json' } :plain #{schema_breadcrumb_json} diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml index 27858932e5e..8ee7910de4b 100644 --- a/app/views/projects/branches/new.html.haml +++ b/app/views/projects/branches/new.html.haml @@ -31,4 +31,5 @@ .form-actions = button_tag 'Create branch', class: 'gl-button btn btn-confirm' = link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel' +-# haml-lint:disable InlineJavaScript %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index 7e260a03c5d..ff5582f2627 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -49,6 +49,7 @@ = render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do .row %section.col-md-12 + -# haml-lint:disable InlineJavaScript %script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe .issuable-discussion.js-vue-notes-event - if @merge_request.description.present? diff --git a/app/views/projects/product_analytics/test.html.haml b/app/views/projects/product_analytics/test.html.haml index 60d897ee138..3204cd5fbbe 100644 --- a/app/views/projects/product_analytics/test.html.haml +++ b/app/views/projects/product_analytics/test.html.haml @@ -12,5 +12,6 @@ %code = @event.as_json_wo_empty +-# haml-lint:disable InlineJavaScript :javascript #{render 'tracker'} diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml index 79205a51d71..d3cc409df1d 100644 --- a/app/views/projects/tags/index.html.haml +++ b/app/views/projects/tags/index.html.haml @@ -18,6 +18,9 @@ = render_if_exists 'projects/commits/mirror_status' + - if @tags_loading_error + = render 'shared/errors/gitaly_unavailable', reason: s_('TagsPage|Unable to load tags') + .tags - if @tags.any? %ul.flex-list.content-list diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml index fe00772d1d6..4281152225a 100644 --- a/app/views/projects/tags/new.html.haml +++ b/app/views/projects/tags/new.html.haml @@ -54,4 +54,5 @@ .form-actions.gl-display-flex = button_tag s_('TagsPage|Create tag'), class: 'gl-button btn btn-confirm gl-mr-3', data: { qa_selector: "create_tag_button" } = link_to s_('TagsPage|Cancel'), project_tags_path(@project), class: 'gl-button btn btn-default btn-cancel' +-# haml-lint:disable InlineJavaScript %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe diff --git a/app/views/shared/errors/_gitaly_unavailable.html.haml b/app/views/shared/errors/_gitaly_unavailable.html.haml new file mode 100644 index 00000000000..96a68cbcdc6 --- /dev/null +++ b/app/views/shared/errors/_gitaly_unavailable.html.haml @@ -0,0 +1,8 @@ +.gl-alert.gl-alert-danger.gl-mb-5.gl-mt-5 + .gl-alert-container + = sprite_icon('error', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') + .gl-alert-content + .gl-alert-title + = reason + .gl-alert-body + = s_('The git server, Gitaly, is not available at this time. Please contact your administrator.') diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 1e8724c3448..f5f5674190c 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -7,6 +7,7 @@ - can_edit_issuable = issuable_sidebar.dig(:current_user, :can_edit) - add_page_startup_api_call "#{issuable_sidebar[:issuable_json_path]}?serializer=sidebar_extras" - reviewers = local_assigns.fetch(:reviewers, nil) +- in_group_context_with_iterations = @project.group.present? && issuable_sidebar[:supports_iterations] %aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite', 'aria-label': issuable_type } .issuable-sidebar @@ -28,11 +29,11 @@ = render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type - if issuable_sidebar[:supports_milestone] - .block.milestone{ :class => ("gl-border-b-0!" if issuable_sidebar[:supports_iterations]), data: { qa_selector: 'milestone_block' } } + .block.milestone{ :class => ("gl-border-b-0!" if in_group_context_with_iterations), data: { qa_selector: 'milestone_block' } } .js-milestone-select{ data: { can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] } } - - if @project.group.present? && issuable_sidebar[:supports_iterations] - .block{ class: 'gl-pt-0!', data: { qa_selector: 'iteration_container' } } + - if in_group_context_with_iterations + .block{ class: 'gl-pt-0! gl-collapse-empty', data: { qa_selector: 'iteration_container', testid: 'iteration_container' } }< = render_if_exists 'shared/issuable/iteration_select', can_edit: can_edit_issuable.to_s, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type - if issuable_sidebar[:supports_time_tracking] @@ -55,11 +56,13 @@ .js-sidebar-status-entry-point{ data: sidebar_status_data(issuable_sidebar, @project) } - if issuable_sidebar.has_key?(:confidential) + -# haml-lint:disable InlineJavaScript %script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: issuable_sidebar[:confidential], is_editable: can_edit_issuable }.to_json.html_safe #js-confidential-entry-point = render_if_exists 'shared/issuable/sidebar_cve_id_request', issuable_sidebar: issuable_sidebar + -# haml-lint:disable InlineJavaScript %script#js-lock-issue-data{ type: "application/json" }= { is_locked: !!issuable_sidebar[:discussion_locked], is_editable: can_edit_issuable }.to_json.html_safe #js-lock-entry-point diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml index f7f5c02370d..e34f412baa4 100644 --- a/app/views/shared/notes/_notes_with_form.html.haml +++ b/app/views/shared/notes/_notes_with_form.html.haml @@ -25,4 +25,5 @@ = sprite_icon('lock', css_class: 'icon') %span = html_escape(_("This %{issuable} is locked. Only %{strong_open}project members%{strong_close} can comment.")) % { issuable: issuable.class.to_s.titleize.downcase, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } +-# haml-lint:disable InlineJavaScript %script.js-notes-data{ type: "application/json" }= initial_notes_data(autocomplete).to_json.html_safe |