user/project: show run/task tabelement only when loaded

This commit is contained in:
Simone Gotti 2019-07-10 17:11:03 +02:00
parent 3ff8a1350b
commit 9187efc9c9
2 changed files with 34 additions and 24 deletions

View File

@ -51,29 +51,35 @@
<span>Pull Requests</span>
</router-link>
</li>
<li v-if="$route.name.endsWith('project run') || $route.name.endsWith('project run task')">
<li
v-if="run && ($route.name.endsWith('project run') || $route.name.endsWith('project run task'))"
>
<tabarrow />
</li>
<li
class="tab-element"
v-if="$route.name.endsWith('project run') || $route.name.endsWith('project run task')"
v-if="run && ($route.name.endsWith('project run') || $route.name.endsWith('project run task'))"
:class="[{ 'tab-element-selected': $route.name.endsWith('project run') }]"
>
<router-link :to="projectRunLink(ownertype, ownername, projectref, $route.params.runid)">
<p v-if="run">
<p>
Run
<strong>#{{run.counter}}</strong>
</p>
</router-link>
</li>
<li v-if="$route.name.endsWith('project run task')">
<li v-if="run && $route.name.endsWith('project run task')">
<tabarrow />
</li>
<li class="tab-element" v-if="$route.name.endsWith('project run task')">
<li
class="tab-element"
v-if="run && $route.name.endsWith('project run task')"
:class="[{ 'tab-element-selected': $route.name.endsWith('project run task') }]"
>
<router-link
:to="projectRunTaskLink(ownertype, ownername, projectref, $route.params.runid, $route.params.taskid)"
>
<p v-if="run">
<p>
Task
<strong>{{run.tasks[$route.params.taskid].name}}</strong>
</p>
@ -168,6 +174,7 @@ export default {
},
watch: {
$route: async function(route) {
this.run = null;
if (route.params.runid) {
let { data, error } = await fetchRun(route.params.runid);
if (error) {

View File

@ -39,33 +39,35 @@
<span>Direct Runs</span>
</router-link>
</li>
<li v-if="$route.name === 'user direct run' || $route.name == 'user direct run task'">
<li
v-if="run && ($route.name === 'user direct run' || $route.name == 'user direct run task')"
>
<tabarrow />
</li>
<li
class="tab-element"
v-if="$route.name === 'user direct run' || $route.name == 'user direct run task'"
v-if="run && ($route.name === 'user direct run' || $route.name == 'user direct run task')"
:class="[{ 'tab-element-selected': $route.name === 'user direct run' }]"
>
<router-link :to="userDirectRunLink(username, $route.params.runid)">
<span v-if="run">
<span>
Run
<strong>#{{run.counter}}</strong>
</span>
</router-link>
</li>
<li v-if="$route.name === 'user direct run task'">
<li v-if="run && $route.name === 'user direct run task'">
<tabarrow />
</li>
<li
class="tab-element"
v-if="$route.name == 'user direct run task'"
v-if="run && $route.name == 'user direct run task'"
:class="[{ 'tab-element-selected': $route.name === 'user direct run task' }]"
>
<router-link
:to="userDirectRunTaskLink(username, $route.params.runid, $route.params.taskid)"
>
<span v-if="run">
<span>
Task
<strong>{{run.tasks[$route.params.taskid].name}}</strong>
</span>
@ -168,6 +170,7 @@ export default {
},
watch: {
$route: async function(route) {
this.run = null;
if (route.params.runid) {
let { data, error } = await fetchRun(route.params.runid);
if (error) {