Commit a9af423c authored by Regis's avatar Regis

almost close to svgs - fixed bug for API call

parent 8a7f58d2
...@@ -174,9 +174,9 @@ ...@@ -174,9 +174,9 @@
} }
break; break;
case 'projects:pipelines:index': case 'projects:pipelines:index':
new gl.MiniPipelineGraph({ // new gl.MiniPipelineGraph({
container: '.js-pipeline-table', // container: '.js-pipeline-table',
}); // });
break; break;
case 'projects:pipelines:builds': case 'projects:pipelines:builds':
case 'projects:pipelines:show': case 'projects:pipelines:show':
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
data() { data() {
return { return {
request: false, request: false,
builds: '<ul></ul>', builds: '',
spinner: '<span class="fa fa-spinner fa-spin"></span>',
}; };
}, },
props: ['stage', 'svgs', 'match'], props: ['stage', 'svgs', 'match'],
...@@ -14,18 +15,28 @@ ...@@ -14,18 +15,28 @@
fetchBuilds() { fetchBuilds() {
this.$http.get(this.endpoint) this.$http.get(this.endpoint)
.then((response) => { .then((response) => {
this.builds = JSON.parse(response.body).html;
this.request = true; this.request = true;
setTimeout(() => {
this.builds = JSON.parse(response.body).html;
}, 100);
}, () => new Flash( }, () => new Flash(
'Something went wrong on our end.', 'Something went wrong on our end.',
)); ));
}, },
clearState() { clearState() {
this.response = false; this.request = false;
this.builds = '<ul></ul>'; this.builds = '';
}, },
}, },
computed: { computed: {
buildsOrSpinner() {
if (this.request) return this.builds;
return this.spinner;
},
dropdownClass() {
if (this.request) return 'js-builds-dropdown-container';
return 'js-builds-dropdown-loading builds-dropdown-loading';
},
endpoint() { endpoint() {
return '/gitlab-org/gitlab-shell/pipelines/121/stage?stage=deploy'; return '/gitlab-org/gitlab-shell/pipelines/121/stage?stage=deploy';
}, },
...@@ -53,8 +64,7 @@ ...@@ -53,8 +64,7 @@
@blur='clearState' @blur='clearState'
class="has-tooltip builds-dropdown js-builds-dropdown-button" class="has-tooltip builds-dropdown js-builds-dropdown-button"
data-placement="top" data-placement="top"
data-stage-endpoint='stage.status.endpoint' :title='stageTitle'
:data-title='stageTitle'
data-toggle="dropdown" data-toggle="dropdown"
type="button" type="button"
> >
...@@ -62,7 +72,7 @@ ...@@ -62,7 +72,7 @@
<span class="mini-pipeline-graph-icon-container"> <span class="mini-pipeline-graph-icon-container">
<span <span
:class='spanClass' :class='spanClass'
:v-html='svg' v-html='svg'
> >
</span> </span>
<i class="fa fa-caret-down dropdown-caret"></i> <i class="fa fa-caret-down dropdown-caret"></i>
...@@ -73,16 +83,10 @@ ...@@ -73,16 +83,10 @@
<div class="dropdown-menu grouped-pipeline-dropdown"> <div class="dropdown-menu grouped-pipeline-dropdown">
<div class="arrow-up"></div> <div class="arrow-up"></div>
<div <div
class="js-builds-dropdown-list" :class='dropdownClass'
v-if='request' v-if='request'
v-html='builds' v-html='buildsOrSpinner'
>
</div>
<div
class="js-builds-dropdown-loading builds-dropdown-loading"
v-if='!request'
> >
<span class="fa fa-spinner fa-spin"></span>
</div> </div>
</div> </div>
</div> </div>
......
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