Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
001c904f
Commit
001c904f
authored
Jun 08, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove inclusive JS imports
parent
421e41c9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
34 deletions
+20
-34
app/assets/javascripts/close_reopen_report_toggle.js
app/assets/javascripts/close_reopen_report_toggle.js
+2
-2
app/assets/javascripts/issue.js
app/assets/javascripts/issue.js
+2
-2
app/assets/javascripts/merge_request.js
app/assets/javascripts/merge_request.js
+2
-2
spec/javascripts/close_reopen_report_toggle_spec.js
spec/javascripts/close_reopen_report_toggle_spec.js
+6
-8
spec/javascripts/issue_spec.js
spec/javascripts/issue_spec.js
+4
-10
spec/javascripts/merge_request_spec.js
spec/javascripts/merge_request_spec.js
+4
-10
No files found.
app/assets/javascripts/close_reopen_report_toggle.js
View file @
001c904f
import
*
as
DropLab
from
'
./droplab/drop_lab
'
;
import
DropLab
from
'
./droplab/drop_lab
'
;
import
ISetter
from
'
./droplab/plugins/input_setter
'
;
import
ISetter
from
'
./droplab/plugins/input_setter
'
;
// Todo: Remove this when fixing issue in input_setter plugin
// Todo: Remove this when fixing issue in input_setter plugin
...
@@ -15,7 +15,7 @@ class CloseReopenReportToggle {
...
@@ -15,7 +15,7 @@ class CloseReopenReportToggle {
this
.
reopenItem
=
this
.
dropdownList
.
querySelector
(
'
.reopen-item
'
);
this
.
reopenItem
=
this
.
dropdownList
.
querySelector
(
'
.reopen-item
'
);
this
.
closeItem
=
this
.
dropdownList
.
querySelector
(
'
.close-item
'
);
this
.
closeItem
=
this
.
dropdownList
.
querySelector
(
'
.close-item
'
);
this
.
droplab
=
new
DropLab
.
default
();
this
.
droplab
=
new
DropLab
();
const
config
=
this
.
setConfig
();
const
config
=
this
.
setConfig
();
...
...
app/assets/javascripts/issue.js
View file @
001c904f
...
@@ -6,7 +6,7 @@ import '~/lib/utils/text_utility';
...
@@ -6,7 +6,7 @@ import '~/lib/utils/text_utility';
import
'
./flash
'
;
import
'
./flash
'
;
import
'
./task_list
'
;
import
'
./task_list
'
;
import
CreateMergeRequestDropdown
from
'
./create_merge_request_dropdown
'
;
import
CreateMergeRequestDropdown
from
'
./create_merge_request_dropdown
'
;
import
*
as
CloseReopenReportToggle
from
'
./close_reopen_report_toggle
'
;
import
CloseReopenReportToggle
from
'
./close_reopen_report_toggle
'
;
class
Issue
{
class
Issue
{
constructor
()
{
constructor
()
{
...
@@ -98,7 +98,7 @@ class Issue {
...
@@ -98,7 +98,7 @@ class Issue {
const
dropdownList
=
container
.
querySelector
(
'
.js-issuable-close-menu
'
);
const
dropdownList
=
container
.
querySelector
(
'
.js-issuable-close-menu
'
);
const
button
=
container
.
querySelector
(
'
.js-issuable-close-button
'
);
const
button
=
container
.
querySelector
(
'
.js-issuable-close-button
'
);
this
.
closeReopenReportToggle
=
new
CloseReopenReportToggle
.
default
({
this
.
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
dropdownTrigger
,
dropdownTrigger
,
dropdownList
,
dropdownList
,
button
,
button
,
...
...
app/assets/javascripts/merge_request.js
View file @
001c904f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
'
vendor/jquery.waitforimages
'
;
import
'
vendor/jquery.waitforimages
'
;
import
'
./task_list
'
;
import
'
./task_list
'
;
import
'
./merge_request_tabs
'
;
import
'
./merge_request_tabs
'
;
import
*
as
CloseReopenReportToggle
from
'
./close_reopen_report_toggle
'
;
import
CloseReopenReportToggle
from
'
./close_reopen_report_toggle
'
;
(
function
()
{
(
function
()
{
this
.
MergeRequest
=
(
function
()
{
this
.
MergeRequest
=
(
function
()
{
...
@@ -130,7 +130,7 @@ import * as CloseReopenReportToggle from './close_reopen_report_toggle';
...
@@ -130,7 +130,7 @@ import * as CloseReopenReportToggle from './close_reopen_report_toggle';
const
dropdownList
=
container
.
querySelector
(
'
.js-issuable-close-menu
'
);
const
dropdownList
=
container
.
querySelector
(
'
.js-issuable-close-menu
'
);
const
button
=
container
.
querySelector
(
'
.js-issuable-close-button
'
);
const
button
=
container
.
querySelector
(
'
.js-issuable-close-button
'
);
const
closeReopenReportToggle
=
new
CloseReopenReportToggle
.
default
({
const
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
dropdownTrigger
,
dropdownTrigger
,
dropdownList
,
dropdownList
,
button
,
button
,
...
...
spec/javascripts/close_reopen_report_toggle_spec.js
View file @
001c904f
import
CloseReopenReportToggle
from
'
~/close_reopen_report_toggle
'
;
import
CloseReopenReportToggle
from
'
~/close_reopen_report_toggle
'
;
import
*
as
DropLab
from
'
~/droplab/drop_lab
'
;
import
DropLab
from
'
~/droplab/drop_lab
'
;
describe
(
'
CloseReopenReportToggle
'
,
()
=>
{
describe
(
'
CloseReopenReportToggle
'
,
()
=>
{
describe
(
'
class constructor
'
,
()
=>
{
describe
(
'
class constructor
'
,
()
=>
{
...
@@ -32,7 +32,6 @@ describe('CloseReopenReportToggle', () => {
...
@@ -32,7 +32,6 @@ describe('CloseReopenReportToggle', () => {
describe
(
'
initDroplab
'
,
()
=>
{
describe
(
'
initDroplab
'
,
()
=>
{
let
closeReopenReportToggle
;
let
closeReopenReportToggle
;
const
dropdownList
=
jasmine
.
createSpyObj
(
'
dropdownList
'
,
[
'
querySelector
'
]);
const
dropdownList
=
jasmine
.
createSpyObj
(
'
dropdownList
'
,
[
'
querySelector
'
]);
const
droplab
=
jasmine
.
createSpyObj
(
'
droplab
'
,
[
'
init
'
]);
const
dropdownTrigger
=
{};
const
dropdownTrigger
=
{};
const
button
=
{};
const
button
=
{};
const
reopenItem
=
{};
const
reopenItem
=
{};
...
@@ -40,7 +39,7 @@ describe('CloseReopenReportToggle', () => {
...
@@ -40,7 +39,7 @@ describe('CloseReopenReportToggle', () => {
const
config
=
{};
const
config
=
{};
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
DropLab
,
'
default
'
).
and
.
returnValue
(
droplab
);
spyOn
(
DropLab
.
prototype
,
'
init
'
);
dropdownList
.
querySelector
.
and
.
returnValues
(
reopenItem
,
closeItem
);
dropdownList
.
querySelector
.
and
.
returnValues
(
reopenItem
,
closeItem
);
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
...
@@ -61,17 +60,16 @@ describe('CloseReopenReportToggle', () => {
...
@@ -61,17 +60,16 @@ describe('CloseReopenReportToggle', () => {
expect
(
closeReopenReportToggle
.
closeItem
).
toBe
(
closeItem
);
expect
(
closeReopenReportToggle
.
closeItem
).
toBe
(
closeItem
);
});
});
it
(
'
instantiates DropLab and set .droplab
'
,
()
=>
{
it
(
'
sets .droplab
'
,
()
=>
{
expect
(
DropLab
.
default
).
toHaveBeenCalled
();
expect
(
closeReopenReportToggle
.
droplab
).
toEqual
(
jasmine
.
any
(
Object
));
expect
(
closeReopenReportToggle
.
droplab
).
toBe
(
droplab
);
});
});
it
(
'
calls .setConfig
'
,
()
=>
{
it
(
'
calls .setConfig
'
,
()
=>
{
expect
(
closeReopenReportToggle
.
setConfig
).
toHaveBeenCalled
();
expect
(
closeReopenReportToggle
.
setConfig
).
toHaveBeenCalled
();
});
});
it
(
'
calls
.
droplab.init
'
,
()
=>
{
it
(
'
calls droplab.init
'
,
()
=>
{
expect
(
droplab
.
init
).
toHaveBeenCalledWith
(
expect
(
DropLab
.
prototype
.
init
).
toHaveBeenCalledWith
(
dropdownTrigger
,
dropdownTrigger
,
dropdownList
,
dropdownList
,
jasmine
.
any
(
Array
),
jasmine
.
any
(
Array
),
...
...
spec/javascripts/issue_spec.js
View file @
001c904f
/* eslint-disable space-before-function-paren, one-var, one-var-declaration-per-line, no-use-before-define, comma-dangle, max-len */
/* eslint-disable space-before-function-paren, one-var, one-var-declaration-per-line, no-use-before-define, comma-dangle, max-len */
import
Issue
from
'
~/issue
'
;
import
Issue
from
'
~/issue
'
;
import
*
as
CloseReopenReportToggle
from
'
~/close_reopen_report_toggle
'
;
import
CloseReopenReportToggle
from
'
~/close_reopen_report_toggle
'
;
import
'
~/lib/utils/text_utility
'
;
import
'
~/lib/utils/text_utility
'
;
describe
(
'
Issue
'
,
function
()
{
describe
(
'
Issue
'
,
function
()
{
...
@@ -208,15 +208,14 @@ describe('Issue', function() {
...
@@ -208,15 +208,14 @@ describe('Issue', function() {
});
});
describe
(
'
initCloseReopenReport
'
,
()
=>
{
describe
(
'
initCloseReopenReport
'
,
()
=>
{
it
(
'
inits a new CloseReopenReportToggle instance and
calls .initDroplab
'
,
()
=>
{
it
(
'
calls .initDroplab
'
,
()
=>
{
const
container
=
jasmine
.
createSpyObj
(
'
container
'
,
[
'
querySelector
'
]);
const
container
=
jasmine
.
createSpyObj
(
'
container
'
,
[
'
querySelector
'
]);
const
closeReopenReportToggle
=
jasmine
.
createSpyObj
(
'
closeReopenReportToggle
'
,
[
'
initDroplab
'
]);
const
dropdownTrigger
=
{};
const
dropdownTrigger
=
{};
const
dropdownList
=
{};
const
dropdownList
=
{};
const
button
=
{};
const
button
=
{};
spyOn
(
document
,
'
querySelector
'
).
and
.
returnValue
(
container
);
spyOn
(
document
,
'
querySelector
'
).
and
.
returnValue
(
container
);
spyOn
(
CloseReopenReportToggle
,
'
default
'
).
and
.
returnValue
(
closeReopenReportToggle
);
spyOn
(
CloseReopenReportToggle
.
prototype
,
'
initDroplab
'
);
container
.
querySelector
.
and
.
returnValues
(
dropdownTrigger
,
dropdownList
,
button
);
container
.
querySelector
.
and
.
returnValues
(
dropdownTrigger
,
dropdownList
,
button
);
Issue
.
prototype
.
initCloseReopenReport
();
Issue
.
prototype
.
initCloseReopenReport
();
...
@@ -225,12 +224,7 @@ describe('Issue', function() {
...
@@ -225,12 +224,7 @@ describe('Issue', function() {
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-toggle
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-toggle
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-menu
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-menu
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-button
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-button
'
);
expect
(
CloseReopenReportToggle
.
default
).
toHaveBeenCalledWith
({
expect
(
CloseReopenReportToggle
.
prototype
.
initDroplab
).
toHaveBeenCalled
();
dropdownTrigger
,
dropdownList
,
button
,
});
expect
(
closeReopenReportToggle
.
initDroplab
).
toHaveBeenCalled
();
});
});
});
});
});
});
...
...
spec/javascripts/merge_request_spec.js
View file @
001c904f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/* global MergeRequest */
/* global MergeRequest */
import
'
~/merge_request
'
;
import
'
~/merge_request
'
;
import
*
as
CloseReopenReportToggle
from
'
~/close_reopen_report_toggle
'
;
import
CloseReopenReportToggle
from
'
~/close_reopen_report_toggle
'
;
(
function
()
{
(
function
()
{
describe
(
'
MergeRequest
'
,
function
()
{
describe
(
'
MergeRequest
'
,
function
()
{
...
@@ -40,15 +40,14 @@ import * as CloseReopenReportToggle from '~/close_reopen_report_toggle';
...
@@ -40,15 +40,14 @@ import * as CloseReopenReportToggle from '~/close_reopen_report_toggle';
});
});
describe
(
'
initCloseReopenReport
'
,
()
=>
{
describe
(
'
initCloseReopenReport
'
,
()
=>
{
it
(
'
inits a new CloseReopenReportToggle instance and
calls .initDroplab
'
,
()
=>
{
it
(
'
calls .initDroplab
'
,
()
=>
{
const
container
=
jasmine
.
createSpyObj
(
'
container
'
,
[
'
querySelector
'
]);
const
container
=
jasmine
.
createSpyObj
(
'
container
'
,
[
'
querySelector
'
]);
const
closeReopenReportToggle
=
jasmine
.
createSpyObj
(
'
closeReopenReportToggle
'
,
[
'
initDroplab
'
]);
const
dropdownTrigger
=
{};
const
dropdownTrigger
=
{};
const
dropdownList
=
{};
const
dropdownList
=
{};
const
button
=
{};
const
button
=
{};
spyOn
(
CloseReopenReportToggle
.
prototype
,
'
initDroplab
'
);
spyOn
(
document
,
'
querySelector
'
).
and
.
returnValue
(
container
);
spyOn
(
document
,
'
querySelector
'
).
and
.
returnValue
(
container
);
spyOn
(
CloseReopenReportToggle
,
'
default
'
).
and
.
returnValue
(
closeReopenReportToggle
);
container
.
querySelector
.
and
.
returnValues
(
dropdownTrigger
,
dropdownList
,
button
);
container
.
querySelector
.
and
.
returnValues
(
dropdownTrigger
,
dropdownList
,
button
);
MergeRequest
.
initCloseReopenReport
();
MergeRequest
.
initCloseReopenReport
();
...
@@ -57,12 +56,7 @@ import * as CloseReopenReportToggle from '~/close_reopen_report_toggle';
...
@@ -57,12 +56,7 @@ import * as CloseReopenReportToggle from '~/close_reopen_report_toggle';
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-toggle
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-toggle
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-menu
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-menu
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-button
'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'
.js-issuable-close-button
'
);
expect
(
CloseReopenReportToggle
.
default
).
toHaveBeenCalledWith
({
expect
(
CloseReopenReportToggle
.
prototype
.
initDroplab
).
toHaveBeenCalled
();
dropdownTrigger
,
dropdownList
,
button
,
});
expect
(
closeReopenReportToggle
.
initDroplab
).
toHaveBeenCalled
();
});
});
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment