Commit 4ac646b3 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'vue-i18n-js-vue-mr-widget-directory-ee' into 'master'

Vue-i18n: app/assets/javascripts/vue_merge_request_widget directory

See merge request gitlab-org/gitlab-ee!14380
parents 6850a11c e6b88baf
...@@ -125,7 +125,9 @@ export default { ...@@ -125,7 +125,9 @@ export default {
this.isStopping = false; this.isStopping = false;
}) })
.catch(() => { .catch(() => {
createFlash('Something went wrong while stopping this environment. Please try again.'); createFlash(
__('Something went wrong while stopping this environment. Please try again.'),
);
this.isStopping = false; this.isStopping = false;
}); });
} }
......
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
type="button" type="button"
class="btn dropdown-toggle qa-dropdown-toggle" class="btn dropdown-toggle qa-dropdown-toggle"
data-toggle="dropdown" data-toggle="dropdown"
aria-label="Download as" :aria-label="__('Download as')"
aria-haspopup="true" aria-haspopup="true"
aria-expanded="false" aria-expanded="false"
> >
......
...@@ -6,6 +6,7 @@ import statusIcon from '../mr_widget_status_icon.vue'; ...@@ -6,6 +6,7 @@ import statusIcon from '../mr_widget_status_icon.vue';
import MrWidgetAuthor from '../../components/mr_widget_author.vue'; import MrWidgetAuthor from '../../components/mr_widget_author.vue';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import { AUTO_MERGE_STRATEGIES } from '../../constants'; import { AUTO_MERGE_STRATEGIES } from '../../constants';
import { __ } from '~/locale';
export default { export default {
name: 'MRWidgetAutoMergeEnabled', name: 'MRWidgetAutoMergeEnabled',
...@@ -55,7 +56,7 @@ export default { ...@@ -55,7 +56,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isCancellingAutoMerge = false; this.isCancellingAutoMerge = false;
Flash('Something went wrong. Please try again.'); Flash(__('Something went wrong. Please try again.'));
}); });
}, },
removeSourceBranch() { removeSourceBranch() {
...@@ -76,7 +77,7 @@ export default { ...@@ -76,7 +77,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isRemovingSourceBranch = false; this.isRemovingSourceBranch = false;
Flash('Something went wrong. Please try again.'); Flash(__('Something went wrong. Please try again.'));
}); });
}, },
}, },
...@@ -107,15 +108,15 @@ export default { ...@@ -107,15 +108,15 @@ export default {
<section class="mr-info-list"> <section class="mr-info-list">
<p> <p>
{{ s__('mrWidget|The changes will be merged into') }} {{ s__('mrWidget|The changes will be merged into') }}
<a :href="mr.targetBranchPath" class="label-branch"> {{ mr.targetBranch }} </a> <a :href="mr.targetBranchPath" class="label-branch">{{ mr.targetBranch }}</a>
</p> </p>
<p v-if="mr.shouldRemoveSourceBranch"> <p v-if="mr.shouldRemoveSourceBranch">
{{ s__('mrWidget|The source branch will be deleted') }} {{ s__('mrWidget|The source branch will be deleted') }}
</p> </p>
<p v-else class="d-flex align-items-start"> <p v-else class="d-flex align-items-start">
<span class="append-right-10"> <span class="append-right-10">{{
{{ s__('mrWidget|The source branch will not be deleted') }} s__('mrWidget|The source branch will not be deleted')
</span> }}</span>
<a <a
v-if="canRemoveSourceBranch" v-if="canRemoveSourceBranch"
:disabled="isRemovingSourceBranch" :disabled="isRemovingSourceBranch"
......
...@@ -4,6 +4,7 @@ import simplePoll from '../../../lib/utils/simple_poll'; ...@@ -4,6 +4,7 @@ import simplePoll from '../../../lib/utils/simple_poll';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import statusIcon from '../mr_widget_status_icon.vue'; import statusIcon from '../mr_widget_status_icon.vue';
import Flash from '../../../flash'; import Flash from '../../../flash';
import { __, sprintf } from '~/locale';
export default { export default {
name: 'MRWidgetRebase', name: 'MRWidgetRebase',
...@@ -40,6 +41,17 @@ export default { ...@@ -40,6 +41,17 @@ export default {
showDisabledButton() { showDisabledButton() {
return ['failed', 'loading'].includes(this.status); return ['failed', 'loading'].includes(this.status);
}, },
fastForwardMergeText() {
return sprintf(
__(
`Fast-forward merge is not possible. Rebase the source branch onto %{startTag}${this.mr.targetBranch}%{endTag} to allow this merge request to be merged.`,
),
{
startTag: '<span class="label-branch">',
endTag: '</span>',
},
);
},
}, },
methods: { methods: {
rebase() { rebase() {
...@@ -54,7 +66,7 @@ export default { ...@@ -54,7 +66,7 @@ export default {
.catch(error => { .catch(error => {
this.rebasingError = error.merge_error; this.rebasingError = error.merge_error;
this.isMakingRequest = false; this.isMakingRequest = false;
Flash('Something went wrong. Please try again.'); Flash(__('Something went wrong. Please try again.'));
}); });
}, },
checkRebaseStatus(continuePolling, stopPolling) { checkRebaseStatus(continuePolling, stopPolling) {
...@@ -69,7 +81,7 @@ export default { ...@@ -69,7 +81,7 @@ export default {
if (res.merge_error && res.merge_error.length) { if (res.merge_error && res.merge_error.length) {
this.rebasingError = res.merge_error; this.rebasingError = res.merge_error;
Flash('Something went wrong. Please try again.'); Flash(__('Something went wrong. Please try again.'));
} }
eventHub.$emit('MRWidgetRebaseSuccess'); eventHub.$emit('MRWidgetRebaseSuccess');
...@@ -78,7 +90,7 @@ export default { ...@@ -78,7 +90,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.isMakingRequest = false; this.isMakingRequest = false;
Flash('Something went wrong. Please try again.'); Flash(__('Something went wrong. Please try again.'));
stopPolling(); stopPolling();
}); });
}, },
...@@ -91,19 +103,14 @@ export default { ...@@ -91,19 +103,14 @@ export default {
<div class="rebase-state-find-class-convention media media-body space-children"> <div class="rebase-state-find-class-convention media media-body space-children">
<template v-if="mr.rebaseInProgress || isMakingRequest"> <template v-if="mr.rebaseInProgress || isMakingRequest">
<span class="bold"> Rebase in progress </span> <span class="bold">{{ __('Rebase in progress') }}</span>
</template> </template>
<template v-if="!mr.rebaseInProgress && !mr.canPushToSourceBranch"> <template v-if="!mr.rebaseInProgress && !mr.canPushToSourceBranch">
<span class="bold"> <span class="bold" v-html="fastForwardMergeText"></span>
Fast-forward merge is not possible. Rebase the source branch onto
<span class="label-branch">{{ mr.targetBranch }}</span> to allow this merge request to be
merged.
</span>
</template> </template>
<template v-if="!mr.rebaseInProgress && mr.canPushToSourceBranch && !isMakingRequest"> <template v-if="!mr.rebaseInProgress && mr.canPushToSourceBranch && !isMakingRequest">
<div <div
class="accept-merge-holder clearfix class="accept-merge-holder clearfix js-toggle-container accept-action media space-children"
js-toggle-container accept-action media space-children"
> >
<button <button
:disabled="isMakingRequest" :disabled="isMakingRequest"
...@@ -111,14 +118,14 @@ js-toggle-container accept-action media space-children" ...@@ -111,14 +118,14 @@ js-toggle-container accept-action media space-children"
class="btn btn-sm btn-reopen btn-success qa-mr-rebase-button" class="btn btn-sm btn-reopen btn-success qa-mr-rebase-button"
@click="rebase" @click="rebase"
> >
<gl-loading-icon v-if="isMakingRequest" /> <gl-loading-icon v-if="isMakingRequest" />{{ __('Rebase') }}
Rebase
</button> </button>
<span v-if="!rebasingError" class="bold"> <span v-if="!rebasingError" class="bold">{{
Fast-forward merge is not possible. Rebase the source branch onto the target branch or __(
merge target branch into source branch to allow this merge request to be merged. 'Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged.',
</span> )
<span v-else class="bold danger"> {{ rebasingError }} </span> }}</span>
<span v-else class="bold danger">{{ rebasingError }}</span>
</div> </div>
</template> </template>
</div> </div>
......
...@@ -22,19 +22,29 @@ export default { ...@@ -22,19 +22,29 @@ export default {
<span v-html="emptyStateSVG"></span> <span v-html="emptyStateSVG"></span>
</div> </div>
<div class="text col-md-7 order-md-first col-12"> <div class="text col-md-7 order-md-first col-12">
<span> <span>{{
Merge requests are a place to propose changes you have made to a project and discuss those s__(
changes with others. 'mrWidgetNothingToMerge|Merge requests are a place to propose changes you have made to a project and discuss those changes with others.',
</span> )
<p>Interested parties can even contribute by pushing commits if they want to.</p> }}</span>
<p> <p>
Currently there are no changes in this merge request's source branch. Please push new {{
commits or use a different branch. s__(
'mrWidgetNothingToMerge|Interested parties can even contribute by pushing commits if they want to.',
)
}}
</p>
<p>
{{
s__(
"mrWidgetNothingToMerge|Currently there are no changes in this merge request's source branch. Please push new commits or use a different branch.",
)
}}
</p> </p>
<div> <div>
<a v-if="mr.newBlobPath" :href="mr.newBlobPath" class="btn btn-inverted btn-success"> <a v-if="mr.newBlobPath" :href="mr.newBlobPath" class="btn btn-inverted btn-success">{{
Create file __('Create file')
</a> }}</a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -248,7 +248,7 @@ export default { ...@@ -248,7 +248,7 @@ export default {
type="button" type="button"
class="btn btn-sm btn-info dropdown-toggle js-merge-moment" class="btn btn-sm btn-info dropdown-toggle js-merge-moment"
data-toggle="dropdown" data-toggle="dropdown"
aria-label="Select merge moment" :aria-label="__('Select merge moment')"
> >
<i class="fa fa-chevron-down qa-merge-moment-dropdown" aria-hidden="true"></i> <i class="fa fa-chevron-down qa-merge-moment-dropdown" aria-hidden="true"></i>
</button> </button>
......
...@@ -46,14 +46,20 @@ export default { ...@@ -46,14 +46,20 @@ export default {
<status-icon :show-disabled-button="Boolean(mr.removeWIPPath)" status="warning" /> <status-icon :show-disabled-button="Boolean(mr.removeWIPPath)" status="warning" />
<div class="media-body space-children"> <div class="media-body space-children">
<span class="bold"> <span class="bold">
This is a Work in Progress {{ __('This is a Work in Progress') }}
<i <i
v-tooltip v-tooltip
class="fa fa-question-circle" class="fa fa-question-circle"
title="When this merge request is ready, :title="
remove the WIP: prefix from the title to allow it to be merged" s__(
aria-label="When this merge request is ready, 'mrWidget|When this merge request is ready, remove the WIP: prefix from the title to allow it to be merged',
remove the WIP: prefix from the title to allow it to be merged" )
"
:aria-label="
s__(
'mrWidget|When this merge request is ready, remove the WIP: prefix from the title to allow it to be merged',
)
"
> >
</i> </i>
</span> </span>
...@@ -64,8 +70,8 @@ export default { ...@@ -64,8 +70,8 @@ export default {
class="btn btn-default btn-sm js-remove-wip" class="btn btn-default btn-sm js-remove-wip"
@click="removeWIP" @click="removeWIP"
> >
<i v-if="isMakingRequest" class="fa fa-spinner fa-spin" aria-hidden="true"> </i> Resolve WIP <i v-if="isMakingRequest" class="fa fa-spinner fa-spin" aria-hidden="true"> </i>
status {{ s__('mrWidget|Resolve WIP status') }}
</button> </button>
</div> </div>
</div> </div>
......
...@@ -263,8 +263,11 @@ export default { ...@@ -263,8 +263,11 @@ export default {
if (!data.pipeline) return; if (!data.pipeline) return;
const { label } = data.pipeline.details.status; const { label } = data.pipeline.details.status;
const title = `Pipeline ${label}`; const title = sprintf(__('Pipeline %{label}'), { label });
const message = `Pipeline ${label} for "${data.title}"`; const message = sprintf(__('Pipeline %{label} for "%{dataTitle}"'), {
dataTitle: data.title,
label,
});
notify.notifyMe(title, message, this.mr.gitlabLogo); notify.notifyMe(title, message, this.mr.gitlabLogo);
}, },
......
...@@ -4689,6 +4689,9 @@ msgstr "" ...@@ -4689,6 +4689,9 @@ msgstr ""
msgid "Download artifacts" msgid "Download artifacts"
msgstr "" msgstr ""
msgid "Download as"
msgstr ""
msgid "Download asset" msgid "Download asset"
msgstr "" msgstr ""
...@@ -5703,6 +5706,9 @@ msgstr "" ...@@ -5703,6 +5706,9 @@ msgstr ""
msgid "Failure" msgid "Failure"
msgstr "" msgstr ""
msgid "Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged."
msgstr ""
msgid "Fast-forward merge without a merge commit" msgid "Fast-forward merge without a merge commit"
msgstr "" msgstr ""
...@@ -9752,6 +9758,12 @@ msgstr "" ...@@ -9752,6 +9758,12 @@ msgstr ""
msgid "Pipeline" msgid "Pipeline"
msgstr "" msgstr ""
msgid "Pipeline %{label}"
msgstr ""
msgid "Pipeline %{label} for \"%{dataTitle}\""
msgstr ""
msgid "Pipeline Schedule" msgid "Pipeline Schedule"
msgstr "" msgstr ""
...@@ -11234,6 +11246,12 @@ msgstr "" ...@@ -11234,6 +11246,12 @@ msgstr ""
msgid "Real-time features" msgid "Real-time features"
msgstr "" msgstr ""
msgid "Rebase"
msgstr ""
msgid "Rebase in progress"
msgstr ""
msgid "Receive alerts from manually configured Prometheus servers." msgid "Receive alerts from manually configured Prometheus servers."
msgstr "" msgstr ""
...@@ -12175,6 +12193,9 @@ msgstr "" ...@@ -12175,6 +12193,9 @@ msgstr ""
msgid "Select members to invite" msgid "Select members to invite"
msgstr "" msgstr ""
msgid "Select merge moment"
msgstr ""
msgid "Select private project" msgid "Select private project"
msgstr "" msgstr ""
...@@ -12741,6 +12762,9 @@ msgstr "" ...@@ -12741,6 +12762,9 @@ msgstr ""
msgid "Something went wrong while resolving this discussion. Please try again." msgid "Something went wrong while resolving this discussion. Please try again."
msgstr "" msgstr ""
msgid "Something went wrong while stopping this environment. Please try again."
msgstr ""
msgid "Something went wrong, unable to add %{project} to dashboard" msgid "Something went wrong, unable to add %{project} to dashboard"
msgstr "" msgstr ""
...@@ -14021,6 +14045,9 @@ msgstr "" ...@@ -14021,6 +14045,9 @@ msgstr ""
msgid "This is a \"Ghost User\", created to hold all issues authored by users that have since been deleted. This user cannot be removed." msgid "This is a \"Ghost User\", created to hold all issues authored by users that have since been deleted. This user cannot be removed."
msgstr "" msgstr ""
msgid "This is a Work in Progress"
msgstr ""
msgid "This is a confidential issue." msgid "This is a confidential issue."
msgstr "" msgstr ""
...@@ -16888,6 +16915,15 @@ msgstr "" ...@@ -16888,6 +16915,15 @@ msgstr ""
msgid "mrWidgetCommitsAdded|1 merge commit" msgid "mrWidgetCommitsAdded|1 merge commit"
msgstr "" msgstr ""
msgid "mrWidgetNothingToMerge|Currently there are no changes in this merge request's source branch. Please push new commits or use a different branch."
msgstr ""
msgid "mrWidgetNothingToMerge|Interested parties can even contribute by pushing commits if they want to."
msgstr ""
msgid "mrWidgetNothingToMerge|Merge requests are a place to propose changes you have made to a project and discuss those changes with others."
msgstr ""
msgid "mrWidget| Please restore it or use a different %{missingBranchName} branch" msgid "mrWidget| Please restore it or use a different %{missingBranchName} branch"
msgstr "" msgstr ""
...@@ -17044,6 +17080,9 @@ msgstr "" ...@@ -17044,6 +17080,9 @@ msgstr ""
msgid "mrWidget|Request to merge" msgid "mrWidget|Request to merge"
msgstr "" msgstr ""
msgid "mrWidget|Resolve WIP status"
msgstr ""
msgid "mrWidget|Resolve conflicts" msgid "mrWidget|Resolve conflicts"
msgstr "" msgstr ""
...@@ -17110,6 +17149,9 @@ msgstr "" ...@@ -17110,6 +17149,9 @@ msgstr ""
msgid "mrWidget|This project is archived, write access has been disabled" msgid "mrWidget|This project is archived, write access has been disabled"
msgstr "" msgstr ""
msgid "mrWidget|When this merge request is ready, remove the WIP: prefix from the title to allow it to be merged"
msgstr ""
msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes." msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes."
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment