BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0b50c922
Commit
0b50c922
authored
Aug 31, 2017
by
Phil Hughes
Committed by
Jose Ivan Vargas
Sep 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '37179-dashboard-project-dropdown' into 'master'"
This reverts commit
6d6223ec
, reversing changes made to
cc781170
.
parent
89e2feab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
project_select_combo_button.js
app/assets/javascripts/project_select_combo_button.js
+5
-11
37179-dashboard-project-dropdown.yml
changelogs/unreleased/37179-dashboard-project-dropdown.yml
+0
-5
project_select_combo_button_spec.js
spec/javascripts/project_select_combo_button_spec.js
+15
-0
No files found.
app/assets/javascripts/project_select_combo_button.js
View file @
0b50c922
...
@@ -14,14 +14,7 @@ export default class ProjectSelectComboButton {
...
@@ -14,14 +14,7 @@ export default class ProjectSelectComboButton {
bindEvents
()
{
bindEvents
()
{
this
.
projectSelectInput
.
siblings
(
'.new-project-item-select-button'
)
this
.
projectSelectInput
.
siblings
(
'.new-project-item-select-button'
)
.
on
(
'click'
,
e
=>
this
.
openDropdown
(
e
));
.
on
(
'click'
,
this
.
openDropdown
);
this
.
newItemBtn
.
on
(
'click'
,
(
e
)
=>
{
if
(
!
this
.
getProjectFromLocalStorage
())
{
e
.
preventDefault
();
this
.
openDropdown
(
e
);
}
});
this
.
projectSelectInput
.
on
(
'change'
,
()
=>
this
.
selectProject
());
this
.
projectSelectInput
.
on
(
'change'
,
()
=>
this
.
selectProject
());
}
}
...
@@ -37,9 +30,8 @@ export default class ProjectSelectComboButton {
...
@@ -37,9 +30,8 @@ export default class ProjectSelectComboButton {
}
}
}
}
// eslint-disable-next-line class-methods-use-this
openDropdown
()
{
openDropdown
(
event
)
{
$
(
this
).
siblings
(
'.project-item-select'
).
select2
(
'open'
);
$
(
event
.
currentTarget
).
siblings
(
'.project-item-select'
).
select2
(
'open'
);
}
}
selectProject
()
{
selectProject
()
{
...
@@ -66,8 +58,10 @@ export default class ProjectSelectComboButton {
...
@@ -66,8 +58,10 @@ export default class ProjectSelectComboButton {
if
(
project
)
{
if
(
project
)
{
this
.
newItemBtn
.
attr
(
'href'
,
project
.
url
);
this
.
newItemBtn
.
attr
(
'href'
,
project
.
url
);
this
.
newItemBtn
.
text
(
`
${
this
.
formattedText
.
defaultTextPrefix
}
in
${
project
.
name
}
`
);
this
.
newItemBtn
.
text
(
`
${
this
.
formattedText
.
defaultTextPrefix
}
in
${
project
.
name
}
`
);
this
.
newItemBtn
.
enable
();
}
else
{
}
else
{
this
.
newItemBtn
.
text
(
`Select project to create
${
this
.
formattedText
.
presetTextSuffix
}
`
);
this
.
newItemBtn
.
text
(
`Select project to create
${
this
.
formattedText
.
presetTextSuffix
}
`
);
this
.
newItemBtn
.
disable
();
}
}
}
}
...
...
changelogs/unreleased/37179-dashboard-project-dropdown.yml
deleted
100644 → 0
View file @
89e2feab
---
title
:
Removes disabled state from dashboard project button
merge_request
:
author
:
type
:
fixed
spec/javascripts/project_select_combo_button_spec.js
View file @
0b50c922
...
@@ -32,6 +32,11 @@ describe('Project Select Combo Button', function () {
...
@@ -32,6 +32,11 @@ describe('Project Select Combo Button', function () {
this
.
comboButton
=
new
ProjectSelectComboButton
(
this
.
projectSelectInput
);
this
.
comboButton
=
new
ProjectSelectComboButton
(
this
.
projectSelectInput
);
});
});
it
(
'newItemBtn is disabled'
,
function
()
{
expect
(
this
.
newItemBtn
.
hasAttribute
(
'disabled'
)).
toBe
(
true
);
expect
(
this
.
newItemBtn
.
classList
.
contains
(
'disabled'
)).
toBe
(
true
);
});
it
(
'newItemBtn href is null'
,
function
()
{
it
(
'newItemBtn href is null'
,
function
()
{
expect
(
this
.
newItemBtn
.
getAttribute
(
'href'
)).
toBe
(
''
);
expect
(
this
.
newItemBtn
.
getAttribute
(
'href'
)).
toBe
(
''
);
});
});
...
@@ -48,6 +53,11 @@ describe('Project Select Combo Button', function () {
...
@@ -48,6 +53,11 @@ describe('Project Select Combo Button', function () {
this
.
comboButton
=
new
ProjectSelectComboButton
(
this
.
projectSelectInput
);
this
.
comboButton
=
new
ProjectSelectComboButton
(
this
.
projectSelectInput
);
});
});
it
(
'newItemBtn is not disabled'
,
function
()
{
expect
(
this
.
newItemBtn
.
hasAttribute
(
'disabled'
)).
toBe
(
false
);
expect
(
this
.
newItemBtn
.
classList
.
contains
(
'disabled'
)).
toBe
(
false
);
});
it
(
'newItemBtn href is correctly set'
,
function
()
{
it
(
'newItemBtn href is correctly set'
,
function
()
{
expect
(
this
.
newItemBtn
.
getAttribute
(
'href'
)).
toBe
(
this
.
defaults
.
projectMeta
.
url
);
expect
(
this
.
newItemBtn
.
getAttribute
(
'href'
)).
toBe
(
this
.
defaults
.
projectMeta
.
url
);
});
});
...
@@ -72,6 +82,11 @@ describe('Project Select Combo Button', function () {
...
@@ -72,6 +82,11 @@ describe('Project Select Combo Button', function () {
.
trigger
(
'change'
);
.
trigger
(
'change'
);
});
});
it
(
'newItemBtn is not disabled'
,
function
()
{
expect
(
this
.
newItemBtn
.
hasAttribute
(
'disabled'
)).
toBe
(
false
);
expect
(
this
.
newItemBtn
.
classList
.
contains
(
'disabled'
)).
toBe
(
false
);
});
it
(
'newItemBtn href is correctly set'
,
function
()
{
it
(
'newItemBtn href is correctly set'
,
function
()
{
expect
(
this
.
newItemBtn
.
getAttribute
(
'href'
))
expect
(
this
.
newItemBtn
.
getAttribute
(
'href'
))
.
toBe
(
'http://myothercoolproject.com/issues/new'
);
.
toBe
(
'http://myothercoolproject.com/issues/new'
);
...
...
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