Skip to content

Commit f814ab9

Browse files
Removing the flashed messages module since it is incompatible with current Angular. Different solution incoming soon.
1 parent 8236e0d commit f814ab9

10 files changed

+32
-51
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"@angular/platform-browser-dynamic": "^5.0.2",
2323
"@angular/router": "^5.0.2",
2424
"@types/csv-parse": "^1.1.11",
25-
"angular2-flash-messages": "^1.0.8",
2625
"bootstrap": "^4.0.0-beta.2",
2726
"class-transformer": "^0.1.6",
2827
"core-js": "^2.4.1",

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
22

33
@Component({
44
selector: 'app-root',
5-
template: '<flash-messages></flash-messages><router-outlet></router-outlet>'
5+
template: '<router-outlet></router-outlet>'
66
})
77
export class AppComponent {
88
version = "1.0"

src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { NgModule } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
44
import { HttpModule } from '@angular/http';
55
import { RouterModule } from '@angular/router';
6-
import { FlashMessagesModule } from 'angular2-flash-messages';
76

87
import { AppComponent } from './app.component';
98
import { BackendServiceProvider } from "app/providers";
@@ -40,7 +39,6 @@ import { ConfigService } from "app/services";
4039
BrowserModule,
4140
FormsModule,
4241
HttpModule,
43-
FlashMessagesModule,
4442
RouterModule.forRoot([
4543
{
4644
path: 'products',

src/app/components/cash-point.component.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, OnInit, OnDestroy } from "@angular/core";
2-
import { FlashMessagesService } from "angular2-flash-messages/module";
32

43
import { GlobalInput, KeyCode } from "app/utils";
54
import { BackendService } from "app/services";
@@ -19,8 +18,7 @@ export class CashPointComponent extends GlobalInput implements OnInit, OnDestroy
1918
withdraw_custom: number;
2019

2120
constructor(
22-
private backend_service: BackendService,
23-
private flash_messages_service: FlashMessagesService
21+
private backend_service: BackendService
2422
) {
2523
super();
2624
}
@@ -58,15 +56,15 @@ export class CashPointComponent extends GlobalInput implements OnInit, OnDestroy
5856
},
5957
error => {
6058
this.wait_identifier = false;
61-
this.flash_messages_service.show('Unkown barcode.', { cssClass: 'alert-danger' });
59+
//this.flash_messages_service.show('Unkown barcode.', { cssClass: 'alert-danger' });
6260
}
6361
);
6462
this.identifier_input = '';
6563
}
6664

6765
processItem(item: Identifiable): void {
6866
if(item instanceof Product){
69-
this.flash_messages_service.show('This is not a user barcode.', { cssClass: 'alert-danger' });
67+
//this.flash_messages_service.show('This is not a user barcode.', { cssClass: 'alert-danger' });
7068
}
7169
else if(item instanceof User){
7270
this.user = item;
@@ -76,25 +74,25 @@ export class CashPointComponent extends GlobalInput implements OnInit, OnDestroy
7674

7775
deposit(amount: number): void {
7876
if(!amount) {
79-
this.flash_messages_service.show('Please specify the transaction amount!', { cssClass: 'alert-warning' });
77+
//this.flash_messages_service.show('Please specify the transaction amount!', { cssClass: 'alert-warning' });
8078
return;
8179
}
8280
this.wait_checkout = true;
8381
this.backend_service.deposit(this.user, amount).subscribe(
8482
transaction => {
85-
this.flash_messages_service.show('Transaction created!', { cssClass: 'alert-success' });
83+
//this.flash_messages_service.show('Transaction created!', { cssClass: 'alert-success' });
8684
this.wait_checkout = false;
8785
this.reset();
8886
},
8987
error => {
90-
this.flash_messages_service.show('Failed to create the transaction!', { cssClass: 'alert-danger' });
88+
//this.flash_messages_service.show('Failed to create the transaction!', { cssClass: 'alert-danger' });
9189
console.log(error);
9290
}
9391
);
9492
}
9593

9694
abort(): void {
97-
this.flash_messages_service.show('Transaction aborted.', { cssClass: 'alert-warning' });
95+
//this.flash_messages_service.show('Transaction aborted.', { cssClass: 'alert-warning' });
9896
this.reset();
9997
}
10098

@@ -104,4 +102,4 @@ export class CashPointComponent extends GlobalInput implements OnInit, OnDestroy
104102
this.user = null;
105103
this.startCaptureInput();
106104
}
107-
}
105+
}

src/app/components/product-edit.component.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
22
import { ActivatedRoute, Router } from "@angular/router";
3-
import { FlashMessagesService } from "angular2-flash-messages";
43

