3 Комити

Аутор SHA1 Порука Датум
  alizalang b8b9673d2b polling messages пре 6 година
  Chad 2214b82e06 Merge branch 'master' of https://git.zipcode.rocks/hallinanc/ZipTeam пре 6 година
  hallinanc 2410e1cee6 Update 'README.md' пре 6 година

+ 2
- 0
README.md Прегледај датотеку

@@ -45,3 +45,5 @@ Add image attachments, emojis. Document attachments, with download.
45 45
 
46 46
 Mobile app interface
47 47
 
48
+<a href="https://git.zipcode.rocks/hallinanc/ZipTeam/src/branch/dev/ZipTeamOrange/Middleteir.uml"> UML </a>
49
+

+ 1
- 1
ZipTeamOrange-ionic-UI/.sourcemaps/main.js.map
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 3
- 4
ZipTeamOrange-ionic-UI/ionic.config.json Прегледај датотеку

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

+ 1
- 1
ZipTeamOrange-ionic-UI/package.json Прегледај датотеку

@@ -34,7 +34,7 @@
34 34
     "zone.js": "0.8.26"
35 35
   },
36 36
   "devDependencies": {
37
-    "@ionic/app-scripts": "3.1.10",
37
+    "@ionic/app-scripts": "^3.1.10",
38 38
     "typescript": "~2.6.2"
39 39
   },
40 40
   "description": "An Ionic project"

+ 1
- 1
ZipTeamOrange-ionic-UI/src/Classes/Messsage.ts Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 import { Chat } from "./Chat";
2 2
 import { User } from "./user";
3 3
 
