Commit a3859c0f authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-05-22

# Conflicts:
#	locale/gitlab.pot

[ci skip]
parents 49478523 76e276cb
......@@ -2,10 +2,7 @@ import $ from 'jquery';
import timeago from 'timeago.js';
import dateFormat from 'vendor/date.format';
import { pluralize } from './text_utility';
import {
languageCode,
s__,
} from '../../locale';
import { languageCode, s__ } from '../../locale';
window.timeago = timeago;
window.dateFormat = dateFormat;
......@@ -17,11 +14,37 @@ window.dateFormat = dateFormat;
*
* @param {Boolean} abbreviated
*/
const getMonthNames = (abbreviated) => {
const getMonthNames = abbreviated => {
if (abbreviated) {
return [s__('Jan'), s__('Feb'), s__('Mar'), s__('Apr'), s__('May'), s__('Jun'), s__('Jul'), s__('Aug'), s__('Sep'), s__('Oct'), s__('Nov'), s__('Dec')];
return [
s__('Jan'),
s__('Feb'),
s__('Mar'),
s__('Apr'),
s__('May'),
s__('Jun'),
s__('Jul'),
s__('Aug'),
s__('Sep'),
s__('Oct'),
s__('Nov'),
s__('Dec'),
];
}
return [s__('January'), s__('February'), s__('March'), s__('April'), s__('May'), s__('June'), s__('July'), s__('August'), s__('September'), s__('October'), s__('November'), s__('December')];
return [
s__('January'),
s__('February'),
s__('March'),
s__('April'),
s__('May'),
s__('June'),
s__('July'),
s__('August'),
s__('September'),
s__('October'),
s__('November'),
s__('December'),
];
};
/**
......@@ -29,7 +52,8 @@ const getMonthNames = (abbreviated) => {
* @param {date} date
* @returns {String}
*/
export const getDayName = date => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()];
export const getDayName = date =>
['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()];
/**
* @example
......@@ -55,7 +79,7 @@ export function getTimeago() {
if (!timeagoInstance) {
const localeRemaining = function getLocaleRemaining(number, index) {
return [
[s__('Timeago|less than a minute ago'), s__('Timeago|in a while')],
[s__('Timeago|less than a minute ago'), s__('Timeago|right now')],
[s__('Timeago|less than a minute ago'), s__('Timeago|%s seconds remaining')],
[s__('Timeago|about a minute ago'), s__('Timeago|1 minute remaining')],
[s__('Timeago|%s minutes ago'), s__('Timeago|%s minutes remaining')],
......@@ -73,7 +97,7 @@ export function getTimeago() {
};
const locale = function getLocale(number, index) {
return [
[s__('Timeago|less than a minute ago'), s__('Timeago|in a while')],
[s__('Timeago|less than a minute ago'), s__('Timeago|right now')],
[s__('Timeago|less than a minute ago'), s__('Timeago|in %s seconds')],
[s__('Timeago|about a minute ago'), s__('Timeago|in 1 minute')],
[s__('Timeago|%s minutes ago'), s__('Timeago|in %s minutes')],
......@@ -102,7 +126,7 @@ export function getTimeago() {
* For the given element, renders a timeago instance.
* @param {jQuery} $els
*/
export const renderTimeago = ($els) => {
export const renderTimeago = $els => {
const timeagoEls = $els || document.querySelectorAll('.js-timeago-render');
// timeago.js sets timeouts internally for each timeago value to be updated in real time
......@@ -119,7 +143,8 @@ export const localTimeAgo = ($timeagoEls, setTimeago = true) => {
if (setTimeago) {
// Recreate with custom template
$(el).tooltip({
template: '<div class="tooltip local-timeago" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
template:
'<div class="tooltip local-timeago" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
});
}
......@@ -141,7 +166,9 @@ export const timeFor = (time, expiredLabel) => {
if (new Date(time) < new Date()) {
return expiredLabel || s__('Timeago|Past due');
}
return getTimeago().format(time, `${timeagoLanguageCode}-remaining`).trim();
return getTimeago()
.format(time, `${timeagoLanguageCode}-remaining`)
.trim();
};
export const getDayDifference = (a, b) => {
......@@ -161,7 +188,7 @@ export const getDayDifference = (a, b) => {
export function timeIntervalInWords(intervalInSeconds) {
const secondsInteger = parseInt(intervalInSeconds, 10);
const minutes = Math.floor(secondsInteger / 60);
const seconds = secondsInteger - (minutes * 60);
const seconds = secondsInteger - minutes * 60;
let text = '';
if (minutes >= 1) {
......@@ -178,8 +205,34 @@ export function dateInWords(date, abbreviated = false, hideYear = false) {
const month = date.getMonth();
const year = date.getFullYear();
const monthNames = [s__('January'), s__('February'), s__('March'), s__('April'), s__('May'), s__('June'), s__('July'), s__('August'), s__('September'), s__('October'), s__('November'), s__('December')];
const monthNamesAbbr = [s__('Jan'), s__('Feb'), s__('Mar'), s__('Apr'), s__('May'), s__('Jun'), s__('Jul'), s__('Aug'), s__('Sep'), s__('Oct'), s__('Nov'), s__('Dec')];
const monthNames = [
s__('January'),
s__('February'),
s__('March'),
s__('April'),
s__('May'),
s__('June'),
s__('July'),
s__('August'),
s__('September'),
s__('October'),
s__('November'),
s__('December'),
];
const monthNamesAbbr = [
s__('Jan'),
s__('Feb'),
s__('Mar'),
s__('Apr'),
s__('May'),
s__('Jun'),
s__('Jul'),
s__('Aug'),
s__('Sep'),
s__('Oct'),
s__('Nov'),
s__('Dec'),
];
const monthName = abbreviated ? monthNamesAbbr[month] : monthNames[month];
......@@ -210,7 +263,7 @@ export const monthInWords = (date, abbreviated = false) => {
*
* @param {Date} date
*/
export const totalDaysInMonth = (date) => {
export const totalDaysInMonth = date => {
if (!date) {
return 0;
}
......@@ -223,12 +276,20 @@ export const totalDaysInMonth = (date) => {
*
* @param {Date} date
*/
export const getSundays = (date) => {
export const getSundays = date => {
if (!date) {
return [];
}
const daysToSunday = ['Saturday', 'Friday', 'Thursday', 'Wednesday', 'Tuesday', 'Monday', 'Sunday'];
const daysToSunday = [
'Saturday',
'Friday',
'Thursday',
'Wednesday',
'Tuesday',
'Monday',
'Sunday',
];
const month = date.getMonth();
const year = date.getFullYear();
......
......@@ -351,7 +351,7 @@ import Cookies from 'js-cookie';
},
getCommitButtonText() {
const initial = 'Commit conflict resolution';
const initial = 'Commit to source branch';
const inProgress = 'Committing...';
return this.state ? this.state.isSubmitting ? inProgress : initial : initial;
......
......@@ -286,6 +286,14 @@ $colors: (
}
.resolve-conflicts-form {
padding-top: $gl-padding;
h4 {
margin-top: 0;
}
.resolve-info {
@media (max-width: $screen-md-max) {
margin-bottom: $gl-padding;
}
}
}
}
......@@ -11,6 +11,6 @@
Showing
%strong.cred {{conflictsCountText}}
between
%strong {{conflictsData.sourceBranch}}
%strong.ref-name {{conflictsData.sourceBranch}}
and
%strong {{conflictsData.targetBranch}}
%strong.ref-name {{conflictsData.targetBranch}}
- branch_name = link_to @merge_request.source_branch, project_tree_path(@merge_request.project, @merge_request.source_branch), class: "ref-name"
- translation =_('You can resolve the merge conflict using either the Interactive mode, by choosing %{use_ours} or %{use_theirs} buttons, or by editing the files directly. Commit these changes into %{branch_name}') % { use_ours: '<code>Use Ours</code>', use_theirs: '<code>Use Theirs</code>', branch_name: branch_name }
%hr
.form-horizontal.resolve-conflicts-form
.form-group
%label.col-sm-2.control-label{ "for" => "commit-message" }
#{ _('Commit message') }
.col-sm-10
.col-md-4
%h4= _('Resolve conflicts on source branch')
.resolve-info
= translation.html_safe
.col-md-8
%label.label-light{ "for" => "commit-message" }
#{ _('Commit message') }
.commit-message-container
.max-width-marker
%textarea.form-control.js-commit-message#commit-message{ "v-model" => "conflictsData.commitMessage", "rows" => "5" }
.form-group
.col-sm-offset-2.col-sm-10
.col-md-offset-4.col-md-8
.row
.col-xs-6
%button.btn.btn-success.js-submit-button{ type: "button", "@click" => "commit()", ":disabled" => "!readyToCommit" }
......
---
title: Use "right now" for short time periods
merge_request: 19095
author:
type: changed
......@@ -29,7 +29,7 @@ The merge conflict resolution editor allows for more complex merge conflicts,
which require the user to manually modify a file in order to resolve a conflict,
to be solved right form the GitLab interface. Use the **Edit inline** button
to open the editor. Once you're sure about your changes, hit the
**Commit conflict resolution** button.
**Commit to source branch** button.
![Merge conflict editor](img/merge_conflict_editor.png)
......
......@@ -8,8 +8,13 @@ msgid ""
msgstr ""
"Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
<<<<<<< HEAD
"POT-Creation-Date: 2018-05-22 07:03+0000\n"
"PO-Revision-Date: 2018-05-22 07:03+0000\n"
=======
"POT-Creation-Date: 2018-05-21 12:38-0700\n"
"PO-Revision-Date: 2018-05-21 12:38-0700\n"
>>>>>>> upstream/master
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
......@@ -4230,6 +4235,9 @@ msgstr ""
msgid "Reset runners registration token"
msgstr ""
msgid "Resolve conflicts on source branch"
msgstr ""
msgid "Resolve discussion"
msgstr ""
......@@ -5650,15 +5658,22 @@ msgstr ""
msgid "You can only edit files when you are on a branch"
msgstr ""
<<<<<<< HEAD
msgid "You cannot write to a read-only secondary GitLab Geo instance. Please use %{link_to_primary_node} instead."
=======
msgid "You can resolve the merge conflict using either the Interactive mode, by choosing %{use_ours} or %{use_theirs} buttons, or by editing the files directly. Commit these changes into %{branch_name}"
>>>>>>> upstream/master
msgstr ""
msgid "You cannot write to this read-only GitLab instance."
msgstr ""
<<<<<<< HEAD
msgid "You do not have the correct permissions to override the settings from the LDAP group sync."
msgstr ""
=======
>>>>>>> upstream/master
msgid "You have no permissions"
msgstr ""
......
......@@ -27,7 +27,7 @@ describe 'Merge request > User resolves conflicts', :js do
end
end
find_button('Commit conflict resolution').send_keys(:return)
find_button('Commit to source branch').send_keys(:return)
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
......@@ -71,7 +71,7 @@ describe 'Merge request > User resolves conflicts', :js do
execute_script('ace.edit($(".files-wrapper .diff-file pre")[1]).setValue("Gregor Samsa woke from troubled dreams");')
end
find_button('Commit conflict resolution').send_keys(:return)
find_button('Commit to source branch').send_keys(:return)
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
......@@ -145,7 +145,7 @@ describe 'Merge request > User resolves conflicts', :js do
execute_script('ace.edit($(".files-wrapper .diff-file pre")[0]).setValue("Gregor Samsa woke from troubled dreams");')
end
click_button 'Commit conflict resolution'
click_button 'Commit to source branch'
expect(page).to have_content('All merge conflicts were resolved')
......
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