54
import { Product, Identifier, Pricing, Tag } from "app/models";
65
import { BackendService } from "app/services";
@@ -17,7 +16,6 @@ export class ProductEditComponent implements OnInit {
1716

1817
constructor(
1918
private backend_service: BackendService,
20-
private flash_messages_service: FlashMessagesService,
2119
private route: ActivatedRoute,
2220
private router: Router
2321
) { }
@@ -56,7 +54,7 @@ export class ProductEditComponent implements OnInit {
5654
this.backend_service.getProduct(+product_id)
5755
.subscribe(
5856
product => this.product = product,
59-
error => this.flash_messages_service.show('Failed to load product!', { cssClass: 'alert-danger' })
57+
error => console.log(error) //this.flash_messages_service.show('Failed to load product!', { cssClass: 'alert-danger' })
6058
);
6159
}
6260
});
@@ -67,14 +65,14 @@ export class ProductEditComponent implements OnInit {
6765
this.backend_service.saveProduct(this.product)
6866
.subscribe(
6967
product => {
70-
this.flash_messages_service.show('Product saved!', { cssClass: 'alert-success' });
68+
//this.flash_messages_service.show('Product saved!', { cssClass: 'alert-success' });
7169
this.router.navigate(['/products']);
7270
},
7371
error => {
74-
this.flash_messages_service.show('Failed to save product!', { cssClass: 'alert-danger' });
72+
//this.flash_messages_service.show('Failed to save product!', { cssClass: 'alert-danger' });
7573
this.wait_save = false;
7674
console.log(error);
7775
}
7876
);
7977
}
80-
}
78+
}

src/app/components/sales-point.component.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, OnInit, OnDestroy } from "@angular/core";
2-
import { FlashMessagesService } from "angular2-flash-messages/module";
32

43
import { Cart, User, Identifiable, Product } from "app/models";
54
import { GlobalInput, KeyCode } from "app/utils";
@@ -20,7 +19,6 @@ export class SalesPointComponent extends GlobalInput implements OnInit, OnDestro
2019

2120
constructor(
2221
private backend_service: BackendService,
23-
private flash_messages_service: FlashMessagesService
2422
) {
2523
super();
2624
this.cart = new Cart();
@@ -59,7 +57,7 @@ export class SalesPointComponent extends GlobalInput implements OnInit, OnDestro
5957
},
6058
error => {
6159
this.wait_identifier = false;
62-
this.flash_messages_service.show('Unkown barcode.', { cssClass: 'alert-danger' });
60+
//this.flash_messages_service.show('Unkown barcode.', { cssClass: 'alert-danger' });
6361
}
6462
);
6563
this.identifier_input = '';
@@ -92,7 +90,7 @@ export class SalesPointComponent extends GlobalInput implements OnInit, OnDestro
9290
cart => this.cart = cart,
9391
error => {
9492
console.log(error);
95-
this.flash_messages_service.show('Cart update failed.', { cssClass: 'alert-danger' });
93+
//this.flash_messages_service.show('Cart update failed.', { cssClass: 'alert-danger' });
9694
}
9795
);
9896
}
@@ -102,23 +100,23 @@ export class SalesPointComponent extends GlobalInput implements OnInit, OnDestro
102100
this.backend_service.payCart(this.cart).subscribe(
103101
transaction => {
104102
this.wait_checkout = false;
105-
this.flash_messages_service.show('Transaction created!', { cssClass: 'alert-success' });
103+
//this.flash_messages_service.show('Transaction created!', { cssClass: 'alert-success' });
106104
this.reset();
107105
},
108106
error => {
109107
console.log(error);
110-
this.flash_messages_service.show('Cart payment failed.', { cssClass: 'alert-danger' });
108+
//this.flash_messages_service.show('Cart payment failed.', { cssClass: 'alert-danger' });
111109
}
112110
);
113111
}
114112

115113
abort(): void {
116-
this.flash_messages_service.show('Transaction aborted.', { cssClass: 'alert-warning' });
114+
//this.flash_messages_service.show('Transaction aborted.', { cssClass: 'alert-warning' });
117115
this.reset();
118116
}
119117

120118
reset(): void {
121119
this.cart = new Cart();
122120
this.user = null;
123121
}
124-
}
122+
}

src/app/components/self-service-point.component.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, OnInit, OnDestroy, ViewChild, ElementRef } from "@angular/core";
2-
import { FlashMessagesService } from "angular2-flash-messages/module";
32

43
declare var jQuery:any;
54

@@ -28,8 +27,7 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
2827

