From c4ddc8abd9975b8abde8403e1556c54eec8b968d Mon Sep 17 00:00:00 2001
From: Abhishek <guywhodesigns@gmail.com>
Date: Jul 26 2018 13:26:59 +0000
Subject: [PATCH 1/5] add individual error states components


---

diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 3178776..16768b7 100755
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -16,11 +16,16 @@ import { HomePage } from '../pages/home/home';
 import { MagazinePage } from '../pages/magazine/magazine';
 import { AskPage } from '../pages/ask/ask';
 import { CalendarPage, Search, meetingDetails } from '../pages/calendar/calendar';
-import { MorePage, AboutDetailPage, AboutPage, BookmarksPage} from '../pages/more/more';
-import { NotificationsPage} from '../pages/notifications/notifications';
+import { MorePage, AboutDetailPage, AboutPage, BookmarksPage } from '../pages/more/more';
+import { NotificationsPage } from '../pages/notifications/notifications';
 import { PackageSearchPage } from '../pages/package-search/package-search';
 import { ViewPackagePage } from '../pages/view-package/view-package';
 
+import { NoBookmarksComponent } from '../components/no-bookmarks/no-bookmarks';
+import { NoMeetingsComponent } from '../components/no-meetings/no-meetings';
+import { NoResultsComponent } from '../components/no-results/no-results';
+import { NoInternetComponent } from '../components/no-internet/no-internet';
+
 import { Browser } from '../providers/browser/browser';
 
 @NgModule({
@@ -39,7 +44,11 @@ import { Browser } from '../providers/browser/browser';
     PackageSearchPage,
     ViewPackagePage,
     Search,
-    meetingDetails
+    meetingDetails,
+    NoBookmarksComponent,
+    NoMeetingsComponent,
+    NoResultsComponent,
+    NoInternetComponent
   ],
   imports: [
     BrowserModule,
diff --git a/src/assets/img/es-internet.png b/src/assets/img/es-internet.png
new file mode 100755
index 0000000..29d9ce4
Binary files /dev/null and b/src/assets/img/es-internet.png differ
diff --git a/src/components/no-bookmarks/no-bookmarks.html b/src/components/no-bookmarks/no-bookmarks.html
new file mode 100755
index 0000000..d6fec3f
--- /dev/null
+++ b/src/components/no-bookmarks/no-bookmarks.html
@@ -0,0 +1,7 @@
+<div class="emptystate">
+    <img src="../assets/img/es-bookmarks.svg">
+    <h1>We couldn't find any articles</h1>
+    <h2>Press
+      <img src="./assets/img/bookmark-inactive.svg"> to save an article for offline viewing</h2>
+    <button (click)="toMag()">Read Latest Articles</button>
+</div>
diff --git a/src/components/no-bookmarks/no-bookmarks.ts b/src/components/no-bookmarks/no-bookmarks.ts
new file mode 100755
index 0000000..71356a3
--- /dev/null
+++ b/src/components/no-bookmarks/no-bookmarks.ts
@@ -0,0 +1,21 @@
+import { Component } from '@angular/core';
+import { NavController} from 'ionic-angular';
+
+@Component({
+  selector: 'no-bookmarks',
+  templateUrl: 'no-bookmarks.html'
+})
+
+export class NoBookmarksComponent {
+
+  constructor(public navCtrl: NavController) {
+  }
+
+  /**
+   * Switches to Mag View to read articles
+   */
+  toMag() {
+    this.navCtrl.parent.select(1);
+  }
+
+}
diff --git a/src/components/no-internet/no-internet.html b/src/components/no-internet/no-internet.html
new file mode 100755
index 0000000..8ac7073
--- /dev/null
+++ b/src/components/no-internet/no-internet.html
@@ -0,0 +1,6 @@
+<div class="emptystate">
+  <img src="./assets/img/es-internet.png">
+  <h1>We can't reach the internet.</h1>
+  <h2>Seems like you're offline, please check your internet connection</h2>
+  <button (click)="reload()">Try Again</button>
+</div>
diff --git a/src/components/no-internet/no-internet.ts b/src/components/no-internet/no-internet.ts
new file mode 100755
index 0000000..1b691cb
--- /dev/null
+++ b/src/components/no-internet/no-internet.ts
@@ -0,0 +1,17 @@
+import { Component } from '@angular/core';
+
+@Component({
+  selector: 'no-internet',
+  templateUrl: 'no-internet.html'
+})
+export class NoInternetComponent {
+
+  constructor() {
+  }
+
+  //reloads the page
+  reload(){
+    location.reload();
+  }
+
+}
diff --git a/src/components/no-meetings/no-meetings.html b/src/components/no-meetings/no-meetings.html
new file mode 100755
index 0000000..c0f00bb
--- /dev/null
+++ b/src/components/no-meetings/no-meetings.html
@@ -0,0 +1,6 @@
+<div class="emptystate">
+  <img src="./assets/img/es-cal.svg">
+  <h1>We couldn't find any events</h1>
+  <h2>Seems like the schedule is light.
+    <br> Relax and Enjoy the moment</h2>
+</div>
\ No newline at end of file
diff --git a/src/components/no-meetings/no-meetings.ts b/src/components/no-meetings/no-meetings.ts
new file mode 100755
index 0000000..5a9c2a9
--- /dev/null
+++ b/src/components/no-meetings/no-meetings.ts
@@ -0,0 +1,12 @@
+import { Component } from '@angular/core';
+
+@Component({
+  selector: 'no-meetings',
+  templateUrl: 'no-meetings.html'
+})
+export class NoMeetingsComponent {
+
+  constructor() {
+  }
+
+}
diff --git a/src/components/no-results/no-results.html b/src/components/no-results/no-results.html
new file mode 100755
index 0000000..c97496a
--- /dev/null
+++ b/src/components/no-results/no-results.html
@@ -0,0 +1,5 @@
+<div class="emptystate">
+  <img src="./assets/img/es-search.svg">
+  <h1>We couldn’t find anything</h1>
+  <h2>Maybe a little spelling mistake?</h2>
+</div>
diff --git a/src/components/no-results/no-results.ts b/src/components/no-results/no-results.ts
new file mode 100755
index 0000000..52136da
--- /dev/null
+++ b/src/components/no-results/no-results.ts
@@ -0,0 +1,12 @@
+import { Component } from '@angular/core';
+
+@Component({
+  selector: 'no-results',
+  templateUrl: 'no-results.html'
+})
+export class NoResultsComponent {
+
+  constructor() {
+  }
+
+}

From 66321ec1a47793dd7eb20454a93c719908f4dfc4 Mon Sep 17 00:00:00 2001
From: Abhishek <guywhodesigns@gmail.com>
Date: Jul 26 2018 13:27:14 +0000
Subject: [PATCH 2/5] add components to pages


---

diff --git a/src/pages/calendar/calendar.html b/src/pages/calendar/calendar.html
index e6e2fb6..3c7aaff 100644
--- a/src/pages/calendar/calendar.html
+++ b/src/pages/calendar/calendar.html
@@ -52,10 +52,5 @@
       </ion-card>
     </div>
   </ion-list>
-  <div *ngIf="meetings.length === 0" class="emptystate">
-    <img src="./assets/img/es-cal.svg">
-    <h1>We couldn't find any events</h1>
-    <h2>Seems like the schedule is light.
-      <br> Relax and Enjoy the moment</h2>
-  </div>
+  <no-meetings *ngIf="meetings.length === 0"></no-meetings>
 </ion-content>
\ No newline at end of file
diff --git a/src/pages/calendar/search.html b/src/pages/calendar/search.html
index d638457..5b4dd28 100644
--- a/src/pages/calendar/search.html
+++ b/src/pages/calendar/search.html
@@ -30,9 +30,5 @@ Template for the modal window for search
             </ion-row>
         </ion-card>
     </ion-list>
-    <div *ngIf="calendars.length===0" class="emptystate">
-        <img src="./assets/img/es-search.svg">
-        <h1>We couldn’t find anything</h1>
-        <h2>Maybe a little spelling mistake?</h2>
-    </div>
+    <no-results *ngIf="calendars.length===0"></no-results>
 </ion-content>
\ No newline at end of file
diff --git a/src/pages/more/about.html b/src/pages/more/about.html
index b1f1ecc..537bb67 100755
--- a/src/pages/more/about.html
+++ b/src/pages/more/about.html
@@ -5,7 +5,7 @@ Template for the bookmarks page
 <ion-header>
   <ion-title>
     <img src="./assets/img/back.svg" tappable navPop>
-    <span>About Us</span>
+    <span>About Fedora</span>
   </ion-title>
 </ion-header>
 <ion-content>
diff --git a/src/pages/more/bookmarks.html b/src/pages/more/bookmarks.html
index 4538757..ebf7f60 100755
--- a/src/pages/more/bookmarks.html
+++ b/src/pages/more/bookmarks.html
@@ -9,10 +9,5 @@ Template for the bookmarks page
   </ion-title>
 </ion-header>
 <ion-content>
-  <div class="emptystate">
-    <img src="./assets/img/es-bookmarks.svg">
-    <h1>We couldn't find any articles</h1>
-    <h2>Press <img src="./assets/img/bookmark-inactive.svg"> to save an article for offline viewing</h2>
-    <button (click)="toMag()">Read Latest Articles</button>
-  </div>
+  <no-bookmarks></no-bookmarks>
 </ion-content>

From 7958b39d9b564ecdf0f08203947e2e7ba7e0a94e Mon Sep 17 00:00:00 2001
From: Abhishek <guywhodesigns@gmail.com>
Date: Jul 28 2018 05:19:35 +0000
Subject: [PATCH 3/5] fix path to img


---

diff --git a/src/components/no-bookmarks/no-bookmarks.html b/src/components/no-bookmarks/no-bookmarks.html
index d6fec3f..46a0735 100755
--- a/src/components/no-bookmarks/no-bookmarks.html
+++ b/src/components/no-bookmarks/no-bookmarks.html
@@ -1,5 +1,5 @@
 <div class="emptystate">
-    <img src="../assets/img/es-bookmarks.svg">
+    <img src="./assets/img/es-bookmarks.svg">
     <h1>We couldn't find any articles</h1>
     <h2>Press
       <img src="./assets/img/bookmark-inactive.svg"> to save an article for offline viewing</h2>

From c0c2841450f130eda4dd340248e9ab6fe85f60df Mon Sep 17 00:00:00 2001
From: Abhishek <guywhodesigns@gmail.com>
Date: Jul 28 2018 05:19:49 +0000
Subject: [PATCH 4/5] show error state in package search


---

diff --git a/src/pages/package-search/package-search.html b/src/pages/package-search/package-search.html
index 3a10377..e00e14f 100755
--- a/src/pages/package-search/package-search.html
+++ b/src/pages/package-search/package-search.html
@@ -26,5 +26,6 @@
         </ion-row>
       </ion-card>
     </div>
+    <no-results *ngIf="showError"></no-results>
   </ion-list>
 </ion-content>
diff --git a/src/pages/package-search/package-search.ts b/src/pages/package-search/package-search.ts
index 684f14e..fd9662a 100755
--- a/src/pages/package-search/package-search.ts
+++ b/src/pages/package-search/package-search.ts
@@ -12,20 +12,26 @@ const RESULTS_PER_PAGE = 10;
 })
 export class PackageSearchPage {
 
-  private searchQuery:string;
+  private searchQuery: string;
   private offset = 0;
   private matches = 0;
-  private packages:Package[] = [];
+  private packages: Package[] = [];
+  private showError: boolean;
 
-  constructor(public navCtrl: NavController, private searchProvider:PackageSearchProvider) {
+  constructor(public navCtrl: NavController, private searchProvider: PackageSearchProvider) {
+    this.showError = false;
   }
 
   search() {
     this.searchProvider.search(this.searchQuery, RESULTS_PER_PAGE, this.offset)
-      .subscribe( r => {
+      .subscribe(r => {
         this.packages = r.packages;
         this.offset = r.offset;
         this.matches = r.matches;
+        //if no matches returned show error
+        if (this.packages.length === 0) {
+          this.showError = true;
+        }
       });
   }
 
@@ -35,11 +41,11 @@ export class PackageSearchPage {
     this.matches = 0;
   }
 
-  showPackage(pkg:Package) {
+  showPackage(pkg: Package) {
     this.navCtrl.push(ViewPackagePage, { pkg });
   }
 
-  getPackageType(pkg:Package) {
+  getPackageType(pkg: Package) {
     return getPackageType(pkg.name);
   }
 }

From de5f8d48e0d4d8ca9a18f14a7b88a9d17a2599f3 Mon Sep 17 00:00:00 2001
From: Abhishek <guywhodesigns@gmail.com>
Date: Jul 29 2018 20:23:49 +0000
Subject: [PATCH 5/5] fix margins


---

diff --git a/src/pages/more/more.scss b/src/pages/more/more.scss
index a2165a5..5cbb769 100755
--- a/src/pages/more/more.scss
+++ b/src/pages/more/more.scss
@@ -110,6 +110,9 @@ about-detail {
       padding: 16px 24px;
       font-size: 16px;
       line-height: 26px;
+      p {
+        margin: 0.5em 0;
+      }
     }
   }
 }

