Skip to content

Commit

Permalink
[ADD] Adding local image support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil-Pahwa committed Dec 19, 2017
1 parent 2e06a37 commit 7ffe1cf
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ <h2>{{ 'PICK_YOUR_DESTINATION' | translate:lang }}</h2>
<!-- banner END-->
<app-flight-filter *ngIf="filteredList" [flights]=filteredList (selectionChanged)="filterSearch($event)"></app-flight-filter>
<!-- Flight Listing -->
<section class="col">
<section class="col" *ngIf="filteredList">
<div class="flight-listing-container">
<span>{{filteredList?.length}} records found</span>
<ul class="results-list">
<li class="offer-listing" *ngFor="let flight of filteredList">
<div class="flex-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ export class FlightSearchComponent implements OnInit {
this.filteredList = [];
filters.forEach((filter: Filter) => {
let items = this.flightsList.filter(function (flight) {
console.log(flight);
return (filter.selected && (flight.carrierId === filter.id));
});
console.log(items);

this.filteredList = this.filteredList.concat(items);

this.filteredList.sort(function (a, b) {
return a.fare - b.fare;
});

});
}
}
6 changes: 3 additions & 3 deletions src/app/shared/resources/flights.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface RemoteFare {
grossamount: string;
grossamount: number;
}

export interface RemoteFlight {
Expand Down Expand Up @@ -30,7 +30,7 @@ export interface Flight {
flightId: string;
destination: string;
styleUrl: string;
fare: string;
fare: number;
carrierId: string;
}

Expand All @@ -47,7 +47,7 @@ export class Flight implements Flight {
public flightId: string,
public destination: string,
public styleUrl: string,
public fare: string,
public fare: number,
public carrierId: string
) {
}
Expand Down
158 changes: 158 additions & 0 deletions src/assets/images/airlines/AI_sq.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions src/assets/images/airlines/JA_sq.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions src/assets/json/flight-search-results.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_comment": "Logos are placed locally for demo purpose",
"data": {
"returnflights": [],
"onwardflights": [{
Expand Down Expand Up @@ -29,7 +30,7 @@
"PromotionId": "",
"fid": 4,
"styleUrl": "assets/css/external_domain_styles/air_india.css",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/AI_sq.svg",
"logoUrl": "assets/images/airlines/AI_sq.svg",
"fare": {
"grossamount": 4886,
"totalbasefare": 4425,
Expand Down Expand Up @@ -76,7 +77,7 @@
"duration": "20h 35m",
"platingcarrier": "",
"qtype": "",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/9W_sq.svg",
"logoUrl": "assets/images/airlines/JA_sq.svg",
"arrterminal": "",
"flightno": "768",
"destination": "HYD",
Expand Down Expand Up @@ -239,7 +240,7 @@
"carrierId": "AI",
"airline": "Air India",
"styleUrl": "assets/css/external_domain_styles/air_india.css",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/AI_sq.svg",
"logoUrl": "assets/images/airlines/AI_sq.svg",
"provider": "",
"PromotionId": "",
"fare": {
Expand Down Expand Up @@ -331,7 +332,7 @@
"styleUrl": "assets/css/external_domain_styles/jet_airways.css",
"provider": "",
"PromotionId": "",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/9W_sq.svg",
"logoUrl": "assets/images/airlines/JA_sq.svg",
"fare": {
"totalsurcharge": 0,
"totalfare": 0,
Expand Down Expand Up @@ -393,7 +394,7 @@
"stops": "2",
"seatsavailable": "1",
"carrierId": "JA",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/9W_sq.svg",
"logoUrl": "assets/images/airlines/JA_sq.svg",
"airline": "Jet Airways",
"styleUrl": "assets/css/external_domain_styles/jet_airways.css",
"provider": "",
Expand Down Expand Up @@ -485,7 +486,7 @@
"carrierId": "JA",
"airline": "Jet Airways",
"styleUrl": "assets/css/external_domain_styles/jet_airways.css",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/9W_sq.svg",
"logoUrl": "assets/images/airlines/JA_sq.svg",
"provider": "",
"PromotionId": "",
"fare": {
Expand Down Expand Up @@ -549,7 +550,7 @@
"stops": "2",
"seatsavailable": "1",
"carrierId": "JA",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/9W_sq.svg",
"logoUrl": "assets/images/airlines/JA_sq.svg",
"airline": "Jet Airways",
"styleUrl": "assets/css/external_domain_styles/jet_airways.css",
"provider": "",
Expand Down Expand Up @@ -706,7 +707,7 @@
"carrierId": "AI",
"airline": "Air India",
"styleUrl": "assets/css/external_domain_styles/air_india.css",
"logoUrl": "//images.trvl-media.com/media/content/expus/graphics/static_content/fusion/v0.1b/images/airlines/vector/s/AI_sq.svg",
"logoUrl": "assets/images/airlines/AI_sq.svg",
"provider": "",
"PromotionId": "",
"fare": {
Expand Down

0 comments on commit 7ffe1cf

Please sign in to comment.