summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-03 21:09:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-03 21:09:56 +0000
commitc1a50b8195f4e36fda9b233acbde57a449bcf6c3 (patch)
treeb24a10a7951e9a799397753d1badf6894fe03089 /app
parentb6847c621ff246e6abceb90545d5a608318762d6 (diff)
downloadgitlab-ce-c1a50b8195f4e36fda9b233acbde57a449bcf6c3.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ide/components/repo_editor.vue7
-rw-r--r--app/assets/javascripts/notes/components/sort_discussion.vue3
-rw-r--r--app/controllers/projects/import/jira_controller.rb8
-rw-r--r--app/models/user.rb8
-rw-r--r--app/serializers/note_user_entity.rb2
-rw-r--r--app/views/profiles/show.html.haml2
-rw-r--r--app/views/projects/import/jira/show.html.haml2
7 files changed, 21 insertions, 11 deletions
diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue
index c93a95e490a..08850679152 100644
--- a/app/assets/javascripts/ide/components/repo_editor.vue
+++ b/app/assets/javascripts/ide/components/repo_editor.vue
@@ -11,7 +11,6 @@ import {
FILE_VIEW_MODE_PREVIEW,
} from '../constants';
import Editor from '../lib/editor';
-import ExternalLink from './external_link.vue';
import FileTemplatesBar from './file_templates/bar.vue';
import { __ } from '~/locale';
@@ -19,7 +18,6 @@ export default {
components: {
ContentViewer,
DiffViewer,
- ExternalLink,
FileTemplatesBar,
},
props: {
@@ -275,8 +273,8 @@ export default {
<template>
<div id="ide" class="blob-viewer-container blob-editor-container">
- <div class="ide-mode-tabs clearfix">
- <ul v-if="!shouldHideEditor && isEditModeActive" class="nav-links float-left border-bottom-0">
+ <div v-if="!shouldHideEditor && isEditModeActive" class="ide-mode-tabs clearfix">
+ <ul class="nav-links float-left border-bottom-0">
<li :class="editTabCSS">
<a
href="javascript:void(0);"
@@ -296,7 +294,6 @@ export default {
>
</li>
</ul>
- <external-link :file="file" />
</div>
<file-templates-bar v-if="showFileTemplatesBar(file.name)" />
<div
diff --git a/app/assets/javascripts/notes/components/sort_discussion.vue b/app/assets/javascripts/notes/components/sort_discussion.vue
index 16eded52763..3f82ddde3ef 100644
--- a/app/assets/javascripts/notes/components/sort_discussion.vue
+++ b/app/assets/javascripts/notes/components/sort_discussion.vue
@@ -2,6 +2,7 @@
import { GlIcon } from '@gitlab/ui';
import { mapActions, mapGetters } from 'vuex';
import { __ } from '~/locale';
+import Tracking from '~/tracking';
import { ASC, DESC } from '../constants';
const SORT_OPTIONS = [
@@ -14,6 +15,7 @@ export default {
components: {
GlIcon,
},
+ mixins: [Tracking.mixin()],
computed: {
...mapGetters(['sortDirection']),
selectedOption() {
@@ -31,6 +33,7 @@ export default {
}
this.setDiscussionSortDirection(direction);
+ this.track('change_discussion_sort_direction', { property: direction });
},
isDropdownItemActive(sortDir) {
return sortDir === this.sortDirection;
diff --git a/app/controllers/projects/import/jira_controller.rb b/app/controllers/projects/import/jira_controller.rb
index e88d28e9db4..03ae17e18be 100644
--- a/app/controllers/projects/import/jira_controller.rb
+++ b/app/controllers/projects/import/jira_controller.rb
@@ -9,7 +9,13 @@ module Projects
def show
unless @project.import_state&.in_progress?
jira_client = @project.jira_service.client
- @jira_projects = jira_client.Project.all.map { |p| ["#{p.name} (#{p.key})", p.key] }
+ jira_projects = jira_client.Project.all
+
+ if jira_projects.present?
+ @jira_projects = jira_projects.map { |p| ["#{p.name} (#{p.key})", p.key] }
+ else
+ flash[:alert] = 'No projects have been returned from Jira. Please check your Jira configuration.'
+ end
end
flash[:notice] = _("Import %{status}") % { status: @project.import_state.status } if @project.import_state.present? && !@project.import_state.none?
diff --git a/app/models/user.rb b/app/models/user.rb
index 343edfae799..62624f8eec1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1405,7 +1405,7 @@ class User < ApplicationRecord
.select('ci_runners.*')
group_runners = Ci::RunnerNamespace
- .where(namespace_id: owned_groups.select(:id))
+ .where(namespace_id: Gitlab::ObjectHierarchy.new(owned_groups).base_and_descendants.select(:id))
.joins(:runner)
.select('ci_runners.*')
@@ -1696,7 +1696,7 @@ class User < ApplicationRecord
def gitlab_employee?
strong_memoize(:gitlab_employee) do
- if Gitlab.com?
+ if Feature.enabled?(:gitlab_employee_badge) && Gitlab.com?
Mail::Address.new(email).domain == "gitlab.com" && confirmed?
else
false
@@ -1713,6 +1713,10 @@ class User < ApplicationRecord
!confirmed? && !confirmation_period_valid?
end
+ def organization
+ gitlab_employee? ? 'GitLab' : super
+ end
+
protected
# override, from Devise::Validatable
diff --git a/app/serializers/note_user_entity.rb b/app/serializers/note_user_entity.rb
index ffaf7664dae..8d30bbff5e4 100644
--- a/app/serializers/note_user_entity.rb
+++ b/app/serializers/note_user_entity.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class NoteUserEntity < UserEntity
- expose :gitlab_employee?, as: :is_gitlab_employee, if: ->(user, options) { ::Feature.enabled?(:gitlab_employee_badge) && user.gitlab_employee? }
+ expose :gitlab_employee?, as: :is_gitlab_employee, if: ->(user, options) { user.gitlab_employee? }
unexpose :web_url
end
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index 86e157ee042..da2b8c40191 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -101,7 +101,7 @@
- else
= f.text_field :location, label: s_('Profiles|Location'), class: 'input-lg', placeholder: s_("Profiles|City, country")
= f.text_field :job_title, class: 'input-md'
- = f.text_field :organization, label: s_('Profiles|Organization'), class: 'input-md', help: s_("Profiles|Who you represent or work for")
+ = f.text_field :organization, readonly: @user.gitlab_employee?, label: s_('Profiles|Organization'), class: 'input-md', help: s_("Profiles|Who you represent or work for")
= f.text_area :bio, label: s_('Profiles|Bio'), rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters")
%hr
%h5= s_("Private profile")
diff --git a/app/views/projects/import/jira/show.html.haml b/app/views/projects/import/jira/show.html.haml
index f295a241113..c734297d7f3 100644
--- a/app/views/projects/import/jira/show.html.haml
+++ b/app/views/projects/import/jira/show.html.haml
@@ -9,7 +9,7 @@
%h3.page-title.d-flex.align-items-center
= sprite_icon('issues', size: 16, css_class: 'mr-1')
= _('Import in progress')
-- else
+- elsif @jira_projects.present?
%h3.page-title.d-flex.align-items-center
= sprite_icon('issues', size: 16, css_class: 'mr-1')
= _('Import issues from Jira')