Browse Source

Upgraded to latest version of Ionic and Spring Boot

Matt Raible 6 years ago
parent
commit
ae86e597db
83 changed files with 6232 additions and 159 deletions
  1. 1
    1
      deploy.sh
  2. 1
    0
      ionic-beer/.gitignore
  3. 0
    26
      ionic-beer/README.md
  4. 11
    13
      ionic-beer/config.xml
  5. 4
    1
      ionic-beer/ionic.config.json
  6. 6090
    0
      ionic-beer/package-lock.json
  7. 55
    59
      ionic-beer/package.json
  8. 8
    0
      ionic-beer/resources/README.md
  9. BIN
      ionic-beer/resources/android/icon/drawable-hdpi-icon.png
  10. BIN
      ionic-beer/resources/android/icon/drawable-ldpi-icon.png
  11. BIN
      ionic-beer/resources/android/icon/drawable-mdpi-icon.png
  12. BIN
      ionic-beer/resources/android/icon/drawable-xhdpi-icon.png
  13. BIN
      ionic-beer/resources/android/icon/drawable-xxhdpi-icon.png
  14. BIN
      ionic-beer/resources/android/icon/drawable-xxxhdpi-icon.png
  15. BIN
      ionic-beer/resources/android/splash/drawable-land-hdpi-screen.png
  16. BIN
      ionic-beer/resources/android/splash/drawable-land-ldpi-screen.png
  17. BIN
      ionic-beer/resources/android/splash/drawable-land-mdpi-screen.png
  18. BIN
      ionic-beer/resources/android/splash/drawable-land-xhdpi-screen.png
  19. BIN
      ionic-beer/resources/android/splash/drawable-land-xxhdpi-screen.png
  20. BIN
      ionic-beer/resources/android/splash/drawable-land-xxxhdpi-screen.png
  21. BIN
      ionic-beer/resources/android/splash/drawable-port-hdpi-screen.png
  22. BIN
      ionic-beer/resources/android/splash/drawable-port-ldpi-screen.png
  23. BIN
      ionic-beer/resources/android/splash/drawable-port-mdpi-screen.png
  24. BIN
      ionic-beer/resources/android/splash/drawable-port-xhdpi-screen.png
  25. BIN
      ionic-beer/resources/android/splash/drawable-port-xxhdpi-screen.png
  26. BIN
      ionic-beer/resources/android/splash/drawable-port-xxxhdpi-screen.png
  27. BIN
      ionic-beer/resources/ios/icon/icon-1024.png
  28. BIN
      ionic-beer/resources/ios/icon/icon-40.png
  29. BIN
      ionic-beer/resources/ios/icon/icon-40@2x.png
  30. BIN
      ionic-beer/resources/ios/icon/icon-50.png
  31. BIN
      ionic-beer/resources/ios/icon/icon-50@2x.png
  32. BIN
      ionic-beer/resources/ios/icon/icon-60.png
  33. BIN
      ionic-beer/resources/ios/icon/icon-60@2x.png
  34. BIN
      ionic-beer/resources/ios/icon/icon-60@3x.png
  35. BIN
      ionic-beer/resources/ios/icon/icon-72.png
  36. BIN
      ionic-beer/resources/ios/icon/icon-72@2x.png
  37. BIN
      ionic-beer/resources/ios/icon/icon-76.png
  38. BIN
      ionic-beer/resources/ios/icon/icon-76@2x.png
  39. BIN
      ionic-beer/resources/ios/icon/icon-small.png
  40. BIN
      ionic-beer/resources/ios/icon/icon-small@2x.png
  41. BIN
      ionic-beer/resources/ios/icon/icon-small@3x.png
  42. BIN
      ionic-beer/resources/ios/icon/icon.png
  43. BIN
      ionic-beer/resources/ios/icon/icon@2x.png
  44. BIN
      ionic-beer/resources/ios/splash/Default-568h@2x~iphone.png
  45. BIN
      ionic-beer/resources/ios/splash/Default-667h.png
  46. BIN
      ionic-beer/resources/ios/splash/Default-736h.png
  47. BIN
      ionic-beer/resources/ios/splash/Default-Landscape-736h.png
  48. BIN
      ionic-beer/resources/ios/splash/Default-Landscape@2x~ipad.png
  49. BIN
      ionic-beer/resources/ios/splash/Default-Landscape~ipad.png
  50. BIN
      ionic-beer/resources/ios/splash/Default-Portrait@2x~ipad.png
  51. BIN
      ionic-beer/resources/ios/splash/Default-Portrait~ipad.png
  52. BIN
      ionic-beer/resources/ios/splash/Default@2x~iphone.png
  53. BIN
      ionic-beer/resources/ios/splash/Default@2x~universal~anyany.png
  54. BIN
      ionic-beer/resources/ios/splash/Default~iphone.png
  55. BIN
      ionic-beer/resources/splash.png
  56. 3
    2
      ionic-beer/src/app/app.module.ts
  57. 1
    1
      ionic-beer/src/app/app.scss
  58. BIN
      ionic-beer/src/assets/imgs/logo.png
  59. 0
    14
      ionic-beer/src/declarations.d.ts
  60. 13
    2
      ionic-beer/src/index.html
  61. 1
    1
      ionic-beer/src/pages/beer/beer-modal.ts
  62. 0
    3
      ionic-beer/src/pages/beer/beer.module.ts
  63. 1
    1
      ionic-beer/src/pages/contact/contact.html
  64. 2
    2
      ionic-beer/src/pages/tabs/tabs.html
  65. 0
    1
      ionic-beer/src/pages/tabs/tabs.ts
  66. 9
    14
      ionic-beer/src/providers/beer-service.ts
  67. 9
    9
      ionic-beer/src/providers/giphy-service.ts
  68. 3
    2
      ionic-beer/src/service-worker.js
  69. 13
    3
      ionic-beer/src/theme/variables.scss
  70. 4
    2
      ionic-beer/tsconfig.json
  71. 0
    1
      server/pom.xml
  72. 1
    1
      server/src/main/java/com/example/demo/beer/BeerController.java
  73. 2
    0
      server/src/main/java/com/example/demo/beer/BeerRepository.java
  74. BIN
      static/android-beer-list.png
  75. BIN
      static/beer-delete.png
  76. BIN
      static/beer-modal.png
  77. BIN
      static/good-beers-json.png
  78. BIN
      static/good-beers-ui.png
  79. BIN
      static/ionic-labs.png
  80. BIN
      static/ionic-tabs.png
  81. BIN
      static/iphone-beer-list.jpg
  82. BIN
      static/lighthouse-51.png
  83. BIN
      static/no-http-provider.png

