Skip to content
Snippets Groups Projects
Commit 3a087a00 authored by Phil Hughes's avatar Phil Hughes
Browse files

Merge branch '33095-mr-widget-ui' into 'master'

Merge Request widget Improvements

Closes #33095

See merge request !12601
parents 03b816f3 bce029a2
No related branches found
No related tags found
No related merge requests found
Showing
with 495 additions and 420 deletions
import tooltip from '../../vue_shared/directives/tooltip';
export default { export default {
name: 'MRWidgetAuthor', name: 'MRWidgetAuthor',
props: { props: {
Loading
@@ -5,11 +7,14 @@ export default {
Loading
@@ -5,11 +7,14 @@ export default {
showAuthorName: { type: Boolean, required: false, default: true }, showAuthorName: { type: Boolean, required: false, default: true },
showAuthorTooltip: { type: Boolean, required: false, default: false }, showAuthorTooltip: { type: Boolean, required: false, default: false },
}, },
directives: {
tooltip,
},
template: ` template: `
<a <a
:href="author.webUrl || author.web_url" :href="author.webUrl || author.web_url"
class="author-link" class="author-link inline"
:class="{ 'has-tooltip': showAuthorTooltip }" :v-tooltip="showAuthorTooltip"
:title="author.name"> :title="author.name">
<img <img
:src="author.avatarUrl || author.avatar_url" :src="author.avatarUrl || author.avatar_url"
Loading
Loading
/* global Flash */ /* global Flash */
   
import '~/lib/utils/datetime_utility'; import '~/lib/utils/datetime_utility';
import { statusIconEntityMap } from '../../vue_shared/ci_status_icons';
import MemoryUsage from './mr_widget_memory_usage'; import MemoryUsage from './mr_widget_memory_usage';
import StatusIcon from './mr_widget_status_icon';
import MRWidgetService from '../services/mr_widget_service'; import MRWidgetService from '../services/mr_widget_service';
   
export default { export default {
Loading
@@ -13,11 +13,7 @@ export default {
Loading
@@ -13,11 +13,7 @@ export default {
}, },
components: { components: {
'mr-widget-memory-usage': MemoryUsage, 'mr-widget-memory-usage': MemoryUsage,
}, 'status-icon': StatusIcon,
computed: {
svg() {
return statusIconEntityMap.icon_status_success;
},
}, },
methods: { methods: {
formatDate(date) { formatDate(date) {
Loading
@@ -51,51 +47,51 @@ export default {
Loading
@@ -51,51 +47,51 @@ export default {
}, },
}, },
template: ` template: `
<div class="mr-widget-heading"> <div class="mr-widget-heading deploy-heading">
<div v-for="deployment in mr.deployments"> <div v-for="deployment in mr.deployments">
<div class="ci-widget"> <div class="ci-widget media">
<div class="ci-status-icon ci-status-icon-success"> <div class="ci-status-icon ci-status-icon-success">
<span class="js-icon-link icon-link"> <span class="js-icon-link icon-link">
<span class="ci-status-icon" <status-icon status="success" />
v-html="svg"
aria-hidden="true"></span>
</span> </span>
</div> </div>
<span> <div class="media-body space-children">
<span <span>
v-if="hasDeploymentMeta(deployment)"> <span
Deployed to v-if="hasDeploymentMeta(deployment)">
</span> Deployed to
<a </span>
v-if="hasDeploymentMeta(deployment)" <a
:href="deployment.url" v-if="hasDeploymentMeta(deployment)"
target="_blank" :href="deployment.url"
rel="noopener noreferrer nofollow" target="_blank"
class="js-deploy-meta"> rel="noopener noreferrer nofollow"
{{deployment.name}} class="js-deploy-meta inline">
</a> {{deployment.name}}
<span </a>
v-if="hasExternalUrls(deployment)"> <span
on v-if="hasExternalUrls(deployment)">
</span> on
<a </span>
v-if="hasExternalUrls(deployment)" <a
:href="deployment.external_url" v-if="hasExternalUrls(deployment)"
target="_blank" :href="deployment.external_url"
rel="noopener noreferrer nofollow" target="_blank"
class="js-deploy-url"> rel="noopener noreferrer nofollow"
<i class="js-deploy-url inline">
class="fa fa-external-link" <i
aria-hidden="true" /> class="fa fa-external-link"
{{deployment.external_url_formatted}} aria-hidden="true" />
</a> {{deployment.external_url_formatted}}
<span </a>
v-if="hasDeploymentTime(deployment)" <span
:data-title="deployment.deployed_at_formatted" v-if="hasDeploymentTime(deployment)"
class="js-deploy-time" :data-title="deployment.deployed_at_formatted"
data-toggle="tooltip" class="js-deploy-time"
data-placement="top"> data-toggle="tooltip"
{{formatDate(deployment.deployed_at)}} data-placement="top">
{{formatDate(deployment.deployed_at)}}
</span>
</span> </span>
<button <button
type="button" type="button"
Loading
@@ -104,13 +100,13 @@ export default {
Loading
@@ -104,13 +100,13 @@ export default {
class="btn btn-default btn-xs"> class="btn btn-default btn-xs">
Stop environment Stop environment
</button> </button>
</span> <mr-widget-memory-usage
v-if="deployment.metrics_url"
:metrics-url="deployment.metrics_url"
:metrics-monitoring-url="deployment.metrics_monitoring_url"
/>
</div>
</div> </div>
<mr-widget-memory-usage
v-if="deployment.metrics_url"
:metrics-url="deployment.metrics_url"
:metrics-monitoring-url="deployment.metrics_monitoring_url"
/>
</div> </div>
</div> </div>
`, `,
Loading
Loading
import tooltip from '../../vue_shared/directives/tooltip';
import '../../lib/utils/text_utility'; import '../../lib/utils/text_utility';
   
export default { export default {
Loading
@@ -5,6 +6,9 @@ export default {
Loading
@@ -5,6 +6,9 @@ export default {
props: { props: {
mr: { type: Object, required: true }, mr: { type: Object, required: true },
}, },
directives: {
tooltip,
},
computed: { computed: {
shouldShowCommitsBehindText() { shouldShowCommitsBehindText() {
return this.mr.divergedCommitsCount > 0; return this.mr.divergedCommitsCount > 0;
Loading
@@ -29,18 +33,51 @@ export default {
Loading
@@ -29,18 +33,51 @@ export default {
}, },
template: ` template: `
<div class="mr-source-target"> <div class="mr-source-target">
<div <div class="normal">
v-if="mr.isOpen" <strong>
class="pull-right"> Request to merge
<span
class="label-branch"
:class="{'label-truncated': isBranchTitleLong(mr.sourceBranch)}"
:title="isBranchTitleLong(mr.sourceBranch) ? mr.sourceBranch : ''"
data-placement="bottom"
:v-tooltip="isBranchTitleLong(mr.sourceBranch)"
v-html="mr.sourceBranchLink"></span>
<button
v-tooltip
class="btn btn-transparent btn-clipboard"
data-title="Copy branch name to clipboard"
:data-clipboard-text="branchNameClipboardData">
<i
aria-hidden="true"
class="fa fa-clipboard"></i>
</button>
into
<span
class="label-branch"
:v-tooltip="isBranchTitleLong(mr.sourceBranch)"
:class="{'label-truncatedtooltip': isBranchTitleLong(mr.targetBranch)}"
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
data-placement="bottom">
<a :href="mr.targetBranchTreePath">{{mr.targetBranch}}</a>
</span>
</strong>
<span
v-if="shouldShowCommitsBehindText"
class="diverged-commits-count">
(<a :href="mr.targetBranchPath">{{mr.divergedCommitsCount}} {{commitsText}} behind</a>)
</span>
</div>
<div v-if="mr.isOpen">
<a <a
href="#modal_merge_info" href="#modal_merge_info"
data-toggle="modal" data-toggle="modal"
class="btn inline btn-grouped btn-sm"> class="btn btn-small inline">
Check out branch Check out branch
</a> </a>
<span class="dropdown inline prepend-left-5"> <span class="dropdown inline prepend-left-10">
<a <a
class="btn btn-sm dropdown-toggle" class="btn btn-xs dropdown-toggle"
data-toggle="dropdown" data-toggle="dropdown"
aria-label="Download as" aria-label="Download as"
role="button"> role="button">
Loading
@@ -69,38 +106,6 @@ export default {
Loading
@@ -69,38 +106,6 @@ export default {
</ul> </ul>
</span> </span>
</div> </div>
<div class="normal">
<strong>
Request to merge
<span
class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.sourceBranch)}"
:title="isBranchTitleLong(mr.sourceBranch) ? mr.sourceBranch : ''"
data-placement="bottom"
v-html="mr.sourceBranchLink"></span>
<button
class="btn btn-transparent btn-clipboard has-tooltip"
data-title="Copy branch name to clipboard"
:data-clipboard-text="branchNameClipboardData">
<i
aria-hidden="true"
class="fa fa-clipboard"></i>
</button>
into
<span
class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.targetBranch)}"
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
data-placement="bottom">
<a :href="mr.targetBranchTreePath">{{mr.targetBranch}}</a>
</span>
</strong>
<span
v-if="shouldShowCommitsBehindText"
class="diverged-commits-count">
(<a :href="mr.targetBranchPath">{{mr.divergedCommitsCount}} {{commitsText}} behind</a>)
</span>
</div>
</div> </div>
`, `,
}; };
Loading
@@ -120,13 +120,12 @@ export default {
Loading
@@ -120,13 +120,12 @@ export default {
}, },
template: ` template: `
<div class="mr-info-list clearfix mr-memory-usage js-mr-memory-usage"> <div class="mr-info-list clearfix mr-memory-usage js-mr-memory-usage">
<div class="legend"></div>
<p <p
v-if="shouldShowLoading" v-if="shouldShowLoading"
class="usage-info js-usage-info usage-info-loading"> class="usage-info js-usage-info usage-info-loading">
<i <i
class="fa fa-spinner fa-spin usage-info-load-spinner" class="fa fa-spinner fa-spin usage-info-load-spinner"
aria-hidden="true" />Loading deployment statistics. aria-hidden="true" />Loading deployment statistics
</p> </p>
<p <p
v-if="shouldShowMemoryGraph" v-if="shouldShowMemoryGraph"
Loading
@@ -136,12 +135,12 @@ export default {
Loading
@@ -136,12 +135,12 @@ export default {
<p <p
v-if="shouldShowLoadFailure" v-if="shouldShowLoadFailure"
class="usage-info js-usage-info usage-info-failed"> class="usage-info js-usage-info usage-info-failed">
Failed to load deployment statistics. Failed to load deployment statistics
</p> </p>
<p <p
v-if="shouldShowMetricsUnavailable" v-if="shouldShowMetricsUnavailable"
class="usage-info js-usage-info usage-info-unavailable"> class="usage-info js-usage-info usage-info-unavailable">
Deployment statistics are not available currently. Deployment statistics are not available currently
</p> </p>
<mr-memory-graph <mr-memory-graph
v-if="shouldShowMemoryGraph" v-if="shouldShowMemoryGraph"
Loading
Loading
Loading
@@ -16,7 +16,7 @@ export default {
Loading
@@ -16,7 +16,7 @@ export default {
<a <a
data-toggle="modal" data-toggle="modal"
href="#modal_merge_info"> href="#modal_merge_info">
command line. command line
</a> </a>
</section> </section>
`, `,
Loading
Loading
Loading
@@ -29,58 +29,55 @@ export default {
Loading
@@ -29,58 +29,55 @@ export default {
}, },
template: ` template: `
<div class="mr-widget-heading"> <div class="mr-widget-heading">
<div class="ci-widget"> <div class="ci-widget media">
<template v-if="hasCIError"> <template v-if="hasCIError">
<div class="ci-status-icon ci-status-icon-failed ci-error js-ci-error"> <div class="ci-status-icon ci-status-icon-failed ci-error js-ci-error append-right-10">
<span class="js-icon-link icon-link"> <span
<span v-html="svg"
v-html="svg" aria-hidden="true"></span>
aria-hidden="true"></span> </div>
</span> <div class="media-body">
Could not connect to the CI server. Please check your settings and try again
</div> </div>
<span>Could not connect to the CI server. Please check your settings and try again.</span>
</template> </template>
<template v-else> <template v-else>
<div> <div class="ci-status-icon append-right-10">
<a <a
class="icon-link" class="icon-link"
:href="this.status.details_path"> :href="this.status.details_path">
<ci-icon :status="status" /> <ci-icon :status="status" />
</a> </a>
</div> </div>
<span> <div class="media-body">
Pipeline <span>
<a Pipeline
:href="mr.pipeline.path" <a
class="pipeline-id">#{{mr.pipeline.id}}</a> :href="mr.pipeline.path"
{{mr.pipeline.details.status.label}} class="pipeline-id">#{{mr.pipeline.id}}</a>
</span> </span>
<span <span class="mr-widget-pipeline-graph">
v-if="mr.pipeline.details.stages.length > 0"> <span class="stage-cell">
with {{stageText}} <div
</span> v-if="mr.pipeline.details.stages.length > 0"
<div class="mr-widget-pipeline-graph"> v-for="stage in mr.pipeline.details.stages"
<div class="stage-cell"> class="stage-container dropdown js-mini-pipeline-graph">
<div <pipeline-stage :stage="stage" />
v-if="mr.pipeline.details.stages.length > 0" </div>
v-for="stage in mr.pipeline.details.stages" </span>
class="stage-container dropdown js-mini-pipeline-graph"> </span>
<pipeline-stage :stage="stage" /> <span>
</div> {{mr.pipeline.details.status.label}} for
</div> <a
:href="mr.pipeline.commit.commit_path"
class="commit-sha js-commit-link">
{{mr.pipeline.commit.short_id}}</a>.
</span>
<span
v-if="mr.pipeline.coverage"
class="js-mr-coverage">
Coverage {{mr.pipeline.coverage}}%
</span>
</div> </div>
<span>
for
<a
:href="mr.pipeline.commit.commit_path"
class="commit-sha js-commit-link">
{{mr.pipeline.commit.short_id}}</a>.
</span>
<span
v-if="mr.pipeline.coverage"
class="js-mr-coverage">
Coverage {{mr.pipeline.coverage}}%.
</span>
</template> </template>
</div> </div>
</div> </div>
Loading
Loading
Loading
@@ -2,37 +2,32 @@ export default {
Loading
@@ -2,37 +2,32 @@ export default {
name: 'MRWidgetRelatedLinks', name: 'MRWidgetRelatedLinks',
props: { props: {
relatedLinks: { type: Object, required: true }, relatedLinks: { type: Object, required: true },
state: { type: String, required: false },
}, },
computed: { computed: {
hasLinks() { hasLinks() {
const { closing, mentioned, assignToMe } = this.relatedLinks; const { closing, mentioned, assignToMe } = this.relatedLinks;
return closing || mentioned || assignToMe; return closing || mentioned || assignToMe;
}, },
}, closesText() {
methods: { if (this.state === 'merged') {
hasMultipleIssues(text) { return 'Closed';
return !text ? false : text.match(/<\/a> and <a/); }
}, if (this.state === 'closed') {
issueLabel(field) { return 'Did not close';
return this.hasMultipleIssues(this.relatedLinks[field]) ? 'issues' : 'issue'; }
}, return 'Closes';
verbLabel(field) {
return this.hasMultipleIssues(this.relatedLinks[field]) ? 'are' : 'is';
}, },
}, },
template: ` template: `
<section <section
v-if="hasLinks" v-if="hasLinks"
class="mr-info-list mr-links"> class="mr-info-list mr-links">
<div class="legend"></div>
<p v-if="relatedLinks.closing"> <p v-if="relatedLinks.closing">
Closes {{issueLabel('closing')}} {{closesText}} <span v-html="relatedLinks.closing"></span>
<span v-html="relatedLinks.closing"></span>.
</p> </p>
<p v-if="relatedLinks.mentioned"> <p v-if="relatedLinks.mentioned">
<span class="capitalize">{{issueLabel('mentioned')}}</span> Mentions <span v-html="relatedLinks.mentioned"></span>
<span v-html="relatedLinks.mentioned"></span>
{{verbLabel('mentioned')}} mentioned but will not be closed.
</p> </p>
<p v-if="relatedLinks.assignToMe"> <p v-if="relatedLinks.assignToMe">
<span v-html="relatedLinks.assignToMe"></span> <span v-html="relatedLinks.assignToMe"></span>
Loading
Loading
import ciIcon from '../../vue_shared/components/ci_icon.vue';
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
export default {
props: {
status: { type: String, required: true },
showDisabledButton: { type: Boolean, required: false },
},
components: {
ciIcon,
loadingIcon,
},
computed: {
statusObj() {
return {
group: this.status,
icon: `icon_status_${this.status}`,
};
},
},
template: `
<div class="space-children flex-container-block append-right-10">
<div v-if="status === 'loading'" class="mr-widget-icon">
<loading-icon />
</div>
<ci-icon v-else :status="statusObj" />
<button
v-if="showDisabledButton"
type="button"
class="btn btn-success btn-small"
disabled="true">
Merge
</button>
</div>
`,
};
import statusIcon from '../mr_widget_status_icon';
export default { export default {
name: 'MRWidgetArchived', name: 'MRWidgetArchived',
components: {
statusIcon,
},
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <div class="space-children">
type="button" <status-icon status="failed" />
class="btn btn-success btn-small" <button
disabled="true"> type="button"
Merge class="btn btn-success btn-small"
</button> disabled="true">
<span class="bold"> Merge
This project is archived, write access has been disabled. </button>
</span> </div>
<div class="media-body">
<span class="bold">
This project is archived, write access has been disabled
</span>
</div>
</div> </div>
`, `,
}; };
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon';
   
export default { export default {
name: 'MRWidgetAutoMergeFailed', name: 'MRWidgetAutoMergeFailed',
Loading
@@ -10,6 +11,9 @@ export default {
Loading
@@ -10,6 +11,9 @@ export default {
isRefreshing: false, isRefreshing: false,
}; };
}, },
components: {
statusIcon,
},
methods: { methods: {
refreshWidget() { refreshWidget() {
this.isRefreshing = true; this.isRefreshing = true;
Loading
@@ -19,18 +23,16 @@ export default {
Loading
@@ -19,18 +23,16 @@ export default {
}, },
}, },
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <status-icon status="failed" />
class="btn btn-success btn-small" <div class="media-body space-children">
disabled="true" <span class="bold">
type="button"> <template v-if="mr.mergeError">{{mr.mergeError}}.</template>
Merge This merge request failed to be merged automatically
</button> </span>
<span class="bold danger">
This merge request failed to be merged automatically.
<button <button
@click="refreshWidget" @click="refreshWidget"
:class="{ disabled: isRefreshing }" :disabled="isRefreshing"
type="button" type="button"
class="btn btn-xs btn-default"> class="btn btn-xs btn-default">
<i <i
Loading
@@ -39,9 +41,6 @@ export default {
Loading
@@ -39,9 +41,6 @@ export default {
aria-hidden="true" /> aria-hidden="true" />
Refresh Refresh
</button> </button>
</span>
<div class="merge-error-text danger bold">
{{mr.mergeError}}
</div> </div>
</div> </div>
`, `,
Loading
Loading
import statusIcon from '../mr_widget_status_icon';
export default { export default {
name: 'MRWidgetChecking', name: 'MRWidgetChecking',
components: {
statusIcon,
},
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <status-icon status="loading" showDisabledButton />
type="button" <div class="media-body space-children">
class="btn btn-success btn-small" <span class="bold">
disabled="true"> Checking ability to merge automatically
Merge </span>
</button> </div>
<span class="bold">
Checking ability to merge automatically.
<i
class="fa fa-spinner fa-spin"
aria-hidden="true" />
</span>
</div> </div>
`, `,
}; };
import mrWidgetAuthorTime from '../../components/mr_widget_author_time'; import mrWidgetAuthorTime from '../../components/mr_widget_author_time';
import statusIcon from '../mr_widget_status_icon';
   
export default { export default {
name: 'MRWidgetClosed', name: 'MRWidgetClosed',
Loading
@@ -7,24 +8,28 @@ export default {
Loading
@@ -7,24 +8,28 @@ export default {
}, },
components: { components: {
'mr-widget-author-and-time': mrWidgetAuthorTime, 'mr-widget-author-and-time': mrWidgetAuthorTime,
statusIcon,
}, },
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<mr-widget-author-and-time <status-icon status="failed" />
actionText="Closed by" <div class="media-body">
:author="mr.closedBy" <mr-widget-author-and-time
:dateTitle="mr.updatedAt" actionText="Closed by"
:dateReadable="mr.closedAt" :author="mr.closedBy"
/> :dateTitle="mr.updatedAt"
<section> :dateReadable="mr.closedAt"
<p> />
The changes were not merged into <section class="mr-info-list">
<a <p>
:href="mr.targetBranchPath" The changes were not merged into
class="label-branch"> <a
{{mr.targetBranch}}</a>. :href="mr.targetBranchPath"
</p> class="label-branch">
</section> {{mr.targetBranch}}</a>
</p>
</section>
</div>
</div> </div>
`, `,
}; };
import statusIcon from '../mr_widget_status_icon';
export default { export default {
name: 'MRWidgetConflicts', name: 'MRWidgetConflicts',
props: { props: {
mr: { type: Object, required: true }, mr: { type: Object, required: true },
}, },
components: {
statusIcon,
},
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <status-icon status="failed" showDisabledButton />
type="button" <div class="media-body space-children">
class="btn btn-success btn-small" <span class="bold">
disabled="true"> There are merge conflicts<span v-if="!mr.canMerge">.</span>
Merge <span v-if="!mr.canMerge">
</button> Resolve these conflicts or ask someone with write access to this repository to merge it locally
<span class="bold"> </span>
There are merge conflicts.
<span v-if="!mr.canMerge">
Resolve these conflicts or ask someone with write access to this repository to merge it locally.
</span> </span>
</span>
<div
v-if="mr.canMerge"
class="btn-group">
<a <a
v-if="mr.conflictResolutionPath" v-if="mr.canMerge && mr.conflictResolutionPath"
:href="mr.conflictResolutionPath" :href="mr.conflictResolutionPath"
class="btn btn-default btn-xs js-resolve-conflicts-button"> class="btn btn-default btn-xs js-resolve-conflicts-button">
Resolve conflicts Resolve conflicts
Loading
Loading
import statusIcon from '../mr_widget_status_icon';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
   
export default { export default {
Loading
@@ -38,39 +39,40 @@ export default {
Loading
@@ -38,39 +39,40 @@ export default {
} }
}, },
}, },
components: {
statusIcon,
},
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <template v-if="isRefreshing">
class="btn btn-success btn-small" <status-icon status="loading" />
disabled="true" <span class="media-body bold js-refresh-label">
type="button"> Refreshing now
Merge
</button>
<span
v-if="!isRefreshing"
class="bold danger">
<span
class="has-error-message"
v-if="mr.mergeError">
{{mr.mergeError}}
</span>
<span v-else>Merge failed.</span>
<span
:class="{ 'has-custom-error': mr.mergeError }">
Refreshing in {{timerText}} to show the updated status...
</span> </span>
<button </template>
@click="refresh" <template v-else>
class="btn btn-default btn-xs js-refresh-button" <status-icon status="failed" showDisabledButton />
type="button"> <div class="media-body space-children">
Refresh now <span class="bold">
</button> <span
</span> class="has-error-message"
<span v-if="mr.mergeError">
v-if="isRefreshing" {{mr.mergeError}}.
class="bold js-refresh-label"> </span>
Refreshing now... <span v-else>Merge failed.</span>
</span> <span
:class="{ 'has-custom-error': mr.mergeError }">
Refreshing in {{timerText}} to show the updated status...
</span>
</span>
<button
@click="refresh"
class="btn btn-default btn-xs js-refresh-button"
type="button">
Refresh now
</button>
</div>
</template>
</div> </div>
`, `,
}; };
import statusIcon from '../mr_widget_status_icon';
export default { export default {
name: 'MRWidgetLocked', name: 'MRWidgetLocked',
props: { props: {
mr: { type: Object, required: true }, mr: { type: Object, required: true },
}, },
components: {
statusIcon,
},
template: ` template: `
<div class="mr-widget-body mr-state-locked"> <div class="mr-widget-body mr-state-locked media">
<span class="state-label">Locked</span> <status-icon status="loading" />
This merge request is in the process of being merged, during which time it is locked and cannot be closed. <div class="media-body">
<i <h4>
class="fa fa-spinner fa-spin" This merge request is in the process of being merged, during which time it is locked and cannot be closed
aria-hidden="true" /> </h4>
<section class="mr-info-list mr-links"> <section class="mr-info-list">
<div class="legend"></div> <p>
<p> The changes will be merged into
The changes will be merged into <span class="label-branch">
<span class="label-branch"> <a :href="mr.targetBranchPath">{{mr.targetBranch}}</a>
<a :href="mr.targetBranchPath">{{mr.targetBranch}}</a> </span>
</span>. </p>
</p> </section>
</section> </div>
</div> </div>
`, `,
}; };
/* global Flash */ /* global Flash */
import statusIcon from '../mr_widget_status_icon';
import MRWidgetAuthor from '../../components/mr_widget_author'; import MRWidgetAuthor from '../../components/mr_widget_author';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
   
Loading
@@ -11,6 +11,7 @@ export default {
Loading
@@ -11,6 +11,7 @@ export default {
}, },
components: { components: {
'mr-widget-author': MRWidgetAuthor, 'mr-widget-author': MRWidgetAuthor,
statusIcon,
}, },
data() { data() {
return { return {
Loading
@@ -61,56 +62,56 @@ export default {
Loading
@@ -61,56 +62,56 @@ export default {
}, },
}, },
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<h4> <status-icon status="success" />
Set by <div class="media-body">
<mr-widget-author :author="mr.setToMWPSBy" /> <h4>
to be merged automatically when the pipeline succeeds. Set by
<a <mr-widget-author :author="mr.setToMWPSBy" />
v-if="mr.canCancelAutomaticMerge" to be merged automatically when the pipeline succeeds
@click.prevent="cancelAutomaticMerge"
:disabled="isCancellingAutoMerge"
role="button"
href="#"
class="btn btn-xs btn-default js-cancel-auto-merge">
<i
v-if="isCancellingAutoMerge"
class="fa fa-spinner fa-spin"
aria-hidden="true" />
Cancel automatic merge
</a>
</h4>
<section class="mr-info-list">
<div class="legend"></div>
<p>The changes will be merged into
<a
:href="mr.targetBranchPath"
class="label-branch">
{{mr.targetBranch}}
</a>.
</p>
<p v-if="mr.shouldRemoveSourceBranch">
The source branch will be removed.
</p>
<p
v-else
class="with-button">
The source branch will not be removed.
<a <a
v-if="canRemoveSourceBranch" v-if="mr.canCancelAutomaticMerge"
:disabled="isRemovingSourceBranch" @click.prevent="cancelAutomaticMerge"
@click.prevent="removeSourceBranch" :disabled="isCancellingAutoMerge"
role="button" role="button"
class="btn btn-xs btn-default js-remove-source-branch" href="#"
href="#"> class="btn btn-xs btn-default js-cancel-auto-merge">
<i <i
v-if="isRemovingSourceBranch" v-if="isCancellingAutoMerge"
class="fa fa-spinner fa-spin" class="fa fa-spinner fa-spin"
aria-hidden="true" /> aria-hidden="true" />
Remove source branch Cancel automatic merge
</a> </a>
</p> </h4>
</section> <section class="mr-info-list">
<p>The changes will be merged into
<a
:href="mr.targetBranchPath"
class="label-branch">
{{mr.targetBranch}}
</a>
</p>
<p v-if="mr.shouldRemoveSourceBranch">
The source branch will be removed
</p>
<p v-else>
The source branch will not be removed
<a
v-if="canRemoveSourceBranch"
:disabled="isRemovingSourceBranch"
@click.prevent="removeSourceBranch"
role="button"
class="btn btn-xs btn-default js-remove-source-branch"
href="#">
<i
v-if="isRemovingSourceBranch"
class="fa fa-spinner fa-spin"
aria-hidden="true" />
Remove source branch
</a>
</p>
</section>
</div>
</div> </div>
`, `,
}; };
/* global Flash */ /* global Flash */
   
import mrWidgetAuthorTime from '../../components/mr_widget_author_time'; import mrWidgetAuthorTime from '../../components/mr_widget_author_time';
import tooltip from '../../../vue_shared/directives/tooltip';
import loadingIcon from '../../../vue_shared/components/loading_icon.vue';
import statusIcon from '../mr_widget_status_icon';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
   
export default { export default {
Loading
@@ -9,14 +12,19 @@ export default {
Loading
@@ -9,14 +12,19 @@ export default {
mr: { type: Object, required: true }, mr: { type: Object, required: true },
service: { type: Object, required: true }, service: { type: Object, required: true },
}, },
components: {
'mr-widget-author-and-time': mrWidgetAuthorTime,
},
data() { data() {
return { return {
isMakingRequest: false, isMakingRequest: false,
}; };
}, },
directives: {
tooltip,
},
components: {
'mr-widget-author-and-time': mrWidgetAuthorTime,
loadingIcon,
statusIcon,
},
computed: { computed: {
shouldShowRemoveSourceBranch() { shouldShowRemoveSourceBranch() {
const { sourceBranchRemoved, isRemovingSourceBranch, canRemoveSourceBranch } = this.mr; const { sourceBranchRemoved, isRemovingSourceBranch, canRemoveSourceBranch } = this.mr;
Loading
@@ -55,75 +63,77 @@ export default {
Loading
@@ -55,75 +63,77 @@ export default {
}, },
}, },
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<mr-widget-author-and-time <status-icon status="success" />
actionText="Merged by" <div class="media-body">
:author="mr.mergedBy" <div class="space-children">
:dateTitle="mr.updatedAt" <mr-widget-author-and-time
:dateReadable="mr.mergedAt" /> actionText="Merged by"
<section class="mr-info-list"> :author="mr.mergedBy"
<div class="legend"></div> :dateTitle="mr.updatedAt"
<p> :dateReadable="mr.mergedAt" />
The changes were merged into <a
<span class="label-branch"> v-if="mr.canRevertInCurrentMR"
<a :href="mr.targetBranchPath">{{mr.targetBranch}}</a> v-tooltip
</span> class="btn btn-close btn-xs"
</p> href="#modal-revert-commit"
<p v-if="mr.sourceBranchRemoved">The source branch has been removed.</p> data-toggle="modal"
<p v-if="shouldShowRemoveSourceBranch"> data-container="body"
You can remove source branch now. title="Revert this merge request in a new merge request">
<button Revert
@click="removeSourceBranch" </a>
:class="{ disabled: isMakingRequest }" <a
type="button" v-else-if="mr.revertInForkPath"
class="btn btn-xs btn-default js-remove-branch-button"> v-tooltip
Remove Source Branch class="btn btn-close btn-xs"
</button> data-method="post"
</p> :href="mr.revertInForkPath"
<p v-if="shouldShowSourceBranchRemoving"> title="Revert this merge request in a new merge request">
<i Revert
class="fa fa-spinner fa-spin" </a>
aria-hidden="true" /> <a
The source branch is being removed. v-if="mr.canCherryPickInCurrentMR"
</p> v-tooltip
</section> class="btn btn-default btn-xs"
<div href="#modal-cherry-pick-commit"
v-if="shouldShowMergedButtons" data-toggle="modal"
class="merged-buttons clearfix"> data-container="body"
<a title="Cherry-pick this merge request in a new merge request">
v-if="mr.canRevertInCurrentMR" Cherry-pick
class="btn btn-close btn-sm has-tooltip" </a>
href="#modal-revert-commit" <a
data-toggle="modal" v-else-if="mr.cherryPickInForkPath"
data-container="body" v-tooltip
title="Revert this merge request in a new merge request"> class="btn btn-default btn-xs"
Revert data-method="post"
</a> :href="mr.cherryPickInForkPath"
<a title="Cherry-pick this merge request in a new merge request">
v-else-if="mr.revertInForkPath" Cherry-pick
class="btn btn-close btn-sm has-tooltip" </a>
data-method="post" </div>
:href="mr.revertInForkPath" <section class="mr-info-list">
title="Revert this merge request in a new merge request"> <p>
Revert The changes were merged into
</a> <span class="label-branch">
<a <a :href="mr.targetBranchPath">{{mr.targetBranch}}</a>
v-if="mr.canCherryPickInCurrentMR" </span>
class="btn btn-default btn-sm has-tooltip" </p>
href="#modal-cherry-pick-commit" <p v-if="mr.sourceBranchRemoved">The source branch has been removed</p>
data-toggle="modal" <p v-if="shouldShowRemoveSourceBranch" class="space-children">
data-container="body" <span>You can remove source branch now</span>
title="Cherry-pick this merge request in a new merge request"> <button
Cherry-pick @click="removeSourceBranch"
</a> :disabled="isMakingRequest"
<a type="button"
v-else-if="mr.cherryPickInForkPath" class="btn btn-xs btn-default js-remove-branch-button">
class="btn btn-default btn-sm has-tooltip" Remove Source Branch
data-method="post" </button>
:href="mr.cherryPickInForkPath" </p>
title="Cherry-pick this merge request in a new merge request"> <p v-if="shouldShowSourceBranchRemoving">
Cherry-pick <loading-icon inline />
</a> <span>The source branch is being removed</span>
</p>
</section>
</div> </div>
</div> </div>
`, `,
Loading
Loading
import statusIcon from '../mr_widget_status_icon';
import tooltip from '../../../vue_shared/directives/tooltip';
import mrWidgetMergeHelp from '../../components/mr_widget_merge_help'; import mrWidgetMergeHelp from '../../components/mr_widget_merge_help';
   
export default { export default {
Loading
@@ -5,30 +7,37 @@ export default {
Loading
@@ -5,30 +7,37 @@ export default {
props: { props: {
mr: { type: Object, required: true }, mr: { type: Object, required: true },
}, },
directives: {
tooltip,
},
components: { components: {
'mr-widget-merge-help': mrWidgetMergeHelp, 'mr-widget-merge-help': mrWidgetMergeHelp,
statusIcon,
}, },
computed: { computed: {
missingBranchName() { missingBranchName() {
return this.mr.sourceBranchRemoved ? 'source' : 'target'; return this.mr.sourceBranchRemoved ? 'source' : 'target';
}, },
message() {
return `If the ${this.missingBranchName} branch exists in your local repository, you can merge this merge request manually using the command line`;
},
}, },
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <status-icon status="failed" showDisabledButton />
type="button" <div class="media-body space-children">
class="btn btn-success btn-small" <span class="bold js-branch-text">
disabled="true"> <span class="capitalize">
Merge {{missingBranchName}}
</button> </span> branch does not exist.
<span class="bold js-branch-text"> Please restore it or use a different {{missingBranchName}} branch
<span class="capitalize"> <i
{{missingBranchName}} v-tooltip
</span> branch does not exist. class="fa fa-question-circle"
Please restore the {{missingBranchName}} branch or use a different {{missingBranchName}} branch. :title="message"
</span> :aria-label="message"></i>
<mr-widget-merge-help </span>
:missing-branch="missingBranchName" /> </div>
</div> </div>
`, `,
}; };
import statusIcon from '../mr_widget_status_icon';
export default { export default {
name: 'MRWidgetNotAllowed', name: 'MRWidgetNotAllowed',
components: {
statusIcon,
},
template: ` template: `
<div class="mr-widget-body"> <div class="mr-widget-body media">
<button <status-icon status="success" showDisabledButton />
type="button" <div class="media-body space-children">
class="btn btn-success btn-small" <span class="bold">
disabled="true"> Ready to be merged automatically.
Merge Ask someone with write access to this repository to merge this request
</button> </span>
<span class="bold"> </div>
Ready to be merged automatically.
Ask someone with write access to this repository to merge this request.
</span>
</div> </div>
`, `,
}; };
Loading
@@ -12,7 +12,7 @@ export default {
Loading
@@ -12,7 +12,7 @@ export default {
return { emptyStateSVG }; return { emptyStateSVG };
}, },
template: ` template: `
<div class="mr-widget-body empty-state"> <div class="mr-widget-body mr-widget-empty-state">
<div class="row"> <div class="row">
<div class="artwork col-sm-5 col-sm-push-7 col-xs-12 text-center"> <div class="artwork col-sm-5 col-sm-push-7 col-xs-12 text-center">
<span v-html="emptyStateSVG"></span> <span v-html="emptyStateSVG"></span>
Loading
@@ -29,12 +29,14 @@ export default {
Loading
@@ -29,12 +29,14 @@ export default {
Currently there are no changes in this merge request's source branch. Currently there are no changes in this merge request's source branch.
Please push new commits or use a different branch. Please push new commits or use a different branch.
</p> </p>
<a <div>
v-if="mr.newBlobPath" <a
:href="mr.newBlobPath" v-if="mr.newBlobPath"
class="btn btn-inverted btn-save"> :href="mr.newBlobPath"
Create file class="btn btn-inverted btn-save">
</a> Create file
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment