Skip to content

Commit 7f741f8

Browse files
committed
fix: budget visibility for spender DQA-1 (#4081)
1 parent 3af9a14 commit 7f741f8

File tree

6 files changed

+61
-7
lines changed

6 files changed

+61
-7
lines changed

src/app/fyle/dashboard/dashboard-budgets/dashboard-budgets.component.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
</div>
5252

5353
<!-- Budget info -->
54-
<!-- TODO: @SahilK-027 to Humanize amount max values -->
5554
<div class="dashboard-budgets__item-info">
5655
<div class="dashboard-budgets__item-info-container">
5756
<!-- limit -->
@@ -62,7 +61,7 @@
6261
<div>
6362
@if (homeCurrency(); as homeCurrency) {
6463
<span class="dashboard-budgets__item-info-stat-value">{{
65-
budget.amount_limit | currency: homeCurrency
64+
budget.amount_limit | humanizeCurrency: homeCurrency
6665
}}</span>
6766
} @else {
6867
<div class="dashboard-budgets__item-info-stat-shimmer">
@@ -97,7 +96,7 @@
9796
<div>
9897
@if (homeCurrency(); as homeCurrency) {
9998
<span class="dashboard-budgets__item-info-stat-value">{{
100-
budget.amount_spent | currency: homeCurrency
99+
budget.amount_spent | humanizeCurrency: homeCurrency
101100
}}</span>
102101
} @else {
103102
<div class="dashboard-budgets__item-info-stat-shimmer">
@@ -116,7 +115,7 @@
116115
<div>
117116
@if (homeCurrency(); as homeCurrency) {
118117
<span class="dashboard-budgets__item-info-stat-value">{{
119-
budget.amount_remaining | currency: homeCurrency
118+
budget.amount_remaining | humanizeCurrency: homeCurrency
120119
}}</span>
121120
} @else {
122121
<div class="dashboard-budgets__item-info-stat-shimmer">

src/app/fyle/dashboard/dashboard-budgets/dashboard-budgets.component.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// TODO: @SahilK-027 to fix this scss as per figma design
21
@use '../../../../theme/colors.scss';
32

43
.dashboard-budgets {

src/app/fyle/dashboard/dashboard-budgets/dashboard-budgets.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getTranslocoTestingModule } from 'src/app/core/testing/transloco-testin
1010
import { Budget } from 'src/app/core/models/budget.model';
1111
import { BudgetTotalUtilisationInfoModalComponent } from './budget-total-utilisation-info-modal/budget-total-utilisation-info-modal.component';
1212
import { cloneDeep } from 'lodash';
13+
import { FyCurrencyPipe } from 'src/app/shared/pipes/fy-currency.pipe';
1314

1415
describe('DashboardBudgetsComponent', () => {
1516
let component: DashboardBudgetsComponent;
@@ -54,6 +55,7 @@ describe('DashboardBudgetsComponent', () => {
5455
providers: [
5556
{ provide: CurrencyService, useValue: currencyServiceSpy },
5657
{ provide: ModalController, useValue: modalControllerSpy },
58+
FyCurrencyPipe,
5759
provideHttpClient(withInterceptorsFromDi()),
5860
provideHttpClientTesting(),
5961
],

src/app/fyle/dashboard/dashboard-budgets/dashboard-budgets.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { CurrencyService } from 'src/app/core/services/currency.service';
1010
import { Subject, takeUntil } from 'rxjs';
1111
import { MatIcon } from '@angular/material/icon';
1212
import { BudgetTotalUtilisationInfoModalComponent } from './budget-total-utilisation-info-modal/budget-total-utilisation-info-modal.component';
13+
import { HumanizeCurrencyPipe } from 'src/app/shared/pipes/humanize-currency.pipe';
1314

1415
// install Swiper modules
1516
SwiperCore.use([Pagination]);
@@ -18,7 +19,7 @@ SwiperCore.use([Pagination]);
1819
selector: 'app-dashboard-budgets',
1920
templateUrl: './dashboard-budgets.component.html',
2021
styleUrls: ['./dashboard-budgets.component.scss'],
21-
imports: [TranslocoPipe, SwiperModule, IonSkeletonText, CommonModule, MatIcon],
22+
imports: [TranslocoPipe, SwiperModule, IonSkeletonText, CommonModule, MatIcon, HumanizeCurrencyPipe],
2223
})
2324
export class DashboardBudgetsComponent implements OnDestroy {
2425
readonly budgets = input<Budget[]>([]);

src/app/fyle/dashboard/dashboard.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
}
103103
<app-stats></app-stats>
104104
@if (areDashboardTabsEnabled()) {
105-
<ion-segment class="dashboard--segment" (ionChange)="onTabChange($event)" [value]="activeTabState()">
105+
<ion-segment mode="md" class="dashboard--segment" (ionChange)="onTabChange($event)" [value]="activeTabState()">
106106
<ion-segment-button value="cards" class="text-capitalize"
107107
>{{ 'dashboard.cardsTab' | transloco }} ({{ cardCount() }})</ion-segment-button
108108
>

src/app/fyle/dashboard/dashboard.page.scss

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,52 @@
3131
}
3232
}
3333

34+
&--segment {
35+
ion-segment-button {
36+
--indicator-color: transparent;
37+
--color: #{colors.$black-light};
38+
--color-checked: #{colors.$black-light};
39+
--background: transparent;
40+
--background-checked: transparent;
41+
--border-radius: 0;
42+
--border-width: 0;
43+
--border-style: none;
44+
--padding-start: 0;
45+
--padding-end: 0;
46+
--margin-start: 0;
47+
--margin-end: 16px;
48+
min-width: auto;
49+
font-size: 14px;
50+
font-weight: 500;
51+
text-transform: capitalize;
52+
53+
&::part(indicator-background) {
54+
background: transparent;
55+
}
56+
57+
&.segment-button-checked {
58+
--color: #{colors.$black-light};
59+
color: colors.$black-light !important;
60+
margin: 0;
61+
padding: 0;
62+
63+
&::part(indicator-background) {
64+
background: transparent;
65+
}
66+
}
67+
68+
&.segment-button-checked::after {
69+
content: '';
70+
position: absolute;
71+
bottom: 0;
72+
left: 0;
73+
right: 0;
74+
height: 2px;
75+
background-color: colors.$brand-primary;
76+
}
77+
}
78+
}
79+
3480
&--greetings-text {
3581
padding: 8px 16px 4px 16px;
3682
font-size: 18px;
@@ -109,24 +155,31 @@
109155
0% {
110156
transform: rotate(0deg);
111157
}
158+
112159
10% {
113160
transform: rotate(14deg);
114161
}
162+
115163
20% {
116164
transform: rotate(-8deg);
117165
}
166+
118167
30% {
119168
transform: rotate(14deg);
120169
}
170+
121171
40% {
122172
transform: rotate(-4deg);
123173
}
174+
124175
50% {
125176
transform: rotate(10deg);
126177
}
178+
127179
60% {
128180
transform: rotate(0deg);
129181
}
182+
130183
100% {
131184
transform: rotate(0deg);
132185
}

0 commit comments

Comments
 (0)