未验证 提交 baa13f3a 编写于 作者: F Fatih Acet

Fix invalid date parsing for unfinished pipelines.

上级 0d7559a7
# CHANGELOG
## [1.1.1] - 2018-10-03
### Fixed
- Invalid date parsing for unfinished pipelines.
## [1.1.0] - 2018-10-02
### Added
- A new config option to toggle GitLab related links on the status bar [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
......
......@@ -2,7 +2,7 @@
"name": "gitlab-workflow",
"displayName": "GitLab Workflow",
"description": "GitLab VSCode integration",
"version": "1.1.0",
"version": "1.1.1",
"publisher": "fatihacet",
"license": "MIT",
"repository": {
......
......@@ -34,9 +34,18 @@ class DataProvider {
if (pipeline) {
const statusText = pipeline.status === 'success' ? 'passed' : pipeline.status;
const timeAgo = moment(pipeline.finished_at).fromNow();
message = `Pipeline #${pipeline.id} ${statusText} · ${timeAgo}`;
const actions = {
running: 'Started',
pending: 'Created',
success: 'Finished',
failed: 'Failed',
canceled: 'Canceled',
skipped: 'Skipped',
};
const timeAgo = moment(pipeline.updated_at).fromNow();
const actionText = actions[pipeline.status] || '';
message = `Pipeline #${pipeline.id} ${statusText} · ${actionText} ${timeAgo}`;
url = `${this.project.web_url}/pipelines/${pipeline.id}`;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册