summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/commit
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /app/assets/javascripts/commit
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/commit')
-rw-r--r--app/assets/javascripts/commit/pipelines/pipelines_bundle.js7
-rw-r--r--app/assets/javascripts/commit/pipelines/pipelines_table.vue126
2 files changed, 67 insertions, 66 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_bundle.js b/app/assets/javascripts/commit/pipelines/pipelines_bundle.js
index 340a93e4e66..c8168afbcb0 100644
--- a/app/assets/javascripts/commit/pipelines/pipelines_bundle.js
+++ b/app/assets/javascripts/commit/pipelines/pipelines_bundle.js
@@ -3,9 +3,10 @@ import commitPipelinesTable from './pipelines_table.vue';
/**
* Used in:
- * - Commit details View > Pipelines Tab > Pipelines Table.
- * - Merge Request details View > Pipelines Tab > Pipelines Table.
- * - New Merge Request View > Pipelines Tab > Pipelines Table.
+ * - Project Pipelines List (projects:pipelines:index)
+ * - Commit details View > Pipelines Tab > Pipelines Table (projects:commit:pipelines)
+ * - Merge Request details View > Pipelines Tab > Pipelines Table (projects:merge_requests:show)
+ * - New Merge Request View > Pipelines Tab > Pipelines Table (projects:merge_requests:creations:new)
*/
const CommitPipelinesTable = Vue.extend(commitPipelinesTable);
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.vue b/app/assets/javascripts/commit/pipelines/pipelines_table.vue
index 2f4118c1717..fe32868e6d8 100644
--- a/app/assets/javascripts/commit/pipelines/pipelines_table.vue
+++ b/app/assets/javascripts/commit/pipelines/pipelines_table.vue
@@ -1,6 +1,5 @@
<script>
import { GlButton, GlLoadingIcon, GlModal, GlLink } from '@gitlab/ui';
-import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import PipelinesService from '~/pipelines/services/pipelines_service';
import PipelineStore from '~/pipelines/stores/pipelines_store';
import pipelinesMixin from '~/pipelines/mixins/pipelines';
@@ -126,16 +125,6 @@ export default {
(latest.flags.detached_merge_request_pipeline || latest.flags.merge_request_pipeline)
);
},
- /**
- * When we are on Desktop and the button is visible
- * we need to add a negative margin to the table
- * to make it inline with the button
- *
- * @returns {Boolean}
- */
- shouldAddNegativeMargin() {
- return this.canRenderPipelineButton && bp.isDesktop();
- },
},
created() {
this.service = new PipelinesService(this.endpoint);
@@ -204,66 +193,77 @@ export default {
"
/>
- <div v-else-if="shouldRenderTable" class="table-holder">
- <div v-if="canRenderPipelineButton" class="nav justify-content-end">
- <gl-button
- variant="success"
- class="js-run-mr-pipeline gl-mt-3 btn-wide-on-xs"
- :disabled="state.isRunningMergeRequestPipeline"
- @click="tryRunPipeline"
- >
- <gl-loading-icon v-if="state.isRunningMergeRequestPipeline" inline />
- {{ s__('Pipelines|Run Pipeline') }}
- </gl-button>
-
- <gl-modal
- :id="modalId"
- ref="modal"
- :modal-id="modalId"
- :title="s__('Pipelines|Are you sure you want to run this pipeline?')"
- :ok-title="s__('Pipelines|Run Pipeline')"
- ok-variant="danger"
- @ok="onClickRunPipeline"
- >
- <p>
- {{
- s__(
- 'Pipelines|This pipeline will run code originating from a forked project merge request. This means that the code can potentially have security considerations like exposing CI variables.',
- )
- }}
- </p>
- <p>
- {{
- s__(
- "Pipelines|It is recommended the code is reviewed thoroughly before running this pipeline with the parent project's CI resource.",
- )
- }}
- </p>
- <p>
- {{
- s__(
- 'Pipelines|If you are unsure, please ask a project maintainer to review it for you.',
- )
- }}
- </p>
- <gl-link
- href="/help/ci/merge_request_pipelines/index.html#run-pipelines-in-the-parent-project-for-merge-requests-from-a-forked-project"
- target="_blank"
- >
- {{ s__('Pipelines|More Information') }}
- </gl-link>
- </gl-modal>
- </div>
+ <div v-else-if="shouldRenderTable">
+ <gl-button
+ v-if="canRenderPipelineButton"
+ block
+ class="gl-mt-3 gl-mb-0 gl-display-md-none"
+ variant="success"
+ data-testid="run_pipeline_button_mobile"
+ :loading="state.isRunningMergeRequestPipeline"
+ @click="tryRunPipeline"
+ >
+ {{ s__('Pipelines|Run Pipeline') }}
+ </gl-button>
<pipelines-table-component
:pipelines="state.pipelines"
:update-graph-dropdown="updateGraphDropdown"
:auto-devops-help-path="autoDevopsHelpPath"
:view-type="viewType"
- :class="{ 'negative-margin-top': shouldAddNegativeMargin }"
- />
+ >
+ <template #table-header-actions>
+ <div v-if="canRenderPipelineButton" class="gl-text-right">
+ <gl-button
+ variant="success"
+ data-testid="run_pipeline_button"
+ :loading="state.isRunningMergeRequestPipeline"
+ @click="tryRunPipeline"
+ >
+ {{ s__('Pipelines|Run Pipeline') }}
+ </gl-button>
+ </div>
+ </template>
+ </pipelines-table-component>
</div>
+ <gl-modal
+ v-if="canRenderPipelineButton"
+ :id="modalId"
+ ref="modal"
+ :modal-id="modalId"
+ :title="s__('Pipelines|Are you sure you want to run this pipeline?')"
+ :ok-title="s__('Pipelines|Run Pipeline')"
+ ok-variant="danger"
+ @ok="onClickRunPipeline"
+ >
+ <p>
+ {{
+ s__(
+ 'Pipelines|This pipeline will run code originating from a forked project merge request. This means that the code can potentially have security considerations like exposing CI variables.',
+ )
+ }}
+ </p>
+ <p>
+ {{
+ s__(
+ "Pipelines|It is recommended the code is reviewed thoroughly before running this pipeline with the parent project's CI resource.",
+ )
+ }}
+ </p>
+ <p>
+ {{
+ s__('Pipelines|If you are unsure, please ask a project maintainer to review it for you.')
+ }}
+ </p>
+ <gl-link
+ href="/help/ci/merge_request_pipelines/index.html#run-pipelines-in-the-parent-project-for-merge-requests-from-a-forked-project"
+ target="_blank"
+ >
+ {{ s__('Pipelines|More Information') }}
+ </gl-link>
+ </gl-modal>
+
<table-pagination
v-if="shouldRenderPagination"
:change="onChangePage"