[go: nahoru, domu]

Skip to content

Commit

Permalink
ui: remove v-if in fragment
Browse files Browse the repository at this point in the history
This commit removes the v-if because it's not good programming practice to put
it in the template.

And change tests to uses table drive model.

Signed-off-by: Leonardo R.S. Joao <leonardo.joao@ossystems.com.br>
  • Loading branch information
leonardojoao authored and gustavosbarreto committed Feb 10, 2022
1 parent cfc0d71 commit f92731c
Show file tree
Hide file tree
Showing 8 changed files with 554 additions and 292 deletions.
8 changes: 7 additions & 1 deletion ui/src/components/session/SessionDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

<v-card>
<v-list-item
v-if="session.recorded"
v-if="session.recorded && isEnterprise"
@click.stop="openDialog('sessionPlayDialog')"
>
<SessionPlay
Expand Down Expand Up @@ -253,6 +253,12 @@ export default {
};
},
computed: {
isEnterprise() {
return this.$env.isEnterprise;
},
},
async created() {
this.uid = this.$route.params.id;
try {
Expand Down
6 changes: 5 additions & 1 deletion ui/src/components/session/SessionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
</v-list-item>

<v-list-item
v-if="item.authenticated && item.recorded"
v-if="item.authenticated && item.recorded && isEnterprise"
@click.stop="showSessionPlay(getListSessions.indexOf(item))"
>
<SessionPlay
Expand Down Expand Up @@ -236,6 +236,10 @@ export default {
getNumberSessions() {
return this.$store.getters['sessions/getNumberSessions'];
},
isEnterprise() {
return this.$env.isEnterprise;
},
},
watch: {
Expand Down
9 changes: 1 addition & 8 deletions ui/src/components/session/SessionPlay.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<fragment
v-if="hidden()"
data-test="render-fragment"
>
<fragment>
<v-tooltip
v-if="recorded"
:disabled="hasAuthorization"
Expand Down Expand Up @@ -430,10 +427,6 @@ export default {
);
}
},
hidden() {
return this.$env.isEnterprise;
},
},
};
Expand Down
Loading

0 comments on commit f92731c

Please sign in to comment.