summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 09:09:29 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 09:09:29 +0000
commit3fd97b4bba24ca412112aad025a38a32c7a6cf8c (patch)
tree4aacc8a184522bcbc3db68df47620bc3d2cfcfd9 /app
parentc52239391bf29f640e1e0af98edbd337c0293940 (diff)
downloadgitlab-ce-3fd97b4bba24ca412112aad025a38a32c7a6cf8c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/labels_select.js9
-rw-r--r--app/assets/javascripts/registry/settings/components/registry_settings_app.vue44
-rw-r--r--app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue16
-rw-r--r--app/assets/stylesheets/pages/issuable.scss4
-rw-r--r--app/assets/stylesheets/pages/issues.scss19
-rw-r--r--app/models/zoom_meeting.rb6
6 files changed, 74 insertions, 24 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js
index b8c8cc91f53..7107c970457 100644
--- a/app/assets/javascripts/labels_select.js
+++ b/app/assets/javascripts/labels_select.js
@@ -495,6 +495,10 @@ export default class LabelsSelect {
].join(''),
);
+ const rightLabelTextColor = ({ label, escapeStr }) => {
+ return escapeStr(label.text_color === '#FFFFFF' ? label.color : label.text_color);
+ };
+
const infoIconTemplate = _.template(
[
'<a href="<%= scopedLabelsDocumentationLink %>" class="gl-link gl-label-icon" target="_blank" rel="noopener">',
@@ -510,7 +514,7 @@ export default class LabelsSelect {
spanOpenTag,
'<%- label.title.slice(0, label.title.lastIndexOf("::")) %>',
'</span>',
- '<span class="gl-label-text" style="color: <%= escapeStr(label.color) %>;">',
+ '<span class="gl-label-text" style="color: <%= rightLabelTextColor({ label, escapeStr }) %>;">',
'<%- label.title.slice(label.title.lastIndexOf("::") + 2) %>',
'</span>',
'</a>',
@@ -536,7 +540,7 @@ export default class LabelsSelect {
'<% _.each(labels, function(label){ %>',
'<% if (isScopedLabel(label) && enableScopedLabels) { %>',
'<span class="d-inline-block position-relative scoped-label-wrapper">',
- '<%= scopedLabelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, infoIconTemplate, scopedLabelsDocumentationLink, tooltipTitleTemplate, escapeStr, linkAttrs: \'data-html="true"\' }) %>',
+ '<%= scopedLabelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, rightLabelTextColor, infoIconTemplate, scopedLabelsDocumentationLink, tooltipTitleTemplate, escapeStr, linkAttrs: \'data-html="true"\' }) %>',
'</span>',
'<% } else { %>',
'<%= labelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, tooltipTitleTemplate, escapeStr, linkAttrs: "" }) %>',
@@ -548,6 +552,7 @@ export default class LabelsSelect {
return tpl({
...tplData,
labelTemplate,
+ rightLabelTextColor,
infoIconTemplate,
scopedLabelTemplate,
tooltipTitleTemplate,
diff --git a/app/assets/javascripts/registry/settings/components/registry_settings_app.vue b/app/assets/javascripts/registry/settings/components/registry_settings_app.vue
index 87e65d354bb..4d767f1a578 100644
--- a/app/assets/javascripts/registry/settings/components/registry_settings_app.vue
+++ b/app/assets/javascripts/registry/settings/components/registry_settings_app.vue
@@ -18,14 +18,23 @@ export default {
unavailableFeatureText: s__(
'ContainerRegistry|Currently, the Container Registry tag expiration feature is not available for projects created before GitLab version 12.8. For updates and more information, visit Issue %{linkStart}#196124%{linkEnd}',
),
+ fetchSettingsErrorText: FETCH_SETTINGS_ERROR_MESSAGE,
+ },
+ data() {
+ return {
+ fetchSettingsError: false,
+ };
},
computed: {
...mapState(['isDisabled']),
+ showSettingForm() {
+ return !this.isDisabled && !this.fetchSettingsError;
+ },
},
mounted() {
- this.fetchSettings().catch(() =>
- this.$toast.show(FETCH_SETTINGS_ERROR_MESSAGE, { type: 'error' }),
- );
+ this.fetchSettings().catch(() => {
+ this.fetchSettingsError = true;
+ });
},
methods: {
...mapActions(['fetchSettings']),
@@ -48,17 +57,22 @@ export default {
}}
</li>
</ul>
- <settings-form v-if="!isDisabled" />
- <gl-alert v-else :dismissible="false">
- <p>
- <gl-sprintf :message="$options.i18n.unavailableFeatureText">
- <template #link="{content}">
- <gl-link href="https://gitlab.com/gitlab-org/gitlab/issues/196124" target="_blank">
- {{ content }}
- </gl-link>
- </template>
- </gl-sprintf>
- </p>
- </gl-alert>
+ <settings-form v-if="showSettingForm" />
+ <template v-else>
+ <gl-alert v-if="isDisabled" :dismissible="false">
+ <p>
+ <gl-sprintf :message="$options.i18n.unavailableFeatureText">
+ <template #link="{content}">
+ <gl-link href="https://gitlab.com/gitlab-org/gitlab/issues/196124" target="_blank">
+ {{ content }}
+ </gl-link>
+ </template>
+ </gl-sprintf>
+ </p>
+ </gl-alert>
+ <gl-alert v-else-if="fetchSettingsError" variant="warning" :dismissible="false">
+ <gl-sprintf :message="$options.i18n.fetchSettingsErrorText" />
+ </gl-alert>
+ </template>
</div>
</template>
diff --git a/app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue b/app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue
index dc7c9d9f174..05803ba09ab 100644
--- a/app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue
+++ b/app/assets/javascripts/related_merge_requests/components/related_merge_requests.vue
@@ -1,6 +1,6 @@
<script>
import { mapState, mapActions } from 'vuex';
-import { GlLoadingIcon } from '@gitlab/ui';
+import { GlLink, GlLoadingIcon } from '@gitlab/ui';
import { sprintf, n__, s__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue';
@@ -10,6 +10,7 @@ export default {
name: 'RelatedMergeRequests',
components: {
Icon,
+ GlLink,
GlLoadingIcon,
RelatedIssuableItem,
},
@@ -64,10 +65,19 @@ export default {
</script>
<template>
- <div v-if="isFetchingMergeRequests || (!isFetchingMergeRequests && totalCount)">
+ <div
+ v-if="isFetchingMergeRequests || (!isFetchingMergeRequests && totalCount)"
+ id="related-merge-requests"
+ >
<div id="merge-requests" class="card card-slim mt-3">
<div class="card-header">
- <div class="card-title mt-0 mb-0 h5 merge-requests-title">
+ <div class="card-title mt-0 mb-0 h5 merge-requests-title position-relative">
+ <gl-link
+ id="user-content-related-merge-requests"
+ class="anchor position-absolute text-decoration-none"
+ href="#related-merge-requests"
+ aria-hidden="true"
+ />
<span class="mr-1">
{{ __('Related merge requests') }}
</span>
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss
index 85a8113ff1b..fd56f655c0a 100644
--- a/app/assets/stylesheets/pages/issuable.scss
+++ b/app/assets/stylesheets/pages/issuable.scss
@@ -158,10 +158,6 @@
a:not(.btn) {
color: inherit;
- .gl-label-text:hover {
- color: inherit;
- }
-
&:hover {
color: $blue-800;
diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss
index b03ad5c6b75..d77b30ce259 100644
--- a/app/assets/stylesheets/pages/issues.scss
+++ b/app/assets/stylesheets/pages/issues.scss
@@ -284,3 +284,22 @@ ul.related-merge-requests > li {
text-align: right;
}
}
+
+.issue-details {
+ .card-title {
+ a.anchor {
+ left: -16px;
+ top: 4px;
+ outline: none;
+
+ &::after {
+ content: image-url('icon_anchor.svg');
+ @include invisible(hidden);
+ }
+ }
+
+ &:hover > a.anchor::after {
+ @include invisible(visible);
+ }
+ }
+}
diff --git a/app/models/zoom_meeting.rb b/app/models/zoom_meeting.rb
index a7ecd1e6a2c..fe2f351018c 100644
--- a/app/models/zoom_meeting.rb
+++ b/app/models/zoom_meeting.rb
@@ -23,4 +23,10 @@ class ZoomMeeting < ApplicationRecord
def self.canonical_meeting_url(issue)
canonical_meeting(issue)&.url
end
+
+ def self.distinct_count_by(column = nil, fallback = -1)
+ distinct.count(column)
+ rescue ActiveRecord::StatementInvalid
+ fallback
+ end
end