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
aa7e55f2
Commit
aa7e55f2
authored
May 08, 2018
by
Dennis Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor dropdown reusable components
parent
da3610ff
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
75 deletions
+20
-75
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue
...luster_dropdowns/components/gke_machine_type_dropdown.vue
+1
-1
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue
..._cluster_dropdowns/components/gke_project_id_dropdown.vue
+1
-1
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
...ts/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
+1
-1
app/assets/javascripts/vue_shared/components/dropdown/dropdown_button.vue
...cripts/vue_shared/components/dropdown/dropdown_button.vue
+12
-8
app/assets/javascripts/vue_shared/components/dropdown/dropdown_hidden_input.vue
.../vue_shared/components/dropdown/dropdown_hidden_input.vue
+1
-1
app/assets/javascripts/vue_shared/components/dropdown/dropdown_search_input.vue
.../vue_shared/components/dropdown/dropdown_search_input.vue
+2
-2
app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue
...ipts/vue_shared/components/sidebar/labels_select/base.vue
+2
-2
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input.vue
...omponents/sidebar/labels_select/dropdown_hidden_input.vue
+0
-22
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input_spec.js
...nents/sidebar/labels_select/dropdown_hidden_input_spec.js
+0
-37
No files found.
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue
View file @
aa7e55f2
...
...
@@ -5,10 +5,10 @@ import { mapState, mapGetters, mapActions } from 'vuex';
import
LoadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
DropdownSearchInput
from
'
~/vue_shared/components/dropdown/dropdown_search_input.vue
'
;
import
DropdownHiddenInput
from
'
~/vue_shared/components/dropdown/dropdown_hidden_input.vue
'
;
import
DropdownButton
from
'
~/vue_shared/components/dropdown/dropdown_button.vue
'
;
import
eventHub
from
'
../eventhub
'
;
import
store
from
'
../stores
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
export
default
{
name
:
'
GkeMachineTypeDropdown
'
,
...
...
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue
View file @
aa7e55f2
...
...
@@ -5,9 +5,9 @@ import { mapState, mapGetters, mapActions } from 'vuex';
import
LoadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
DropdownSearchInput
from
'
~/vue_shared/components/dropdown/dropdown_search_input.vue
'
;
import
DropdownHiddenInput
from
'
~/vue_shared/components/dropdown/dropdown_hidden_input.vue
'
;
import
DropdownButton
from
'
~/vue_shared/components/dropdown/dropdown_button.vue
'
;
import
store
from
'
../stores
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
export
default
{
name
:
'
GkeProjectIdDropdown
'
,
...
...
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
View file @
aa7e55f2
...
...
@@ -5,10 +5,10 @@ import { mapState, mapGetters, mapActions } from 'vuex';
import
LoadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
DropdownSearchInput
from
'
~/vue_shared/components/dropdown/dropdown_search_input.vue
'
;
import
DropdownHiddenInput
from
'
~/vue_shared/components/dropdown/dropdown_hidden_input.vue
'
;
import
DropdownButton
from
'
~/vue_shared/components/dropdown/dropdown_button.vue
'
;
import
eventHub
from
'
../eventhub
'
;
import
store
from
'
../stores
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
export
default
{
name
:
'
GkeZoneDropdown
'
,
...
...
app/assets/javascripts/
projects/gke_cluster_dropdowns/components
/dropdown_button.vue
→
app/assets/javascripts/
vue_shared/components/dropdown
/dropdown_button.vue
View file @
aa7e55f2
<
script
>
import
{
s
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
LoadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
export
default
{
...
...
@@ -19,8 +19,8 @@ export default {
},
toggleText
:
{
type
:
String
,
required
:
tru
e
,
default
:
s__
(
'
ClusterIntegration|
Select
'
),
required
:
fals
e
,
default
:
__
(
'
Select
'
),
},
},
};
...
...
@@ -41,11 +41,15 @@ export default {
<span
class=
"dropdown-toggle-text"
>
{{
toggleText
}}
</span>
<i
aria-hidden=
"true"
data-hidden=
"true"
<span
class=
"dropdown-toggle-icon"
v-show=
"!isLoading"
class=
"fa fa-chevron-down"
></i>
>
<i
class=
"fa fa-chevron-down"
aria-hidden=
"true"
data-hidden=
"true"
></i>
</span>
</button>
</
template
>
app/assets/javascripts/vue_shared/components/dropdown/dropdown_hidden_input.vue
View file @
aa7e55f2
...
...
@@ -6,7 +6,7 @@ export default {
required
:
true
,
},
value
:
{
type
:
String
,
type
:
[
Number
,
String
]
,
required
:
true
,
},
},
...
...
app/assets/javascripts/vue_shared/components/dropdown/dropdown_search_input.vue
View file @
aa7e55f2
...
...
@@ -30,14 +30,14 @@ export default {
autocomplete=
"off"
/>
<i
aria-hidden=
"true"
class=
"fa fa-search dropdown-input-search"
aria-hidden=
"true"
data-hidden=
"true"
>
</i>
<i
aria-hidden=
"true"
class=
"fa fa-times dropdown-input-clear js-dropdown-input-clear"
aria-hidden=
"true"
data-hidden=
"true"
role=
"button"
>
...
...
app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue
View file @
aa7e55f2
...
...
@@ -2,13 +2,13 @@
import
$
from
'
jquery
'
;
import
{
__
}
from
'
~/locale
'
;
import
LabelsSelect
from
'
~/labels_select
'
;
import
DropdownHiddenInput
from
'
~/vue_shared/components/dropdown/dropdown_hidden_input.vue
'
;
import
LoadingIcon
from
'
../../loading_icon.vue
'
;
import
DropdownTitle
from
'
./dropdown_title.vue
'
;
import
DropdownValue
from
'
./dropdown_value.vue
'
;
import
DropdownValueCollapsed
from
'
./dropdown_value_collapsed.vue
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
import
DropdownHiddenInput
from
'
./dropdown_hidden_input.vue
'
;
import
DropdownHeader
from
'
./dropdown_header.vue
'
;
import
DropdownSearchInput
from
'
./dropdown_search_input.vue
'
;
import
DropdownFooter
from
'
./dropdown_footer.vue
'
;
...
...
@@ -140,7 +140,7 @@ export default {
v-for=
"label in context.labels"
:key=
"label.id"
:name=
"hiddenInputName"
:
label=
"label
"
:
value=
"label.id
"
/>
<div
class=
"dropdown"
...
...
app/assets/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input.vue
deleted
100644 → 0
View file @
da3610ff
<
script
>
export
default
{
props
:
{
name
:
{
type
:
String
,
required
:
true
,
},
label
:
{
type
:
Object
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<input
type=
"hidden"
:name=
"name"
:value=
"label.id"
/>
</
template
>
spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_hidden_input_spec.js
deleted
100644 → 0
View file @
da3610ff
import
Vue
from
'
vue
'
;
import
dropdownHiddenInputComponent
from
'
~/vue_shared/components/sidebar/labels_select/dropdown_hidden_input.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
mockLabels
}
from
'
./mock_data
'
;
const
createComponent
=
(
name
=
'
label_id[]
'
,
label
=
mockLabels
[
0
])
=>
{
const
Component
=
Vue
.
extend
(
dropdownHiddenInputComponent
);
return
mountComponent
(
Component
,
{
name
,
label
,
});
};
describe
(
'
DropdownHiddenInputComponent
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders input element of type `hidden`
'
,
()
=>
{
expect
(
vm
.
$el
.
nodeName
).
toBe
(
'
INPUT
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
type
'
)).
toBe
(
'
hidden
'
);
expect
(
vm
.
$el
.
getAttribute
(
'
name
'
)).
toBe
(
vm
.
name
);
expect
(
vm
.
$el
.
getAttribute
(
'
value
'
)).
toBe
(
`
${
vm
.
label
.
id
}
`
);
});
});
});
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