Skip to content
Snippets Groups Projects
Commit fc53ce8e authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 8e22ef10
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 26 deletions
12.4.0
12.10.0
Loading
Loading
@@ -35,10 +35,10 @@ export default {
title() {
const timeago = getTimeago();
const { timeDifference, standardDateFormat } = this;
const formatedDate = standardDateFormat;
const formattedDate = standardDateFormat;
 
if (timeDifference >= -1 && timeDifference < 7) {
return `${timeago.format(this.issueDueDate)} (${formatedDate})`;
return `${timeago.format(this.issueDueDate)} (${formattedDate})`;
}
 
return timeago.format(this.issueDueDate);
Loading
Loading
Loading
Loading
@@ -159,7 +159,7 @@ export default {
<div role="rowheader" class="table-mobile-header">{{ __('Created') }}</div>
<div class="table-mobile-content text-secondary key-created-at">
<span v-tooltip :title="tooltipTitle(deployKey.created_at)">
<icon name="calendar" /> <span>{{ timeFormated(deployKey.created_at) }}</span>
<icon name="calendar" /> <span>{{ timeFormatted(deployKey.created_at) }}</span>
</span>
</div>
</div>
Loading
Loading
Loading
Loading
@@ -177,6 +177,7 @@ export default {
projectPath: this.projectPath,
dismissEndpoint: this.dismissEndpoint,
showSuggestPopover: this.showSuggestPopover,
useSingleDiffStyle: this.glFeatures.singleMrDiffView,
});
 
if (this.shouldShow) {
Loading
Loading
Loading
Loading
@@ -46,6 +46,7 @@ export const setBaseConfig = ({ commit }, options) => {
projectPath,
dismissEndpoint,
showSuggestPopover,
useSingleDiffStyle,
} = options;
commit(types.SET_BASE_CONFIG, {
endpoint,
Loading
Loading
@@ -54,11 +55,15 @@ export const setBaseConfig = ({ commit }, options) => {
projectPath,
dismissEndpoint,
showSuggestPopover,
useSingleDiffStyle,
});
};
 
export const fetchDiffFiles = ({ state, commit }) => {
const worker = new TreeWorker();
const urlParams = {
w: state.showWhitespace ? '0' : '1',
};
 
commit(types.SET_LOADING, true);
 
Loading
Loading
@@ -69,9 +74,10 @@ export const fetchDiffFiles = ({ state, commit }) => {
});
 
return axios
.get(mergeUrlParams({ w: state.showWhitespace ? '0' : '1' }, state.endpoint))
.get(mergeUrlParams(urlParams, state.endpoint))
.then(res => {
commit(types.SET_LOADING, false);
commit(types.SET_MERGE_REQUEST_DIFFS, res.data.merge_request_diffs || []);
commit(types.SET_DIFF_DATA, res.data);
 
Loading
Loading
Loading
Loading
@@ -31,4 +31,5 @@ export default () => ({
fileFinderVisible: false,
dismissEndpoint: '',
showSuggestPopover: true,
useSingleDiffStyle: false,
});
Loading
Loading
@@ -19,6 +19,7 @@ export default {
projectPath,
dismissEndpoint,
showSuggestPopover,
useSingleDiffStyle,
} = options;
Object.assign(state, {
endpoint,
Loading
Loading
@@ -27,6 +28,7 @@ export default {
projectPath,
dismissEndpoint,
showSuggestPopover,
useSingleDiffStyle,
});
},
 
Loading
Loading
Loading
Loading
@@ -56,7 +56,7 @@ export default {
__('Reported %{timeAgo} by %{reportedBy}'),
{
reportedBy: `<strong>${this.error.culprit}</strong>`,
timeAgo: this.timeFormated(this.stacktraceData.date_received),
timeAgo: this.timeFormatted(this.stacktraceData.date_received),
},
false,
);
Loading
Loading
@@ -107,7 +107,7 @@ export default {
this.$refs.sentryIssueForm.submit();
},
formatDate(date) {
return `${this.timeFormated(date)} (${dateFormat(date, 'UTC:yyyy-mm-dd h:MM:ssTT Z')})`;
return `${this.timeFormatted(date)} (${dateFormat(date, 'UTC:yyyy-mm-dd h:MM:ssTT Z')})`;
},
},
};
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ export default {
mixins: [timeAgoMixin],
data() {
return {
lastCommitFormatedAge: null,
lastCommitFormattedAge: null,
};
},
computed: {
Loading
Loading
@@ -62,7 +62,7 @@ export default {
},
commitAgeUpdate() {
if (this.lastCommit) {
this.lastCommitFormatedAge = this.timeFormated(this.lastCommit.committed_date);
this.lastCommitFormattedAge = this.timeFormatted(this.lastCommit.committed_date);
}
},
getCommitPath(shortSha) {
Loading
Loading
@@ -118,7 +118,7 @@ export default {
:title="tooltipTitle(lastCommit.committed_date)"
data-placement="top"
data-container="body"
>{{ lastCommitFormatedAge }}</time
>{{ lastCommitFormattedAge }}</time
>
</div>
<ide-status-list class="ml-auto" />
Loading
Loading
Loading
Loading
@@ -91,7 +91,7 @@ export default {
/>
<gl-tooltip :target="() => $refs.state" placement="bottom">
<span class="d-block">
<span class="bold"> {{ stateTitle }} </span> {{ timeFormated(closedOrCreatedDate) }}
<span class="bold"> {{ stateTitle }} </span> {{ timeFormatted(closedOrCreatedDate) }}
</span>
<span class="text-tertiary">{{ tooltipTitle(closedOrCreatedDate) }}</span>
</gl-tooltip>
Loading
Loading
Loading
Loading
@@ -168,13 +168,13 @@ export default {
/>
<detail-row
v-if="job.finished_at"
:value="timeFormated(job.finished_at)"
:value="timeFormatted(job.finished_at)"
class="js-job-finished"
title="Finished"
/>
<detail-row
v-if="job.erased_at"
:value="timeFormated(job.erased_at)"
:value="timeFormatted(job.erased_at)"
class="js-job-erased"
title="Erased"
/>
Loading
Loading
Loading
Loading
@@ -114,7 +114,7 @@ export const logLinesParser = (lines = [], accumulator = []) =>
acc.push(parseHeaderLine(line, lineNumber));
} else if (isCollapsibleSection(acc, last, line)) {
// if the object belongs to a nested section, we append it to the new `lines` array of the
// previously formated header
// previously formatted header
last.lines.push(parseLine(line, lineNumber));
} else if (line.section_duration) {
// if the line has section_duration, we look for the correct header to add it
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@
import $ from 'jquery';
import axios from './axios_utils';
import { getLocationHash } from './url_utility';
import { convertToCamelCase } from './text_utility';
import { convertToCamelCase, convertToSnakeCase } from './text_utility';
import { isObject } from './type_utility';
import breakpointInstance from '../../breakpoints';
 
Loading
Loading
@@ -697,6 +697,22 @@ export const convertObjectPropsToCamelCase = (obj = {}, options = {}) => {
}, initial);
};
 
/**
* Converts all the object keys to snake case
*
* @param {Object} obj Object to transform
* @returns {Object}
*/
// Follow up to add additional options param:
// https://gitlab.com/gitlab-org/gitlab/issues/39173
export const convertObjectPropsToSnakeCase = (obj = {}) =>
obj
? Object.entries(obj).reduce(
(acc, [key, value]) => ({ ...acc, [convertToSnakeCase(key)]: value }),
{},
)
: {};
export const imagePath = imgUrl =>
`${gon.asset_host || ''}${gon.relative_url_root || ''}/assets/${imgUrl}`;
 
Loading
Loading
Loading
Loading
@@ -447,7 +447,7 @@ export const parsePikadayDate = dateString => {
/**
* Used `onSelect` method in pickaday
* @param {Date} date UTC format
* @return {String} Date formated in yyyy-mm-dd
* @return {String} Date formatted in yyyy-mm-dd
*/
export const pikadayToString = date => {
const day = pad(date.getDate());
Loading
Loading
@@ -513,8 +513,8 @@ export const stringifyTime = (timeObject, fullNameFormat = false) => {
 
if (fullNameFormat && isNonZero) {
// Remove traling 's' if unit value is singular
const formatedUnitName = unitValue > 1 ? unitName : unitName.replace(/s$/, '');
return `${memo} ${unitValue} ${formatedUnitName}`;
const formattedUnitName = unitValue > 1 ? unitName : unitName.replace(/s$/, '');
return `${memo} ${unitValue} ${formattedUnitName}`;
}
 
return isNonZero ? `${memo} ${unitValue}${unitName.charAt(0)}` : memo;
Loading
Loading
Loading
Loading
@@ -45,7 +45,7 @@ export default {
return this.mergeRequest.headPipeline && this.mergeRequest.headPipeline.detailedStatus;
},
formattedTime() {
return this.timeFormated(this.mergeRequest.createdAt);
return this.timeFormatted(this.mergeRequest.createdAt);
},
statusBoxClass() {
switch (this.mergeRequest.state) {
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ export default {
hasFinishedTime() {
return this.finishedTime !== '';
},
durationFormated() {
durationFormatted() {
const date = new Date(this.duration * 1000);
 
let hh = date.getUTCHours();
Loading
Loading
@@ -59,7 +59,7 @@ export default {
<div class="table-mobile-header" role="rowheader">{{ s__('Pipeline|Duration') }}</div>
<div class="table-mobile-content">
<p v-if="hasDuration" class="duration">
<span v-html="iconTimerSvg"> </span> {{ durationFormated }}
<span v-html="iconTimerSvg"> </span> {{ durationFormatted }}
</p>
 
<p v-if="hasFinishedTime" class="finished-at d-none d-sm-none d-md-block">
Loading
Loading
@@ -71,7 +71,7 @@ export default {
data-placement="top"
data-container="body"
>
{{ timeFormated(finishedTime) }}
{{ timeFormatted(finishedTime) }}
</time>
</p>
</div>
Loading
Loading
Loading
Loading
@@ -247,7 +247,7 @@ export default {
 
<td>
<span v-gl-tooltip.bottom :title="tooltipTitle(item.createdAt)">{{
timeFormated(item.createdAt)
timeFormatted(item.createdAt)
}}</span>
</td>
 
Loading
Loading
Loading
Loading
@@ -48,7 +48,7 @@ export default {
},
releasedTimeAgo() {
return sprintf(__('released %{time}'), {
time: this.timeFormated(this.release.released_at),
time: this.timeFormatted(this.release.released_at),
});
},
userImageAltDescription() {
Loading
Loading
Loading
Loading
@@ -50,7 +50,7 @@ export default {
},
computed: {
releasedAtTimeAgo() {
return this.timeFormated(this.releasedAt);
return this.timeFormatted(this.releasedAt);
},
userImageAltDescription() {
return this.author && this.author.username
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ export default {
},
computed: {
deployTimeago() {
return this.timeFormated(this.deployment.deployed_at);
return this.timeFormatted(this.deployment.deployed_at);
},
deployedText() {
return this.$options.deployedTextMap[this.computedDeploymentStatus];
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