Commit aa29ece0 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents b2708669 43b6f69c
This diff is collapsed.
......@@ -124,14 +124,14 @@ GEM
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.1)
aws-eventstream (~> 1, >= 1.0.2)
azure-storage-blob (2.0.1)
azure-storage-blob (2.0.3)
azure-storage-common (~> 2.0)
nokogiri (~> 1.11.0.rc2)
azure-storage-common (2.0.2)
nokogiri (~> 1, >= 1.10.8)
azure-storage-common (2.0.4)
faraday (~> 1.0)
faraday_middleware (~> 1.0.0.rc1)
faraday_middleware (~> 1.0, >= 1.0.0.rc1)
net-http-persistent (~> 4.0)
nokogiri (~> 1.11.0.rc2)
nokogiri (~> 1, >= 1.10.8)
babosa (1.0.4)
backport (1.2.0)
base32 (0.3.2)
......
......@@ -35,31 +35,33 @@ const trackInputRule = (contentType, inputRule) => {
};
const trackInputRulesAndShortcuts = (tiptapExtension) => {
return tiptapExtension.extend({
addKeyboardShortcuts() {
const shortcuts = this.parent?.() || {};
const { name } = this;
/**
* We don’t want to track keyboard shortcuts
* that are not deliberately executed to create
* new types of content
*/
const dotNotTrackKeys = [ENTER_KEY, BACKSPACE_KEY];
const decorated = mapValues(shortcuts, (commandFn, shortcut) =>
dotNotTrackKeys.includes(shortcut)
? commandFn
: trackKeyboardShortcut(name, commandFn, shortcut),
);
return tiptapExtension
.extend({
addKeyboardShortcuts() {
const shortcuts = this.parent?.() || {};
const { name } = this;
/**
* We don’t want to track keyboard shortcuts
* that are not deliberately executed to create
* new types of content
*/
const dotNotTrackKeys = [ENTER_KEY, BACKSPACE_KEY];
const decorated = mapValues(shortcuts, (commandFn, shortcut) =>
dotNotTrackKeys.includes(shortcut)
? commandFn
: trackKeyboardShortcut(name, commandFn, shortcut),
);
return decorated;
},
addInputRules() {
const inputRules = this.parent?.() || [];
const { name } = this;
return decorated;
},
addInputRules() {
const inputRules = this.parent?.() || [];
const { name } = this;
return inputRules.map((inputRule) => trackInputRule(name, inputRule));
},
});
return inputRules.map((inputRule) => trackInputRule(name, inputRule));
},
})
.configure(tiptapExtension.options);
};
export default trackInputRulesAndShortcuts;
......@@ -22,7 +22,7 @@
.row
.form-group.col-sm-12
= f.label :role, _('Role'), class: 'label-bold'
= f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, {}, class: 'form-control js-user-role-dropdown', autofocus: true
= f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, { include_blank: _('Select a role') }, class: 'form-control js-user-role-dropdown', autofocus: true, required: true
- if Feature.enabled?(:user_other_role_details)
.row
.form-group.col-sm-12.js-other-role-group.hidden
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'Welcome screen', :js do
let_it_be(:user) { create(:user) }
let_it_be(:user) { create(:user, role: nil) }
context 'when on GitLab.com' do
before do
......@@ -18,9 +18,24 @@ RSpec.describe 'Welcome screen', :js do
it 'shows the welcome page' do
expect(page).to have_content('Welcome to GitLab')
expect(page).to have_content('Select a role')
expect(page).to have_content('Continue')
end
it 'has validations' do
click_button 'Continue'
expect(page).to have_field("user_role", valid: false)
expect(page).to have_field("user_setup_for_company_true", valid: false)
page.select('Software Developer', from: 'user_role')
choose 'user_setup_for_company_true'
click_button 'Continue'
expect(page).not_to have_selector('#user_role')
end
it 'allows specifying other for jobs_to_be_done' do
expect(page).not_to have_content('Why are you signing up? (Optional)')
......@@ -32,9 +47,12 @@ RSpec.describe 'Welcome screen', :js do
end
context 'email opt in' do
let(:user) { create(:user, email_opted_in: false) }
it 'does not show the email opt in checkbox when setting up for a company' do
expect(page).not_to have_selector('input[name="user[email_opted_in]', visible: true)
page.select('Software Developer', from: 'user_role')
choose 'user_setup_for_company_true'
expect(page).not_to have_selector('input[name="user[email_opted_in]', visible: true)
......@@ -44,9 +62,10 @@ RSpec.describe 'Welcome screen', :js do
expect(user.reload.email_opted_in).to eq(true)
end
it 'shows the email opt checkbox in when setting up for just me' do
it 'shows the email opt in checkbox when setting up for just me' do
expect(page).not_to have_selector('input[name="user[email_opted_in]', visible: true)
page.select('Software Developer', from: 'user_role')
choose 'user_setup_for_company_false'
expect(page).to have_selector('input[name="user[email_opted_in]', visible: true)
......
......@@ -63,36 +63,36 @@
"@rails/ujs": "6.1.4-1",
"@sentry/browser": "5.30.0",
"@sourcegraph/code-host-integration": "0.0.60",
"@tiptap/core": "^2.0.0-beta.143",
"@tiptap/extension-blockquote": "^2.0.0-beta.25",
"@tiptap/extension-bold": "^2.0.0-beta.24",
"@tiptap/extension-bullet-list": "^2.0.0-beta.23",
"@tiptap/extension-code": "^2.0.0-beta.25",
"@tiptap/extension-code-block-lowlight": "2.0.0-beta.57",
"@tiptap/core": "^2.0.0-beta.160",
"@tiptap/extension-blockquote": "^2.0.0-beta.26",
"@tiptap/extension-bold": "^2.0.0-beta.25",
"@tiptap/extension-bullet-list": "^2.0.0-beta.26",
"@tiptap/extension-code": "^2.0.0-beta.26",
"@tiptap/extension-code-block-lowlight": "2.0.0-beta.63",
"@tiptap/extension-document": "^2.0.0-beta.15",
"@tiptap/extension-dropcursor": "^2.0.0-beta.25",
"@tiptap/extension-gapcursor": "^2.0.0-beta.33",
"@tiptap/extension-gapcursor": "^2.0.0-beta.34",
"@tiptap/extension-hard-break": "^2.0.0-beta.30",
"@tiptap/extension-heading": "^2.0.0-beta.23",
"@tiptap/extension-heading": "^2.0.0-beta.24",
"@tiptap/extension-history": "^2.0.0-beta.21",
"@tiptap/extension-horizontal-rule": "^2.0.0-beta.30",
"@tiptap/extension-image": "^2.0.0-beta.24",
"@tiptap/extension-italic": "^2.0.0-beta.24",
"@tiptap/extension-link": "^2.0.0-beta.28",
"@tiptap/extension-list-item": "^2.0.0-beta.19",
"@tiptap/extension-ordered-list": "^2.0.0-beta.24",
"@tiptap/extension-paragraph": "^2.0.0-beta.22",
"@tiptap/extension-strike": "^2.0.0-beta.26",
"@tiptap/extension-subscript": "^2.0.0-beta.9",
"@tiptap/extension-superscript": "^2.0.0-beta.9",
"@tiptap/extension-table": "^2.0.0-beta.43",
"@tiptap/extension-italic": "^2.0.0-beta.25",
"@tiptap/extension-link": "^2.0.0-beta.34",
"@tiptap/extension-list-item": "^2.0.0-beta.20",
"@tiptap/extension-ordered-list": "^2.0.0-beta.27",
"@tiptap/extension-paragraph": "^2.0.0-beta.23",
"@tiptap/extension-strike": "^2.0.0-beta.27",
"@tiptap/extension-subscript": "^2.0.0-beta.10",
"@tiptap/extension-superscript": "^2.0.0-beta.10",
"@tiptap/extension-table": "^2.0.0-beta.46",
"@tiptap/extension-table-cell": "^2.0.0-beta.20",
"@tiptap/extension-table-header": "^2.0.0-beta.22",
"@tiptap/extension-table-row": "^2.0.0-beta.19",
"@tiptap/extension-task-item": "^2.0.0-beta.29",
"@tiptap/extension-task-list": "^2.0.0-beta.23",
"@tiptap/extension-task-item": "^2.0.0-beta.30",
"@tiptap/extension-task-list": "^2.0.0-beta.26",
"@tiptap/extension-text": "^2.0.0-beta.15",
"@tiptap/vue-2": "^2.0.0-beta.69",
"@tiptap/vue-2": "^2.0.0-beta.74",
"@toast-ui/editor": "^2.5.2",
"@toast-ui/vue-editor": "^2.5.2",
"apollo-cache-inmemory": "^1.6.6",
......@@ -162,11 +162,11 @@
"popper.js": "^1.16.1",
"portal-vue": "^2.1.7",
"prismjs": "^1.21.0",
"prosemirror-markdown": "^1.6.0",
"prosemirror-model": "^1.15.0",
"prosemirror-markdown": "1.6.0",
"prosemirror-model": "^1.16.1",
"prosemirror-state": "^1.3.4",
"prosemirror-tables": "^1.1.1",
"prosemirror-view": "^1.23.3",
"prosemirror-view": "^1.23.5",
"raphael": "^2.2.7",
"raw-loader": "^4.0.2",
"scrollparent": "^2.0.1",
......
......@@ -33,7 +33,7 @@ describe('content_editor/extensions/link', () => {
${'documentation](readme.md'} | ${() => p('documentation](readme.md')}
${'http://example.com '} | ${() => p(link({ href: 'http://example.com' }, 'http://example.com'))}
${'https://example.com '} | ${() => p(link({ href: 'https://example.com' }, 'https://example.com'))}
${'www.example.com '} | ${() => p(link({ href: 'www.example.com' }, 'www.example.com'))}
${'www.example.com '} | ${() => p(link({ href: 'http://www.example.com' }, 'www.example.com'))}
${'example.com/ab.html '} | ${() => p('example.com/ab.html')}
${'https://www.google.com '} | ${() => p(link({ href: 'https://www.google.com' }, 'https://www.google.com'))}
`('with input=$input, then should insert a $insertedNode', ({ input, insertedNode }) => {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment