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
11e9339d
Commit
11e9339d
authored
May 04, 2018
by
Dennis Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix number of form value bugs
parent
7db2ef36
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
32 deletions
+26
-32
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue
...luster_dropdowns/components/gke_machine_type_dropdown.vue
+2
-2
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue
..._cluster_dropdowns/components/gke_project_id_dropdown.vue
+16
-27
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
...ts/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
+4
-2
app/assets/javascripts/projects/gke_cluster_dropdowns/stores/index.js
...avascripts/projects/gke_cluster_dropdowns/stores/index.js
+4
-1
No files found.
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue
View file @
11e9339d
...
...
@@ -85,7 +85,7 @@ export default {
fetchItems
()
{
this
.
isLoading
=
true
;
const
request
=
this
.
service
.
machineTypes
.
list
({
project
:
this
.
$store
.
state
.
selectedProject
,
project
:
this
.
$store
.
state
.
selectedProject
.
projectId
,
zone
:
this
.
$store
.
state
.
selectedZone
,
});
...
...
@@ -143,7 +143,7 @@ export default {
>
<dropdown-hidden-input
:name=
"fieldName"
:value=
"$store.state.selected
Project
"
:value=
"$store.state.selected
MachineType
"
/>
<dropdown-button
:class=
"
{ 'gl-field-error-outline': hasErrors }"
...
...
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue
View file @
11e9339d
...
...
@@ -11,7 +11,6 @@ import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidde
import
store
from
'
../stores
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
// TODO: Consolidate dropdown code
// TODO: Account for invalid project settings/errors (project returns error when retrieving zones)
export
default
{
name
:
'
GkeProjectIdDropdown
'
,
...
...
@@ -43,7 +42,6 @@ export default {
},
data
()
{
return
{
isDisabled
:
false
,
isLoading
:
true
,
hasErrors
:
false
,
searchQuery
:
''
,
...
...
@@ -52,17 +50,24 @@ export default {
};
},
computed
:
{
isDisabled
()
{
return
this
.
items
.
length
<
2
;
},
results
()
{
return
this
.
items
.
filter
(
item
=>
item
.
name
.
toLowerCase
().
indexOf
(
this
.
searchQuery
)
>
-
1
);
},
toggleText
()
{
if
(
this
.
$store
.
state
.
selectedProject
)
{
return
this
.
$store
.
state
.
selectedProject
;
if
(
this
.
$store
.
state
.
selectedProject
.
name
)
{
return
this
.
$store
.
state
.
selectedProject
.
name
;
}
if
(
this
.
isLoading
)
{
return
s__
(
'
ClusterIntegration|Fetching projects
'
);
}
return
this
.
i
sLoading
?
s__
(
'
ClusterIntegration|
Fetching projects
'
)
:
s__
(
'
ClusterIntegration|
Select project
'
);
return
this
.
i
tems
.
length
?
s__
(
'
ClusterIntegration|
Select project
'
)
:
s__
(
'
ClusterIntegration|
No projects found
'
);
},
placeholderText
()
{
return
s__
(
'
ClusterIntegration|Search projects
'
);
...
...
@@ -102,26 +107,10 @@ export default {
resp
=>
{
this
.
items
=
resp
.
result
.
projects
;
// Cause error
// this.items = data;
// Single state
// this.items = [
// {
// create_time: '2018-01-16T15:55:02.992Z',
// lifecycle_state: 'ACTIVE',
// name: 'NaturalInterface',
// item_id: 'naturalinterface-192315',
// item_number: 840816084083,
// },
// ];
this
.
isLoading
=
false
;
if
(
this
.
items
.
length
===
1
)
{
this
.
isDisabled
=
true
;
this
.
setProject
(
this
.
items
[
0
].
name
);
this
.
setProject
(
this
.
items
[
0
]);
}
this
.
isLoading
=
false
;
},
resp
=>
{
this
.
isLoading
=
false
;
...
...
@@ -150,7 +139,7 @@ export default {
>
<dropdown-hidden-input
:name=
"fieldName"
:value=
"$store.state.selectedProject"
:value=
"$store.state.selectedProject
.projectId
"
/>
<dropdown-button
:class=
"
{ 'gl-field-error-outline': hasErrors }"
...
...
@@ -171,7 +160,7 @@ export default {
>
<a
href=
"#"
@
click.prevent=
"setProject(result
.name
)"
@
click.prevent=
"setProject(result)"
>
{{
result
.
name
}}
</a>
</li>
</ul>
...
...
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
View file @
11e9339d
...
...
@@ -76,7 +76,9 @@ export default {
...
mapActions
([
'
setZone
'
]),
fetchItems
()
{
this
.
isLoading
=
true
;
const
request
=
this
.
service
.
zones
.
list
({
project
:
this
.
$store
.
state
.
selectedProject
});
const
request
=
this
.
service
.
zones
.
list
({
project
:
this
.
$store
.
state
.
selectedProject
.
projectId
,
});
return
request
.
then
(
resp
=>
{
...
...
@@ -129,7 +131,7 @@ export default {
>
<dropdown-hidden-input
:name=
"fieldName"
:value=
"$store.state.selected
Project
"
:value=
"$store.state.selected
Zone
"
/>
<dropdown-button
:class=
"
{ 'gl-field-error-outline': hasErrors }"
...
...
app/assets/javascripts/projects/gke_cluster_dropdowns/stores/index.js
View file @
11e9339d
...
...
@@ -11,7 +11,10 @@ export default new Vuex.Store({
getters
,
mutations
,
state
:
{
selectedProject
:
''
,
selectedProject
:
{
projectId
:
''
,
name
:
''
,
},
selectedZone
:
''
,
selectedMachineType
:
''
,
},
...
...
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