diff options
Diffstat (limited to 'app/assets/javascripts/pipelines/components/pipelines_list')
4 files changed, 16 insertions, 56 deletions
diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_multi_actions.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_multi_actions.vue index b778fe28e59..9725e882d5e 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_multi_actions.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipeline_multi_actions.vue @@ -95,9 +95,9 @@ export default { {{ $options.i18n.artifactsFetchErrorMessage }} </gl-alert> - <gl-loading-icon v-if="isLoading" size="sm" /> + <gl-loading-icon v-else-if="isLoading" size="sm" /> - <gl-dropdown-item v-if="!artifacts.length && !isLoading" data-testid="artifacts-empty-message"> + <gl-dropdown-item v-else-if="!artifacts.length" data-testid="artifacts-empty-message"> {{ $options.i18n.emptyArtifactsMessage }} </gl-dropdown-item> diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_artifacts.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_artifacts.vue index 1c7c4d7c704..7d0cea67099 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_artifacts.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_artifacts.vue @@ -1,20 +1,15 @@ <script> import { - GlAlert, GlDropdown, GlDropdownItem, GlDropdownSectionHeader, - GlLoadingIcon, GlTooltipDirective, } from '@gitlab/ui'; -import axios from '~/lib/utils/axios_utils'; -import { __, s__ } from '~/locale'; +import { __ } from '~/locale'; export const i18n = { artifacts: __('Artifacts'), artifactSectionHeader: __('Download artifacts'), - artifactsFetchErrorMessage: s__('Pipelines|Could not load artifacts.'), - noArtifacts: s__('Pipelines|No artifacts available'), }; export default { @@ -23,11 +18,9 @@ export default { GlTooltip: GlTooltipDirective, }, components: { - GlAlert, GlDropdown, GlDropdownItem, GlDropdownSectionHeader, - GlLoadingIcon, }, inject: { artifactsEndpoint: { @@ -42,44 +35,22 @@ export default { type: Number, required: true, }, - }, - data() { - return { - artifacts: [], - hasError: false, - isLoading: false, - }; - }, - computed: { - hasArtifacts() { - return Boolean(this.artifacts.length); + artifacts: { + type: Array, + required: false, + default: () => [], }, }, - methods: { - fetchArtifacts() { - this.isLoading = true; - // Replace the placeholder with the ID of the pipeline we are viewing - const endpoint = this.artifactsEndpoint.replace( - this.artifactsEndpointPlaceholder, - this.pipelineId, - ); - return axios - .get(endpoint) - .then(({ data }) => { - this.artifacts = data.artifacts; - }) - .catch(() => { - this.hasError = true; - }) - .finally(() => { - this.isLoading = false; - }); + computed: { + shouldShowDropdown() { + return this.artifacts?.length; }, }, }; </script> <template> <gl-dropdown + v-if="shouldShowDropdown" v-gl-tooltip class="build-artifacts js-pipeline-dropdown-download" :title="$options.i18n.artifacts" @@ -89,22 +60,11 @@ export default { right lazy text-sr-only - @show.once="fetchArtifacts" > <gl-dropdown-section-header>{{ $options.i18n.artifactSectionHeader }}</gl-dropdown-section-header> - <gl-alert v-if="hasError" variant="danger" :dismissible="false"> - {{ $options.i18n.artifactsFetchErrorMessage }} - </gl-alert> - - <gl-loading-icon v-if="isLoading" size="sm" /> - - <gl-alert v-else-if="!hasArtifacts" variant="info" :dismissible="false"> - {{ $options.i18n.noArtifacts }} - </gl-alert> - <gl-dropdown-item v-for="(artifact, i) in artifacts" :key="i" diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_ci_templates.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_ci_templates.vue index c6c81d5253b..83f6356f31a 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_ci_templates.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_ci_templates.vue @@ -76,7 +76,7 @@ export default { </p> <div class="row gl-mb-8"> - <div class="col-lg-3"> + <div class="col-12"> <gl-card> <div class="gl-flex-direction-row"> <div class="gl-py-5"><gl-emoji class="gl-font-size-h2-xl" data-name="wave" /></div> diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue index 12ee82f0390..d64decc81ec 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue @@ -1,5 +1,5 @@ <script> -import { GlTable, GlTooltipDirective } from '@gitlab/ui'; +import { GlTableLite, GlTooltipDirective } from '@gitlab/ui'; import { s__ } from '~/locale'; import eventHub from '../../event_hub'; import PipelineMiniGraph from './pipeline_mini_graph.vue'; @@ -18,7 +18,7 @@ const DEFAULT_TH_CLASSES = export default { components: { - GlTable, + GlTableLite, LinkedPipelinesMiniList: () => import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'), PipelinesCommit, @@ -156,7 +156,7 @@ export default { </script> <template> <div class="ci-table"> - <gl-table + <gl-table-lite :fields="tableFields" :items="pipelines" tbody-tr-class="commit" @@ -225,7 +225,7 @@ export default { <template #cell(actions)="{ item }"> <pipeline-operations :pipeline="item" :canceling-pipeline="cancelingPipeline" /> </template> - </gl-table> + </gl-table-lite> <pipeline-stop-modal :pipeline="pipeline" @submit="onSubmit" /> </div> |