Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
840ee74e
Commit
840ee74e
authored
Dec 06, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused components and polyfill - use interceptor for vue resource
parent
e9e498fd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
113 deletions
+9
-113
app/assets/javascripts/vue_pipelines_index/branch_commit.js.es6
...sets/javascripts/vue_pipelines_index/branch_commit.js.es6
+0
-64
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+1
-2
app/assets/javascripts/vue_pipelines_index/interceptor.js.es6
...assets/javascripts/vue_pipelines_index/interceptor.js.es6
+8
-0
app/assets/javascripts/vue_pipelines_index/object_assign.js.es6
...sets/javascripts/vue_pipelines_index/object_assign.js.es6
+0
-30
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+0
-17
No files found.
app/assets/javascripts/vue_pipelines_index/branch_commit.js.es6
deleted
100644 → 0
View file @
e9e498fd
/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueBranchCommit = Vue.extend({
props: ['pipeline'],
computed: {
mailto() {
return `mailto:${this.pipeline.commit.author_email}`;
},
alt() {
return `${this.pipeline.commit.author_name}'s avatar`;
},
avatarUrl() {
const author = this.pipeline.commit.author;
if (author) return author.avatar_url;
return this.pipeline.commit.author_gravatar_url;
},
},
template: `
<td class="branch-commit">
<div class="icon-container">
<i class="fa fa-code-fork"></i>
</div>
<a
class="monospace branch-name"
:href='pipeline.ref.url'
>
{{pipeline.ref.name}}
</a>
<div class="icon-container commit-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
<path fill="#8F8F8F" fill-rule="evenodd" d="M28.7769836,18 C27.8675252,13.9920226 24.2831748,11 20,11 C15.7168252,11 12.1324748,13.9920226 11.2230164,18 L4.0085302,18 C2.90195036,18 2,18.8954305 2,20 C2,21.1122704 2.8992496,22 4.0085302,22 L11.2230164,22 C12.1324748,26.0079774 15.7168252,29 20,29 C24.2831748,29 27.8675252,26.0079774 28.7769836,22 L35.9914698,22 C37.0980496,22 38,21.1045695 38,20 C38,18.8877296 37.1007504,18 35.9914698,18 L28.7769836,18 L28.7769836,18 Z M20,25 C22.7614237,25 25,22.7614237 25,20 C25,17.2385763 22.7614237,15 20,15 C17.2385763,15 15,17.2385763 15,20 C15,22.7614237 17.2385763,25 20,25 L20,25 Z"></path>
</svg>
</div>
<a
class="commit-id monospace"
:href='pipeline.commit.commit_url'
>
{{pipeline.commit.short_id}}
</a>
<p class="commit-title">
<a
:href='mailto'
>
<!-- ** will still need gravatar url ** -->
<img
class="avatar has-tooltip s20 hidden-xs"
:title='pipeline.commit.author_name'
data-container="body"
:src='avatarUrl'
>
</a>
<a
class="commit-row-message"
:href='pipeline.commit.commit_url'
>
{{pipeline.commit.title}}
</a>
</p>
</td>
`,
});
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_index/index.js.es6
View file @
840ee74e
...
...
@@ -5,7 +5,7 @@
//= require vue-resource
//= require ./
object_assign
.js.es6
//= require ./
interceptor
.js.es6
//= require ./status.js.es6
//= require ./store.js.es6
//= require ./pipeline_url.js.es6
...
...
@@ -13,7 +13,6 @@
//= require ./stage.js.es6
//= require ./stages.js.es6
//= require ./pipeline_actions.js.es6
//= require ./branch_commit.js.es6
//= require ./time_ago.js.es6
//= require ./pipelines.js.es6
...
...
app/assets/javascripts/vue_pipelines_index/interceptor.js.es6
0 → 100644
View file @
840ee74e
/* eslint-disable */
Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
next(function (response) {
Vue.activeResources--;
});
});
app/assets/javascripts/vue_pipelines_index/object_assign.js.es6
deleted
100644 → 0
View file @
e9e498fd
/* eslint-disable */
/* global Vue, gl */
/* eslint-disable no-param-reassign */
(() => {
if (typeof Object.assign != 'function') {
(function () {
Object.assign = function (target) {
'use strict';
// We must check against these specific cases.
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source !== undefined && source !== null) {
for (var nextKey in source) {
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}
})();
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
840ee74e
...
...
@@ -4,13 +4,6 @@
((gl) => {
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum, url, apiScope) {
const setVueResources = () => { Vue.activeResources = 1; };
const resetVueResources = () => { Vue.activeResources = 0; };
const addToVueResources = () => { Vue.activeResources += 1; };
const subtractFromVueResources = () => { Vue.activeResources -= 1; };
resetVueResources();
const updatePipelineNums = (count) => {
const { all } = count;
const running = count.running_or_pending;
...
...
@@ -18,14 +11,6 @@
document.querySelector('.js-running-count').innerHTML = running;
};
const resourceChecker = () => {
if (Vue.activeResources === 0) {
setVueResources();
} else {
addToVueResources();
}
};
const goFetch = () =>
this.$http.get(`${url}?scope=${apiScope}&page=${pageNum}`)
.then((response) => {
...
...
@@ -34,12 +19,10 @@
Vue.set(this, 'count', res.count);
updatePipelineNums(this.count);
this.pageRequest = false;
subtractFromVueResources();
}, () => new Flash(
'Something went wrong on our end.',
));
resourceChecker();
goFetch();
const startTimeLoops = () => {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment