Commit e24153b0 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 3fe34368
/* eslint-disable no-var, consistent-return, no-return-assign */ /* eslint-disable consistent-return, no-return-assign */
function notificationGranted(message, opts, onclick) { function notificationGranted(message, opts, onclick) {
var notification; const notification = new Notification(message, opts);
notification = new Notification(message, opts);
setTimeout( setTimeout(
() => () =>
// Hide the notification after X amount of seconds // Hide the notification after X amount of seconds
...@@ -21,8 +20,7 @@ function notifyPermissions() { ...@@ -21,8 +20,7 @@ function notifyPermissions() {
} }
function notifyMe(message, body, icon, onclick) { function notifyMe(message, body, icon, onclick) {
var opts; const opts = {
opts = {
body, body,
icon, icon,
}; };
......
/* eslint-disable func-names, no-var, one-var, no-loop-func, consistent-return, camelcase */ /* eslint-disable func-names, no-var, one-var, consistent-return, camelcase */
import $ from 'jquery'; import $ from 'jquery';
import { __ } from '../locale'; import { __ } from '../locale';
import axios from '../lib/utils/axios_utils'; import axios from '../lib/utils/axios_utils';
import Raphael from './raphael'; import Raphael from './raphael';
export default (function() { export default class BranchGraph {
function BranchGraph(element1, options1) { constructor(element1, options1) {
this.element = element1; this.element = element1;
this.options = options1; this.options = options1;
this.scrollTop = this.scrollTop.bind(this); this.scrollTop = this.scrollTop.bind(this);
...@@ -28,7 +28,7 @@ export default (function() { ...@@ -28,7 +28,7 @@ export default (function() {
this.load(); this.load();
} }
BranchGraph.prototype.load = function() { load() {
axios axios
.get(this.options.url) .get(this.options.url)
.then(({ data }) => { .then(({ data }) => {
...@@ -37,9 +37,9 @@ export default (function() { ...@@ -37,9 +37,9 @@ export default (function() {
this.buildGraph(); this.buildGraph();
}) })
.catch(() => __('Error fetching network graph.')); .catch(() => __('Error fetching network graph.'));
}; }
BranchGraph.prototype.prepareData = function(days, commits) { prepareData(days, commits) {
var c, ch, cw, j, len, ref; var c, ch, cw, j, len, ref;
this.days = days; this.days = days;
this.commits = commits; this.commits = commits;
...@@ -61,34 +61,30 @@ export default (function() { ...@@ -61,34 +61,30 @@ export default (function() {
this.markCommit(c); this.markCommit(c);
} }
return this.collectColors(); return this.collectColors();
}; }
BranchGraph.prototype.collectParents = function() { collectParents() {
var c, j, len, p, ref, results; var c, j, len, p, ref, results;
var l, len1, ref1, results1;
ref = this.commits; ref = this.commits;
results = []; results = [];
for (j = 0, len = ref.length; j < len; j += 1) { for (j = 0, len = ref.length; j < len; j += 1) {
c = ref[j]; c = ref[j];
this.mtime = Math.max(this.mtime, c.time); this.mtime = Math.max(this.mtime, c.time);
this.mspace = Math.max(this.mspace, c.space); this.mspace = Math.max(this.mspace, c.space);
results.push( ref1 = c.parents;
function() { results1 = [];
var l, len1, ref1, results1; for (l = 0, len1 = ref1.length; l < len1; l += 1) {
ref1 = c.parents; p = ref1[l];
results1 = []; this.parents[p[0]] = true;
for (l = 0, len1 = ref1.length; l < len1; l += 1) { results1.push((this.mspace = Math.max(this.mspace, p[1])));
p = ref1[l]; }
this.parents[p[0]] = true; results.push(results1);
results1.push((this.mspace = Math.max(this.mspace, p[1])));
}
return results1;
}.call(this),
);
} }
return results; return results;
}; }
BranchGraph.prototype.collectColors = function() { collectColors() {
var k, results; var k, results;
k = 0; k = 0;
results = []; results = [];
...@@ -100,9 +96,9 @@ export default (function() { ...@@ -100,9 +96,9 @@ export default (function() {
results.push((k += 1)); results.push((k += 1));
} }
return results; return results;
}; }
BranchGraph.prototype.buildGraph = function() { buildGraph() {
var cuday, cumonth, day, len, mm, ref; var cuday, cumonth, day, len, mm, ref;
const { r } = this; const { r } = this;
cuday = 0; cuday = 0;
...@@ -138,9 +134,9 @@ export default (function() { ...@@ -138,9 +134,9 @@ export default (function() {
} }
this.renderPartialGraph(); this.renderPartialGraph();
return this.bindEvents(); return this.bindEvents();
}; }
BranchGraph.prototype.renderPartialGraph = function() { renderPartialGraph() {
var commit, end, i, isGraphEdge, start, x, y; var commit, end, i, isGraphEdge, start, x, y;
start = Math.floor((this.element.scrollTop() - this.offsetY) / this.unitTime) - 10; start = Math.floor((this.element.scrollTop() - this.offsetY) / this.unitTime) - 10;
if (start < 0) { if (start < 0) {
...@@ -170,49 +166,43 @@ export default (function() { ...@@ -170,49 +166,43 @@ export default (function() {
} }
return this.top.toFront(); return this.top.toFront();
} }
}; }
BranchGraph.prototype.bindEvents = function() { bindEvents() {
const { element } = this; const { element } = this;
return $(element).scroll( return $(element).scroll(() => this.renderPartialGraph());
(function(_this) { }
return function() {
return _this.renderPartialGraph();
};
})(this),
);
};
BranchGraph.prototype.scrollDown = function() { scrollDown() {
this.element.scrollTop(this.element.scrollTop() + 50); this.element.scrollTop(this.element.scrollTop() + 50);
return this.renderPartialGraph(); return this.renderPartialGraph();
}; }
BranchGraph.prototype.scrollUp = function() { scrollUp() {
this.element.scrollTop(this.element.scrollTop() - 50); this.element.scrollTop(this.element.scrollTop() - 50);
return this.renderPartialGraph(); return this.renderPartialGraph();
}; }
BranchGraph.prototype.scrollLeft = function() { scrollLeft() {
this.element.scrollLeft(this.element.scrollLeft() - 50); this.element.scrollLeft(this.element.scrollLeft() - 50);
return this.renderPartialGraph(); return this.renderPartialGraph();
}; }
BranchGraph.prototype.scrollRight = function() { scrollRight() {
this.element.scrollLeft(this.element.scrollLeft() + 50); this.element.scrollLeft(this.element.scrollLeft() + 50);
return this.renderPartialGraph(); return this.renderPartialGraph();
}; }
BranchGraph.prototype.scrollBottom = function() { scrollBottom() {
return this.element.scrollTop(this.element.find('svg').height()); return this.element.scrollTop(this.element.find('svg').height());
}; }
BranchGraph.prototype.scrollTop = function() { scrollTop() {
return this.element.scrollTop(0); return this.element.scrollTop(0);
}; }
BranchGraph.prototype.appendLabel = function(x, y, commit) { appendLabel(x, y, commit) {
var label, rect, shortrefs, text, textbox; var label, rect, shortrefs, text, textbox;
if (!commit.refs) { if (!commit.refs) {
...@@ -248,9 +238,9 @@ export default (function() { ...@@ -248,9 +238,9 @@ export default (function() {
label.transform(['t', -rect.getBBox().width - 15, 0]); label.transform(['t', -rect.getBBox().width - 15, 0]);
// Set text to front // Set text to front
return text.toFront(); return text.toFront();
}; }
BranchGraph.prototype.appendAnchor = function(x, y, commit) { appendAnchor(x, y, commit) {
const { r, top, options } = this; const { r, top, options } = this;
const anchor = r const anchor = r
.circle(x, y, 10) .circle(x, y, 10)
...@@ -270,9 +260,9 @@ export default (function() { ...@@ -270,9 +260,9 @@ export default (function() {
}, },
); );
return top.push(anchor); return top.push(anchor);
}; }
BranchGraph.prototype.drawDot = function(x, y, commit) { drawDot(x, y, commit) {
const { r } = this; const { r } = this;
r.circle(x, y, 3).attr({ r.circle(x, y, 3).attr({
fill: this.colors[commit.space], fill: this.colors[commit.space],
...@@ -293,9 +283,9 @@ export default (function() { ...@@ -293,9 +283,9 @@ export default (function() {
'text-anchor': 'start', 'text-anchor': 'start',
font: '14px Monaco, monospace', font: '14px Monaco, monospace',
}); });
}; }
BranchGraph.prototype.drawLines = function(x, y, commit) { drawLines(x, y, commit) {
var arrow, color, i, len, offset, parent, parentCommit, parentX1, parentX2, parentY, route; var arrow, color, i, len, offset, parent, parentCommit, parentX1, parentX2, parentY, route;
const { r } = this; const { r } = this;
const ref = commit.parents; const ref = commit.parents;
...@@ -344,9 +334,9 @@ export default (function() { ...@@ -344,9 +334,9 @@ export default (function() {
); );
} }
return results; return results;
}; }
BranchGraph.prototype.markCommit = function(commit) { markCommit(commit) {
if (commit.id === this.options.commit_id) { if (commit.id === this.options.commit_id) {
const { r } = this; const { r } = this;
const x = this.offsetX + this.unitSpace * (this.mspace - commit.space); const x = this.offsetX + this.unitSpace * (this.mspace - commit.space);
...@@ -359,7 +349,5 @@ export default (function() { ...@@ -359,7 +349,5 @@ export default (function() {
// Displayed in the center // Displayed in the center
return this.element.scrollTop(y - this.graphHeight / 2); return this.element.scrollTop(y - this.graphHeight / 2);
} }
}; }
}
return BranchGraph;
})();
/* eslint-disable func-names, no-var, one-var, consistent-return, no-return-assign, no-shadow, no-else-return, @gitlab/i18n/no-non-i18n-strings */ /* eslint-disable func-names, consistent-return, no-return-assign, no-else-return, @gitlab/i18n/no-non-i18n-strings */
import $ from 'jquery'; import $ from 'jquery';
import RefSelectDropdown from './ref_select_dropdown'; import RefSelectDropdown from './ref_select_dropdown';
...@@ -26,23 +26,22 @@ export default class NewBranchForm { ...@@ -26,23 +26,22 @@ export default class NewBranchForm {
} }
setupRestrictions() { setupRestrictions() {
var endsWith, invalid, single, startsWith; const startsWith = {
startsWith = {
pattern: /^(\/|\.)/g, pattern: /^(\/|\.)/g,
prefix: "can't start with", prefix: "can't start with",
conjunction: 'or', conjunction: 'or',
}; };
endsWith = { const endsWith = {
pattern: /(\/|\.|\.lock)$/g, pattern: /(\/|\.|\.lock)$/g,
prefix: "can't end in", prefix: "can't end in",
conjunction: 'or', conjunction: 'or',
}; };
invalid = { const invalid = {
pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g, pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g,
prefix: "can't contain", prefix: "can't contain",
conjunction: ', ', conjunction: ', ',
}; };
single = { const single = {
pattern: /^@+$/g, pattern: /^@+$/g,
prefix: "can't be", prefix: "can't be",
conjunction: 'or', conjunction: 'or',
...@@ -51,19 +50,17 @@ export default class NewBranchForm { ...@@ -51,19 +50,17 @@ export default class NewBranchForm {
} }
validate() { validate() {
var errorMessage, errors, formatter, unique, validator;
const { indexOf } = []; const { indexOf } = [];
this.branchNameError.empty(); this.branchNameError.empty();
unique = function(values, value) { const unique = function(values, value) {
if (indexOf.call(values, value) === -1) { if (indexOf.call(values, value) === -1) {
values.push(value); values.push(value);
} }
return values; return values;
}; };
formatter = function(values, restriction) { const formatter = function(values, restriction) {
var formatted; const formatted = values.map(value => {
formatted = values.map(value => {
switch (false) { switch (false) {
case !/\s/.test(value): case !/\s/.test(value):
return 'spaces'; return 'spaces';
...@@ -75,10 +72,9 @@ export default class NewBranchForm { ...@@ -75,10 +72,9 @@ export default class NewBranchForm {
}); });
return `${restriction.prefix} ${formatted.join(restriction.conjunction)}`; return `${restriction.prefix} ${formatted.join(restriction.conjunction)}`;
}; };
validator = (function(_this) { const validator = (function(_this) {
return function(errors, restriction) { return function(errors, restriction) {
var matched; const matched = _this.name.val().match(restriction.pattern);
matched = _this.name.val().match(restriction.pattern);
if (matched) { if (matched) {
return errors.concat(formatter(matched.reduce(unique, []), restriction)); return errors.concat(formatter(matched.reduce(unique, []), restriction));
} else { } else {
...@@ -86,9 +82,9 @@ export default class NewBranchForm { ...@@ -86,9 +82,9 @@ export default class NewBranchForm {
} }
}; };
})(this); })(this);
errors = this.restrictions.reduce(validator, []); const errors = this.restrictions.reduce(validator, []);
if (errors.length > 0) { if (errors.length > 0) {
errorMessage = $('<span/>').text(errors.join(', ')); const errorMessage = $('<span/>').text(errors.join(', '));
return this.branchNameError.append(errorMessage); return this.branchNameError.append(errorMessage);
} }
} }
......
---
title: Resolve Hide Delete selected in designs when viewing an old version
merge_request: 19889
author:
type: fixed
---
title: Remove IIFEs from branch_graph.js
merge_request: 20008
author: minghuan lei
type: other
---
title: Remove var from new_branch_form.js
merge_request: 20099
author: Lee Tickett
type: other
...@@ -97,7 +97,7 @@ future GitLab releases.** ...@@ -97,7 +97,7 @@ future GitLab releases.**
| `CI_PROJECT_TITLE` | 12.4 | all | The human-readable project name as displayed in the GitLab web interface. | | `CI_PROJECT_TITLE` | 12.4 | all | The human-readable project name as displayed in the GitLab web interface. |
| `CI_PROJECT_URL` | 8.10 | 0.5 | The HTTP(S) address to access project | | `CI_PROJECT_URL` | 8.10 | 0.5 | The HTTP(S) address to access project |
| `CI_PROJECT_VISIBILITY` | 10.3 | all | The project visibility (internal, private, public) | | `CI_PROJECT_VISIBILITY` | 10.3 | all | The project visibility (internal, private, public) |
| `CI_REGISTRY` | 8.10 | 0.5 | If the Container Registry is enabled it returns the address of GitLab's Container Registry | | `CI_REGISTRY` | 8.10 | 0.5 | If the Container Registry is enabled it returns the address of GitLab's Container Registry. This variable will include a `:port` value if one has been specified in the registry configuration. |
| `CI_REGISTRY_IMAGE` | 8.10 | 0.5 | If the Container Registry is enabled for the project it returns the address of the registry tied to the specific project | | `CI_REGISTRY_IMAGE` | 8.10 | 0.5 | If the Container Registry is enabled for the project it returns the address of the registry tied to the specific project |
| `CI_REGISTRY_PASSWORD` | 9.0 | all | The password to use to push containers to the GitLab Container Registry | | `CI_REGISTRY_PASSWORD` | 9.0 | all | The password to use to push containers to the GitLab Container Registry |
| `CI_REGISTRY_USER` | 9.0 | all | The username to use to push containers to the GitLab Container Registry | | `CI_REGISTRY_USER` | 9.0 | all | The username to use to push containers to the GitLab Container Registry |
......
...@@ -108,6 +108,21 @@ Then, you could run `npm publish` either locally or via GitLab CI/CD: ...@@ -108,6 +108,21 @@ Then, you could run `npm publish` either locally or via GitLab CI/CD:
- **GitLab CI/CD:** Set an `NPM_TOKEN` [variable](../../../ci/variables/README.md) - **GitLab CI/CD:** Set an `NPM_TOKEN` [variable](../../../ci/variables/README.md)
under your project's **Settings > CI/CD > Variables**. under your project's **Settings > CI/CD > Variables**.
### Authenticating with a CI job token
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9104) in GitLab Premium 12.5.
If you’re using NPM with GitLab CI/CD, a CI job token can be used instead of a personal access token.
The token will inherit the permissions of the user that generates the pipeline.
Add a corresponding section to your `.npmrc` file:
```ini
@foo:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=${env.CI_JOB_TOKEN}
//gitlab.com/api/v4/projects/{env.CI_PROJECT_ID>/packages/npm/:_authToken=${env.CI_JOB_TOKEN}
```
## Uploading packages ## Uploading packages
......
...@@ -75,9 +75,9 @@ request approval rules: ...@@ -75,9 +75,9 @@ request approval rules:
1. Click **Add approvers** to create a new approval rule. 1. Click **Add approvers** to create a new approval rule.
1. Just like in [GitLab Starter](#editing-approvals), select the approval members and approvals required. 1. Just like in [GitLab Starter](#editing-approvals), select the approval members and approvals required.
1. Give the approval rule a name that describes the set of approvers selected. 1. Give the approval rule a name that describes the set of approvers selected.
1. Click **Add approvers** to submit the new rule. 1. Click **Add approval rule** to submit the new rule.
![Approvals premium project edit](img/approvals_premium_project_edit_v12_3.png) ![Approvals premium project edit](img/approvals_premium_project_edit_v12_5.png)
## Multiple approval rules **(PREMIUM)** ## Multiple approval rules **(PREMIUM)**
......
...@@ -17260,6 +17260,9 @@ msgstr "" ...@@ -17260,6 +17260,9 @@ msgstr ""
msgid "There was a problem communicating with your device." msgid "There was a problem communicating with your device."
msgstr "" msgstr ""
msgid "There was a problem saving your custom stage, please try again"
msgstr ""
msgid "There was a problem sending the confirmation email" msgid "There was a problem sending the confirmation email"
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