Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
bistaastha committed Feb 8, 2024
2 parents 2a450f5 + a0c3f87 commit 64109d3
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 32 deletions.
3 changes: 3 additions & 0 deletions src/app/core/models/card-details-amount-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface CardDetailsAmountResponse {
current_amount: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface CardDetailsResponseWithNickName {
full_card_number: string;
cvv: string;
expiry_date: Date;
nick_name?: string;
}
10 changes: 0 additions & 10 deletions src/app/core/models/card-details-response.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,3 @@ export interface CardDetailsResponse {
cvv: string;
expiry_date: Date;
}
export interface CardDetailsResponseWithNickName {
full_card_number: string;
cvv: string;
expiry_date: Date;
nick_name?: string;
current_amount?: number;
}
export interface CardDetailsAmountResponse {
current_amount: number;
}
8 changes: 3 additions & 5 deletions src/app/core/services/virtual-cards.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { Injectable } from '@angular/core';
import { SpenderPlatformV1ApiService } from './spender-platform-v1-api.service';
import { Observable, concatMap, forkJoin, from, map, of } from 'rxjs';
import { VirtualCardsRequest } from '../models/virtual-cards-request.model';
import {
CardDetailsAmountResponse,
CardDetailsResponse,
CardDetailsResponseWithNickName,
} from '../models/card-details-response.model';
import { CardDetailsResponse } from '../models/card-details-response.model';
import { CardDetailsAmountResponse } from '../models/card-details-amount-response';
import { PlatformApiResponse } from '../models/platform/platform-api-response.model';
import { VirtualCard } from '../models/virtual-card.model';
import { virtualCardCurrentAmountResponse } from '../mock-data/virtual-card-details-response.data';
import { CardDetailsResponseWithNickName } from '../models/card-details-response-with-nickname.model';

@Injectable({
providedIn: 'root',
Expand Down
5 changes: 3 additions & 2 deletions src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1373,11 +1373,12 @@ export class AddEditMileagePage implements OnInit {
this.mileageRates$ = forkJoin({
orgUserMileageSettings: this.mileageService.getOrgUserMileageSettings(),
allMileageRates: this.mileageRateService.getAllMileageRates(),
orgSettings: orgSettings$,
}).pipe(
map(({ orgUserMileageSettings, allMileageRates }) => {
map(({ orgUserMileageSettings, allMileageRates, orgSettings }) => {
let enabledMileageRates = this.mileageRatesService.filterEnabledMileageRates(allMileageRates);
const mileageRateSettings = orgUserMileageSettings?.mileage_rate_labels || [];
if (mileageRateSettings.length > 0) {
if (orgSettings.mileage?.enable_individual_mileage_rates && mileageRateSettings.length > 0) {
enabledMileageRates = enabledMileageRates.filter((rate) => mileageRateSettings.includes(rate.vehicle_type));
}
return enabledMileageRates;
Expand Down
46 changes: 31 additions & 15 deletions src/app/shared/components/virtual-card/virtual-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,39 @@
<div>{{ cardStatus | titlecase }}</div>
</div>
</div>
<div class="ion-align-items-center d-flex">
<div *ngIf="!showCardNumber" class="virtual-card__card-number__card-number-mask d-flex">
<div>****</div>
<div>******</div>
</div>
<div *ngIf="showCardNumber" class="virtual-card__card-number__card-number-unmasked d-flex">
<div>{{ cardNumber | slice : 0 : 4 }}</div>
<div>{{ cardNumber | slice : 4 : 10 }}</div>
</div>
<div class="virtual-card__card-number__unmasked-card-digits">
{{ cardNumber | slice : 10 : 15 }}
</div>
</div>
<div class="ion-align-items-center d-flex">
<div *ngIf="!showCardNumber" class="virtual-card__card-number__card-number-mask d-flex">
<div>****</div>
<div>******</div>
</div>
<div *ngIf="showCardNumber" class="virtual-card__card-number__card-number-unmasked d-flex">
<div>{{ cardNumber | slice : 0 : 4 }}</div>
<div>{{ cardNumber | slice : 4 : 10 }}</div>
</div>
<div class="virtual-card__card-number__unmasked-card-digits">
{{ cardNumber | slice : 10 : 15 }}
</div>
<ion-icon
src="../../../../../assets/svg/duplicate.svg"
(press)="toggleShowCardNumber()"
(pressup)="hideCardNumberAndCopy()"
(tap)="copyToClipboard(cardNumber)"
></ion-icon>
</div>
</div>
<div class="virtual-card__card-fields ion-align-items-center d-flex">
<div class="virtual-card__card-fields__cvv-field">
<div class="virtual-card__card-fields__label-text">CVV</div>
<div class="d-flex">
<div *ngIf="!showCvv" class="virtual-card__card-fields__cvv-mask">****</div>
<div *ngIf="showCvv" class="virtual-card__card-fields__cvv-number">{{ cvv }}</div>
<ion-icon
class="virtual-card__card-fields__cvv-copy-icon"
src="../../../../../assets/svg/duplicate.svg"
(press)="toggleShowCardNumber()"
(pressup)="hideCardNumberAndCopy()"
(tap)="copyToClipboard(cardNumber)"
(press)="toggleShowCvv()"
(pressup)="hideCvvAndCopy()"
(tap)="copyToClipboard(cvv)"
></ion-icon>
</div>
</div>
Expand Down

0 comments on commit 64109d3

Please sign in to comment.