woat 6 år sedan
förälder
incheckning
fe0defce3a
5 ändrade filer med 52 tillägg och 146 borttagningar
  1. 46
    84
      package-lock.json
  2. 1
    3
      package.json
  3. 1
    29
      src/app/app.module.ts
  4. 1
    3
      src/app/post.service.ts
  5. 3
    27
      src/app/timeline/timeline.component.ts

+ 46
- 84
package-lock.json Visa fil

@@ -411,22 +411,6 @@
411 411
         "semver-intersect": "^1.1.2"
412 412
       }
413 413
     },
414
-    "@stomp/ng2-stompjs": {
415
-      "version": "4.0.1",
416
-      "resolved": "https://registry.npmjs.org/@stomp/ng2-stompjs/-/ng2-stompjs-4.0.1.tgz",
417
-      "integrity": "sha512-LiP/VoCLGhwVR56T0WCLN3pV1Cx8ifgteNIKzAtKngJJjtkwk9cHAoiPz/u3ZPmuCxcd+JpGrIM/j0utg2CfUg==",
418
-      "requires": {
419
-        "@stomp/stompjs": "^4.0.0 >=4.0.7"
420
-      }
421
-    },
422
-    "@stomp/stompjs": {
423
-      "version": "4.0.7",
424
-      "resolved": "https://registry.npmjs.org/@stomp/stompjs/-/stompjs-4.0.7.tgz",
425
-      "integrity": "sha512-2fI/P978d7Kux3KqOfF5GLkiCbwgrPjOZwkgr0qZvVh9b+kHVueqhkxDGIGVyyrUO4Iwdmy5s6sXPc5RxhFlQA==",
426
-      "requires": {
427
-        "websocket": "^1.0.24"
428
-      }
429
-    },
430 414
     "@types/jasmine": {
431 415
       "version": "2.8.8",
432 416
       "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.8.8.tgz",
@@ -2385,6 +2369,7 @@
2385 2369
       "version": "2.6.9",
2386 2370
       "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
2387 2371
       "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
2372
+      "dev": true,
2388 2373
       "requires": {
2389 2374
         "ms": "2.0.0"
2390 2375
       }
@@ -3095,6 +3080,7 @@
3095 3080
       "version": "0.1.6",
3096 3081
       "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz",
3097 3082
       "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=",
3083
+      "dev": true,
3098 3084
       "requires": {
3099 3085
         "original": ">=0.0.5"
3100 3086
       }
@@ -3719,12 +3705,14 @@
3719 3705
         "balanced-match": {
3720 3706
           "version": "1.0.0",
3721 3707
           "bundled": true,
3722
-          "dev": true
3708
+          "dev": true,
3709
+          "optional": true
3723 3710
         },
3724 3711
         "brace-expansion": {
3725 3712
           "version": "1.1.11",
3726 3713
           "bundled": true,
3727 3714
           "dev": true,
3715
+          "optional": true,
3728 3716
           "requires": {
3729 3717
             "balanced-match": "^1.0.0",
3730 3718
             "concat-map": "0.0.1"
@@ -3739,17 +3727,20 @@
3739 3727
         "code-point-at": {
3740 3728
           "version": "1.1.0",
3741 3729
           "bundled": true,
3742
-          "dev": true
3730
+          "dev": true,
3731
+          "optional": true
3743 3732
         },
3744 3733
         "concat-map": {
3745 3734
           "version": "0.0.1",
3746 3735
           "bundled": true,
3747
-          "dev": true
3736
+          "dev": true,
3737
+          "optional": true
3748 3738
         },
3749 3739
         "console-control-strings": {
3750 3740
           "version": "1.1.0",
3751 3741
           "bundled": true,
3752
-          "dev": true
3742
+          "dev": true,
3743
+          "optional": true
3753 3744
         },
3754 3745
         "core-util-is": {
3755 3746
           "version": "1.0.2",
@@ -3866,7 +3857,8 @@
3866 3857
         "inherits": {
3867 3858
           "version": "2.0.3",
3868 3859
           "bundled": true,
3869
-          "dev": true
3860
+          "dev": true,
3861
+          "optional": true
3870 3862
         },
3871 3863
         "ini": {
3872 3864
           "version": "1.3.5",
@@ -3878,6 +3870,7 @@
3878 3870
           "version": "1.0.0",
3879 3871
           "bundled": true,
3880 3872
           "dev": true,
3873
+          "optional": true,
3881 3874
           "requires": {
3882 3875
             "number-is-nan": "^1.0.0"
3883 3876
           }
@@ -3892,6 +3885,7 @@
3892 3885
           "version": "3.0.4",
3893 3886
           "bundled": true,
3894 3887
           "dev": true,
3888
+          "optional": true,
3895 3889
           "requires": {
3896 3890
             "brace-expansion": "^1.1.7"
3897 3891
           }
@@ -3899,12 +3893,14 @@
3899 3893
         "minimist": {
3900 3894
           "version": "0.0.8",
3901 3895
           "bundled": true,
3902
-          "dev": true
3896
+          "dev": true,
3897
+          "optional": true
3903 3898
         },
3904 3899
         "minipass": {
3905 3900
           "version": "2.2.4",
3906 3901
           "bundled": true,
3907 3902
           "dev": true,
3903
+          "optional": true,
3908 3904
           "requires": {
3909 3905
             "safe-buffer": "^5.1.1",
3910 3906
             "yallist": "^3.0.0"
@@ -3923,6 +3919,7 @@
3923 3919
           "version": "0.5.1",
3924 3920
           "bundled": true,
3925 3921
           "dev": true,
3922
+          "optional": true,
3926 3923
           "requires": {
3927 3924
             "minimist": "0.0.8"
3928 3925
           }
@@ -4003,7 +4000,8 @@
4003 4000
         "number-is-nan": {
4004 4001
           "version": "1.0.1",
4005 4002
           "bundled": true,
4006
-          "dev": true
4003
+          "dev": true,
4004
+          "optional": true
4007 4005
         },
4008 4006
         "object-assign": {
4009 4007
           "version": "4.1.1",
@@ -4015,6 +4013,7 @@
4015 4013
           "version": "1.4.0",
4016 4014
           "bundled": true,
4017 4015
           "dev": true,
4016
+          "optional": true,
4018 4017
           "requires": {
4019 4018
             "wrappy": "1"
4020 4019
           }
@@ -4136,6 +4135,7 @@
4136 4135
           "version": "1.0.2",
4137 4136
           "bundled": true,
4138 4137
           "dev": true,
4138
+          "optional": true,
4139 4139
           "requires": {
4140 4140
             "code-point-at": "^1.0.0",
4141 4141
             "is-fullwidth-code-point": "^1.0.0",
@@ -4756,7 +4756,8 @@
4756 4756
     "http-parser-js": {
4757 4757
       "version": "0.4.13",
4758 4758
       "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.13.tgz",
4759
-      "integrity": "sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc="
4759
+      "integrity": "sha1-O9bW/ebjFyyTNMOzO2wZPYD+ETc=",
4760
+      "dev": true
4760 4761
     },
4761 4762
     "http-proxy": {
4762 4763
       "version": "1.17.0",
@@ -4925,7 +4926,8 @@
4925 4926
     "inherits": {
4926 4927
       "version": "2.0.3",
4927 4928
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
4928
-      "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
4929
+      "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
4930
+      "dev": true
4929 4931
     },
4930 4932
     "ini": {
4931 4933
       "version": "1.3.5",
@@ -5219,7 +5221,8 @@
5219 5221
     "is-typedarray": {
5220 5222
       "version": "1.0.0",
5221 5223
       "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
5222
-      "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
5224
+      "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
5225
+      "dev": true
5223 5226
     },
5224 5227
     "is-utf8": {
5225 5228
       "version": "0.2.1",
@@ -5606,7 +5609,8 @@
5606 5609
     "json3": {
5607 5610
       "version": "3.3.2",
5608 5611
       "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz",
5609
-      "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE="
5612
+      "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=",
5613
+      "dev": true
5610 5614
     },
5611 5615
     "json5": {
5612 5616
       "version": "0.5.1",
@@ -6490,7 +6494,8 @@
6490 6494
     "ms": {
6491 6495
       "version": "2.0.0",
6492 6496
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
6493
-      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
6497
+      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
6498
+      "dev": true
6494 6499
     },
6495 6500
     "multicast-dns": {
6496 6501
       "version": "6.2.3",
@@ -6512,6 +6517,7 @@
6512 6517
       "version": "2.10.0",
6513 6518
       "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
6514 6519
       "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
6520
+      "dev": true,
6515 6521
       "optional": true
6516 6522
     },
6517 6523
     "nanomatch": {
@@ -7118,6 +7124,7 @@
7118 7124
       "version": "1.0.1",
7119 7125
       "resolved": "https://registry.npmjs.org/original/-/original-1.0.1.tgz",
7120 7126
       "integrity": "sha512-IEvtB5vM5ULvwnqMxWBLxkS13JIEXbakizMSo3yoPNPCIWzg8TG3Usn/UhXoZFM/m+FuEA20KdzPSFq/0rS+UA==",
7127
+      "dev": true,
7121 7128
       "requires": {
7122 7129
         "url-parse": "~1.4.0"
7123 7130
       }
@@ -7800,7 +7807,8 @@
7800 7807
     "querystringify": {
7801 7808
       "version": "2.0.0",
7802 7809
       "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.0.0.tgz",
7803
-      "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw=="
7810
+      "integrity": "sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw==",
7811
+      "dev": true
7804 7812
     },
7805 7813
     "randomatic": {
7806 7814
       "version": "3.0.0",
@@ -8179,7 +8187,8 @@
8179 8187
     "requires-port": {
8180 8188
       "version": "1.0.0",
8181 8189
       "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
8182
-      "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
8190
+      "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
8191
+      "dev": true
8183 8192
     },
8184 8193
     "resolve": {
8185 8194
       "version": "1.8.1",
@@ -8262,9 +8271,9 @@
8262 8271
       }
8263 8272
     },
8264 8273
     "rxjs": {
8265
-      "version": "6.2.2",
8266
-      "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.2.tgz",
8267
-      "integrity": "sha512-0MI8+mkKAXZUF9vMrEoPnaoHkfzBPP4IGwUYRJhIRJF6/w3uByO1e91bEHn8zd43RdkTMKiooYKmwz7RH6zfOQ==",
8274
+      "version": "6.2.1",
8275
+      "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.1.tgz",
8276
+      "integrity": "sha512-OwMxHxmnmHTUpgO+V7dZChf3Tixf4ih95cmXjzzadULziVl/FKhHScGLj4goEw9weePVOH2Q0+GcCBUhKCZc/g==",
8268 8277
       "requires": {
8269 8278
         "tslib": "^1.9.0"
8270 8279
       }
@@ -8950,29 +8959,6 @@
8950 8959
         }
8951 8960
       }
8952 8961
     },
8953
-    "sockjs-client-web": {
8954
-      "version": "1.1.1-alpha.2",
8955
-      "resolved": "https://registry.npmjs.org/sockjs-client-web/-/sockjs-client-web-1.1.1-alpha.2.tgz",
8956
-      "integrity": "sha512-5z0kLtfyhWym0d04VQrAxB+5+85OY6T82gFYhChF4JcsWWJInVLt2frK95bnD2igl3jtgGaf/V5yA9xrTNoy7A==",
8957
-      "requires": {
8958
-        "debug": "^2.2.0",
8959
-        "eventsource": "~0.1.6",
8960
-        "faye-websocket": "~0.11.0",
8961
-        "inherits": "^2.0.1",
8962
-        "json3": "^3.3.2",
8963
-        "url-parse": "^1.1.1"
8964
-      },
8965
-      "dependencies": {
8966
-        "faye-websocket": {
8967
-          "version": "0.11.1",
8968
-          "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz",
8969
-          "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=",
8970
-          "requires": {
8971
-            "websocket-driver": ">=0.5.1"
8972
-          }
8973
-        }
8974
-      }
8975
-    },
8976 8962
     "source-list-map": {
8977 8963
       "version": "2.0.0",
8978 8964
       "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz",
@@ -9690,15 +9676,6 @@
9690 9676
       "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
9691 9677
       "dev": true
9692 9678
     },
9693
-    "typedarray-to-buffer": {
9694
-      "version": "3.1.5",
9695
-      "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
9696
-      "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
9697
-      "optional": true,
9698
-      "requires": {
9699
-        "is-typedarray": "^1.0.0"
9700
-      }
9701
-    },
9702 9679
     "typescript": {
9703 9680
       "version": "2.7.2",
9704 9681
       "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz",
@@ -9949,6 +9926,7 @@
9949 9926
       "version": "1.4.1",
9950 9927
       "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.1.tgz",
9951 9928
       "integrity": "sha512-x95Td74QcvICAA0+qERaVkRpTGKyBHHYdwL2LXZm5t/gBtCB9KQSO/0zQgSTYEV1p0WcvSg79TLNPSvd5IDJMQ==",
9929
+      "dev": true,
9952 9930
       "requires": {
9953 9931
         "querystringify": "^2.0.0",
9954 9932
         "requires-port": "^1.0.0"
@@ -10435,22 +10413,11 @@
10435 10413
         "webpack-core": "^0.6.8"
10436 10414
       }
10437 10415
     },
10438
-    "websocket": {
10439
-      "version": "1.0.26",
10440
-      "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.26.tgz",
10441
-      "integrity": "sha512-fjcrYDPIQxpTnqFQ9JjxUQcdvR89MFAOjPBlF+vjOt49w/XW4fJknUoMz/mDIn2eK1AdslVojcaOxOqyZZV8rw==",
10442
-      "optional": true,
10443
-      "requires": {
10444
-        "debug": "^2.2.0",
10445
-        "nan": "^2.3.3",
10446
-        "typedarray-to-buffer": "^3.1.2",
10447
-        "yaeti": "^0.0.6"
10448
-      }
10449
-    },
10450 10416
     "websocket-driver": {
10451 10417
       "version": "0.7.0",
10452 10418
       "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz",
10453 10419
       "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=",
10420
+      "dev": true,
10454 10421
       "requires": {
10455 10422
         "http-parser-js": ">=0.4.0",
10456 10423
         "websocket-extensions": ">=0.1.1"
@@ -10459,7 +10426,8 @@
10459 10426
     "websocket-extensions": {
10460 10427
       "version": "0.1.3",
10461 10428
       "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
10462
-      "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg=="
10429
+      "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
10430
+      "dev": true
10463 10431
     },
10464 10432
     "when": {
10465 10433
       "version": "3.6.4",
@@ -10597,12 +10565,6 @@
10597 10565
       "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
10598 10566
       "dev": true
10599 10567
     },
10600
-    "yaeti": {
10601
-      "version": "0.0.6",
10602
-      "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
10603
-      "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=",
10604
-      "optional": true
10605
-    },
10606 10568
     "yallist": {
10607 10569
       "version": "2.1.2",
10608 10570
       "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",

+ 1
- 3
package.json Visa fil

@@ -20,11 +20,9 @@
20 20
     "@angular/platform-browser": "^6.0.3",
21 21
     "@angular/platform-browser-dynamic": "^6.0.3",
22 22
     "@angular/router": "^6.0.3",
23
-    "@stomp/ng2-stompjs": "^4.0.1",
24 23
     "angular-in-memory-web-api": "^0.6.0",
25 24
     "core-js": "^2.5.4",
26
-    "rxjs": "^6.2.2",
27
-    "sockjs-client-web": "^1.1.1-alpha.2",
25
+    "rxjs": "^6.0.0",
28 26
     "zone.js": "^0.8.26"
29 27
   },
30 28
   "devDependencies": {

+ 1
- 29
src/app/app.module.ts Visa fil

@@ -2,8 +2,6 @@ import { BrowserModule } from '@angular/platform-browser';
2 2
 import { NgModule } from '@angular/core';
3 3
 import { FormsModule } from '@angular/forms';
4 4
 import { HttpClientModule } from '@angular/common/http';
5
-import { StompConfig, StompService } from '@stomp/ng2-stompjs';
6
-import * as SockJS from 'sockjs-client';
7 5
 
8 6
 import { AppComponent } from './app.component';
9 7
 import { StatusComponent } from './timeline/status/status.component';
@@ -18,26 +16,6 @@ import { MessageComponent } from './inbox/message/message.component';
18 16
 import { RouterModule, Routes } from '@angular/router';
19 17
 import { ChatroomComponent } from './chatroom/chatroom.component';
20 18
 
21
-export function socketProvider() {
22
-	return new SockJS('http://localhost:8080/stomp');
23
-}
24
-
25
-const stompConfig: StompConfig = {
26
-	url: socketProvider,
27
-
28
-	headers: {
29
-		login: 'guest',
30
-		passcode: 'guest'
31
-	},
32
-
33
-	heartbeat_in: 0,
34
-	heartbeat_out: 5000,
35
-
36
-	reconnect_delay: 5000,
37
-	debug: true
38
-
39
-};
40
-
41 19
 const appRoutes: Routes = [
42 20
 	{ path: '', component: TimelineComponent },
43 21
 	{ path: 'chatroom', component: ChatroomComponent }
@@ -66,13 +44,7 @@ const appRoutes: Routes = [
66 44
 			{ enableTracing: false }
67 45
 		),
68 46
 	],
69
-	providers: [
70
-		StompService,
71
-		{
72
-			provide: StompConfig,
73
-			useValue: stompConfig
74
-		}
75
-	],
47
+	providers: [],
76 48
 	bootstrap: [AppComponent]
77 49
 })
78 50
 export class AppModule { }

+ 1
- 3
src/app/post.service.ts Visa fil

@@ -7,9 +7,7 @@ import { HttpClient, HttpParams } from '@angular/common/http';
7 7
 
8 8
 export class PostService {
9 9
 
10
-	constructor(private http: HttpClient) {
11
-
12
-	}
10
+	constructor( private http: HttpClient ) {}
13 11
 
14 12
 	getAllPosts() {
15 13
 		return this.http.get('/api/post/all').toPromise();

+ 3
- 27
src/app/timeline/timeline.component.ts Visa fil

@@ -1,7 +1,4 @@
1
-import { Component, OnInit, OnDestroy } from '@angular/core';
2
-import { Observable } from 'rxjs';
3
-import { Subscription  } from 'rxjs';
4
-import { StompService } from '@stomp/ng2-stompjs';
1
+import { Component, OnInit } from '@angular/core';
5 2
 import { PostService } from '../post.service';
6 3
 
7 4
 @Component({
@@ -9,34 +6,13 @@ import { PostService } from '../post.service';
9 6
 	templateUrl: './timeline.component.html',
10 7
 	styleUrls: ['./timeline.component.css']
11 8
 })
12
-
13 9
 export class TimelineComponent implements OnInit {
14
-	private subscription: Subscription;
15
-	public messages: Observable<any>;
16
-
17
-	public subscribed: boolean;
18
-	public mq: Array<string> = [];
19
-	public count = 0;
20
-	private _counter = 1;
21
-
22 10
 	posts: any;
23 11
 
24
-	constructor(
25
-		private postService: PostService,
26
-		private _stompService: StompService) { }
12
+	constructor( private postService: PostService ) { }
27 13
 
28 14
 	ngOnInit() {
29
-		this.subscribed = false;
30
-		this.subscribe();
31
-		// this.getAllPostsFromService();
32
-	}
33
-
34
-	public subscribe() {
35
-		if (this.subscribed) {
36
-			return;
37
-		}
38
-
39
-		this.messages = this._stompService.subscribe('')
15
+		this.getAllPostsFromService();
40 16
 	}
41 17
 
42 18
 	async getAllPostsFromService() {