4
-export class Message{
4
+export class Message {
5 5
     id: number;
6 6
     message: String;
7 7
     private chat: Chat;

+ 5
- 4
ZipTeamOrange-ionic-UI/src/pages/chat/chat.html Прегледај датотеку

@@ -14,12 +14,13 @@
14 14
 <!-- *ngFor="let m of msg">{{ m }} -->
15 15
 
16 16
 <ion-content padding >
17
-  <div *ngFor="let m of msg">
18
-    {{ m.message }}
17
+  <div *ngFor="let m of msg" class="message-wrapper">
18
+    <div class="name">Nhu <span class="timestamp">4/10</span></div>
19
+    <div class="message">{{m.message}}</div>
19 20
   </div>
20 21
 
21 22
   <form  #test1="ngForm" ng-submit="send(test1.value)">
22
-    <ion-textarea  type="text" name="message" [(ngModel)]="test" ></ion-textarea>
23
-    <button ion-button (click)="send(test1.value)"(click)="getMessages()">send</button>
23
+    <ion-textarea  type="text" name="message" [(ngModel)]="test" class="user-message"></ion-textarea>
24
+    <button ion-button (click)="send(test1.value)" >send</button>
24 25
   </form>
25 26
 </ion-content>

+ 4
- 0
ZipTeamOrange-ionic-UI/src/pages/chat/chat.scss Прегледај датотеку

@@ -1,3 +1,7 @@
1 1
 page-chat {
2
+    .user-message {
3
+        border: 1px solid #CCC;
4
+    }
2 5
 
6
+    
3 7
 }

+ 24
- 14
ZipTeamOrange-ionic-UI/src/pages/chat/chat.ts Прегледај датотеку

@@ -1,15 +1,13 @@
1
-import { Component } from '@angular/core';
1
+import { Component, OnInit, Input } from '@angular/core';
2 2
 import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 3
 import { NgForm } from '../../../node_modules/@angular/forms';
4 4
 import { MessageServiceProvider } from '../../providers/message-service/message-service';
5 5
 import { Message } from '../../../node_modules/@angular/compiler/src/i18n/i18n_ast';
6
+// import {OnInit} from '@angular/core';
7
+// import { interval } from '../../../node_modules/rxjs/observable/interval';
8
+// import { startWith } from '../../../node_modules/rxjs/operators';
9
+// import { switchMap } from '../../../node_modules/rxjs/operator/switchMap';
6 10
 
7
-/**
8
- * Generated class for the ChatPage page.
9
- *
10
- * See https://ionicframework.com/docs/components/#navigation for more info on
11
- * Ionic pages and navigation.
12
- */
13 11
 
14 12
 @IonicPage()
15 13
 @Component({
@@ -19,28 +17,40 @@ import { Message } from '../../../node_modules/@angular/compiler/src/i18n/i18n_a
19 17
 export class ChatPage {
20 18
   test: any;
21 19
   msg: any;
20
+  @Input()
22 21
   messages: Message [];
22
+  mApi: any;
23
+
23 24
   constructor(public navCtrl: NavController, public navParams: NavParams, public messageApi: MessageServiceProvider) {
25
+  this.mApi = messageApi;
24 26
   }
25 27
 
26 28
   ionViewDidLoad() {
27 29
     console.log('ionViewDidLoad ChatPage');
28
-    this.getMessages();
30
+    this.getMessages(this);
29 31
   }
30 32
 
31 33
   send(createAccountInfo: NgForm){
32 34
     console.log("clicked");
33 35
     console.log(createAccountInfo)
34 36
     this.messageApi.saveMessage(createAccountInfo).subscribe(console.log);
35
-    this.getMessages()
37
+    this.test = '';
38
+    this.getMessages(this);
36 39
   }
37 40
 
38
-  getMessages(){
39
-    this.messageApi.getMessages().subscribe(data => {
40
-      this.msg = data
41
-      console.log(data)
41
+  getMessages(chatPage){
42
+    chatPage.messageApi.getMessages().subscribe(data => {
43
+      this.msg = data;
44
+      console.log(this.msg);
42 45
     });
43
-    this.test = this.messageApi.getCurrentMessage();
46
+ }
47
+
48
+  ngOnInit() {
49
+    setInterval(() => {this.getMessages(this)}, 500);
44 50
   }
45 51
 
52
+
53
+
54
+
55
+
46 56
 }

+ 1
- 1
ZipTeamOrange-ionic-UI/src/providers/message-service/message-service.ts Прегледај датотеку

@@ -29,4 +29,4 @@ export class MessageServiceProvider {
29 29
     return this.http.post(`http://localhost:8080/message/add`, createAccountInfo);
30 30
   }
31 31
 
32
-}
32
+}

+ 4
- 0
ZipTeamOrange-ionic-UI/www/build/main.css Прегледај датотеку

@@ -25677,3 +25677,7 @@ ion-navbar.toolbar {
25677 25677
   min-height: calc(46px + constant(safe-area-inset-bottom));
25678 25678
   min-height: calc(46px + env(safe-area-inset-bottom));
25679 25679
 }
25680
+
25681
+page-chat .user-message {
25682
+  border: 1px solid #CCC;
25683
+}

+ 22
- 17
ZipTeamOrange-ionic-UI/www/build/main.js Прегледај датотеку

@@ -20,44 +20,50 @@ var __metadata = (this && this.__metadata) || function (k, v) {
20 20
 
21 21
 
22 22
 
23
-/**
24
- * Generated class for the ChatPage page.
25
- *
26
- * See https://ionicframework.com/docs/components/#navigation for more info on
27
- * Ionic pages and navigation.
28
- */
23
+// import {OnInit} from '@angular/core';
24
+// import { interval } from '../../../node_modules/rxjs/observable/interval';
25
+// import { startWith } from '../../../node_modules/rxjs/operators';
26
+// import { switchMap } from '../../../node_modules/rxjs/operator/switchMap';
29 27
 var ChatPage = /** @class */ (function () {
30 28
     function ChatPage(navCtrl, navParams, messageApi) {
31 29
         this.navCtrl = navCtrl;
32 30
         this.navParams = navParams;
33 31
         this.messageApi = messageApi;
32
+        this.mApi = messageApi;
34 33
     }
35 34
     ChatPage.prototype.ionViewDidLoad = function () {
36 35
         console.log('ionViewDidLoad ChatPage');
37
-        this.getMessages();
36
+        this.getMessages(this);
38 37
     };
39 38
     ChatPage.prototype.send = function (createAccountInfo) {
40 39
         console.log("clicked");
41 40
         console.log(createAccountInfo);
42 41
         this.messageApi.saveMessage(createAccountInfo).subscribe(console.log);
43
-        this.getMessages();
42
+        this.test = '';
43
+        this.getMessages(this);
44 44
     };
45
-    ChatPage.prototype.getMessages = function () {
45
+    ChatPage.prototype.getMessages = function (chatPage) {
46 46
         var _this = this;
47
-        this.messageApi.getMessages().subscribe(function (data) {
47
+        chatPage.messageApi.getMessages().subscribe(function (data) {
48 48
             _this.msg = data;
49
-            console.log(data);
49
+            console.log(_this.msg);
50 50
         });
51
-        this.test = this.messageApi.getCurrentMessage();
52 51
     };
52
+    ChatPage.prototype.ngOnInit = function () {
53
+        var _this = this;
54
+        setInterval(function () { _this.getMessages(_this); }, 500);
55
+    };
56
+    __decorate([
57
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["D" /* Input */])(),
58
+        __metadata("design:type", Array)
59
+    ], ChatPage.prototype, "messages", void 0);
53 60
     ChatPage = __decorate([
54 61
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
55
-            selector: 'page-chat',template:/*ion-inline-start:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/'<!--\n  Generated template for the ChatPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>chatPage</ion-title>\n  </ion-navbar>\n\n</ion-header>\n<!-- *ngFor="let m of msg">{{ m }} -->\n\n<ion-content padding >\n  <div *ngFor="let m of msg">\n    {{ m.message }}\n  </div>\n\n  <form  #test1="ngForm" ng-submit="send(test1.value)">\n    <ion-textarea  type="text" name="message" [(ngModel)]="test" ></ion-textarea>\n    <button ion-button (click)="send(test1.value)"(click)="getMessages()">send</button>\n  </form>\n</ion-content>\n'/*ion-inline-end:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/,
62
+            selector: 'page-chat',template:/*ion-inline-start:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/'<!--\n  Generated template for the ChatPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>chatPage</ion-title>\n  </ion-navbar>\n\n</ion-header>\n<!-- *ngFor="let m of msg">{{ m }} -->\n\n<ion-content padding >\n  <div *ngFor="let m of msg" class="message-wrapper">\n    <div class="name">Nhu <span class="timestamp">4/10</span></div>\n    <div class="message">{{m.message}}</div>\n  </div>\n\n  <form  #test1="ngForm" ng-submit="send(test1.value)">\n    <ion-textarea  type="text" name="message" [(ngModel)]="test" class="user-message"></ion-textarea>\n    <button ion-button (click)="send(test1.value)" >send</button>\n  </form>\n</ion-content>\n'/*ion-inline-end:"/Users/alizalang/Desktop/ZipTeam/ZipTeamOrange-ionic-UI/src/pages/chat/chat.html"*/,
56 63
         }),
57
-        __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_2__providers_message_service_message_service__["a" /* MessageServiceProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__providers_message_service_message_service__["a" /* MessageServiceProvider */]) === "function" && _c || Object])
64
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2__providers_message_service_message_service__["a" /* MessageServiceProvider */]])
58 65
     ], ChatPage);
59 66
     return ChatPage;
60
-    var _a, _b, _c;
61 67
 }());
62 68
 
63 69
 //# sourceMappingURL=chat.js.map
@@ -288,10 +294,9 @@ var MessageServiceProvider = /** @class */ (function () {
288 294
     };
289 295
     MessageServiceProvider = __decorate([
290 296
         Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["A" /* Injectable */])(),
291
-        __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_common_http__["a" /* HttpClient */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_common_http__["a" /* HttpClient */]) === "function" && _a || Object])
297
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_0__angular_common_http__["a" /* HttpClient */]])
292 298
     ], MessageServiceProvider);
293 299
     return MessageServiceProvider;
294
-    var _a;
295 300
 }());
296 301
 
297 302
 //# sourceMappingURL=message-service.js.map

+ 1
- 1
ZipTeamOrange-ionic-UI/www/build/main.js.map
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1
- 1
ZipTeamOrange-ionic-UI/www/build/vendor.js.map
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку