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
0
Merge Requests
0
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
Boxiang Sun
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
Show 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 {
...
@@ -85,7 +85,7 @@ export default {
fetchItems
()
{
fetchItems
()
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
const
request
=
this
.
service
.
machineTypes
.
list
({
const
request
=
this
.
service
.
machineTypes
.
list
({
project
:
this
.
$store
.
state
.
selectedProject
,
project
:
this
.
$store
.
state
.
selectedProject
.
projectId
,
zone
:
this
.
$store
.
state
.
selectedZone
,
zone
:
this
.
$store
.
state
.
selectedZone
,
});
});
...
@@ -143,7 +143,7 @@ export default {
...
@@ -143,7 +143,7 @@ export default {
>
>
<dropdown-hidden-input
<dropdown-hidden-input
:name=
"fieldName"
:name=
"fieldName"
:value=
"$store.state.selected
Project
"
:value=
"$store.state.selected
MachineType
"
/>
/>
<dropdown-button
<dropdown-button
:class=
"
{ 'gl-field-error-outline': hasErrors }"
: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
...
@@ -11,7 +11,6 @@ import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidde
import
store
from
'
../stores
'
;
import
store
from
'
../stores
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
import
DropdownButton
from
'
./dropdown_button.vue
'
;
// TODO: Consolidate dropdown code
// TODO: Consolidate dropdown code
// TODO: Account for invalid project settings/errors (project returns error when retrieving zones)
export
default
{
export
default
{
name
:
'
GkeProjectIdDropdown
'
,
name
:
'
GkeProjectIdDropdown
'
,
...
@@ -43,7 +42,6 @@ export default {
...
@@ -43,7 +42,6 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
isDisabled
:
false
,
isLoading
:
true
,
isLoading
:
true
,
hasErrors
:
false
,
hasErrors
:
false
,
searchQuery
:
''
,
searchQuery
:
''
,
...
@@ -52,17 +50,24 @@ export default {
...
@@ -52,17 +50,24 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
isDisabled
()
{
return
this
.
items
.
length
<
2
;
},
results
()
{
results
()
{
return
this
.
items
.
filter
(
item
=>
item
.
name
.
toLowerCase
().
indexOf
(
this
.
searchQuery
)
>
-
1
);
return
this
.
items
.
filter
(
item
=>
item
.
name
.
toLowerCase
().
indexOf
(
this
.
searchQuery
)
>
-
1
);
},
},
toggleText
()
{
toggleText
()
{
if
(
this
.
$store
.
state
.
selectedProject
)
{
if
(
this
.
$store
.
state
.
selectedProject
.
name
)
{
return
this
.
$store
.
state
.
selectedProject
;
return
this
.
$store
.
state
.
selectedProject
.
name
;
}
if
(
this
.
isLoading
)
{
return
s__
(
'
ClusterIntegration|Fetching projects
'
);
}
}
return
this
.
i
sLoading
return
this
.
i
tems
.
length
?
s__
(
'
ClusterIntegration|
Fetching projects
'
)
?
s__
(
'
ClusterIntegration|
Select project
'
)
:
s__
(
'
ClusterIntegration|
Select project
'
);
:
s__
(
'
ClusterIntegration|
No projects found
'
);
},
},
placeholderText
()
{
placeholderText
()
{
return
s__
(
'
ClusterIntegration|Search projects
'
);
return
s__
(
'
ClusterIntegration|Search projects
'
);
...
@@ -102,26 +107,10 @@ export default {
...
@@ -102,26 +107,10 @@ export default {
resp
=>
{
resp
=>
{
this
.
items
=
resp
.
result
.
projects
;
this
.
items
=
resp
.
result
.
projects
;
// Cause error
this
.
isLoading
=
false
;
// 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,
// },
// ];
if
(
this
.
items
.
length
===
1
)
{
if
(
this
.
items
.
length
===
1
)
{
this
.
isDisabled
=
true
;
this
.
setProject
(
this
.
items
[
0
]);
this
.
setProject
(
this
.
items
[
0
].
name
);
}
}
this
.
isLoading
=
false
;
},
},
resp
=>
{
resp
=>
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
...
@@ -150,7 +139,7 @@ export default {
...
@@ -150,7 +139,7 @@ export default {
>
>
<dropdown-hidden-input
<dropdown-hidden-input
:name=
"fieldName"
:name=
"fieldName"
:value=
"$store.state.selectedProject"
:value=
"$store.state.selectedProject
.projectId
"
/>
/>
<dropdown-button
<dropdown-button
:class=
"
{ 'gl-field-error-outline': hasErrors }"
:class=
"
{ 'gl-field-error-outline': hasErrors }"
...
@@ -171,7 +160,7 @@ export default {
...
@@ -171,7 +160,7 @@ export default {
>
>
<a
<a
href=
"#"
href=
"#"
@
click.prevent=
"setProject(result
.name
)"
@
click.prevent=
"setProject(result)"
>
{{
result
.
name
}}
</a>
>
{{
result
.
name
}}
</a>
</li>
</li>
</ul>
</ul>
...
...
app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown.vue
View file @
11e9339d
...
@@ -76,7 +76,9 @@ export default {
...
@@ -76,7 +76,9 @@ export default {
...
mapActions
([
'
setZone
'
]),
...
mapActions
([
'
setZone
'
]),
fetchItems
()
{
fetchItems
()
{
this
.
isLoading
=
true
;
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
(
return
request
.
then
(
resp
=>
{
resp
=>
{
...
@@ -129,7 +131,7 @@ export default {
...
@@ -129,7 +131,7 @@ export default {
>
>
<dropdown-hidden-input
<dropdown-hidden-input
:name=
"fieldName"
:name=
"fieldName"
:value=
"$store.state.selected
Project
"
:value=
"$store.state.selected
Zone
"
/>
/>
<dropdown-button
<dropdown-button
:class=
"
{ 'gl-field-error-outline': hasErrors }"
: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({
...
@@ -11,7 +11,10 @@ export default new Vuex.Store({
getters
,
getters
,
mutations
,
mutations
,
state
:
{
state
:
{
selectedProject
:
''
,
selectedProject
:
{
projectId
:
''
,
name
:
''
,
},
selectedZone
:
''
,
selectedZone
:
''
,
selectedMachineType
:
''
,
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