Skip to content

Commit

Permalink
fix:draft report zero state improvements (#3363)
Browse files Browse the repository at this point in the history
* fix:draft report zero state improvements

* fixing unit test error

* fixing unit test

* fix cta text size based on different scrren size

* minor changes

---------

Co-authored-by: Snehasish <snehasish@Snehasishs-MacBook-Air.local>
  • Loading branch information
Sishhhh and Snehasish authored Jan 7, 2025
1 parent 7b4dd49 commit f890298
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 11 deletions.
26 changes: 16 additions & 10 deletions src/app/fyle/my-view-report/my-view-report.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,27 @@
</div>
<div class="view-reports--expenses-zero-state" *ngIf="!isExpensesLoading && report.num_expenses === 0">
<div class="text-center">
<img src="../../../assets/images/zero-states/expenses.png" alt="No expense in this report" />
<div class="view-reports--zero-state-header">Looks like this report is empty.</div>
<div class="view-reports--zero-state-image-container">
<img src="../../../assets/images/zero-states/invoice.png" alt="No expense in this report" />
</div>
<div class="view-reports--zero-state-semibold-header">Looks like you’ve got</div>
<div class="view-reports--zero-state-header">0 expense right now</div>
</div>
<div class="view-reports--footer-container">
<button
*ngIf="unreportedExpenses && unreportedExpenses.length > 0"
class="view-reports--unreported-cta"
class="btn-primary view-reports--cta"
(click)="showAddExpensesToReportModal()"
>
Add complete expenses
Add complete expense
</button>
<button
id="add-expense"
[ngClass]="{'btn-primary': !(unreportedExpenses && unreportedExpenses.length > 0), 'btn-outline-secondary view-reports--cta': unreportedExpenses && unreportedExpenses.length > 0}"
(click)="addExpense()"
>
Add new expense
</button>
<div class="view-reports--add-more-container" (click)="addExpense()">
<div class="view-reports--add-more-icon-container">
<mat-icon class="view-reports--add-more-icon" svgIcon="plus-square"></mat-icon>
</div>
<div class="view-reports--add-more-text">Add Expenses</div>
</div>
</div>
</div>
</ng-container>
Expand Down
34 changes: 34 additions & 0 deletions src/app/fyle/my-view-report/my-view-report.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@
}
}

&--footer-container {
display: flex;
justify-content: space-between;
padding: 12px 16px;
gap: 8px;
text-wrap: nowrap;
position: fixed;
bottom: 0;
width: 100%;
background-color: $pure-white;
box-shadow: 0 -2px 12px $pink-shadow;
z-index: 999;
}

&--cta {
font-size: 14px !important;
@media (max-width: 350px) {
font-size: 12px !important;
}
}

&--card-body {
font-size: 16px;
color: $gray-3;
Expand Down Expand Up @@ -365,6 +386,19 @@
font-weight: 500;
}

&--zero-state-semibold-header {
font-size: 14px;
display: block;
color: $blue-black;
line-height: 1.5;
}

&--zero-state-image-container {
height: 150px;
width: 150px;
overflow: hidden;
}

&--history-container {
background: $pure-white;
border-radius: 16px;
Expand Down
2 changes: 1 addition & 1 deletion src/app/fyle/my-view-report/my-view-report.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ describe('MyViewReportPage', () => {
component.report$ = of(cloneDeep({ ...platformReportData, state: 'DRAFT' }));
fixture.detectChanges();

const addExpenseButton = getElementBySelector(fixture, '.view-reports--add-more-container') as HTMLElement;
const addExpenseButton = getElementBySelector(fixture, '#add-expense') as HTMLElement;
click(addExpenseButton);

expect(router.navigate).toHaveBeenCalledOnceWith([
Expand Down
Binary file added src/assets/images/zero-states/invoice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f890298

Please sign in to comment.