diff options
author | Enrique Alcantara <ealcantara@gitlab.com> | 2019-08-30 16:36:59 -0400 |
---|---|---|
committer | Enrique Alcantara <ealcantara@gitlab.com> | 2019-09-11 11:28:05 -0400 |
commit | d7a3e6c41f447c1527b900d168be2fa95b549f2a (patch) | |
tree | 7b47e008ed858fff46699aa8fd59b0b9fd1ceb6f | |
parent | 43a40ac995f3a3e875497fa7a36ba546086a52fe (diff) | |
download | gitlab-ce-d7a3e6c41f447c1527b900d168be2fa95b549f2a.tar.gz |
Create EKS cluster Vue app skeleton
- Add AWS SDK Dependency
- Create placeholders for Vue components
- Create store with state structure
17 files changed, 103 insertions, 0 deletions
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 @@ +<script> +import ServiceCredentialsForm from './service_credentials_form.vue'; +import EksClusterConfigurationForm from './eks_cluster_configuration_form.vue'; + +export default { + components: { + ServiceCredentialsForm, + EksClusterConfigurationForm, + }, +}; +</script> +<template> + <eks-cluster-configuration-form /> +</template> 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 @@ +<script> +import RoleNameDropdown from './role_name_dropdown.vue'; +import SecurityGroupDropdown from './security_group_dropdown.vue'; +import SubnetDropdown from './subnet_dropdown.vue'; +import VPCDropdown from './vpc_dropdown.vue'; + +export default { + components: { + RoleNameDropdown, + SecurityGroupDropdown, + SubnetDropdown, + VPCDropdown, + }, +}; +</script> +<template> + <form name="eks-cluster-configuration-form"></form> +</template> 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/role_name_dropdown.vue 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/security_group_dropdown.vue 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 @@ +<template> + <form name="service-credentials-form"></form> +</template> 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/subnet_dropdown.vue 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/vpc_dropdown.vue 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/services/aws_services_facade.js 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/getters.js 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/mutation_types.js 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 --- /dev/null +++ b/app/assets/javascripts/create_cluster/eks_cluster/store/mutations.js 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 = '<a/>'.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 |