From d7a3e6c41f447c1527b900d168be2fa95b549f2a Mon Sep 17 00:00:00 2001 From: Enrique Alcantara Date: Fri, 30 Aug 2019 16:36:59 -0400 Subject: Create EKS cluster Vue app skeleton - Add AWS SDK Dependency - Create placeholders for Vue components - Create store with state structure --- .../eks_cluster/components/create_eks_cluster.vue | 14 +++++++++++++ .../components/eks_cluster_configuration_form.vue | 18 +++++++++++++++++ .../eks_cluster/components/role_name_dropdown.vue | 0 .../components/security_group_dropdown.vue | 0 .../components/service_credentials_form.vue | 3 +++ .../eks_cluster/components/subnet_dropdown.vue | 0 .../eks_cluster/components/vpc_dropdown.vue | 0 .../create_cluster/eks_cluster/index.js | 19 ++++++++++++++++++ .../eks_cluster/services/aws_services_facade.js | 0 .../create_cluster/eks_cluster/store/actions.js | 3 +++ .../create_cluster/eks_cluster/store/getters.js | 0 .../create_cluster/eks_cluster/store/index.js | 15 ++++++++++++++ .../eks_cluster/store/mutation_types.js | 0 .../create_cluster/eks_cluster/store/mutations.js | 0 .../create_cluster/eks_cluster/store/state.js | 23 ++++++++++++++++++++++ .../pages/projects/clusters/new/index.js | 5 +++++ app/views/clusters/clusters/new.html.haml | 3 +++ 17 files changed, 103 insertions(+) create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/index.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/store/actions.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/store/getters.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/store/index.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js create mode 100644 app/assets/javascripts/create_cluster/eks_cluster/store/state.js create mode 100644 app/assets/javascripts/pages/projects/clusters/new/index.js diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue new file mode 100644 index 00000000000..ce2e4b883e4 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/create_eks_cluster.vue @@ -0,0 +1,14 @@ + + diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue new file mode 100644 index 00000000000..1ec45c8b651 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue @@ -0,0 +1,18 @@ + + diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue new file mode 100644 index 00000000000..79029b8cfa8 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue @@ -0,0 +1,3 @@ + diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/index.js b/app/assets/javascripts/create_cluster/eks_cluster/index.js new file mode 100644 index 00000000000..c62e5ec101d --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/index.js @@ -0,0 +1,19 @@ +import Vue from 'vue'; +import Vuex from 'vuex'; +import CreateEksCluster from './components/create_eks_cluster.vue'; +import createStore from './store'; + +Vue.use(Vuex); + +export default () => + new Vue({ + el: '.js-create-eks-cluster-form-container', + store: createStore(), + components: { + CreateEksCluster, + }, + data() {}, + render(createElement) { + return createElement('create-eks-cluster'); + }, + }); diff --git a/app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js b/app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/actions.js b/app/assets/javascripts/create_cluster/eks_cluster/store/actions.js new file mode 100644 index 00000000000..861bcddfcc7 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/actions.js @@ -0,0 +1,3 @@ +// import awsServices from '../services/aws_services_facade'; + +export default () => {}; diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/getters.js b/app/assets/javascripts/create_cluster/eks_cluster/store/getters.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/index.js b/app/assets/javascripts/create_cluster/eks_cluster/store/index.js new file mode 100644 index 00000000000..99e9e35fd1a --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/index.js @@ -0,0 +1,15 @@ +import Vuex from 'vuex'; +import * as actions from './actions'; +import * as getters from './getters'; +import mutations from './mutations'; +import state from './state'; + +const createStore = () => + new Vuex.Store({ + actions, + getters, + mutations, + state, + }); + +export default createStore; diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js b/app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js b/app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/create_cluster/eks_cluster/store/state.js b/app/assets/javascripts/create_cluster/eks_cluster/store/state.js new file mode 100644 index 00000000000..5007df8ad95 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/state.js @@ -0,0 +1,23 @@ +export default () => ({ + serviceCredentials: { + accessKeyId: '', + secretAccessKey: '', + }, + isValidatingCredentials: false, + validCredentials: false, + + isLoadingRoles: false, + isLoadingVPCs: false, + isLoadingSubnets: false, + isLoadingSecurityGroups: false, + + roles: [], + vpcs: [], + subnets: [], + securityGroups: [], + + selectedRole: '', + selectedVPC: '', + selectedSubnet: '', + selectedSecurityGroup: '', +}); diff --git a/app/assets/javascripts/pages/projects/clusters/new/index.js b/app/assets/javascripts/pages/projects/clusters/new/index.js new file mode 100644 index 00000000000..518253b14c7 --- /dev/null +++ b/app/assets/javascripts/pages/projects/clusters/new/index.js @@ -0,0 +1,5 @@ +import initCreateEKSCluster from '~/create_cluster/eks_cluster'; + +document.addEventListener('DOMContentLoaded', () => { + initCreateEKSCluster(); +}); diff --git a/app/views/clusters/clusters/new.html.haml b/app/views/clusters/clusters/new.html.haml index fb182d99ff0..c9e4dcec36d 100644 --- a/app/views/clusters/clusters/new.html.haml +++ b/app/views/clusters/clusters/new.html.haml @@ -5,6 +5,9 @@ - link_end = ''.html_safe = javascript_include_tag 'https://apis.google.com/js/api.js' +- if create_eks_enabled + = javascript_include_tag 'https://sdk.amazonaws.com/js/aws-sdk-2.523.0.min.js' + = render_gcp_signup_offer .row.prepend-top-default -- cgit v1.2.1