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
319ebaef
Commit
319ebaef
authored
6 years ago
by
Dennis Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update view name for gke dropdown check
parent
70c65e82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/assets/javascripts/pages/projects/index.js
app/assets/javascripts/pages/projects/index.js
+1
-1
app/controllers/projects/clusters_controller.rb
app/controllers/projects/clusters_controller.rb
+5
-5
No files found.
app/assets/javascripts/pages/projects/index.js
View file @
319ebaef
...
...
@@ -5,7 +5,7 @@ import ShortcutsNavigation from '../../shortcuts_navigation';
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
page
=
document
.
body
.
dataset
.
page
;
const
newClusterViews
=
[
'
projects:clusters:new
'
,
'
projects:clusters:create
_cluster
'
];
const
newClusterViews
=
[
'
projects:clusters:new
'
,
'
projects:clusters:create
'
];
if
(
newClusterViews
.
indexOf
(
page
)
>
-
1
)
{
gcpSignupOffer
();
...
...
This diff is collapsed.
Click to expand it.
app/controllers/projects/clusters_controller.rb
View file @
319ebaef
...
...
@@ -2,6 +2,7 @@ class Projects::ClustersController < Projects::ApplicationController
before_action
:cluster
,
except:
[
:index
,
:new
,
:create
]
before_action
:authorize_read_cluster!
before_action
:generate_gcp_authorize_url
,
only:
[
:new
]
before_action
:validate_gcp_token
,
only:
[
:new
]
before_action
:new_cluster
,
only:
[
:new
]
before_action
:existing_cluster
,
only:
[
:new
]
before_action
:authorize_create_cluster!
,
only:
[
:new
]
...
...
@@ -83,6 +84,7 @@ class Projects::ClustersController < Projects::ApplicationController
redirect_to
project_cluster_path
(
project
,
@cluster
)
else
generate_gcp_authorize_url
validate_gcp_token
case
params
[
:type
]
when
'new'
...
...
@@ -171,10 +173,8 @@ class Projects::ClustersController < Projects::ApplicationController
end
def
new_cluster
if
valid_gcp_token
@new_cluster
=
::
Clusters
::
Cluster
.
new
.
tap
do
|
cluster
|
cluster
.
build_provider_gcp
end
@new_cluster
=
::
Clusters
::
Cluster
.
new
.
tap
do
|
cluster
|
cluster
.
build_provider_gcp
end
end
...
...
@@ -184,7 +184,7 @@ class Projects::ClustersController < Projects::ApplicationController
end
end
def
valid_gcp_token
def
valid
ate
_gcp_token
@valid_gcp_token
=
GoogleApi
::
CloudPlatform
::
Client
.
new
(
token_in_session
,
nil
)
.
validate_token
(
expires_at_in_session
)
end
...
...
This diff is collapsed.
Click to expand it.
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