Skip to content

Commit

Permalink
fix: indicator footer buttons render conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
allan-chagas-brisa committed Oct 2, 2023
1 parent 63024a6 commit cc0be06
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions projects/ion/src/lib/indicator/indicator.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h4 data-testid="ion-indicator-value">{{ value }}</h4>
*ngIf="buttonConfig && !loading && !error"
>
<ion-button
*ngIf="buttonConfig.type !== 'popover'; else ionPopoverButton"
*ngIf="buttonConfig.type !== 'popover'"
[attr.data-testid]="'ion-indicator-button-' + buttonConfig.type"
type="ghost"
size="sm"
Expand All @@ -57,28 +57,26 @@ <h4 data-testid="ion-indicator-value">{{ value }}</h4>
[iconType]="buttonConfig.icon ? buttonConfig.icon : 'right2'"
(ionOnClick)="handleButtonClick(buttonConfig.type)"
></ion-button>
<ng-template #ionPopoverButton>
<ion-button
[attr.data-testid]="'ion-indicator-button-' + buttonConfig.type"
type="ghost"
size="sm"
rightSideIcon="true"
[label]="buttonConfig.label"
[iconType]="buttonConfig.icon ? buttonConfig.icon : 'right2'"
(ionOnClick)="handleButtonClick(buttonConfig.type)"
ionPopover
[ionPopoverTitle]="buttonConfig.popoverConfig.ionPopoverTitle"
[ionPopoverBody]="ionIndicatorPopoverBody"
[ionPopoverActions]="buttonConfig.popoverConfig.ionPopoverActions"
[ionPopoverIcon]="buttonConfig.popoverConfig.ionPopoverIcon"
[ionPopoverIconClose]="
buttonConfig.popoverConfig.ionPopoverIconClose
"
[ionPopoverPosition]="buttonConfig.popoverConfig.ionPopoverPosition"
(ionOnFirstAction)="buttonConfig.popoverConfig.firstAction()"
(ionOnSecondAction)="buttonConfig.popoverConfig.secondAction()"
></ion-button>
</ng-template>

<ion-button
*ngIf="buttonConfig.popoverConfig"
[attr.data-testid]="'ion-indicator-button-' + buttonConfig.type"
type="ghost"
size="sm"
rightSideIcon="true"
[label]="buttonConfig.label"
[iconType]="buttonConfig.icon ? buttonConfig.icon : 'right2'"
(ionOnClick)="handleButtonClick(buttonConfig.type)"
ionPopover
[ionPopoverTitle]="buttonConfig.popoverConfig.ionPopoverTitle"
[ionPopoverBody]="ionIndicatorPopoverBody"
[ionPopoverActions]="buttonConfig.popoverConfig.ionPopoverActions"
[ionPopoverIcon]="buttonConfig.popoverConfig.ionPopoverIcon"
[ionPopoverIconClose]="buttonConfig.popoverConfig.ionPopoverIconClose"
[ionPopoverPosition]="buttonConfig.popoverConfig.ionPopoverPosition"
(ionOnFirstAction)="buttonConfig.popoverConfig.firstAction()"
(ionOnSecondAction)="buttonConfig.popoverConfig.secondAction()"
></ion-button>
</footer>
</div>
</div>
Expand Down

0 comments on commit cc0be06

Please sign in to comment.