From 583cc364b64810dc51444a20bf5d33729e8995c9 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 18 Sep 2018 17:14:25 +0000 Subject: Improve cluster apps installation flow --- .../images/cluster_app_logos/elasticsearch.png | Bin 0 -> 796 bytes app/assets/images/cluster_app_logos/gitlab.png | Bin 0 -> 1757 bytes app/assets/images/cluster_app_logos/helm.png | Bin 0 -> 1438 bytes app/assets/images/cluster_app_logos/jeager.png | Bin 0 -> 2619 bytes app/assets/images/cluster_app_logos/jupyterhub.png | Bin 0 -> 895 bytes app/assets/images/cluster_app_logos/kubernetes.png | Bin 0 -> 1437 bytes app/assets/images/cluster_app_logos/meltano.png | Bin 0 -> 580 bytes app/assets/images/cluster_app_logos/prometheus.png | Bin 0 -> 923 bytes .../clusters/components/application_row.vue | 137 ++++--- .../clusters/components/applications.vue | 439 +++++++++++---------- app/assets/stylesheets/pages/clusters.scss | 57 ++- ...n-of-cluster-apps-to-handle-larger-quantity.yml | 5 + locale/gitlab.pot | 12 +- spec/features/projects/clusters/user_spec.rb | 1 - 14 files changed, 385 insertions(+), 266 deletions(-) create mode 100644 app/assets/images/cluster_app_logos/elasticsearch.png create mode 100644 app/assets/images/cluster_app_logos/gitlab.png create mode 100644 app/assets/images/cluster_app_logos/helm.png create mode 100644 app/assets/images/cluster_app_logos/jeager.png create mode 100644 app/assets/images/cluster_app_logos/jupyterhub.png create mode 100644 app/assets/images/cluster_app_logos/kubernetes.png create mode 100644 app/assets/images/cluster_app_logos/meltano.png create mode 100644 app/assets/images/cluster_app_logos/prometheus.png create mode 100644 changelogs/unreleased/50111-improve-design-of-cluster-apps-to-handle-larger-quantity.yml diff --git a/app/assets/images/cluster_app_logos/elasticsearch.png b/app/assets/images/cluster_app_logos/elasticsearch.png new file mode 100644 index 00000000000..96e9e0ff934 Binary files /dev/null and b/app/assets/images/cluster_app_logos/elasticsearch.png differ diff --git a/app/assets/images/cluster_app_logos/gitlab.png b/app/assets/images/cluster_app_logos/gitlab.png new file mode 100644 index 00000000000..cb2195fc6a2 Binary files /dev/null and b/app/assets/images/cluster_app_logos/gitlab.png differ diff --git a/app/assets/images/cluster_app_logos/helm.png b/app/assets/images/cluster_app_logos/helm.png new file mode 100644 index 00000000000..2989cae7b93 Binary files /dev/null and b/app/assets/images/cluster_app_logos/helm.png differ diff --git a/app/assets/images/cluster_app_logos/jeager.png b/app/assets/images/cluster_app_logos/jeager.png new file mode 100644 index 00000000000..be5bf2a0c9c Binary files /dev/null and b/app/assets/images/cluster_app_logos/jeager.png differ diff --git a/app/assets/images/cluster_app_logos/jupyterhub.png b/app/assets/images/cluster_app_logos/jupyterhub.png new file mode 100644 index 00000000000..80c7343067f Binary files /dev/null and b/app/assets/images/cluster_app_logos/jupyterhub.png differ diff --git a/app/assets/images/cluster_app_logos/kubernetes.png b/app/assets/images/cluster_app_logos/kubernetes.png new file mode 100644 index 00000000000..4d774909c10 Binary files /dev/null and b/app/assets/images/cluster_app_logos/kubernetes.png differ diff --git a/app/assets/images/cluster_app_logos/meltano.png b/app/assets/images/cluster_app_logos/meltano.png new file mode 100644 index 00000000000..7a2d82fbe27 Binary files /dev/null and b/app/assets/images/cluster_app_logos/meltano.png differ diff --git a/app/assets/images/cluster_app_logos/prometheus.png b/app/assets/images/cluster_app_logos/prometheus.png new file mode 100644 index 00000000000..a8663449b88 Binary files /dev/null and b/app/assets/images/cluster_app_logos/prometheus.png differ diff --git a/app/assets/javascripts/clusters/components/application_row.vue b/app/assets/javascripts/clusters/components/application_row.vue index 651f3b50236..0452729d3ff 100644 --- a/app/assets/javascripts/clusters/components/application_row.vue +++ b/app/assets/javascripts/clusters/components/application_row.vue @@ -2,6 +2,7 @@ /* eslint-disable vue/require-default-prop */ import { s__, sprintf } from '../../locale'; import eventHub from '../event_hub'; + import identicon from '../../vue_shared/components/identicon.vue'; import loadingButton from '../../vue_shared/components/loading_button.vue'; import { APPLICATION_STATUS, @@ -13,6 +14,7 @@ export default { components: { loadingButton, + identicon, }, props: { id: { @@ -31,6 +33,16 @@ type: String, required: false, }, + logoUrl: { + type: String, + required: false, + default: null, + }, + disabled: { + type: Boolean, + required: false, + default: false, + }, status: { type: String, required: false, @@ -60,6 +72,18 @@ isKnownStatus() { return Object.values(APPLICATION_STATUS).includes(this.status); }, + isInstalled() { + return ( + this.status === APPLICATION_STATUS.INSTALLED || this.status === APPLICATION_STATUS.UPDATED + ); + }, + hasLogo() { + return !!this.logoUrl; + }, + identiconId() { + // generate a deterministic integer id for the identicon background + return this.id.charCodeAt(0); + }, rowJsClass() { return `js-cluster-application-row-${this.id}`; }, @@ -128,37 +152,81 @@ diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index d708a9e595a..a1069985178 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -1,5 +1,14 @@ diff --git a/app/assets/stylesheets/pages/clusters.scss b/app/assets/stylesheets/pages/clusters.scss index 0f22fe21143..71a3fd544f2 100644 --- a/app/assets/stylesheets/pages/clusters.scss +++ b/app/assets/stylesheets/pages/clusters.scss @@ -4,9 +4,60 @@ } } -.cluster-applications-table { - // Wait for the Vue to kick-in and render the applications block - min-height: 628px; +.cluster-application-row { + background: $gray-lighter; + + &.cluster-application-installed { + background: none; + } + + .settings-message { + padding: $gl-vert-padding $gl-padding-8; + } +} + +@media (min-width: map-get($grid-breakpoints, md)) { + .cluster-application-list { + border: 1px solid $border-color; + border-radius: $border-radius-default; + } + + .cluster-application-row { + border-bottom: 1px solid $border-color; + padding: $gl-padding; + } +} + +.cluster-application-logo { + border: 3px solid $white-light; + box-shadow: 0 0 0 1px $gray-normal; + + &.avatar:hover { + border-color: $white-light; + } +} + +.cluster-application-warning { + font-weight: bold; + text-align: center; + padding: $gl-padding; + border-bottom: 1px solid $white-normal; + + .svg-container { + display: inline-block; + vertical-align: middle; + margin-right: $gl-padding-8; + width: 40px; + height: 40px; + } +} + +.cluster-application-description { + flex: 1; +} + +.cluster-application-disabled { + opacity: 0.5; } .clusters-dropdown-menu { diff --git a/changelogs/unreleased/50111-improve-design-of-cluster-apps-to-handle-larger-quantity.yml b/changelogs/unreleased/50111-improve-design-of-cluster-apps-to-handle-larger-quantity.yml new file mode 100644 index 00000000000..438c847327a --- /dev/null +++ b/changelogs/unreleased/50111-improve-design-of-cluster-apps-to-handle-larger-quantity.yml @@ -0,0 +1,5 @@ +--- +title: Improve install flow of Kubernetes cluster apps +merge_request: 21567 +author: +type: changed diff --git a/locale/gitlab.pot b/locale/gitlab.pot index db372811db3..3e6baeae87a 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -1353,6 +1353,9 @@ msgstr "" msgid "ClusterIntegration|Certificate Authority bundle (PEM format)" msgstr "" +msgid "ClusterIntegration|Choose which applications to install on your Kubernetes cluster. Helm Tiller is required to install any of the following applications." +msgstr "" + msgid "ClusterIntegration|Choose which of your environments will use this cluster." msgstr "" @@ -1443,9 +1446,6 @@ msgstr "" msgid "ClusterIntegration|Install" msgstr "" -msgid "ClusterIntegration|Install applications on your Kubernetes cluster. Read more about %{helpLink}" -msgstr "" - msgid "ClusterIntegration|Installed" msgstr "" @@ -1653,6 +1653,9 @@ msgstr "" msgid "ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way." msgstr "" +msgid "ClusterIntegration|You must first install Helm Tiller before installing the applications below" +msgstr "" + msgid "ClusterIntegration|Your account must have %{link_to_kubernetes_engine}" msgstr "" @@ -1671,9 +1674,6 @@ msgstr "" msgid "ClusterIntegration|help page" msgstr "" -msgid "ClusterIntegration|installing applications" -msgstr "" - msgid "ClusterIntegration|meets the requirements" msgstr "" diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb index 00941efc8c8..2b4998ed5ac 100644 --- a/spec/features/projects/clusters/user_spec.rb +++ b/spec/features/projects/clusters/user_spec.rb @@ -86,7 +86,6 @@ describe 'User Cluster', :js do context 'when user disables the cluster' do before do page.find(:css, '.js-cluster-enable-toggle-area .js-project-feature-toggle').click - fill_in 'cluster_name', with: 'dev-cluster' page.within('#cluster-integration') { click_button 'Save changes' } end -- cgit v1.2.1