summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-09 18:09:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-09 18:09:11 +0000
commitd23f33082ad893fad172b17f1ce66bd847671d56 (patch)
treebdffb3f1a3f4855d2a9a7f8762f2812366c75a41 /app
parent3670ddd229b178c0a2e09a1466ddfd7fd2f7855d (diff)
downloadgitlab-ce-d23f33082ad893fad172b17f1ce66bd847671d56.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/nav/components/new_nav_toggle.vue5
-rw-r--r--app/assets/javascripts/sentry/index.js5
-rw-r--r--app/assets/javascripts/super_sidebar/components/nav_item.vue11
-rw-r--r--app/assets/javascripts/super_sidebar/components/user_menu.vue10
-rw-r--r--app/assets/javascripts/vue_shared/components/source_viewer/constants.js9
-rw-r--r--app/assets/stylesheets/framework/super_sidebar.scss7
-rw-r--r--app/controllers/profiles/chat_names_controller.rb9
-rw-r--r--app/helpers/application_settings_helper.rb5
-rw-r--r--app/helpers/auth_helper.rb2
-rw-r--r--app/helpers/sidebars_helper.rb13
-rw-r--r--app/views/admin/application_settings/_slack.html.haml33
-rw-r--r--app/views/groups/edit.html.haml3
-rw-r--r--app/views/projects/edit.html.haml2
13 files changed, 88 insertions, 26 deletions
diff --git a/app/assets/javascripts/nav/components/new_nav_toggle.vue b/app/assets/javascripts/nav/components/new_nav_toggle.vue
index 5eb5e5b9b90..9db123da405 100644
--- a/app/assets/javascripts/nav/components/new_nav_toggle.vue
+++ b/app/assets/javascripts/nav/components/new_nav_toggle.vue
@@ -1,5 +1,5 @@
<script>
-import { GlBadge, GlToggle, GlDisclosureDropdownItem } from '@gitlab/ui';
+import { GlToggle, GlDisclosureDropdownItem } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils';
import { createAlert } from '~/alert';
import { s__ } from '~/locale';
@@ -7,7 +7,6 @@ import Tracking from '~/tracking';
export default {
i18n: {
- badgeLabel: s__('NorthstarNavigation|Beta'),
sectionTitle: s__('NorthstarNavigation|Navigation redesign'),
toggleMenuItemLabel: s__('NorthstarNavigation|New navigation'),
toggleLabel: s__('NorthstarNavigation|Toggle new navigation'),
@@ -16,7 +15,6 @@ export default {
),
},
components: {
- GlBadge,
GlToggle,
GlDisclosureDropdownItem,
},
@@ -83,7 +81,6 @@ export default {
class="gl-px-4 gl-py-2 gl-display-flex gl-justify-content-space-between gl-align-items-center"
>
<b>{{ $options.i18n.sectionTitle }}</b>
- <gl-badge variant="info">{{ $options.i18n.badgeLabel }}</gl-badge>
</div>
<div
diff --git a/app/assets/javascripts/sentry/index.js b/app/assets/javascripts/sentry/index.js
index 5539a061726..ea835945aa9 100644
--- a/app/assets/javascripts/sentry/index.js
+++ b/app/assets/javascripts/sentry/index.js
@@ -15,8 +15,9 @@ const index = function index() {
: [gon.gitlab_url, 'webpack-internal://'],
release: gon.revision,
tags: {
- revision: gon.revision,
- feature_category: gon.feature_category,
+ revision: gon?.revision,
+ feature_category: gon?.feature_category,
+ page: document?.body?.dataset?.page,
},
});
};
diff --git a/app/assets/javascripts/super_sidebar/components/nav_item.vue b/app/assets/javascripts/super_sidebar/components/nav_item.vue
index a4bbd87b34a..9dc26ad10f5 100644
--- a/app/assets/javascripts/super_sidebar/components/nav_item.vue
+++ b/app/assets/javascripts/super_sidebar/components/nav_item.vue
@@ -136,12 +136,17 @@ export default {
</div>
</div>
<slot name="actions"></slot>
- <span v-if="hasPill || isPinnable" class="gl-flex-grow-1 gl-text-right gl-mr-3">
- <gl-badge v-if="hasPill" size="sm" variant="neutral">
+ <span v-if="hasPill || isPinnable" class="gl-flex-grow-1 gl-text-right gl-mr-3 gl-relative">
+ <gl-badge
+ v-if="hasPill"
+ size="sm"
+ variant="neutral"
+ class="count-pill gl-absolute gl-right-0"
+ >
{{ pillData }}
</gl-badge>
<gl-button
- v-else-if="isPinnable && !isPinned"
+ v-if="isPinnable && !isPinned"
size="small"
category="tertiary"
icon="thumbtack"
diff --git a/app/assets/javascripts/super_sidebar/components/user_menu.vue b/app/assets/javascripts/super_sidebar/components/user_menu.vue
index b8a654124e9..cd5a83c86cc 100644
--- a/app/assets/javascripts/super_sidebar/components/user_menu.vue
+++ b/app/assets/javascripts/super_sidebar/components/user_menu.vue
@@ -1,7 +1,6 @@
<script>
import {
GlAvatar,
- GlBadge,
GlDisclosureDropdown,
GlDisclosureDropdownGroup,
GlDisclosureDropdownItem,
@@ -19,10 +18,9 @@ import UserNameGroup from './user_name_group.vue';
const DROPDOWN_X_OFFSET = -211;
export default {
- feedbackUrl: 'https://gitlab.com/gitlab-org/gitlab/-/issues/403059',
+ feedbackUrl: 'https://gitlab.com/gitlab-org/gitlab/-/issues/409005',
i18n: {
newNavigation: {
- badgeLabel: s__('NorthstarNavigation|Beta'),
sectionTitle: s__('NorthstarNavigation|Navigation redesign'),
},
setStatus: s__('SetStatusModal|Set status'),
@@ -38,7 +36,6 @@ export default {
},
components: {
GlAvatar,
- GlBadge,
GlDisclosureDropdown,
GlDisclosureDropdownGroup,
GlDisclosureDropdownItem,
@@ -140,7 +137,7 @@ export default {
extraAttrs: {
target: '_blank',
...USER_MENU_TRACKING_DEFAULTS,
- 'data-track-label': 'provide_nav_beta_feedback',
+ 'data-track-label': 'provide_nav_feedback',
},
};
},
@@ -320,9 +317,6 @@ export default {
<gl-disclosure-dropdown-group bordered>
<template #group-label>
<span class="gl-font-sm">{{ $options.i18n.newNavigation.sectionTitle }}</span>
- <gl-badge size="sm" variant="info"
- >{{ $options.i18n.newNavigation.badgeLabel }}
- </gl-badge>
</template>
<new-nav-toggle :endpoint="toggleNewNavEndpoint" enabled new-navigation />
<gl-disclosure-dropdown-item :item="feedbackItem" data-testid="feedback-item" />
diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
index 514b626ed95..58db1ceda95 100644
--- a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
+++ b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
@@ -141,6 +141,9 @@ export const BIDI_CHARS_CLASS_LIST = 'unicode-bidi has-tooltip';
export const BIDI_CHAR_TOOLTIP = 'Potentially unwanted character detected: Unicode BiDi Control';
-// We fallback to highlighting these languages with Rouge, see the following issue for more detail:
-// https://gitlab.com/gitlab-org/gitlab/-/issues/384375#note_1212752013
-export const LEGACY_FALLBACKS = ['python'];
+/**
+ * We fallback to highlighting these languages with Rouge, see the following issues for more detail:
+ * Python: https://gitlab.com/gitlab-org/gitlab/-/issues/384375#note_1212752013
+ * HAML: https://github.com/highlightjs/highlight.js/issues/3783
+ * */
+export const LEGACY_FALLBACKS = ['python', 'haml'];
diff --git a/app/assets/stylesheets/framework/super_sidebar.scss b/app/assets/stylesheets/framework/super_sidebar.scss
index d58849e21af..a1e26e78fbe 100644
--- a/app/assets/stylesheets/framework/super_sidebar.scss
+++ b/app/assets/stylesheets/framework/super_sidebar.scss
@@ -189,6 +189,13 @@ $super-sidebar-transition-hint-duration: $super-sidebar-transition-duration / 4;
}
}
+ &:hover,
+ &:focus-within {
+ .count-pill {
+ display: none;
+ }
+ }
+
&:focus button,
button:focus {
opacity: 1;
diff --git a/app/controllers/profiles/chat_names_controller.rb b/app/controllers/profiles/chat_names_controller.rb
index 564a84a0829..c4384c962d2 100644
--- a/app/controllers/profiles/chat_names_controller.rb
+++ b/app/controllers/profiles/chat_names_controller.rb
@@ -68,8 +68,13 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
end
def integration_name
+ return s_('Integrations|GitLab for Slack app') if slack_app_params?
+
s_('Integrations|Mattermost slash commands')
end
-end
-Profiles::ChatNamesController.prepend_mod
+ def slack_app_params?
+ chat_name_params[:team_id].start_with?('T') &&
+ chat_name_params[:chat_id].start_with?('U', 'W')
+ end
+end
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index dfb80df0882..dab682d88e0 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -358,6 +358,11 @@ module ApplicationSettingsHelper
:sign_in_text,
:signup_enabled,
:silent_mode_enabled,
+ :slack_app_enabled,
+ :slack_app_id,
+ :slack_app_secret,
+ :slack_app_signing_secret,
+ :slack_app_verification_token,
:sourcegraph_enabled,
:sourcegraph_url,
:sourcegraph_public_only,
diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb
index 58d647c41b1..0ee08ba1820 100644
--- a/app/helpers/auth_helper.rb
+++ b/app/helpers/auth_helper.rb
@@ -21,6 +21,8 @@ module AuthHelper
LDAP_PROVIDER = /\Aldap/.freeze
POPULAR_PROVIDERS = %w(google_oauth2 github).freeze
+ delegate :slack_app_id, to: :'Gitlab::CurrentSettings.current_application_settings'
+
def ldap_enabled?
Gitlab::Auth::Ldap::Config.enabled?
end
diff --git a/app/helpers/sidebars_helper.rb b/app/helpers/sidebars_helper.rb
index 2a9701a93ed..92e589bb09e 100644
--- a/app/helpers/sidebars_helper.rb
+++ b/app/helpers/sidebars_helper.rb
@@ -84,7 +84,7 @@ module SidebarsHelper
current_context: super_sidebar_current_context(project: project, group: group),
context_switcher_links: context_switcher_links,
search: search_data,
- pinned_items: user.pinned_nav_items[panel_type] || [],
+ pinned_items: user.pinned_nav_items[panel_type] || super_sidebar_default_pins(panel_type),
panel_type: panel_type,
update_pins_url: pins_url,
is_impersonating: impersonating?,
@@ -360,6 +360,17 @@ module SidebarsHelper
shortcut_links
end
+
+ def super_sidebar_default_pins(panel_type)
+ case panel_type
+ when 'project'
+ [:project_issue_list, :project_merge_request_list]
+ when 'group'
+ [:group_issue_list, :group_merge_request_list]
+ else
+ []
+ end
+ end
end
SidebarsHelper.prepend_mod_with('SidebarsHelper')
diff --git a/app/views/admin/application_settings/_slack.html.haml b/app/views/admin/application_settings/_slack.html.haml
new file mode 100644
index 00000000000..69a5e284b4c
--- /dev/null
+++ b/app/views/admin/application_settings/_slack.html.haml
@@ -0,0 +1,33 @@
+- return unless Gitlab.dev_or_test_env? || Gitlab.com?
+
+- expanded = integration_expanded?('slack_app_')
+%section.settings.as-slack.no-animate#js-slack-settings{ class: ('expanded' if expanded) }
+ .settings-header
+ %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
+ = _('Slack application')
+ = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
+ = expanded ? _('Collapse') : _('Expand')
+ %p
+ = _('Slack integration allows you to interact with GitLab via slash commands in a chat window.')
+ .settings-content
+ = gitlab_ui_form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f|
+ = form_errors(@application_setting) if expanded
+
+ %fieldset
+ .form-group
+ = f.gitlab_ui_checkbox_component :slack_app_enabled, s_('ApplicationSettings|Enable Slack application'),
+ help_text: s_('ApplicationSettings|This option is only available on GitLab.com')
+ .form-group
+ = f.label :slack_app_id, s_('SlackIntegration|Client ID'), class: 'label-bold'
+ = f.text_field :slack_app_id, class: 'form-control gl-form-input'
+ .form-group
+ = f.label :slack_app_secret, s_('SlackIntegration|Client secret'), class: 'label-bold'
+ = f.text_field :slack_app_secret, class: 'form-control gl-form-input'
+ .form-group
+ = f.label :slack_app_signing_secret, s_('SlackIntegration|Signing secret'), class: 'label-bold'
+ = f.text_field :slack_app_signing_secret, class: 'form-control gl-form-input'
+ .form-group
+ = f.label :slack_app_verification_token, s_('SlackIntegration|Verification token'), class: 'label-bold'
+ = f.text_field :slack_app_verification_token, class: 'form-control gl-form-input'
+
+ = f.submit _('Save changes'), pajamas_button: true
diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml
index 3d7916e22dc..dedff502a87 100644
--- a/app/views/groups/edit.html.haml
+++ b/app/views/groups/edit.html.haml
@@ -30,8 +30,7 @@
= render_if_exists 'groups/merge_requests', expanded: expanded, group: @group
= render_if_exists 'groups/merge_request_approval_settings', expanded: expanded, group: @group, user: current_user
-= render_if_exists 'groups/insights', expanded: expanded
-= render_if_exists 'groups/analytics_dashboards', expanded: expanded
+= render_if_exists 'groups/analytics', expanded: expanded
%section.settings.no-animate#js-badge-settings{ class: ('expanded' if expanded) }
.settings-header
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index 13d628ec9a4..79202dabff9 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -42,7 +42,7 @@
= c.body do
= _('On the left sidebar, select %{merge_requests_link} to view them.').html_safe % { merge_requests_link: link_to('Settings > Merge requests', project_settings_merge_requests_path(@project)).html_safe }
-= render_if_exists 'projects/settings/analytics_dashboards', expanded: expanded
+= render_if_exists 'projects/settings/analytics', expanded: expanded
%section.settings.no-animate{ class: ('expanded' if expanded), data: { qa_selector: 'badges_settings_content' } }
.settings-header