Browse Source

Deployment fix and add focus to name field in modal

Matt Raible 7 years ago
parent
commit
acb515d1b4
2 changed files with 14 additions and 7 deletions
  1. 8
    1
      client/src/pages/beer/beer-modal.ts
  2. 6
    6
      deploy.sh

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

1
 import { BeerService } from '../../providers/beer-service';
1
 import { BeerService } from '../../providers/beer-service';
2
-import { Component } from '@angular/core';
2
+import { Component, ViewChild } from '@angular/core';
3
 import { GiphyService } from '../../providers/giphy-service';
3
 import { GiphyService } from '../../providers/giphy-service';
4
 import { NavParams, ViewController, ToastController, NavController } from 'ionic-angular';
4
 import { NavParams, ViewController, ToastController, NavController } from 'ionic-angular';
5
 import { NgForm } from '@angular/forms';
5
 import { NgForm } from '@angular/forms';
9
   templateUrl: './beer-modal.html'
9
   templateUrl: './beer-modal.html'
10
 })
10
 })
11
 export class BeerModalPage {
11
 export class BeerModalPage {
12
+  @ViewChild('name') name;
12
   beer: any = {};
13
   beer: any = {};
13
   error: any;
14
   error: any;
14
 
15
 
42
       this.dismiss();
43
       this.dismiss();
43
     }, error => this.error = error)
44
     }, error => this.error = error)
44
   }
45
   }
46
+
47
+  ionViewDidLoad() {
48
+    setTimeout(() => {
49
+      this.name.setFocus();
50
+    },150);
51
+  }
45
 }
52
 }

+ 6
- 6
deploy.sh View File

50
 cf start ionic-server
50
 cf start ionic-server
51
 
51
 
52
 # Get the URL for the server
52
 # Get the URL for the server
53
-serverUri=https://`app_domain pwa-server`
53
+serverUri=https://`app_domain ionic-server`
54
 
54
 
55
 # Deploy the client
55
 # Deploy the client
56
 cd $r/client
56
 cd $r/client
57
 npm run clean
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" src/app/app.module.ts
60
 npm install && ionic build ios
60
 npm install && ionic build ios
61
 
61
 
62
+# deploy client to phone
63
+ionic run ios
64
+
62
 # cleanup changed files
65
 # cleanup changed files
63
 git checkout $r/client
66
 git checkout $r/client
64
-rm $r/client/src/app/app.module.ts-e
65
-
66
-# deploy client to phone
67
-ionic run ios
67
+rm $r/client/src/app/app.module.ts-e