Skip to content

Commit 700c375

Browse files
committed
Fixes
1 parent 5445731 commit 700c375

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed
File renamed without changes.

eFormAPI/EformBase.Pn/eFormApi.BasePn.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
</ItemGroup>
147147
<ItemGroup>
148148
<Compile Include="Consts\EformRoles.cs" />
149-
<Compile Include="Helpers\LocaleHelper.cs" />
149+
<Compile Include="Infrastructure\Helpers\LocaleHelper.cs" />
150150
<Compile Include="Infrastructure\Data\BaseDbContext.cs" />
151151
<Compile Include="Infrastructure\Data\Base\BaseEntity.cs" />
152152
<Compile Include="Infrastructure\Data\Entities\EformRole.cs" />
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import {Injectable} from '@angular/core';
2+
// import PNotify from 'pnotify';
3+
import 'pnotify/dist/pnotify.css';
4+
import 'pnotify/dist/pnotify.buttons.js';
5+
import 'pnotify/dist/pnotify.buttons.css';
6+
7+
declare const PNotify: any;
8+
9+
@Injectable()
10+
export class NotifyPnService {
11+
pnotifySettings: any;
12+
isDesktop = false;
13+
14+
constructor() {
15+
this.pnotifySettings = Object.assign({styling: 'bootstrap3'}, {});
16+
17+
if (typeof this.pnotifySettings.styling === 'undefined') {
18+
throw new Error('pnotifySettings.styling must be a string');
19+
}
20+
}
21+
22+
private desktop() {
23+
PNotify.desktop.permission();
24+
this.isDesktop = true;
25+
}
26+
27+
private pnotify(opts) {
28+
opts.styling = this.pnotifySettings.styling;
29+
PNotify.prototype.options.delay = 2000;
30+
if (this.isDesktop) {
31+
opts.desktop = opts.desktop || {};
32+
opts.desktop.desktop = true;
33+
}
34+
return new PNotify(opts);
35+
}
36+
37+
success(opts) {
38+
opts.type = 'success';
39+
return this.pnotify(opts);
40+
}
41+
42+
notice(opts) {
43+
opts.type = 'notice';
44+
return this.pnotify(opts);
45+
}
46+
47+
error(opts) {
48+
opts.type = 'error';
49+
return this.pnotify(opts);
50+
}
51+
52+
info(opts) {
53+
opts.type = 'info';
54+
return this.pnotify(opts);
55+
}
56+
}

0 commit comments

Comments
 (0)