Skip to content

Commit

Permalink
fix(ui): conditional rendering for billing components
Browse files Browse the repository at this point in the history
Adjusted SettingOwnerInfo to only render if the user lacks authorization
(v-if="!hasAuthorization").

Moved BillingDialog and its container to render only when the user has
authorization (v-else).

Updated related snapshot tests to reflect new conditional rendering logic.
  • Loading branch information
luannmoreira authored and gustavosbarreto committed Dec 11, 2024
1 parent 78aa99d commit 18c7e5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ui/src/components/Setting/SettingBilling.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<BillingDialog v-model="dialogCheckout" @reload="reload" />
<v-container fluid>
<SettingOwnerInfo :is-owner="hasAuthorization" data-test="settings-owner-info-component" />
<SettingOwnerInfo :is-owner="hasAuthorization" v-if="!hasAuthorization" data-test="settings-owner-info-component" />
<v-container fluid v-else>
<BillingDialog v-model="dialogCheckout" @reload="reload" />
<v-card
variant="flat"
class="bg-transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

exports[`Billing Settings Free Mode > Renders the component 1`] = `
"<div data-v-d7a09f69=\\"\\" class=\\"v-container v-container--fluid v-locale--is-ltr\\">
<!--v-if-->
<!---->
<!---->
<div data-v-d7a09f69=\\"\\" class=\\"v-card v-theme--light v-card--density-default v-card--variant-flat bg-transparent\\" data-test=\\"billing-card\\">
<!---->
<div class=\\"v-card__loader\\">
Expand Down

0 comments on commit 18c7e5c

Please sign in to comment.