Commit 845623af authored by Brett Walker's avatar Brett Walker

Update deckar01-task_list gem to 2.2.1

This fixes issue where a task list with only spaces
as the text would incorrectly be detected in the source
as a task list item and get checked incorrectly.
parent 1040979b
...@@ -136,7 +136,7 @@ gem 'faraday_middleware-aws-signers-v4' ...@@ -136,7 +136,7 @@ gem 'faraday_middleware-aws-signers-v4'
# Markdown and HTML processing # Markdown and HTML processing
gem 'html-pipeline', '~> 2.8' gem 'html-pipeline', '~> 2.8'
gem 'deckar01-task_list', '2.2.0' gem 'deckar01-task_list', '2.2.1'
gem 'gitlab-markup', '~> 1.7.0' gem 'gitlab-markup', '~> 1.7.0'
gem 'github-markup', '~> 1.7.0', require: 'github/markup' gem 'github-markup', '~> 1.7.0', require: 'github/markup'
gem 'commonmarker', '~> 0.17' gem 'commonmarker', '~> 0.17'
......
...@@ -194,7 +194,7 @@ GEM ...@@ -194,7 +194,7 @@ GEM
database_cleaner (1.7.0) database_cleaner (1.7.0)
debug_inspector (0.0.3) debug_inspector (0.0.3)
debugger-ruby_core_source (1.3.8) debugger-ruby_core_source (1.3.8)
deckar01-task_list (2.2.0) deckar01-task_list (2.2.1)
html-pipeline html-pipeline
declarative (0.0.10) declarative (0.0.10)
declarative-option (0.1.0) declarative-option (0.1.0)
...@@ -603,7 +603,7 @@ GEM ...@@ -603,7 +603,7 @@ GEM
netrc (0.11.0) netrc (0.11.0)
nio4r (2.3.1) nio4r (2.3.1)
no_proxy_fix (0.1.2) no_proxy_fix (0.1.2)
nokogiri (1.10.4) nokogiri (1.10.5)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
nokogumbo (1.5.0) nokogumbo (1.5.0)
nokogiri nokogiri
...@@ -1127,7 +1127,7 @@ DEPENDENCIES ...@@ -1127,7 +1127,7 @@ DEPENDENCIES
creole (~> 0.5.0) creole (~> 0.5.0)
danger (~> 6.0) danger (~> 6.0)
database_cleaner (~> 1.7.0) database_cleaner (~> 1.7.0)
deckar01-task_list (= 2.2.0) deckar01-task_list (= 2.2.1)
default_value_for (~> 3.3.0) default_value_for (~> 3.3.0)
derailed_benchmarks derailed_benchmarks
device_detector device_detector
......
---
title: Fix checking task item when previous tasks contain only spaces
merge_request: 19724
author:
type: fixed
...@@ -8,7 +8,23 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont ...@@ -8,7 +8,23 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} let(:namespace) { create(:namespace, name: 'frontend-fixtures' )}
let(:project) { create(:project, :repository, namespace: namespace, path: 'merge-requests-project') } let(:project) { create(:project, :repository, namespace: namespace, path: 'merge-requests-project') }
let(:merge_request) { create(:merge_request, :with_diffs, source_project: project, target_project: project, description: '- [ ] Task List Item') }
# rubocop: disable Layout/TrailingWhitespace
let(:merge_request) do
create(
:merge_request,
:with_diffs,
source_project: project,
target_project: project,
description: <<~MARKDOWN.strip_heredoc
- [ ] Task List Item
- [ ]
- [ ] Task List Item 2
MARKDOWN
)
end
# rubocop: enable Layout/TrailingWhitespace
let(:merged_merge_request) { create(:merge_request, :merged, source_project: project, target_project: project) } let(:merged_merge_request) { create(:merge_request, :merged, source_project: project, target_project: project) }
let(:pipeline) do let(:pipeline) do
create( create(
......
/* eslint-disable no-return-assign */
import $ from 'jquery'; import $ from 'jquery';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -22,7 +20,8 @@ describe('MergeRequest', function() { ...@@ -22,7 +20,8 @@ describe('MergeRequest', function() {
.onPatch(`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`) .onPatch(`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`)
.reply(200, {}); .reply(200, {});
return (this.merge = new MergeRequest()); this.merge = new MergeRequest();
return this.merge;
}); });
afterEach(() => { afterEach(() => {
...@@ -34,10 +33,30 @@ describe('MergeRequest', function() { ...@@ -34,10 +33,30 @@ describe('MergeRequest', function() {
const changeEvent = document.createEvent('HTMLEvents'); const changeEvent = document.createEvent('HTMLEvents');
changeEvent.initEvent('change', true, true); changeEvent.initEvent('change', true, true);
$('input[type=checkbox]') $('input[type=checkbox]')
.first()
.attr('checked', true)[0]
.dispatchEvent(changeEvent);
setTimeout(() => {
expect($('.js-task-list-field').val()).toBe(
'- [x] Task List Item\n- [ ] \n- [ ] Task List Item 2\n',
);
done();
});
});
it('ensure that task with only spaces does not get checked incorrectly', done => {
// fixed in 'deckar01-task_list', '2.2.1' gem
spyOn($, 'ajax').and.stub();
const changeEvent = document.createEvent('HTMLEvents');
changeEvent.initEvent('change', true, true);
$('input[type=checkbox]')
.last()
.attr('checked', true)[0] .attr('checked', true)[0]
.dispatchEvent(changeEvent); .dispatchEvent(changeEvent);
setTimeout(() => { setTimeout(() => {
expect($('.js-task-list-field').val()).toBe('- [x] Task List Item'); expect($('.js-task-list-field').val()).toBe(
'- [ ] Task List Item\n- [ ] \n- [x] Task List Item 2\n',
);
done(); done();
}); });
}); });
...@@ -59,7 +78,7 @@ describe('MergeRequest', function() { ...@@ -59,7 +78,7 @@ describe('MergeRequest', function() {
`${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`, `${gl.TEST_HOST}/frontend-fixtures/merge-requests-project/merge_requests/1.json`,
{ {
merge_request: { merge_request: {
description: '- [ ] Task List Item', description: '- [ ] Task List Item\n- [ ] \n- [ ] Task List Item 2\n',
lock_version: 0, lock_version: 0,
update_task: { line_number: lineNumber, line_source: lineSource, index, checked }, update_task: { line_number: lineNumber, line_source: lineSource, index, checked },
}, },
......
...@@ -3475,7 +3475,7 @@ d3@^4.13.0: ...@@ -3475,7 +3475,7 @@ d3@^4.13.0:
d3-voronoi "1.1.2" d3-voronoi "1.1.2"
d3-zoom "1.7.1" d3-zoom "1.7.1"
d3@^5.12: d3@^5.12, d3@^5.7.0:
version "5.12.0" version "5.12.0"
resolved "https://registry.yarnpkg.com/d3/-/d3-5.12.0.tgz#0ddeac879c28c882317cd439b495290acd59ab61" resolved "https://registry.yarnpkg.com/d3/-/d3-5.12.0.tgz#0ddeac879c28c882317cd439b495290acd59ab61"
integrity sha512-flYVMoVuhPFHd9zVCe2BxIszUWqBcd5fvQGMNRmSiBrgdnh6Vlruh60RJQTouAK9xPbOB0plxMvBm4MoyODXNg== integrity sha512-flYVMoVuhPFHd9zVCe2BxIszUWqBcd5fvQGMNRmSiBrgdnh6Vlruh60RJQTouAK9xPbOB0plxMvBm4MoyODXNg==
...@@ -3512,43 +3512,6 @@ d3@^5.12: ...@@ -3512,43 +3512,6 @@ d3@^5.12:
d3-voronoi "1" d3-voronoi "1"
d3-zoom "1" d3-zoom "1"
d3@^5.7.0:
version "5.9.2"
resolved "https://registry.yarnpkg.com/d3/-/d3-5.9.2.tgz#64e8a7e9c3d96d9e6e4999d2c8a2c829767e67f5"
integrity sha512-ydrPot6Lm3nTWH+gJ/Cxf3FcwuvesYQ5uk+j/kXEH/xbuYWYWTMAHTJQkyeuG8Y5WM5RSEYB41EctUrXQQytRQ==
dependencies:
d3-array "1"
d3-axis "1"
d3-brush "1"
d3-chord "1"
d3-collection "1"
d3-color "1"
d3-contour "1"
d3-dispatch "1"
d3-drag "1"
d3-dsv "1"
d3-ease "1"
d3-fetch "1"
d3-force "1"
d3-format "1"
d3-geo "1"
d3-hierarchy "1"
d3-interpolate "1"
d3-path "1"
d3-polygon "1"
d3-quadtree "1"
d3-random "1"
d3-scale "2"
d3-scale-chromatic "1"
d3-selection "1"
d3-shape "1"
d3-time "1"
d3-time-format "2"
d3-timer "1"
d3-transition "1"
d3-voronoi "1"
d3-zoom "1"
dagre-d3@dagrejs/dagre-d3: dagre-d3@dagrejs/dagre-d3:
version "0.6.4-pre" version "0.6.4-pre"
resolved "https://codeload.github.com/dagrejs/dagre-d3/tar.gz/e1a00e5cb518f5d2304a35647e024f31d178e55b" resolved "https://codeload.github.com/dagrejs/dagre-d3/tar.gz/e1a00e5cb518f5d2304a35647e024f31d178e55b"
...@@ -3643,10 +3606,10 @@ decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: ...@@ -3643,10 +3606,10 @@ decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0:
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
deckar01-task_list@^2.2.0: deckar01-task_list@^2.2.1:
version "2.2.0" version "2.2.1"
resolved "https://registry.yarnpkg.com/deckar01-task_list/-/deckar01-task_list-2.2.0.tgz#5cc3ea06f01d3d786b1a667064a462eb5d069bd3" resolved "https://registry.yarnpkg.com/deckar01-task_list/-/deckar01-task_list-2.2.1.tgz#e1e8a16c4fd6e153e51fd9258fdbee067ebcd86b"
integrity sha512-NUfu5ARoD9SC2k+fBT5cBer59iKfEdawPrmfqp5+zAahTECb8z9dsuS1Xnx7jzFAmCCLnEs3z/aYucYXzNrKkQ== integrity sha512-aNAVYAYwONXezSQy2p5M67wjZE+U7JpPotdegbyy1Wq35V6jDhF3qndJYA1rYnY3aI9ifCep6EMGPav/UQaBZw==
decode-uri-component@^0.2.0: decode-uri-component@^0.2.0:
version "0.2.0" version "0.2.0"
......
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