ソースを参照

Fix for issues found in production

Matt Raible 7 年 前
コミット
db269c7499
共有4 個のファイルを変更した6 個の追加8 個の削除を含む
  1. 2
    6
      client/src/pages/beer/beer-modal.ts
  2. 2
    0
      client/src/pages/beer/beer.ts
  3. 1
    1
      client/src/providers/giphy-service.ts
  4. 1
    1
      deploy.sh

+ 2
- 6
client/src/pages/beer/beer-modal.ts ファイルの表示

36
     this.beerService.save(form).subscribe(result => {
36
     this.beerService.save(form).subscribe(result => {
37
       let toast = this.toastCtrl.create({
37
       let toast = this.toastCtrl.create({
38
         message: 'Beer "' + form.name + '" ' + ((update) ? 'updated' : 'added') + '.',
38
         message: 'Beer "' + form.name + '" ' + ((update) ? 'updated' : 'added') + '.',
39
-        duration: 2000,
40
-        position: 'top'
39
+        duration: 2000
41
       });
40
       });
42
       toast.present();
41
       toast.present();
43
-      // this should work, but doesn't refresh model
44
-      //this.viewCtrl.dismiss();
45
-      // this refreshes model
46
-      this.navCtrl.push(BeerPage);
42
+      this.dismiss();
47
     }, error => this.error = error)
43
     }, error => this.error = error)
48
   }
44
   }
49
 }
45
 }

+ 2
- 0
client/src/pages/beer/beer.ts ファイルの表示

31
   openModal(beerId) {
31
   openModal(beerId) {
32
     let modal = this.modalCtrl.create(BeerModalPage, beerId);
32
     let modal = this.modalCtrl.create(BeerModalPage, beerId);
33
     modal.present();
33
     modal.present();
34
+    // refresh data after modal dismissed
35
+    modal.onDidDismiss(() => this.ionViewDidLoad())
34
   }
36
   }
35
 
37
 
36
   remove(beer) {
38
   remove(beer) {

+ 1
- 1
client/src/providers/giphy-service.ts ファイルの表示

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 = '//api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
9
+  giphyApi = 'https://api.giphy.com/v1/gifs/search?api_key=dc6zaTOxFJmzC&q=';
10
 
10
 
11
   constructor(public http: Http) {
11
   constructor(public http: Http) {
12
   }
12
   }

+ 1
- 1
deploy.sh ファイルの表示

54
 
54
 
55
 # Deploy the client
55
 # Deploy the client
56
 cd $r/client
56
 cd $r/client
57
-rm -rf dist
57
+npm run clean
58
 # replace the server URL in the client
58
 # replace the server URL in the client
59
 sed -i -e "s|http://localhost:8080|$serverUri|g" $r/client/src/app/app.module.ts
59
 sed -i -e "s|http://localhost:8080|$serverUri|g" $r/client/src/app/app.module.ts
60
 npm install && ionic build ios
60
 npm install && ionic build ios