diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/clusters_list | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/clusters_list')
5 files changed, 27 insertions, 32 deletions
diff --git a/app/assets/javascripts/clusters_list/components/ancestor_notice.vue b/app/assets/javascripts/clusters_list/components/ancestor_notice.vue index 7954fc61785..b241aa34283 100644 --- a/app/assets/javascripts/clusters_list/components/ancestor_notice.vue +++ b/app/assets/javascripts/clusters_list/components/ancestor_notice.vue @@ -1,11 +1,12 @@ <script> -import { GlLink, GlSprintf } from '@gitlab/ui'; +import { GlLink, GlSprintf, GlAlert } from '@gitlab/ui'; import { mapState } from 'vuex'; export default { components: { GlLink, GlSprintf, + GlAlert, }, computed: { ...mapState(['ancestorHelperPath', 'hasAncestorClusters']), @@ -14,21 +15,19 @@ export default { </script> <template> - <div v-if="hasAncestorClusters" class="bs-callout bs-callout-info"> - <p> - <gl-sprintf - :message=" - s__( - 'ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters. %{linkStart}More information%{linkEnd}', - ) - " - > - <template #link="{ content }"> - <gl-link :href="ancestorHelperPath"> - <strong>{{ content }}</strong> - </gl-link> - </template> - </gl-sprintf> - </p> - </div> + <gl-alert v-if="hasAncestorClusters" variant="info" :dismissible="false" class="gl-my-4"> + <gl-sprintf + :message=" + s__( + 'ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters. %{linkStart}More information%{linkEnd}', + ) + " + > + <template #link="{ content }"> + <gl-link :href="ancestorHelperPath"> + <strong>{{ content }}</strong> + </gl-link> + </template> + </gl-sprintf> + </gl-alert> </template> diff --git a/app/assets/javascripts/clusters_list/components/clusters.vue b/app/assets/javascripts/clusters_list/components/clusters.vue index 08fd7db40a1..53eec5c8a0d 100644 --- a/app/assets/javascripts/clusters_list/components/clusters.vue +++ b/app/assets/javascripts/clusters_list/components/clusters.vue @@ -79,7 +79,7 @@ export default { { key: 'cluster_type', label: __('Cluster level'), - formatter: value => CLUSTER_TYPES[value], + formatter: (value) => CLUSTER_TYPES[value], }, ]; }, @@ -254,9 +254,7 @@ export default { <template #freeSpacePercentage>{{ totalCpuAndUsage(item.nodes).freeSpacePercentage }}</template> - <template #percentSymbol - >%</template - > + <template #percentSymbol>%</template> </gl-sprintf> </span> @@ -277,9 +275,7 @@ export default { <template #freeSpacePercentage>{{ totalMemoryAndUsage(item.nodes).freeSpacePercentage }}</template> - <template #percentSymbol - >%</template - > + <template #percentSymbol>%</template> </gl-sprintf> </span> @@ -293,7 +289,7 @@ export default { /> </template> - <template #cell(cluster_type)="{value}"> + <template #cell(cluster_type)="{ value }"> <gl-badge variant="muted"> {{ value }} </gl-badge> diff --git a/app/assets/javascripts/clusters_list/load_clusters.js b/app/assets/javascripts/clusters_list/load_clusters.js index 98bc5880898..01430230879 100644 --- a/app/assets/javascripts/clusters_list/load_clusters.js +++ b/app/assets/javascripts/clusters_list/load_clusters.js @@ -1,7 +1,7 @@ import Clusters from './components/clusters.vue'; import { createStore } from './store'; -export default Vue => { +export default (Vue) => { const el = document.querySelector('#js-clusters-list-app'); if (!el) { diff --git a/app/assets/javascripts/clusters_list/store/actions.js b/app/assets/javascripts/clusters_list/store/actions.js index 1be82988db0..97ed0a7ab37 100644 --- a/app/assets/javascripts/clusters_list/store/actions.js +++ b/app/assets/javascripts/clusters_list/store/actions.js @@ -13,11 +13,11 @@ const allNodesPresent = (clusters, retryCount) => { They may fail for reasons GitLab cannot control. MAX_REQUESTS will ensure this poll stops at some point. */ - return retryCount > MAX_REQUESTS || clusters.every(cluster => cluster.nodes != null); + return retryCount > MAX_REQUESTS || clusters.every((cluster) => cluster.nodes != null); }; export const reportSentryError = (_store, { error, tag }) => { - Sentry.withScope(scope => { + Sentry.withScope((scope) => { scope.setTag('javascript_clusters_list', tag); Sentry.captureException(error); }); @@ -30,7 +30,7 @@ export const fetchClusters = ({ state, commit, dispatch }) => { const poll = new Poll({ resource: { - fetchClusters: paginatedEndPoint => axios.get(paginatedEndPoint), + fetchClusters: (paginatedEndPoint) => axios.get(paginatedEndPoint), }, data: `${state.endpoint}?page=${state.page}`, method: 'fetchClusters', @@ -59,7 +59,7 @@ export const fetchClusters = ({ state, commit, dispatch }) => { dispatch('reportSentryError', { error, tag: 'fetchClustersSuccessCallback' }); } }, - errorCallback: response => { + errorCallback: (response) => { poll.stop(); commit(types.SET_LOADING_CLUSTERS, false); diff --git a/app/assets/javascripts/clusters_list/store/index.js b/app/assets/javascripts/clusters_list/store/index.js index c472d2f354c..47e17b3624b 100644 --- a/app/assets/javascripts/clusters_list/store/index.js +++ b/app/assets/javascripts/clusters_list/store/index.js @@ -6,7 +6,7 @@ import * as actions from './actions'; Vue.use(Vuex); -export const createStore = initialState => +export const createStore = (initialState) => new Vuex.Store({ actions, mutations, |