+ 1
- 1
deploy.sh View File

63
 # See http://stackoverflow.com/a/43363820
63
 # See http://stackoverflow.com/a/43363820
64
 
64
 
65
 # cleanup changed files
65
 # cleanup changed files
66
-git checkout $r/ionic-beer
66
+sed -i -e "s|$serverUri|http://localhost:8080|g" src/providers/beer-service.ts
67
 rm $r/ionic-beer/src/providers/beer-service.ts-e
67
 rm $r/ionic-beer/src/providers/beer-service.ts-e

+ 1
- 0
ionic-beer/.gitignore View File

13
 npm-debug.log*
13
 npm-debug.log*
14
 
14
 
15
 .idea/
15
 .idea/
16
+.sourcemaps/
16
 .sass-cache/
17
 .sass-cache/
17
 .tmp/
18
 .tmp/
18
 .versions/
19
 .versions/

+ 0
- 26
ionic-beer/README.md View File

1
-This is a starter template for [Ionic](http://ionicframework.com/docs/) projects.
2
-
3
-## How to use this template
4
-
5
-*This template does not work on its own*. The shared files for each starter are found in the [ionic2-app-base repo](https://github.com/driftyco/ionic2-app-base).
6
-
7
-To use this template, either create a new ionic project using the ionic node.js utility, or copy the files from this repository into the [Starter App Base](https://github.com/driftyco/ionic2-app-base).
8
-
9
-### With the Ionic CLI:
10
-
11
-Take the name after `ionic2-starter-`, and that is the name of the template to be used when using the `ionic start` command below:
12
-
13
-```bash
14
-$ sudo npm install -g ionic cordova
15
-$ ionic start myTabs tabs
16
-```
17
-
18
-Then, to run it, cd into `myTabs` and run:
19
-
20
-```bash
21
-$ ionic cordova platform add ios
22
-$ ionic cordova run ios
23
-```
24
-
25
-Substitute ios for android if not on a Mac.
26
-

+ 11
- 13
ionic-beer/config.xml View File

1
 <?xml version='1.0' encoding='utf-8'?>
1
 <?xml version='1.0' encoding='utf-8'?>
2
 <widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2
 <widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3
-    <name>MyApp</name>
3
+    <name>ionic-beer</name>
4
     <description>An awesome Ionic/Cordova app.</description>
4
     <description>An awesome Ionic/Cordova app.</description>
5
     <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
5
     <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
6
     <content src="index.html" />
6
     <content src="index.html" />
7
     <access origin="*" />
7
     <access origin="*" />
8
-    <allow-navigation href="http://ionic.local/*" />
9
     <allow-intent href="http://*/*" />
8
     <allow-intent href="http://*/*" />
10
     <allow-intent href="https://*/*" />
9
     <allow-intent href="https://*/*" />
11
     <allow-intent href="tel:*" />
10
     <allow-intent href="tel:*" />
12
     <allow-intent href="sms:*" />
11
     <allow-intent href="sms:*" />
13
     <allow-intent href="mailto:*" />
12
     <allow-intent href="mailto:*" />
14
     <allow-intent href="geo:*" />
13
     <allow-intent href="geo:*" />
15
-    <preference name="webviewbounce" value="false" />
16
-    <preference name="UIWebViewBounce" value="false" />
17
-    <preference name="DisallowOverscroll" value="true" />
14
+    <preference name="ScrollEnabled" value="false" />
18
     <preference name="android-minSdkVersion" value="16" />
15
     <preference name="android-minSdkVersion" value="16" />
19
     <preference name="BackupWebStorage" value="none" />
16
     <preference name="BackupWebStorage" value="none" />
20
     <preference name="SplashMaintainAspectRatio" value="true" />
17
     <preference name="SplashMaintainAspectRatio" value="true" />
64
         <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
61
         <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
65
         <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
62
         <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
66
         <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
63
         <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
64
+        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
67
         <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
65
         <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
68
         <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
66
         <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
69
         <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
67
         <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
76
         <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
74
         <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
77
         <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
75
         <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
78
         <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
76
         <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
77
+        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
79
     </platform>
78
     </platform>
80
-    <engine name="android" spec="^6.2.3" />
81
-    <engine name="ios" spec="^4.4.0" />
82
-    <plugin name="cordova-plugin-console" spec="^1.0.5" />
83
-    <plugin name="cordova-plugin-device" spec="^1.1.4" />
84
-    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
85
-    <plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
86
-    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
87
-    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
79
+    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
80
+    <plugin name="cordova-plugin-device" spec="^2.0.1" />
81
+    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
82
+    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
83
+    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
84
+    <engine name="ios" spec="4.5.4" />
85
+    <engine name="android" spec="~7.0.0" />
88
 </widget>
86
 </widget>

+ 4
- 1
ionic-beer/ionic.config.json View File

1
 {
1
 {
2
   "name": "ionic-beer",
2
   "name": "ionic-beer",
3
   "app_id": "",
3
   "app_id": "",
4
-  "type": "ionic-angular"
4
+  "type": "ionic-angular",
5
+  "integrations": {
6
+    "cordova": {}
7
+  }
5
 }
8
 }

+ 6090
- 0
ionic-beer/package-lock.json
File diff suppressed because it is too large
View File


+ 55
- 59
ionic-beer/package.json View File

1
 {
1
 {
2
-    "name": "ionic-beer",
3
-    "version": "0.0.1",
4
-    "author": "Ionic Framework",
5
-    "homepage": "http://ionicframework.com/",
6
-    "private": true,
7
-    "scripts": {
8
-        "clean": "ionic-app-scripts clean",
9
-        "build": "ionic-app-scripts build",
10
-        "lint": "ionic-app-scripts lint",
11
-        "ionic:build": "ionic-app-scripts build",
12
-        "ionic:serve": "ionic-app-scripts serve"
2
+  "name": "ionic-beer",
3
+  "version": "0.0.1",
4
+  "author": "Ionic Framework",
5
+  "homepage": "http://ionicframework.com/",
6
+  "private": true,
7
+  "scripts": {
8
+    "clean": "ionic-app-scripts clean",
9
+    "build": "ionic-app-scripts build",
10
+    "lint": "ionic-app-scripts lint",
11
+    "ionic:build": "ionic-app-scripts build",
12
+    "ionic:serve": "ionic-app-scripts serve"
13
+  },
14
+  "dependencies": {
15
+    "@angular/common": "5.0.3",
16
+    "@angular/compiler": "5.0.3",
17
+    "@angular/compiler-cli": "5.0.3",
18
+    "@angular/core": "5.0.3",
19
+    "@angular/forms": "5.0.3",
20
+    "@angular/http": "5.0.3",
21
+    "@angular/platform-browser": "5.0.3",
22
+    "@angular/platform-browser-dynamic": "5.0.3",
23
+    "@ionic-native/core": "4.4.0",
24
+    "@ionic-native/splash-screen": "4.4.0",
25
+    "@ionic-native/status-bar": "4.4.0",
26
+    "@ionic/storage": "2.1.3",
27
+    "cordova-android": "7.0.0",
28
+    "cordova-ios": "4.5.4",
29
+    "cordova-plugin-device": "^2.0.1",
30
+    "cordova-plugin-ionic-keyboard": "^2.0.5",
31
+    "cordova-plugin-ionic-webview": "^1.1.16",
32
+    "cordova-plugin-splashscreen": "^5.0.2",
33
+    "cordova-plugin-whitelist": "^1.3.3",
34
+    "ionic-angular": "3.9.2",
35
+    "ionicons": "3.0.0",
36
+    "rxjs": "5.5.2",
37
+    "sw-toolbox": "3.6.0",
38
+    "zone.js": "0.8.18"
39
+  },
40
+  "devDependencies": {
41
+    "@ionic/app-scripts": "3.1.8",
42
+    "typescript": "2.4.2"
43
+  },
44
+  "description": "An Ionic project",
45
+  "cordova": {
46
+    "plugins": {
47
+      "cordova-plugin-whitelist": {},
48
+      "cordova-plugin-device": {},
49
+      "cordova-plugin-splashscreen": {},
50
+      "cordova-plugin-ionic-webview": {},
51
+      "cordova-plugin-ionic-keyboard": {}
13
     },
52
     },
14
-    "dependencies": {
15
-        "@angular/common": "4.1.0",
16
-        "@angular/compiler": "4.1.0",
17
-        "@angular/compiler-cli": "4.1.0",
18
-        "@angular/core": "4.1.0",
19
-        "@angular/forms": "4.1.0",
20
-        "@angular/http": "4.1.0",
21
-        "@angular/platform-browser": "4.1.0",
22
-        "@angular/platform-browser-dynamic": "4.1.0",
23
-        "@ionic-native/core": "3.7.0",
24
-        "@ionic-native/splash-screen": "3.7.0",
25
-        "@ionic-native/status-bar": "3.7.0",
26
-        "@ionic/storage": "2.0.1",
27
-        "cordova-android": "^6.2.3",
28
-        "cordova-ios": "^4.4.0",
29
-        "cordova-plugin-console": "^1.0.5",
30
-        "cordova-plugin-device": "^1.1.4",
31
-        "cordova-plugin-splashscreen": "^4.0.3",
32
-        "cordova-plugin-statusbar": "^2.2.2",
33
-        "cordova-plugin-whitelist": "^1.3.1",
34
-        "ionic-angular": "3.2.1",
35
-        "ionic-plugin-keyboard": "^2.2.1",
36
-        "ionicons": "3.0.0",
37
-        "rxjs": "5.1.1",
38
-        "sw-toolbox": "3.6.0",
39
-        "zone.js": "0.8.10"
40
-    },
41
-    "devDependencies": {
42
-        "@ionic/app-scripts": "1.3.7",
43
-        "@ionic/cli-plugin-cordova": "1.4.0",
44
-        "@ionic/cli-plugin-ionic-angular": "1.3.1",
45
-        "typescript": "2.2.1"
46
-    },
47
-    "description": "An Ionic project",
48
-    "cordova": {
49
-        "plugins": {
50
-            "cordova-plugin-console": {},
51
-            "cordova-plugin-device": {},
52
-            "cordova-plugin-splashscreen": {},
53
-            "cordova-plugin-statusbar": {},
54
-            "cordova-plugin-whitelist": {},
55
-            "ionic-plugin-keyboard": {}
56
-        },
57
-        "platforms": [
58
-            "android",
59
-            "ios"
60
-        ]
61
-    }
53
+    "platforms": [
54
+      "ios",
55
+      "android"
56
+    ]
57
+  }
62
 }
58
 }

+ 8
- 0
ionic-beer/resources/README.md View File

1
+These are Cordova resources. You can replace icon.png and splash.png and run
2
+`ionic cordova resources` to generate custom icons and splash screens for your
3
+app. See `ionic cordova resources --help` for details.
4
+
5
+Cordova reference documentation:
6
+
7
+- Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
8
+- Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/

BIN
ionic-beer/resources/android/icon/drawable-hdpi-icon.png View File


BIN
ionic-beer/resources/android/icon/drawable-ldpi-icon.png View File


BIN
ionic-beer/resources/android/icon/drawable-mdpi-icon.png View File


BIN
ionic-beer/resources/android/icon/drawable-xhdpi-icon.png View File


BIN
ionic-beer/resources/android/icon/drawable-xxhdpi-icon.png View File


BIN
ionic-beer/resources/android/icon/drawable-xxxhdpi-icon.png View File


BIN
ionic-beer/resources/android/splash/drawable-land-hdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-land-ldpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-land-mdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-land-xhdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-land-xxhdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-land-xxxhdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-port-hdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-port-ldpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-port-mdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-port-xhdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-port-xxhdpi-screen.png View File


BIN
ionic-beer/resources/android/splash/drawable-port-xxxhdpi-screen.png View File


BIN
ionic-beer/resources/ios/icon/icon-1024.png View File


BIN
ionic-beer/resources/ios/icon/icon-40.png View File


BIN
ionic-beer/resources/ios/icon/icon-40@2x.png View File


BIN
ionic-beer/resources/ios/icon/icon-50.png View File


BIN
ionic-beer/resources/ios/icon/icon-50@2x.png View File


BIN
ionic-beer/resources/ios/icon/icon-60.png View File


BIN
ionic-beer/resources/ios/icon/icon-60@2x.png View File


BIN
ionic-beer/resources/ios/icon/icon-60@3x.png View File


BIN
ionic-beer/resources/ios/icon/icon-72.png View File


BIN
ionic-beer/resources/ios/icon/icon-72@2x.png View File


BIN
ionic-beer/resources/ios/icon/icon-76.png View File


BIN
ionic-beer/resources/ios/icon/icon-76@2x.png View File


BIN
ionic-beer/resources/ios/icon/icon-small.png View File


BIN
ionic-beer/resources/ios/icon/icon-small@2x.png View File


BIN
ionic-beer/resources/ios/icon/icon-small@3x.png View File


BIN
ionic-beer/resources/ios/icon/icon.png View File


BIN
ionic-beer/resources/ios/icon/icon@2x.png View File


BIN
ionic-beer/resources/ios/splash/Default-568h@2x~iphone.png View File


BIN
ionic-beer/resources/ios/splash/Default-667h.png View File


BIN
ionic-beer/resources/ios/splash/Default-736h.png View File


BIN
ionic-beer/resources/ios/splash/Default-Landscape-736h.png View File


BIN
ionic-beer/resources/ios/splash/Default-Landscape@2x~ipad.png View File


BIN
ionic-beer/resources/ios/splash/Default-Landscape~ipad.png View File


BIN
ionic-beer/resources/ios/splash/Default-Portrait@2x~ipad.png View File


BIN
ionic-beer/resources/ios/splash/Default-Portrait~ipad.png View File


BIN
ionic-beer/resources/ios/splash/Default@2x~iphone.png View File


BIN
ionic-beer/resources/ios/splash/Default@2x~universal~anyany.png View File


BIN
ionic-beer/resources/ios/splash/Default~iphone.png View File


BIN
ionic-beer/resources/splash.png View File


+ 3
- 2
ionic-beer/src/app/app.module.ts View File

10
 
10
 
11
 import { StatusBar } from '@ionic-native/status-bar';
11
 import { StatusBar } from '@ionic-native/status-bar';
12
 import { SplashScreen } from '@ionic-native/splash-screen';
12
 import { SplashScreen } from '@ionic-native/splash-screen';
13
+
13
 import { BeerPageModule } from '../pages/beer/beer.module';
14
 import { BeerPageModule } from '../pages/beer/beer.module';
14
-import { HttpModule } from '@angular/http';
15
+import { HttpClientModule } from '@angular/common/http';
15
 
16
 
16
 @NgModule({
17
 @NgModule({
17
   declarations: [
18
   declarations: [
23
   ],
24
   ],
24
   imports: [
25
   imports: [
25
     BrowserModule,
26
     BrowserModule,
26
-    HttpModule,
27
+    HttpClientModule,
27
     IonicModule.forRoot(MyApp),
28
     IonicModule.forRoot(MyApp),
28
     BeerPageModule
29
     BeerPageModule
29
   ],
30
   ],

+ 1
- 1
ionic-beer/src/app/app.scss View File

1
-// http://ionicframework.com/docs/v2/theming/
1
+// http://ionicframework.com/docs/theming/
2
 
2
 
3
 
3
 
4
 // App Global Sass
4
 // App Global Sass

BIN
ionic-beer/src/assets/imgs/logo.png View File


+ 0
- 14
ionic-beer/src/declarations.d.ts View File

1
-/*
2
-  Declaration files are how the Typescript compiler knows about the type information(or shape) of an object.
3
-  They're what make intellisense work and make Typescript know all about your code.
4
-
5
-  A wildcard module is declared below to allow third party libraries to be used in an app even if they don't
6
-  provide their own type declarations.
7
-
8
-  To learn more about using third party libraries in an Ionic app, check out the docs here:
9
-  http://ionicframework.com/docs/v2/resources/third-party-libs/
10
-
11
-  For more info on type definition files, check out the Typescript docs here:
12
-  https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html
13
-*/
14
-declare module '*';

+ 13
- 2
ionic-beer/src/index.html View File

11
   <link rel="manifest" href="manifest.json">
11
   <link rel="manifest" href="manifest.json">
12
   <meta name="theme-color" content="#4e8ef7">
12
   <meta name="theme-color" content="#4e8ef7">
13
 
13
 
14
-  <!-- cordova.js required for cordova apps -->
14
+  <!-- add to homescreen for ios -->
15
+  <meta name="apple-mobile-web-app-capable" content="yes">
16
+  <meta name="apple-mobile-web-app-status-bar-style" content="black">
17
+
18
+  <!-- cordova.js required for cordova apps (remove if not needed) -->
15
   <script src="cordova.js"></script>
19
   <script src="cordova.js"></script>
16
 
20
 
17
   <script>
21
   <script>
26
 
30
 
27
 </head>
31
 </head>
28
 <body>
32
 <body>
33
+<noscript>
34
+  <h1>You must enable JavaScript to view this page.</h1>
35
+</noscript>
29
 
36
 
30
   <!-- Ionic's root component and where the app will load -->
37
   <!-- Ionic's root component and where the app will load -->
31
   <ion-app></ion-app>
38
   <ion-app></ion-app>
33
   <!-- The polyfills js is generated during the build process -->
40
   <!-- The polyfills js is generated during the build process -->
34
   <script src="build/polyfills.js"></script>
41
   <script src="build/polyfills.js"></script>
35
 
42
 
36
-  <!-- The bundle js is generated during the build process -->
43
+  <!-- The vendor js is generated during the build process
44
+       It contains all of the dependencies in node_modules -->
45
+  <script src="build/vendor.js"></script>
46
+
47
+  <!-- The main bundle js is generated during the build process -->
37
   <script src="build/main.js"></script>
48
   <script src="build/main.js"></script>
38
 
49
 
39
 </body>
50
 </body>

+ 1
- 1
ionic-beer/src/pages/beer/beer-modal.ts View File

19
               public toastCtrl: ToastController,
19
               public toastCtrl: ToastController,
20
               public navCtrl: NavController) {
20
               public navCtrl: NavController) {
21
     if (this.params.data.id) {
21
     if (this.params.data.id) {
22
-      this.beerService.get(this.params.get('id')).subscribe(beer => {
22
+      this.beerService.get(this.params.get('id')).subscribe((beer: any) => {
23
         this.beer = beer;
23
         this.beer = beer;
24
         this.beer.href = beer._links.self.href;
24
         this.beer.href = beer._links.self.href;
25
         this.giphyService.get(beer.name).subscribe(url => beer.giphyUrl = url);
25
         this.giphyService.get(beer.name).subscribe(url => beer.giphyUrl = url);

+ 0
- 3
ionic-beer/src/pages/beer/beer.module.ts View File

13
   imports: [
13
   imports: [
14
     IonicPageModule.forChild(BeerPage),
14
     IonicPageModule.forChild(BeerPage),
15
   ],
15
   ],
16
-  exports: [
17
-    BeerPage
18
-  ],
19
   providers: [
16
   providers: [
20
     BeerService,
17
     BeerService,
21
     GiphyService
18
     GiphyService

+ 1
- 1
ionic-beer/src/pages/contact/contact.html View File

10
   <ion-list>
10
   <ion-list>
11
     <ion-list-header>Follow us on Twitter</ion-list-header>
11
     <ion-list-header>Follow us on Twitter</ion-list-header>
12
     <ion-item>
12
     <ion-item>
13
-      <ion-icon name="ionic" item-left></ion-icon>
13
+      <ion-icon name="ionic" item-start></ion-icon>
14
       @ionicframework
14
       @ionicframework
15
     </ion-item>
15
     </ion-item>
16
   </ion-list>
16
   </ion-list>

+ 2
- 2
ionic-beer/src/pages/tabs/tabs.html View File

1
 <ion-tabs>
1
 <ion-tabs>
2
   <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
2
   <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
3
   <ion-tab [root]="tab2Root" tabTitle="Beer" tabIcon="beer"></ion-tab>
3
   <ion-tab [root]="tab2Root" tabTitle="Beer" tabIcon="beer"></ion-tab>
4
-  <ion-tab [root]="tab3Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
5
-  <ion-tab [root]="tab4Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
4
+  <ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
5
+  <ion-tab [root]="tab4Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
6
 </ion-tabs>
6
 </ion-tabs>

+ 0
- 1
ionic-beer/src/pages/tabs/tabs.ts View File

9
   templateUrl: 'tabs.html'
9
   templateUrl: 'tabs.html'
10
 })
10
 })
11
 export class TabsPage {
11
 export class TabsPage {
12
-
13
   tab1Root = HomePage;
12
   tab1Root = HomePage;
14
   tab2Root = BeerPage;
13
   tab2Root = BeerPage;
15
   tab3Root = AboutPage;
14
   tab3Root = AboutPage;

+ 9
- 14
ionic-beer/src/providers/beer-service.ts View File

1
 import { Injectable } from '@angular/core';
1
 import { Injectable } from '@angular/core';
2
-import { Http, Response } from '@angular/http';
3
-import 'rxjs/add/operator/map';
4
-import 'rxjs/add/operator/catch';
5
 import { Observable } from 'rxjs';
2
 import { Observable } from 'rxjs';
3
+import { HttpClient } from '@angular/common/http';
6
 
4
 
7
 @Injectable()
5
 @Injectable()
8
 export class BeerService {
6
 export class BeerService {
9
-  public API = 'http://localhost:8080';
7
+  public API = 'http://192.168.1.48:8080';
10
   public BEER_API = this.API + '/beers';
8
   public BEER_API = this.API + '/beers';
11
 
9
 
12
-  constructor(public http: Http) {}
10
+  constructor(public http: HttpClient) {
11
+  }
13
 
12
 
14
   getGoodBeers(): Observable<any> {
13
   getGoodBeers(): Observable<any> {
15
-    return this.http.get(this.API + '/good-beers')
16
-      .map((response: Response) => response.json());
14
+    return this.http.get(this.API + '/good-beers');
17
   }
15
   }
18
 
16
 
19
   get(id: string) {
17
   get(id: string) {
20
-    return this.http.get(this.BEER_API + '/' + id)
21
-      .map((response: Response) => response.json());
18
+    return this.http.get(this.BEER_API + '/' + id);
22
   }
19
   }
23
 
20
 
24
   save(beer: any): Observable<any> {
21
   save(beer: any): Observable<any> {
25
-    let result: Observable<Response>;
22
+    let result: Observable<Object>;
26
     if (beer['href']) {
23
     if (beer['href']) {
27
       result = this.http.put(beer.href, beer);
24
       result = this.http.put(beer.href, beer);
28
     } else {
25
     } else {
29
       result = this.http.post(this.BEER_API, beer)
26
       result = this.http.post(this.BEER_API, beer)
30
     }
27
     }
31
-    return result.map((response: Response) => response.json())
32
-      .catch(error => Observable.throw(error));
28
+    return result.catch(error => Observable.throw(error));
33
   }
29
   }
34
 
30
 
35
   remove(id: string) {
31
   remove(id: string) {
36
-    return this.http.delete(this.BEER_API + '/' + id)
37
-      .map((response: Response) => response.json());
32
+    return this.http.delete(this.BEER_API + '/' + id);
38
   }
33
   }
39
 }
34
 }

+ 9
- 9
ionic-beer/src/providers/giphy-service.ts View File

1
 import { Injectable } from '@angular/core';
1
 import { Injectable } from '@angular/core';
2
-import { Http, Response } from '@angular/http';
3
-import { Observable } from 'rxjs';
2
+import { HttpClient } from '@angular/common/http';
3
+import 'rxjs/add/operator/map';
4
 
4
 
5
 @Injectable()
5
 @Injectable()
6
 // http://tutorials.pluralsight.com/front-end-javascript/getting-started-with-angular-2-by-building-a-giphy-search-application
6
 // http://tutorials.pluralsight.com/front-end-javascript/getting-started-with-angular-2-by-building-a-giphy-search-application
7
 export class GiphyService {
7
 export class GiphyService {
8
 
8
 
9
-  giphyApi = 'https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
9
+  // Public beta key: https://github.com/Giphy/GiphyAPI#public-beta-key
10
+  giphyApi = 'https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&limit=1&q=';
10
 
11
 
11
-  constructor(public http: Http) {
12
+  constructor(public http: HttpClient) {
12
   }
13
   }
13
 
14
 
14
-  get(searchTerm): Observable<any> {
15
+  get(searchTerm) {
15
     const apiLink = this.giphyApi + searchTerm;
16
     const apiLink = this.giphyApi + searchTerm;
16
-    return this.http.request(apiLink).map((res: Response) => {
17
-      const results = res.json().data;
18
-      if (results.length > 0) {
19
-        return results[0].images.original.url;
17
+    return this.http.get(apiLink).map((response: any) => {
18
+      if (response.data.length > 0) {
19
+        return response.data[0].images.original.url;
20
       } else {
20
       } else {
21
         return 'https://media.giphy.com/media/YaOxRsmrv9IeA/giphy.gif'; // dancing cat for 404
21
         return 'https://media.giphy.com/media/YaOxRsmrv9IeA/giphy.gif'; // dancing cat for 404
22
       }
22
       }

+ 3
- 2
ionic-beer/src/service-worker.js View File

1
 /**
1
 /**
2
- * Check out https://googlechrome.github.io/sw-toolbox/ for
2
+ * Check out https://googlechromelabs.github.io/sw-toolbox/ for
3
  * more info on how to use sw-toolbox to custom configure your service worker.
3
  * more info on how to use sw-toolbox to custom configure your service worker.
4
  */
4
  */
5
 
5
 
15
 self.toolbox.precache(
15
 self.toolbox.precache(
16
   [
16
   [
17
     './build/main.js',
17
     './build/main.js',
18
+    './build/vendor.js',
18
     './build/main.css',
19
     './build/main.css',
19
     './build/polyfills.js',
20
     './build/polyfills.js',
20
     'index.html',
21
     'index.html',
23
 );
24
 );
24
 
25
 
25
 // dynamically cache any other local assets
26
 // dynamically cache any other local assets
26
-self.toolbox.router.any('/*', self.toolbox.cacheFirst);
27
+self.toolbox.router.any('/*', self.toolbox.fastest);
27
 
28
 
28
 // for any other requests go to the network, cache,
29
 // for any other requests go to the network, cache,
29
 // and then only use that cached resource if your user goes offline
30
 // and then only use that cached resource if your user goes offline

+ 13
- 3
ionic-beer/src/theme/variables.scss View File

1
 // Ionic Variables and Theming. For more info, please see:
1
 // Ionic Variables and Theming. For more info, please see:
2
-// http://ionicframework.com/docs/v2/theming/
2
+// http://ionicframework.com/docs/theming/
3
+
4
+// Font path is used to include ionicons,
5
+// roboto, and noto sans fonts
3
 $font-path: "../assets/fonts";
6
 $font-path: "../assets/fonts";
4
 
7
 
8
+
9
+// The app direction is used to include
10
+// rtl styles in your app. For more info, please see:
11
+// http://ionicframework.com/docs/theming/rtl-support/
12
+$app-direction: ltr;
13
+
14
+
5
 @import "ionic.globals";
15
 @import "ionic.globals";
6
 
16
 
7
 
17
 
10
 // To customize the look and feel of this app, you can override
20
 // To customize the look and feel of this app, you can override
11
 // the Sass variables found in Ionic's source scss files.
21
 // the Sass variables found in Ionic's source scss files.
12
 // To view all the possible Ionic variables, see:
22
 // To view all the possible Ionic variables, see:
13
-// http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/
23
+// http://ionicframework.com/docs/theming/overriding-ionic-variables/
14
 
24
 
15
 
25
 
16
 
26
 
66
 // Ionicons
76
 // Ionicons
67
 // --------------------------------------------------
77
 // --------------------------------------------------
68
 // The premium icon font for Ionic. For more info, please see:
78
 // The premium icon font for Ionic. For more info, please see:
69
-// http://ionicframework.com/docs/v2/ionicons/
79
+// http://ionicframework.com/docs/ionicons/
70
 
80
 
71
 @import "ionic.ionicons";
81
 @import "ionic.ionicons";
72
 
82
 

+ 4
- 2
ionic-beer/tsconfig.json View File

17
     "src/**/*.ts"
17
     "src/**/*.ts"
18
   ],
18
   ],
19
   "exclude": [
19
   "exclude": [
20
-    "node_modules"
20
+    "node_modules",
21
+    "src/**/*.spec.ts",
22
+    "src/**/__tests__/*.ts"
21
   ],
23
   ],
22
   "compileOnSave": false,
24
   "compileOnSave": false,
23
   "atom": {
25
   "atom": {
24
     "rewriteTsconfig": false
26
     "rewriteTsconfig": false
25
   }
27
   }
26
-}
28
+}

+ 0
- 1
server/pom.xml View File

56
     </dependencies>
56
     </dependencies>
57
 
57
 
58
     <build>
58
     <build>
59
-        <defaultGoal>spring-boot:run</defaultGoal>
60
         <plugins>
59
         <plugins>
61
             <plugin>
60
             <plugin>
62
                 <groupId>org.springframework.boot</groupId>
61
                 <groupId>org.springframework.boot</groupId>

+ 1
- 1
server/src/main/java/com/example/demo/beer/BeerController.java View File

16
     }
16
     }
17
 
17
 
18
     @GetMapping("/good-beers")
18
     @GetMapping("/good-beers")
19
-    @CrossOrigin(origins = "http://localhost:4200")
19
+    @CrossOrigin(origins = {"http://localhost:8100","http://localhost:8080"})
20
     public Collection<Beer> goodBeers() {
20
     public Collection<Beer> goodBeers() {
21
 
21
 
22
         return repository.findAll().stream()
22
         return repository.findAll().stream()

+ 2
- 0
server/src/main/java/com/example/demo/beer/BeerRepository.java View File

2
 
2
 
3
 import org.springframework.data.jpa.repository.JpaRepository;
3
 import org.springframework.data.jpa.repository.JpaRepository;
4
 import org.springframework.data.rest.core.annotation.RepositoryRestResource;
4
 import org.springframework.data.rest.core.annotation.RepositoryRestResource;
5
+import org.springframework.web.bind.annotation.CrossOrigin;
5
 
6
 
6
 @RepositoryRestResource
7
 @RepositoryRestResource
8
+@CrossOrigin(origins = {"http://localhost:8100","http://localhost:8080"})
7
 interface BeerRepository extends JpaRepository<Beer, Long> {
9
 interface BeerRepository extends JpaRepository<Beer, Long> {
8
 }
10
 }

BIN
static/android-beer-list.png View File


BIN
static/beer-delete.png View File


BIN
static/beer-modal.png View File


BIN
static/good-beers-json.png View File


BIN
static/good-beers-ui.png View File


BIN
static/ionic-labs.png View File


BIN
static/ionic-tabs.png View File


BIN
static/iphone-beer-list.jpg View File


BIN
static/lighthouse-51.png View File


BIN
static/no-http-provider.png View File