2928
constructor(
3029
private backend_service: BackendService,
31-
private config_service: ConfigService,
32-
private flash_messages_service: FlashMessagesService
30+
private config_service: ConfigService
3331
) {
3432
super();
3533
this.cart = new Cart();
@@ -79,7 +77,7 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
7977
error => {
8078
this.wait_identifier = false;
8179
console.error(error);
82-
this.flash_messages_service.show('Not found! No product or user with this barcode exists.', { cssClass: 'alert-danger' });
80+
//this.flash_messages_service.show('Not found! No product or user with this barcode exists.', { cssClass: 'alert-danger' });
8381
}
8482
);
8583
this.identifier_input = '';
@@ -88,15 +86,15 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
8886
processItem(item: Identifiable): void {
8987
if(item instanceof Product){
9088
if(!this.user){
91-
this.flash_messages_service.show('Please scan your ID card first! You have scanned a product, but you need to scan your ID card.', { cssClass: 'alert-danger' });
89+
//this.flash_messages_service.show('Please scan your ID card first! You have scanned a product, but you need to scan your ID card.', { cssClass: 'alert-danger' });
9290
return;
9391
}
9492
this.cart.addToCart(item.name, item.pricings[0]); // hackedyhack ... select proper pricing instead
9593
this.updateCart();
9694
}
9795
else if(item instanceof User){
9896
if(this.user){
99-
this.flash_messages_service.show('Already logged in! You have already scanned an ID card. If you want to change the user, please abort this transaction.', { cssClass: 'alert-danger' });
97+
//this.flash_messages_service.show('Already logged in! You have already scanned an ID card. If you want to change the user, please abort this transaction.', { cssClass: 'alert-danger' });
10098
return;
10199
}
102100
this.user = item;
@@ -111,7 +109,7 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
111109
cart => this.cart = cart,
112110
error => {
113111
console.error(error);
114-
this.flash_messages_service.show('Cart update failed! The cart could not be updated, probably because the product is no longer available.', { cssClass: 'alert-danger' });
112+
//this.flash_messages_service.show('Cart update failed! The cart could not be updated, probably because the product is no longer available.', { cssClass: 'alert-danger' });
115113
}
116114
);
117115
}
@@ -125,7 +123,7 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
125123
},
126124
error => {
127125
console.error(error);
128-
this.flash_messages_service.show('Cart payment failed! The server did not accept the transaction, probably because your account balance is insufficient.', { cssClass: 'alert-danger' });
126+
//this.flash_messages_service.show('Cart payment failed! The server did not accept the transaction, probably because your account balance is insufficient.', { cssClass: 'alert-danger' });
129127
}
130128
);
131129
}
@@ -142,7 +140,7 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
142140
}
143141

144142
abort(): void {
145-
this.flash_messages_service.show('The checkout process has been aborted.', { cssClass: 'alert-warning' });
143+
//this.flash_messages_service.show('The checkout process has been aborted.', { cssClass: 'alert-warning' });
146144
this.cart = new Cart();
147145
this.user = null;
148146
this.mode = 0;
@@ -169,4 +167,4 @@ export class SelfServicePointComponent extends GlobalInput implements OnInit, On
169167
}, 4000);
170168
}
171169
*/
172-
}
170+
}

src/app/components/user-edit.component.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
22
import { ActivatedRoute, Router } from "@angular/router";
3-
import { FlashMessagesService } from "angular2-flash-messages";
43

54
import { User, Tag, Identifier } from "app/models";
65
import { BackendService } from "app/services";
@@ -17,7 +16,6 @@ export class UserEditComponent implements OnInit {
1716

1817
constructor(
1918
private backend_service: BackendService,
20-
private flashMessagesService: FlashMessagesService,
2119
private route: ActivatedRoute,
2220
private router: Router
2321
) { }
@@ -48,7 +46,7 @@ export class UserEditComponent implements OnInit {
4846
this.backend_service.getUser(+user_id)
4947
.subscribe(
5048
user => this.user = user,
51-
error => this.flashMessagesService.show('Failed to load user!', { cssClass: 'alert-danger' })
49+
error => console.log(error) //this.flashMessagesService.show('Failed to load user!', { cssClass: 'alert-danger' })
5250
);
5351
}
5452
});
@@ -59,14 +57,14 @@ export class UserEditComponent implements OnInit {
5957
this.backend_service.saveUser(this.user)
6058
.subscribe(
6159
user => {
62-
this.flashMessagesService.show('User saved!', { cssClass: 'alert-success' });
60+
//this.flashMessagesService.show('User saved!', { cssClass: 'alert-success' });
6361
this.router.navigate(['/users']);
6462
},
6563
error => {
66-
this.flashMessagesService.show('Failed to save user!', { cssClass: 'alert-danger' });
64+
//this.flashMessagesService.show('Failed to save user!', { cssClass: 'alert-danger' });
6765
this.wait_save = false;
6866
console.log(error);
6967
}
7068
);
7169
}
72-
}
70+
}

src/app/components/user-import.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Component, OnInit } from "@angular/core";
22
import { User, Tag, Identifier } from "app/models";
33
import { BackendService } from "app/services/backend.service";
4-
import { FlashMessagesService } from "angular2-flash-messages";
54
import { Parser } from "csv-parse";
65

76
@Component({
@@ -17,8 +16,7 @@ export class UserImportComponent implements OnInit{
1716
importProgress: number;
1817

1918
constructor(
20-
private backendService: BackendService,
21-
private flashMessagesService: FlashMessagesService
19+
private backendService: BackendService
2220
) { }
2321

2422
ngOnInit() {

yarn.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,6 @@ amdefine@>=0.0.4:
292292
version "1.0.1"
293293
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
294294

295-
angular2-flash-messages@^1.0.8:
296-
version "1.0.8"
297-
resolved "https://registry.yarnpkg.com/angular2-flash-messages/-/angular2-flash-messages-1.0.8.tgz#21e10833a8c044c1ea7c709480154949c2723463"
298-
299295
300296
version "0.0.7"
301297
resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e"

0 commit comments

Comments
 (0)