Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
6de2a04a4e
commit
19ab203bec
|
|
@ -21,7 +21,6 @@ Style/OpenStructUse:
|
|||
- spec/graphql/mutations/commits/create_spec.rb
|
||||
- spec/helpers/application_settings_helper_spec.rb
|
||||
- spec/helpers/profiles_helper_spec.rb
|
||||
- spec/lib/gitlab/auth/o_auth/provider_spec.rb
|
||||
- spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb
|
||||
- spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb
|
||||
- spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ function parseDatasetToProps(data) {
|
|||
editProjectPath,
|
||||
learnMorePath,
|
||||
triggerEvents,
|
||||
sections,
|
||||
fields,
|
||||
inheritFromId,
|
||||
integrationLevel,
|
||||
|
|
@ -81,6 +82,7 @@ function parseDatasetToProps(data) {
|
|||
},
|
||||
learnMorePath,
|
||||
triggerEvents: JSON.parse(triggerEvents),
|
||||
sections: JSON.parse(sections, { deep: true }),
|
||||
fields: convertObjectPropsToCamelCase(JSON.parse(fields), { deep: true }),
|
||||
inheritFromId: parseInt(inheritFromId, 10),
|
||||
integrationLevel,
|
||||
|
|
|
|||
|
|
@ -495,6 +495,7 @@ export default {
|
|||
:textarea-value="content"
|
||||
:markdown-docs-path="pageInfo.markdownHelpPath"
|
||||
:uploads-path="pageInfo.uploadsPath"
|
||||
:enable-preview="isMarkdownFormat"
|
||||
class="bordered-box"
|
||||
>
|
||||
<template #textarea>
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ export default {
|
|||
required: false,
|
||||
default: '',
|
||||
},
|
||||
enablePreview: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
addSpacingClasses: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
|
|
@ -204,6 +209,14 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
enablePreview: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!newVal) {
|
||||
this.showWriteTab();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// GLForm class handles all the toolbar buttons
|
||||
|
|
@ -301,6 +314,7 @@ export default {
|
|||
:preview-markdown="previewMarkdown"
|
||||
:line-content="lineContent"
|
||||
:can-suggest="canSuggest"
|
||||
:enable-preview="enablePreview"
|
||||
:show-suggest-popover="showSuggestPopover"
|
||||
:suggestion-start-index="suggestionsStartIndex"
|
||||
data-testid="markdownHeader"
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ export default {
|
|||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
enablePreview: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -164,6 +169,7 @@ export default {
|
|||
@click="writeMarkdownTab($event)"
|
||||
/>
|
||||
<gl-tab
|
||||
v-if="enablePreview"
|
||||
title-link-class="gl-pt-3 gl-px-3 js-md-preview-button"
|
||||
:title="$options.i18n.previewTabTitle"
|
||||
:active="previewMarkdown"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ class Admin::IntegrationsController < Admin::ApplicationController
|
|||
|
||||
before_action :not_found, unless: -> { instance_level_integrations? }
|
||||
|
||||
before_action do
|
||||
push_frontend_feature_flag(:integration_form_sections, default_enabled: :yaml)
|
||||
end
|
||||
|
||||
feature_category :integrations
|
||||
|
||||
def overrides
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ module Groups
|
|||
|
||||
before_action :authorize_admin_group!
|
||||
|
||||
before_action do
|
||||
push_frontend_feature_flag(:integration_form_sections, group, default_enabled: :yaml)
|
||||
end
|
||||
|
||||
feature_category :integrations
|
||||
|
||||
layout 'group_settings'
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ class Projects::ServicesController < Projects::ApplicationController
|
|||
before_action :set_deprecation_notice_for_prometheus_integration, only: [:edit, :update]
|
||||
before_action :redirect_deprecated_prometheus_integration, only: [:update]
|
||||
|
||||
before_action do
|
||||
push_frontend_feature_flag(:integration_form_sections, project, default_enabled: :yaml)
|
||||
end
|
||||
|
||||
respond_to :html
|
||||
|
||||
layout "project_settings"
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ module IntegrationsHelper
|
|||
comment_detail: integration.comment_detail,
|
||||
learn_more_path: integrations_help_page_path,
|
||||
trigger_events: trigger_events_for_integration(integration),
|
||||
sections: integration.sections.to_json,
|
||||
fields: fields_for_integration(integration),
|
||||
inherit_from_id: integration.inherit_from_id,
|
||||
integration_level: integration_level(integration),
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ class Integration < ApplicationRecord
|
|||
Integrations::BaseSlashCommands
|
||||
].freeze
|
||||
|
||||
SECTION_TYPE_CONNECTION = 'connection'
|
||||
|
||||
serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize
|
||||
|
||||
attribute :type, Gitlab::Integrations::StiType.new
|
||||
|
|
@ -363,6 +365,10 @@ class Integration < ApplicationRecord
|
|||
[]
|
||||
end
|
||||
|
||||
def sections
|
||||
[]
|
||||
end
|
||||
|
||||
def password_fields
|
||||
fields.select { |f| f[:type] == 'password' }.pluck(:name)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ module Integrations
|
|||
|
||||
def help
|
||||
jira_doc_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_url('integration/jira/index.html') }
|
||||
s_("JiraService|You need to configure Jira before enabling this integration. For more details, read the %{jira_doc_link_start}Jira integration documentation%{link_end}.") % { jira_doc_link_start: jira_doc_link_start, link_end: '</a>'.html_safe }
|
||||
s_("JiraService|You must configure Jira before enabling this integration. For more details, read the %{jira_doc_link_start}Jira integration documentation%{link_end}.") % { jira_doc_link_start: jira_doc_link_start, link_end: '</a>'.html_safe }
|
||||
end
|
||||
|
||||
def title
|
||||
|
|
@ -130,6 +130,7 @@ module Integrations
|
|||
def fields
|
||||
[
|
||||
{
|
||||
section: SECTION_TYPE_CONNECTION,
|
||||
type: 'text',
|
||||
name: 'url',
|
||||
title: s_('JiraService|Web URL'),
|
||||
|
|
@ -138,12 +139,14 @@ module Integrations
|
|||
required: true
|
||||
},
|
||||
{
|
||||
section: SECTION_TYPE_CONNECTION,
|
||||
type: 'text',
|
||||
name: 'api_url',
|
||||
title: s_('JiraService|Jira API URL'),
|
||||
help: s_('JiraService|If different from Web URL.')
|
||||
},
|
||||
{
|
||||
section: SECTION_TYPE_CONNECTION,
|
||||
type: 'text',
|
||||
name: 'username',
|
||||
title: s_('JiraService|Username or Email'),
|
||||
|
|
@ -151,6 +154,7 @@ module Integrations
|
|||
required: true
|
||||
},
|
||||
{
|
||||
section: SECTION_TYPE_CONNECTION,
|
||||
type: 'password',
|
||||
name: 'password',
|
||||
title: s_('JiraService|Password or API token'),
|
||||
|
|
@ -162,6 +166,16 @@ module Integrations
|
|||
]
|
||||
end
|
||||
|
||||
def sections
|
||||
[
|
||||
{
|
||||
type: SECTION_TYPE_CONNECTION,
|
||||
title: s_('Integrations|Connection details'),
|
||||
description: help
|
||||
}
|
||||
].freeze
|
||||
end
|
||||
|
||||
def web_url(path = nil, **params)
|
||||
return '' unless url.present?
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,6 @@
|
|||
class ReleasePresenter < Gitlab::View::Presenter::Delegated
|
||||
presents ::Release, as: :release
|
||||
|
||||
# TODO: Remove `delegate` as it's redundant due to SimpleDelegator.
|
||||
delegator_override :tag, :project
|
||||
delegate :project, :tag, to: :release
|
||||
|
||||
def commit_path
|
||||
return unless release.commit && can_download_code?
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class ServiceFieldEntity < Grape::Entity
|
|||
include RequestAwareEntity
|
||||
include Gitlab::Utils::StrongMemoize
|
||||
|
||||
expose :type, :name, :placeholder, :required, :choices, :checkbox_label
|
||||
expose :section, :type, :name, :placeholder, :required, :choices, :checkbox_label
|
||||
|
||||
expose :title do |field|
|
||||
non_empty_password?(field) ? field[:non_empty_password_title] : field[:title]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
name: integration_form_sections
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80712
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/352827
|
||||
milestone: '14.9'
|
||||
type: development
|
||||
group: group::integrations
|
||||
default_enabled: false
|
||||
|
|
@ -50,11 +50,13 @@ There are two kinds of events logged:
|
|||
|
||||
When a user is being [impersonated](../user/admin_area/index.md#user-impersonation), their actions are logged as audit events as usual, with two additional details:
|
||||
|
||||
1. Usual audit events include information about the impersonating administrator. These are visible in their respective Audit Event pages depending on their type (Group/Project/User).
|
||||
1. Extra audit events are recorded for the start and stop of the administrator's impersonation session. These are visible in
|
||||
the:
|
||||
1. Usual audit events include information about the impersonating administrator. These audit events are visible in their
|
||||
respective audit event pages depending on their type (group, project, or user).
|
||||
1. Extra audit events are recorded for the start and stop of the administrator's impersonation session. These audit events
|
||||
are visible in the:
|
||||
- Instance audit events.
|
||||
- Group audit events for all groups the user belongs to (GitLab 14.8 and later). This is limited to 20 groups for performance reasons.
|
||||
- Group audit events for all groups the user belongs to (GitLab 14.8 and later). For performance reasons, group audit
|
||||
events are limited to the oldest 20 groups to which you belong.
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ Starting 30 days before a subscription expires, GitLab notifies administrators o
|
|||
|
||||
We recommend following these steps during renewal:
|
||||
|
||||
1. Prune any inactive or unwanted users by [blocking them](../../user/admin_area/moderate_users.md#block-a-user).
|
||||
1. Prior to the renewal date, prune any inactive or unwanted users by [blocking them](../../user/admin_area/moderate_users.md#block-a-user).
|
||||
1. Determine if you have a need for user growth in the upcoming subscription.
|
||||
1. Log in to the [Customers Portal](https://customers.gitlab.com/customers/sign_in) and select the **Renew** button beneath your existing subscription.
|
||||
The **Renew** button remains disabled (grayed-out) until 15 days before a subscription expires.
|
||||
|
|
|
|||
|
|
@ -17,10 +17,6 @@ following methods:
|
|||
- Press <kbd>?</kbd>.
|
||||
- In the Help menu in the top right of the application, select **Keyboard shortcuts**.
|
||||
|
||||
In [GitLab 12.8 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/22113),
|
||||
you can disable keyboard shortcuts by using the **Keyboard shortcuts** toggle
|
||||
at the top of the keyboard shortcut window.
|
||||
|
||||
Although [global shortcuts](#global-shortcuts) work from any area of GitLab,
|
||||
you must be in specific pages for the other shortcuts to be available, as
|
||||
explained in each section.
|
||||
|
|
@ -43,19 +39,19 @@ These shortcuts are available in most areas of GitLab:
|
|||
| <kbd>Shift</kbd> + <kbd>t</kbd> | Go to your To-Do List page. |
|
||||
| <kbd>p</kbd> + <kbd>b</kbd> | Show or hide the Performance Bar. |
|
||||
| <kbd>g</kbd> + <kbd>x</kbd> | Toggle between [GitLab](https://gitlab.com/) and [GitLab Next](https://next.gitlab.com/) (GitLab SaaS only). |
|
||||
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/index.md). |
|
||||
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/index.md). |
|
||||
|
||||
Additionally, the following shortcuts are available when editing text in text
|
||||
fields (for example, comments, replies, issue descriptions, and merge request
|
||||
descriptions):
|
||||
|
||||
| Keyboard shortcut | Description |
|
||||
|---------------------------------------------------------------------------|-------------|
|
||||
| <kbd>↑</kbd> | Edit your last comment. You must be in a blank text field below a thread, and you must already have at least one comment in the thread. |
|
||||
| <kbd>⌘</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | Toggle Markdown preview when editing text in a text field that has **Write** and **Preview** tabs at the top. |
|
||||
| <kbd>⌘</kbd> (Mac) / <kbd>Control</kbd> + <kbd>b</kbd> | Bold the selected text (surround it with `**`). |
|
||||
| <kbd>⌘</kbd> (Mac) / <kbd>Control</kbd> + <kbd>i</kbd> | Italicize the selected text (surround it with `_`). |
|
||||
| <kbd>⌘</kbd> (Mac) / <kbd>Control</kbd> + <kbd>k</kbd> | Add a link (surround the selected text with `[]()`). |
|
||||
| macOS shortcut | Windows shortcut | Description |
|
||||
|----------------|------------------|-------------|
|
||||
| <kbd>↑</kbd> | <kbd>↑</kbd> | Edit your last comment. You must be in a blank text field below a thread, and you must already have at least one comment in the thread. |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> | Toggle Markdown preview when editing text in a text field that has **Write** and **Preview** tabs at the top. |
|
||||
| <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold the selected text (surround it with `**`). |
|
||||
| <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italicize the selected text (surround it with `_`). |
|
||||
| <kbd>Command</kbd> + <kbd>k</kbd> | <kbd>Control</kbd> + <kbd>k</kbd> | Add a link (surround the selected text with `[]()`). |
|
||||
|
||||
The shortcuts for editing in text fields are always enabled, even if other
|
||||
keyboard shortcuts are disabled.
|
||||
|
|
@ -102,7 +98,7 @@ These shortcuts are available when viewing issues and [merge requests](project/m
|
|||
| <kbd>]</kbd> or <kbd>j</kbd> | Move to next file (merge requests only). |
|
||||
| <kbd>[</kbd> or <kbd>k</kbd> | Move to previous file (merge requests only). |
|
||||
| <kbd>b</kbd> | Copy source branch name (merge requests only). |
|
||||
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/index.md). |
|
||||
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/index.md). |
|
||||
|
||||
### Project files
|
||||
|
||||
|
|
@ -113,7 +109,7 @@ These shortcuts are available when browsing the files in a project (go to
|
|||
|-------------------|-------------|
|
||||
| <kbd>↑</kbd> | Move selection up. |
|
||||
| <kbd>↓</kbd> | Move selection down. |
|
||||
| <kbd>enter</kbd> | Open selection. |
|
||||
| <kbd>Enter</kbd> | Open selection. |
|
||||
| <kbd>Escape</kbd> | Go back to file list screen (only while searching for files, **Repository > Files**, then select **Find File**). |
|
||||
| <kbd>y</kbd> | Go to file permalink (only while viewing a file). |
|
||||
| <kbd>.</kbd> | Open the [Web IDE](project/web_ide/index.md). |
|
||||
|
|
@ -122,15 +118,15 @@ These shortcuts are available when browsing the files in a project (go to
|
|||
|
||||
These shortcuts are available when editing a file with the [Web IDE](project/web_ide/index.md):
|
||||
|
||||
| Keyboard shortcut | Description |
|
||||
|------------------------------------------------------------|-------------|
|
||||
| <kbd>⌘</kbd> (Mac) / <kbd>Control</kbd> + <kbd>p</kbd> | Search for, and then open another file for editing. |
|
||||
| <kbd>⌘</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Enter</kbd> | Commit (when editing the commit message). |
|
||||
| macOS shortcut | Windows shortcut | Description |
|
||||
|---------------------------------|---------------------|-------------|
|
||||
| <kbd>Command</kbd> + <kbd>p</kbd> | <kbd>Control</kbd> + <kbd>p</kbd> | Search for, and then open another file for editing. |
|
||||
| <kbd>Command</kbd> + <kbd>Enter</kbd> | <kbd>Control</kbd> + <kbd>Enter</kbd> | Commit (when editing the commit message). |
|
||||
|
||||
### Repository graph
|
||||
|
||||
These shortcuts are available when viewing the project [repository graph](project/repository/index.md#repository-history-graph)
|
||||
page (navigate to **Repository > Graph**):
|
||||
page (go to **Repository > Graph**):
|
||||
|
||||
| Keyboard shortcut | Description |
|
||||
|--------------------------------------------------------------------|-------------|
|
||||
|
|
@ -151,63 +147,64 @@ This shortcut is available when viewing a [wiki page](project/wiki/index.md):
|
|||
|
||||
### Content editor
|
||||
|
||||
These shortcuts are available when editing a file with the [Content Editor](https://about.gitlab.com/direction/create/editor/content_editor/):
|
||||
These shortcuts are available when editing a file with the
|
||||
[Content Editor](https://about.gitlab.com/direction/create/editor/content_editor/):
|
||||
|
||||
| Keyboard shortcut | Description |
|
||||
|-------------------|-------------|
|
||||
| <kbd>⌘</kbd> + <kbd>C</kbd> (Mac) / <kbd>Control</kbd> + <kbd>C</kbd> | Copy |
|
||||
| <kbd>⌘</kbd> + <kbd>X</kbd> (Mac) / <kbd>Control</kbd> + <kbd>X</kbd> | Cut |
|
||||
| <kbd>⌘</kbd> + <kbd>V</kbd> (Mac) / <kbd>Control</kbd> + <kbd>V</kbd> | Paste |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | Paste without formatting |
|
||||
| <kbd>⌘</kbd> + <kbd>Z</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Z</kbd> | Undo |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | Redo |
|
||||
| <kbd>Shift</kbd> + <kbd>Enter</kbd> | Add a line break |
|
||||
| macOS shortcut | Windows shortcut | Description |
|
||||
|----------------|------------------|-------------|
|
||||
| <kbd>Command</kbd> + <kbd>C</kbd> | <kbd>Control</kbd> + <kbd>C</kbd> | Copy |
|
||||
| <kbd>Command</kbd> + <kbd>X</kbd> | <kbd>Control</kbd> + <kbd>X</kbd> | Cut |
|
||||
| <kbd>Command</kbd> + <kbd>V</kbd> | <kbd>Control</kbd> + <kbd>V</kbd> | Paste |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | Paste without formatting |
|
||||
| <kbd>Command</kbd> + <kbd>Z</kbd> | <kbd>Control</kbd> + <kbd>Z</kbd> | Undo |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | Redo |
|
||||
| <kbd>Shift</kbd> + <kbd>Enter</kbd> | <kbd>Shift</kbd> + <kbd>Enter</kbd> | Add a line break |
|
||||
|
||||
#### Formatting
|
||||
|
||||
| Mac | Windows/Linux | Description |
|
||||
|-----|---------------|-------------|
|
||||
| <kbd>⌘</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold |
|
||||
| <kbd>⌘</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italic |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | Strikethrough |
|
||||
| <kbd>⌘</kbd> + <kbd>e</kbd> | <kbd>Control</kbd> + <kbd>e</kbd> | Code |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | Apply normal text style |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | Apply heading style 1 |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>2</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>2</kbd> | Apply heading style 2 |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>3</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>3</kbd> | Apply heading style 3 |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>4</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>4</kbd> | Apply heading style 4 |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>5</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>5</kbd> | Apply heading style 5 |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>6</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>6</kbd> | Apply heading style 6 |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | Ordered list |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | Bullet list |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | Task list |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>b</kbd> | Blockquote |
|
||||
| <kbd>⌘</kbd> + <kbd>Alt</kbd> + <kbd>c</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>c</kbd> | Code block |
|
||||
| <kbd>⌘</kbd> + <kbd>,</kbd> | <kbd>Control</kbd> + <kbd>,</kbd> | Subscript |
|
||||
| <kbd>⌘</kbd> + <kbd>.</kbd> | <kbd>Control</kbd> + <kbd>,</kbd> | Superscript |
|
||||
| <kbd>Tab</kbd> | | Indent list |
|
||||
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | | Outdent list |
|
||||
| macOS shortcut | Windows/Linux shortcut | Description |
|
||||
|----------------|------------------------|-------------|
|
||||
| <kbd>Command</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>b</kbd> | Bold |
|
||||
| <kbd>Command</kbd> + <kbd>i</kbd> | <kbd>Control</kbd> + <kbd>i</kbd> | Italic |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | Strikethrough |
|
||||
| <kbd>Command</kbd> + <kbd>e</kbd> | <kbd>Control</kbd> + <kbd>e</kbd> | Code |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>0</kbd> | Apply normal text style |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>1</kbd> | Apply heading style 1 |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>2</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>2</kbd> | Apply heading style 2 |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>3</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>3</kbd> | Apply heading style 3 |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>4</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>4</kbd> | Apply heading style 4 |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>5</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>5</kbd> | Apply heading style 5 |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>6</kbd> | <kbd>Control</kbd> + <kbd>Alt</kbd> + <kbd>6</kbd> | Apply heading style 6 |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>7</kbd> | Ordered list |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>8</kbd> | Bullet list |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>9</kbd> | Task list |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>b</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>b</kbd> | Blockquote |
|
||||
| <kbd>Command</kbd> + <kbd>Alt</kbd> + <kbd>c</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>c</kbd> | Code block |
|
||||
| <kbd>Command</kbd> + <kbd>,</kbd> | <kbd>Control</kbd> + <kbd>,</kbd> | Subscript |
|
||||
| <kbd>Command</kbd> + <kbd>.</kbd> | <kbd>Control</kbd> + <kbd>.</kbd> | Superscript |
|
||||
| <kbd>Tab</kbd> | <kbd>Tab</kbd> | Indent list |
|
||||
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | <kbd>Shift</kbd> + <kbd>Tab</kbd> | Outdent list |
|
||||
|
||||
#### Text selection
|
||||
|
||||
| Keyboard shortcut | Description |
|
||||
|-------------------|-------------|
|
||||
| <kbd>⌘</kbd> + <kbd>a</kbd> (Mac) / <kbd>Control</kbd> + <kbd>a</kbd> | Select all |
|
||||
| <kbd>Shift</kbd> + <kbd>←</kbd> | Extend selection one character to left |
|
||||
| <kbd>Shift</kbd> + <kbd>→</kbd> | Extend selection one character to right |
|
||||
| <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection one line up |
|
||||
| <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection one line down |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection to the beginning of the document |
|
||||
| <kbd>⌘</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> (Mac) / <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection to the end of the document |
|
||||
| macOS shortcut | Windows shortcut | Description |
|
||||
|----------------|------------------|-------------|
|
||||
| <kbd>Command</kbd> + <kbd>a</kbd> | <kbd>Control</kbd> + <kbd>a</kbd> | Select all |
|
||||
| <kbd>Shift</kbd> + <kbd>←</kbd> | <kbd>Shift</kbd> + <kbd>←</kbd> | Extend selection one character to left |
|
||||
| <kbd>Shift</kbd> + <kbd>→</kbd> | <kbd>Shift</kbd> + <kbd>→</kbd> | Extend selection one character to right |
|
||||
| <kbd>Shift</kbd> + <kbd>↑</kbd> | <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection one line up |
|
||||
| <kbd>Shift</kbd> + <kbd>↓</kbd> | <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection one line down |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↑</kbd> | Extend selection to the beginning of the document |
|
||||
| <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | <kbd>Control</kbd> + <kbd>Shift</kbd> + <kbd>↓</kbd> | Extend selection to the end of the document |
|
||||
|
||||
### Filtered search
|
||||
|
||||
These shortcuts are available when using a [filtered search input](search/index.md):
|
||||
|
||||
| Keyboard shortcut | Description |
|
||||
|--------------------------------------------------------|-------------|
|
||||
| <kbd>⌘</kbd> (Mac) + <kbd>⌫</kbd> | Clear entire search filter. |
|
||||
| <kbd>⌥</kbd> (Mac) / <kbd>Control</kbd> + <kbd>⌫</kbd> | Clear one token at a time. |
|
||||
| macOS shortcut | Windows shortcut | Description |
|
||||
|----------------------|----------------------------------------|-------------|
|
||||
| <kbd>Command</kbd> | <kbd>Delete</kbd> | Clear entire search filter. |
|
||||
| <kbd>Option</kbd> | <kbd>Control</kbd> + <kbd>Delete</kbd> | Clear one token at a time. |
|
||||
|
||||
## Epics **(PREMIUM)**
|
||||
|
||||
|
|
@ -218,3 +215,13 @@ These shortcuts are available when viewing [epics](group/epics/index.md):
|
|||
| <kbd>r</kbd> | Start writing a comment. Pre-selected text is quoted in the comment. Can't be used to reply in a thread. |
|
||||
| <kbd>e</kbd> | Edit description. |
|
||||
| <kbd>l</kbd> | Change label. |
|
||||
|
||||
## Disable keyboard shortcuts
|
||||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/22113) in GitLab 12.8.
|
||||
|
||||
To disable keyboard shortcuts:
|
||||
|
||||
1. While viewing a page that supports keyboard shortcuts, and outside a text box,
|
||||
press <kbd>?</kbd> to display the list of shortcuts.
|
||||
1. Select **Toggle shortcuts**.
|
||||
|
|
|
|||
|
|
@ -16,13 +16,15 @@ module Gitlab
|
|||
:div,
|
||||
class: 'gl-form-checkbox custom-control custom-checkbox'
|
||||
) do
|
||||
value = checkbox_options[:multiple] ? checked_value : nil
|
||||
|
||||
@template.check_box(
|
||||
@object_name,
|
||||
method,
|
||||
format_options(checkbox_options, ['custom-control-input']),
|
||||
checked_value,
|
||||
unchecked_value
|
||||
) + generic_label(method, label, label_options, help_text: help_text)
|
||||
) + generic_label(method, label, label_options, help_text: help_text, value: value)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19681,6 +19681,9 @@ msgstr ""
|
|||
msgid "Integrations|Comment settings:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Integrations|Connection details"
|
||||
msgstr ""
|
||||
|
||||
msgid "Integrations|Connection failed. Please check your settings."
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -20932,7 +20935,7 @@ msgstr ""
|
|||
msgid "JiraService|Work on Jira issues without leaving GitLab. Adds a Jira menu to access your list of Jira issues and view any issue as read-only."
|
||||
msgstr ""
|
||||
|
||||
msgid "JiraService|You need to configure Jira before enabling this integration. For more details, read the %{jira_doc_link_start}Jira integration documentation%{link_end}."
|
||||
msgid "JiraService|You must configure Jira before enabling this integration. For more details, read the %{jira_doc_link_start}Jira integration documentation%{link_end}."
|
||||
msgstr ""
|
||||
|
||||
msgid "Job"
|
||||
|
|
|
|||
|
|
@ -154,6 +154,20 @@ describe('WikiForm', () => {
|
|||
expect(findContent().element.value).toBe(' My page content ');
|
||||
});
|
||||
|
||||
it.each`
|
||||
format | enabled | action
|
||||
${'markdown'} | ${true} | ${'displays'}
|
||||
${'rdoc'} | ${false} | ${'hides'}
|
||||
${'asciidoc'} | ${false} | ${'hides'}
|
||||
${'org'} | ${false} | ${'hides'}
|
||||
`('$action preview in the markdown field when format is $format', async ({ format, enabled }) => {
|
||||
createWrapper();
|
||||
|
||||
await setFormat(format);
|
||||
|
||||
expect(findClassicEditor().props('enablePreview')).toBe(enabled);
|
||||
});
|
||||
|
||||
it.each`
|
||||
value | text
|
||||
${'markdown'} | ${'[Link Title](page-slug)'}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ exports[`Snippet Description Edit component rendering matches the snapshot 1`] =
|
|||
>
|
||||
<markdown-header-stub
|
||||
data-testid="markdownHeader"
|
||||
enablepreview="true"
|
||||
linecontent=""
|
||||
suggestionstartindex="0"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import $ from 'jquery';
|
|||
import { TEST_HOST, FIXTURES_PATH } from 'spec/test_constants';
|
||||
import axios from '~/lib/utils/axios_utils';
|
||||
import MarkdownField from '~/vue_shared/components/markdown/field.vue';
|
||||
import MarkdownFieldHeader from '~/vue_shared/components/markdown/header.vue';
|
||||
import { mountExtended } from 'helpers/vue_test_utils_helper';
|
||||
|
||||
const markdownPreviewPath = `${TEST_HOST}/preview`;
|
||||
|
|
@ -32,7 +33,7 @@ describe('Markdown field component', () => {
|
|||
axiosMock.restore();
|
||||
});
|
||||
|
||||
function createSubject(lines = []) {
|
||||
function createSubject({ lines = [], enablePreview = true } = {}) {
|
||||
// We actually mount a wrapper component so that we can force Vue to rerender classes in order to test a regression
|
||||
// caused by mixing Vanilla JS and Vue.
|
||||
subject = mountExtended(
|
||||
|
|
@ -61,6 +62,7 @@ describe('Markdown field component', () => {
|
|||
isSubmitting: false,
|
||||
textareaValue,
|
||||
lines,
|
||||
enablePreview,
|
||||
},
|
||||
provide: {
|
||||
glFeatures: {
|
||||
|
|
@ -272,11 +274,22 @@ describe('Markdown field component', () => {
|
|||
|
||||
describe('suggestions', () => {
|
||||
it('escapes new line characters', () => {
|
||||
createSubject([{ rich_text: 'hello world\\n' }]);
|
||||
createSubject({ lines: [{ rich_text: 'hello world\\n' }] });
|
||||
|
||||
expect(subject.find('[data-testid="markdownHeader"]').props('lineContent')).toBe(
|
||||
'hello world%br',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('allows enabling and disabling Markdown Preview', () => {
|
||||
createSubject({ enablePreview: false });
|
||||
|
||||
expect(subject.findComponent(MarkdownFieldHeader).props('enablePreview')).toBe(false);
|
||||
|
||||
subject.destroy();
|
||||
createSubject({ enablePreview: true });
|
||||
|
||||
expect(subject.findComponent(MarkdownFieldHeader).props('enablePreview')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -157,4 +157,12 @@ describe('Markdown field header component', () => {
|
|||
|
||||
expect(wrapper.find('.js-suggestion-btn').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('hides preview tab when previewMarkdown property is false', () => {
|
||||
createWrapper({
|
||||
enablePreview: false,
|
||||
});
|
||||
|
||||
expect(wrapper.findByTestId('preview-tab').exists()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ RSpec.describe Gitlab::Auth::OAuth::Provider do
|
|||
|
||||
context 'for an OmniAuth provider' do
|
||||
before do
|
||||
provider = OpenStruct.new(
|
||||
provider = ActiveSupport::InheritableOptions.new(
|
||||
name: 'google_oauth2',
|
||||
app_id: 'asd123',
|
||||
app_secret: 'asd123'
|
||||
|
|
@ -74,7 +74,7 @@ RSpec.describe Gitlab::Auth::OAuth::Provider do
|
|||
subject { described_class.config_for('google_oauth2') }
|
||||
|
||||
it 'returns the config' do
|
||||
expect(subject).to be_a(OpenStruct)
|
||||
expect(subject).to be_a(ActiveSupport::InheritableOptions)
|
||||
end
|
||||
|
||||
it 'merges defaults with the given configuration' do
|
||||
|
|
@ -98,7 +98,7 @@ RSpec.describe Gitlab::Auth::OAuth::Provider do
|
|||
context 'when configuration specifies a custom label' do
|
||||
let(:name) { 'google_oauth2' }
|
||||
let(:label) { 'Custom Google Provider' }
|
||||
let(:provider) { OpenStruct.new({ 'name' => name, 'label' => label }) }
|
||||
let(:provider) { ActiveSupport::InheritableOptions.new(name: name, label: label) }
|
||||
|
||||
before do
|
||||
stub_omniauth_setting(providers: [provider])
|
||||
|
|
@ -110,7 +110,7 @@ RSpec.describe Gitlab::Auth::OAuth::Provider do
|
|||
end
|
||||
|
||||
context 'when configuration does not specify a custom label' do
|
||||
let(:provider) { OpenStruct.new({ 'name' => name } ) }
|
||||
let(:provider) { ActiveSupport::InheritableOptions.new(name: name) }
|
||||
|
||||
before do
|
||||
stub_omniauth_setting(providers: [provider])
|
||||
|
|
|
|||
|
|
@ -78,6 +78,29 @@ RSpec.describe Gitlab::FormBuilders::GitlabUiFormBuilder do
|
|||
expect(fake_template).to have_received(:label).with(:user, :view_diffs_file_by_file, { class: %w(custom-control-label label-foo-bar), object: user, value: nil })
|
||||
end
|
||||
end
|
||||
|
||||
context 'with checkbox_options: { multiple: true }' do
|
||||
let(:optional_args) do
|
||||
{
|
||||
checkbox_options: { multiple: true },
|
||||
checked_value: 'one',
|
||||
unchecked_value: false
|
||||
}
|
||||
end
|
||||
|
||||
it 'renders labels with correct for attributes' do
|
||||
expected_html = <<~EOS
|
||||
<div class="gl-form-checkbox custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" value="one" name="user[view_diffs_file_by_file][]" id="user_view_diffs_file_by_file_one" />
|
||||
<label class="custom-control-label" for="user_view_diffs_file_by_file_one">
|
||||
Show one file at a time on merge request's Changes tab
|
||||
</label>
|
||||
</div>
|
||||
EOS
|
||||
|
||||
expect(checkbox_html).to eq(html_strip_whitespace(expected_html))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#gitlab_ui_radio_component' do
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ RSpec.describe ServiceFieldEntity do
|
|||
|
||||
it 'exposes correct attributes' do
|
||||
expected_hash = {
|
||||
section: 'connection',
|
||||
type: 'text',
|
||||
name: 'username',
|
||||
title: 'Username or Email',
|
||||
|
|
@ -40,6 +41,7 @@ RSpec.describe ServiceFieldEntity do
|
|||
|
||||
it 'exposes correct attributes but hides password' do
|
||||
expected_hash = {
|
||||
section: 'connection',
|
||||
type: 'password',
|
||||
name: 'password',
|
||||
title: 'Enter new password or API token',
|
||||
|
|
@ -64,6 +66,7 @@ RSpec.describe ServiceFieldEntity do
|
|||
|
||||
it 'exposes correct attributes and casts value to Boolean' do
|
||||
expected_hash = {
|
||||
section: nil,
|
||||
type: 'checkbox',
|
||||
name: 'send_from_committer_email',
|
||||
title: 'Send from committer',
|
||||
|
|
@ -84,6 +87,7 @@ RSpec.describe ServiceFieldEntity do
|
|||
|
||||
it 'exposes correct attributes' do
|
||||
expected_hash = {
|
||||
section: nil,
|
||||
type: 'select',
|
||||
name: 'branches_to_be_notified',
|
||||
title: 'Branches for which notifications are to be sent',
|
||||
|
|
|
|||
Loading…
Reference in New Issue