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
3fff93ca
Commit
3fff93ca
authored
Jan 07, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use Object.assign instead of Vue.set - change duration to computed prop
parent
ec90700c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+3
-3
app/assets/javascripts/vue_pipelines_index/time_ago.js.es6
app/assets/javascripts/vue_pipelines_index/time_ago.js.es6
+4
-4
No files found.
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
3fff93ca
...
@@ -25,11 +25,11 @@
...
@@ -25,11 +25,11 @@
this.$http.get(`${url}?scope=${apiScope}&page=${pageNum}`)
this.$http.get(`${url}?scope=${apiScope}&page=${pageNum}`)
.then((response) => {
.then((response) => {
const pageInfo = pageValues(response.headers);
const pageInfo = pageValues(response.headers);
Vue.set(this, 'pageInfo'
, pageInfo);
this.pageInfo = Object.assign({}, this.pageInfo
, pageInfo);
const res = JSON.parse(response.body);
const res = JSON.parse(response.body);
Vue.set(this, 'pipelines', res.pipelines
);
this.count = Object.assign({}, this.count, res.count
);
Vue.set(this, 'count', res.count
);
this.pipelines = Object.assign([], this.pipelines, res.pipelines
);
updatePipelineNums(this.count);
updatePipelineNums(this.count);
this.pageRequest = false;
this.pageRequest = false;
...
...
app/assets/javascripts/vue_pipelines_index/time_ago.js.es6
View file @
3fff93ca
...
@@ -29,23 +29,23 @@
...
@@ -29,23 +29,23 @@
if (!finished && changeTime) return false;
if (!finished && changeTime) return false;
return ({ words: this.timeAgo.format(finished) });
return ({ words: this.timeAgo.format(finished) });
},
},
},
methods: {
duration() {
duration() {
const { duration } = this.pipeline.details;
const { duration } = this.pipeline.details;
if (duration === 0) return '00:00:00';
if (duration === 0) return '00:00:00';
if (duration !== null) return duration;
if (duration !== null) return duration;
return false;
return false;
},
},
},
methods: {
changeTime() {
changeTime() {
this.currentTime = new Date();
this.currentTime = new Date();
},
},
},
},
template: `
template: `
<td>
<td>
<p class="duration" v-if='duration
()
'>
<p class="duration" v-if='duration'>
<span v-html='svgs.iconTimer'></span>
<span v-html='svgs.iconTimer'></span>
{{duration
()
}}
{{duration}}
</p>
</p>
<p class="finished-at" v-if='timeStopped'>
<p class="finished-at" v-if='timeStopped'>
<i class="fa fa-calendar"></i>
<i class="fa fa-calendar"></i>
...
...
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