@things-factory/notification 7.0.0-alpha.8 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/actions/notification-fcm.ts +1 -1
- package/client/bootstrap.ts +2 -1
- package/client/pages/notification/notification-list-page.ts +6 -5
- package/client/pages/notification-rule/notification-rule-importer.ts +5 -12
- package/client/pages/notification-rule/notification-rule-list-page.ts +6 -5
- package/client/viewparts/notification-badge.ts +15 -19
- package/client/viewparts/notification-item.ts +20 -17
- package/client/viewparts/notification-list.ts +23 -23
- package/client/viewparts/notification-sender.ts +53 -37
- package/client/viewparts/notification-setting-let.ts +44 -27
- package/dist-client/actions/notification-fcm.js.map +1 -1
- package/dist-client/bootstrap.js +1 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/pages/notification/notification-list-page.js +6 -5
- package/dist-client/pages/notification/notification-list-page.js.map +1 -1
- package/dist-client/pages/notification-rule/notification-rule-importer.d.ts +1 -0
- package/dist-client/pages/notification-rule/notification-rule-importer.js +5 -12
- package/dist-client/pages/notification-rule/notification-rule-importer.js.map +1 -1
- package/dist-client/pages/notification-rule/notification-rule-list-page.js +6 -5
- package/dist-client/pages/notification-rule/notification-rule-list-page.js.map +1 -1
- package/dist-client/reducers/notification.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/notification-badge.d.ts +1 -0
- package/dist-client/viewparts/notification-badge.js +14 -19
- package/dist-client/viewparts/notification-badge.js.map +1 -1
- package/dist-client/viewparts/notification-item.d.ts +1 -1
- package/dist-client/viewparts/notification-item.js +19 -17
- package/dist-client/viewparts/notification-item.js.map +1 -1
- package/dist-client/viewparts/notification-list.d.ts +3 -2
- package/dist-client/viewparts/notification-list.js +20 -22
- package/dist-client/viewparts/notification-list.js.map +1 -1
- package/dist-client/viewparts/notification-sender.d.ts +3 -3
- package/dist-client/viewparts/notification-sender.js +51 -36
- package/dist-client/viewparts/notification-sender.js.map +1 -1
- package/dist-client/viewparts/notification-setting-let.d.ts +3 -4
- package/dist-client/viewparts/notification-setting-let.js +44 -22
- package/dist-client/viewparts/notification-setting-let.js.map +1 -1
- package/dist-server/controllers/fcm.d.ts +34 -0
- package/dist-server/controllers/fcm.js +5 -6
- package/dist-server/controllers/fcm.js.map +1 -1
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/index.d.ts +4 -0
- package/dist-server/middlewares/index.d.ts +1 -0
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/middlewares/notification-middleware.d.ts +1 -0
- package/dist-server/middlewares/notification-middleware.js +1 -2
- package/dist-server/middlewares/notification-middleware.js.map +1 -1
- package/dist-server/routers/notification-router.d.ts +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/service/index.d.ts +13 -0
- package/dist-server/service/notification/directive-notification.d.ts +3 -0
- package/dist-server/service/notification/directive-notification.js.map +1 -1
- package/dist-server/service/notification/index.d.ts +12 -0
- package/dist-server/service/notification/notification-mutation.d.ts +9 -0
- package/dist-server/service/notification/notification-mutation.js +2 -2
- package/dist-server/service/notification/notification-mutation.js.map +1 -1
- package/dist-server/service/notification/notification-query.d.ts +13 -0
- package/dist-server/service/notification/notification-query.js +4 -4
- package/dist-server/service/notification/notification-query.js.map +1 -1
- package/dist-server/service/notification/notification-subscription.d.ts +6 -0
- package/dist-server/service/notification/notification-subscription.js +2 -2
- package/dist-server/service/notification/notification-subscription.js.map +1 -1
- package/dist-server/service/notification/notification-type.d.ts +21 -0
- package/dist-server/service/notification/notification-type.js +6 -6
- package/dist-server/service/notification/notification-type.js.map +1 -1
- package/dist-server/service/notification/notification.d.ts +28 -0
- package/dist-server/service/notification/notification.js +4 -4
- package/dist-server/service/notification/notification.js.map +1 -1
- package/dist-server/service/notification-rule/event-subscriber.d.ts +7 -0
- package/dist-server/service/notification-rule/event-subscriber.js +2 -2
- package/dist-server/service/notification-rule/event-subscriber.js.map +1 -1
- package/dist-server/service/notification-rule/index.d.ts +7 -0
- package/dist-server/service/notification-rule/notification-rule-history.d.ts +28 -0
- package/dist-server/service/notification-rule/notification-rule-history.js +5 -5
- package/dist-server/service/notification-rule/notification-rule-history.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule-mutation.d.ts +10 -0
- package/dist-server/service/notification-rule/notification-rule-mutation.js +2 -2
- package/dist-server/service/notification-rule/notification-rule-mutation.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule-query.d.ts +12 -0
- package/dist-server/service/notification-rule/notification-rule-query.js +3 -3
- package/dist-server/service/notification-rule/notification-rule-query.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule-type.d.ts +27 -0
- package/dist-server/service/notification-rule/notification-rule-type.js +6 -6
- package/dist-server/service/notification-rule/notification-rule-type.js.map +1 -1
- package/dist-server/service/notification-rule/notification-rule.d.ts +34 -0
- package/dist-server/service/notification-rule/notification-rule.js +8 -9
- package/dist-server/service/notification-rule/notification-rule.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -12
- package/server/service/notification/notification-query.ts +8 -2
- package/server/service/notification/notification.ts +1 -1
- package/server/service/notification-rule/notification-rule-history.ts +5 -5
- package/server/service/notification-rule/notification-rule-query.ts +4 -1
- package/server/service/notification-rule/notification-rule.ts +1 -1
|
@@ -53,7 +53,7 @@ async function _getVapidKey() {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// to avoid race condition
|
|
56
|
-
const getVapidKey = synchronize(_getVapidKey)
|
|
56
|
+
const getVapidKey = synchronize(_getVapidKey) as any
|
|
57
57
|
|
|
58
58
|
export async function isSupportingMessaging() {
|
|
59
59
|
const { messaging } = (await getVapidKey()) || {}
|
package/client/bootstrap.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { notify } from '@operato/layout'
|
|
4
|
-
import { auth } from '@things-factory/auth-base/dist-client'
|
|
4
|
+
import { auth } from '@things-factory/auth-base/dist-client/auth.js'
|
|
5
|
+
|
|
5
6
|
import { i18next } from '@operato/i18n'
|
|
6
7
|
import { notificationStore, route, store } from '@operato/shell'
|
|
7
8
|
import { subscribe as graphqlSubscribe } from '@operato/graphql'
|
|
@@ -85,7 +85,7 @@ export class NotificationListPage extends connect(store)(localize(i18next)(Scope
|
|
|
85
85
|
|
|
86
86
|
<div id="sorters">
|
|
87
87
|
Sort
|
|
88
|
-
<
|
|
88
|
+
<md-icon
|
|
89
89
|
@click=${e => {
|
|
90
90
|
const target = e.currentTarget
|
|
91
91
|
this.sortersControl.open({
|
|
@@ -93,7 +93,7 @@ export class NotificationListPage extends connect(store)(localize(i18next)(Scope
|
|
|
93
93
|
top: target.offsetTop + target.offsetHeight
|
|
94
94
|
})
|
|
95
95
|
}}
|
|
96
|
-
>expand_more</
|
|
96
|
+
>expand_more</md-icon
|
|
97
97
|
>
|
|
98
98
|
<ox-popup id="sorter-control">
|
|
99
99
|
<ox-sorters-control> </ox-sorters-control>
|
|
@@ -101,9 +101,10 @@ export class NotificationListPage extends connect(store)(localize(i18next)(Scope
|
|
|
101
101
|
</div>
|
|
102
102
|
|
|
103
103
|
<div id="modes">
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
<
|
|
104
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
105
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
106
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
107
|
+
</div>
|
|
107
108
|
</div>
|
|
108
109
|
</div>
|
|
109
110
|
</ox-grist>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
1
2
|
import '@operato/data-grist'
|
|
2
3
|
|
|
3
4
|
import gql from 'graphql-tag'
|
|
@@ -7,30 +8,22 @@ import { property } from 'lit/decorators.js'
|
|
|
7
8
|
import { client } from '@operato/graphql'
|
|
8
9
|
import { i18next } from '@operato/i18n'
|
|
9
10
|
import { isMobileDevice } from '@operato/utils'
|
|
11
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
10
12
|
|
|
11
13
|
export class NotificationRuleImporter extends LitElement {
|
|
12
14
|
static styles = [
|
|
15
|
+
ButtonContainerStyles,
|
|
13
16
|
css`
|
|
14
17
|
:host {
|
|
15
18
|
display: flex;
|
|
16
19
|
flex-direction: column;
|
|
17
20
|
|
|
18
|
-
background-color:
|
|
21
|
+
background-color: var(--md-sys-color-surface);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
ox-grist {
|
|
22
25
|
flex: 1;
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
.button-container {
|
|
26
|
-
display: flex;
|
|
27
|
-
margin-left: auto;
|
|
28
|
-
padding: var(--padding-default);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
mwc-button {
|
|
32
|
-
margin-left: var(--margin-default);
|
|
33
|
-
}
|
|
34
27
|
`
|
|
35
28
|
]
|
|
36
29
|
|
|
@@ -71,7 +64,7 @@ export class NotificationRuleImporter extends LitElement {
|
|
|
71
64
|
></ox-grist>
|
|
72
65
|
|
|
73
66
|
<div class="button-container">
|
|
74
|
-
<
|
|
67
|
+
<button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
|
75
68
|
</div>
|
|
76
69
|
`
|
|
77
70
|
}
|
|
@@ -100,7 +100,7 @@ export class NotificationRuleListPage extends connect(store)(localize(i18next)(S
|
|
|
100
100
|
|
|
101
101
|
<div id="sorters">
|
|
102
102
|
Sort
|
|
103
|
-
<
|
|
103
|
+
<md-icon
|
|
104
104
|
@click=${e => {
|
|
105
105
|
const target = e.currentTarget
|
|
106
106
|
this.sortersControl.open({
|
|
@@ -108,7 +108,7 @@ export class NotificationRuleListPage extends connect(store)(localize(i18next)(S
|
|
|
108
108
|
top: target.offsetTop + target.offsetHeight
|
|
109
109
|
})
|
|
110
110
|
}}
|
|
111
|
-
>expand_more</
|
|
111
|
+
>expand_more</md-icon
|
|
112
112
|
>
|
|
113
113
|
<ox-popup id="sorter-control">
|
|
114
114
|
<ox-sorters-control> </ox-sorters-control>
|
|
@@ -116,9 +116,10 @@ export class NotificationRuleListPage extends connect(store)(localize(i18next)(S
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="modes">
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
<
|
|
119
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
120
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
121
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
122
|
+
</div>
|
|
122
123
|
</div>
|
|
123
124
|
</div>
|
|
124
125
|
</ox-grist>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import { LitElement, html, css } from 'lit'
|
|
2
4
|
import { customElement, property } from 'lit/decorators.js'
|
|
3
5
|
|
|
@@ -10,49 +12,43 @@ export class NotificationBadge extends connect(store)(LitElement) {
|
|
|
10
12
|
css`
|
|
11
13
|
:host {
|
|
12
14
|
font-size: 2em;
|
|
13
|
-
|
|
14
|
-
--badge-size: 14px;
|
|
15
|
+
position: relative;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
md-icon {
|
|
18
19
|
display: block;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
position: relative;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[data-badge]::after {
|
|
22
|
+
:host::after {
|
|
26
23
|
content: attr(data-badge);
|
|
27
24
|
position: absolute;
|
|
28
25
|
top: 0px;
|
|
29
26
|
right: -6px;
|
|
30
27
|
font-family: var(--theme-font);
|
|
31
|
-
font-size: 0.
|
|
32
|
-
background: var(--
|
|
33
|
-
color: var(--
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
28
|
+
font-size: 0.3em;
|
|
29
|
+
background: var(--md-sys-color-error, rgb(186 26 26));
|
|
30
|
+
color: var(--md-sys-color-on-primary);
|
|
31
|
+
width: 14px;
|
|
32
|
+
height: 14px;
|
|
36
33
|
text-align: center;
|
|
37
|
-
line-height:
|
|
34
|
+
line-height: 14px;
|
|
38
35
|
border-radius: 50%;
|
|
39
36
|
box-shadow: var(--box-shadow);
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
[data-badge='0']::after {
|
|
39
|
+
:host([data-badge='0'])::after {
|
|
43
40
|
display: none;
|
|
44
41
|
}
|
|
45
42
|
`
|
|
46
43
|
]
|
|
47
44
|
|
|
48
|
-
@property({ type: Number }) badge?: number
|
|
45
|
+
@property({ type: Number, attribute: 'data-badge', reflect: true }) badge?: number
|
|
49
46
|
|
|
50
47
|
render() {
|
|
51
|
-
|
|
52
|
-
return html` <mwc-icon data-badge=${badge} class="badge">notifications_none</mwc-icon> `
|
|
48
|
+
return html` <md-icon>notifications_none</md-icon> `
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
stateChanged(state) {
|
|
56
|
-
this.badge = state.notification.badge
|
|
52
|
+
this.badge = state.notification.badge || 0
|
|
57
53
|
}
|
|
58
54
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import gql from 'graphql-tag'
|
|
2
4
|
import { LitElement, html, css } from 'lit'
|
|
3
5
|
import { customElement, property } from 'lit/decorators.js'
|
|
4
|
-
import '@material/mwc-icon'
|
|
5
6
|
import { client } from '@operato/graphql'
|
|
6
7
|
|
|
7
8
|
function isOriginSameAsLocation(url) {
|
|
@@ -36,18 +37,20 @@ export class NotificationItem extends LitElement {
|
|
|
36
37
|
css`
|
|
37
38
|
:host {
|
|
38
39
|
position: relative;
|
|
39
|
-
background-color: var(--
|
|
40
|
-
padding: var(--
|
|
40
|
+
background-color: var(--md-sys-color-surface);
|
|
41
|
+
padding: var(--spacing-medium);
|
|
41
42
|
border-left: 0 solid transparent;
|
|
42
|
-
border-bottom: var(--
|
|
43
|
-
transition:
|
|
44
|
-
|
|
43
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant) !important;
|
|
44
|
+
transition:
|
|
45
|
+
border-left 300ms ease-in-out,
|
|
46
|
+
padding-left 300ms ease-in-out;
|
|
47
|
+
color: var(--md-sys-color-on-surface);
|
|
45
48
|
|
|
46
49
|
--type-dot-size: 9px;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
:host([newbie]) {
|
|
50
|
-
background-color: var(--
|
|
53
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
:host(:hover) {
|
|
@@ -61,7 +64,7 @@ export class NotificationItem extends LitElement {
|
|
|
61
64
|
text-overflow: ellipsis;
|
|
62
65
|
font-size: var(--fontsize-large);
|
|
63
66
|
font-weight: bold;
|
|
64
|
-
color: var(--
|
|
67
|
+
color: var(--md-sys-color-secondary);
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
[titler] span {
|
|
@@ -69,7 +72,7 @@ export class NotificationItem extends LitElement {
|
|
|
69
72
|
width: var(--type-dot-size);
|
|
70
73
|
height: var(--type-dot-size);
|
|
71
74
|
border-radius: 50%;
|
|
72
|
-
margin-right: var(--
|
|
75
|
+
margin-right: var(--spacing-small);
|
|
73
76
|
}
|
|
74
77
|
[titler] * {
|
|
75
78
|
vertical-align: middle;
|
|
@@ -87,18 +90,18 @@ export class NotificationItem extends LitElement {
|
|
|
87
90
|
opacity: 1;
|
|
88
91
|
}
|
|
89
92
|
[detail] {
|
|
90
|
-
padding: var(--
|
|
93
|
+
padding: var(--spacing-small) var(--spacing-medium);
|
|
91
94
|
border-radius: var(--border-radius);
|
|
92
95
|
font-size: 0.85em;
|
|
93
96
|
}
|
|
94
97
|
span.more {
|
|
95
98
|
margin-left: 16px;
|
|
96
99
|
float: right;
|
|
97
|
-
padding: 0px var(--
|
|
100
|
+
padding: 0px var(--spacing-small) 2px var(--spacing-small);
|
|
98
101
|
border-radius: var(--border-radius);
|
|
99
102
|
font-size: 0.8em;
|
|
100
|
-
color: var(--
|
|
101
|
-
--
|
|
103
|
+
color: var(--md-sys-color-on-primary);
|
|
104
|
+
--md-icon-size: 14px;
|
|
102
105
|
}
|
|
103
106
|
span.more * {
|
|
104
107
|
vertical-align: middle;
|
|
@@ -142,13 +145,13 @@ export class NotificationItem extends LitElement {
|
|
|
142
145
|
|
|
143
146
|
[message] {
|
|
144
147
|
font-size: var(--fontsize-default);
|
|
145
|
-
color: var(--
|
|
148
|
+
color: var(--md-sys-color-secondary);
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
[timestamp] {
|
|
149
152
|
white-space: nowrap;
|
|
150
153
|
font-size: var(--fontsize-small);
|
|
151
|
-
color: var(--
|
|
154
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
152
155
|
}
|
|
153
156
|
`
|
|
154
157
|
]
|
|
@@ -174,7 +177,7 @@ export class NotificationItem extends LitElement {
|
|
|
174
177
|
: html`<a href=${url}>${title}</a>`
|
|
175
178
|
: title}
|
|
176
179
|
</div>
|
|
177
|
-
<
|
|
180
|
+
<md-icon close @click=${e => this.dispatchEvent(new CustomEvent('close'))}>close</md-icon>
|
|
178
181
|
|
|
179
182
|
${image
|
|
180
183
|
? url
|
|
@@ -190,7 +193,7 @@ export class NotificationItem extends LitElement {
|
|
|
190
193
|
this.decipherErrorCode()
|
|
191
194
|
}}
|
|
192
195
|
>
|
|
193
|
-
<span class="more"><
|
|
196
|
+
<span class="more"><md-icon>expand_circle_down</md-icon> more</span>
|
|
194
197
|
</div>`
|
|
195
198
|
: html``}
|
|
196
199
|
${detail ? html`<div detail>${detail.message}</div>` : html``}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@material/web/button/elevated-button.js'
|
|
3
|
+
import './notification-item'
|
|
4
|
+
|
|
1
5
|
import { LitElement, html, css } from 'lit'
|
|
2
6
|
import { customElement, property } from 'lit/decorators.js'
|
|
3
7
|
import { connect } from 'pwa-helpers'
|
|
@@ -5,19 +9,16 @@ import { store, notificationStore } from '@operato/shell'
|
|
|
5
9
|
import { i18next, localize } from '@operato/i18n'
|
|
6
10
|
import { UPDATE_NOTIFICATION } from '../actions/notification-fcm'
|
|
7
11
|
|
|
8
|
-
import '@material/mwc-icon'
|
|
9
|
-
import './notification-item'
|
|
10
|
-
|
|
11
12
|
@customElement('notification-list')
|
|
12
13
|
export class NotificationList extends connect(store)(localize(i18next)(LitElement)) {
|
|
13
14
|
static styles = [
|
|
14
15
|
css`
|
|
15
16
|
:host {
|
|
16
17
|
display: block;
|
|
17
|
-
background-color: var(--
|
|
18
|
+
background-color: var(--md-sys-color-surface);
|
|
18
19
|
box-shadow: var(--box-shadow);
|
|
19
|
-
margin-right: var(--
|
|
20
|
-
padding: var(--
|
|
20
|
+
margin-right: var(--spacing-large);
|
|
21
|
+
padding: var(--spacing-medium);
|
|
21
22
|
max-height: 100%;
|
|
22
23
|
overflow-x: hidden;
|
|
23
24
|
overflow-y: auto;
|
|
@@ -28,7 +29,7 @@ export class NotificationList extends connect(store)(localize(i18next)(LitElemen
|
|
|
28
29
|
height: 0px;
|
|
29
30
|
border-left: 7px solid transparent;
|
|
30
31
|
border-right: 7px solid transparent;
|
|
31
|
-
border-bottom: 7px solid var(--
|
|
32
|
+
border-bottom: 7px solid var(--md-sys-color-on-primary);
|
|
32
33
|
position: absolute;
|
|
33
34
|
margin-top: -7px;
|
|
34
35
|
right: 50px;
|
|
@@ -41,27 +42,28 @@ export class NotificationList extends connect(store)(localize(i18next)(LitElemen
|
|
|
41
42
|
}
|
|
42
43
|
[notifications-wrap] div {
|
|
43
44
|
align-items: stretch;
|
|
44
|
-
border-bottom: 1px solid var(--
|
|
45
|
+
border-bottom: 1px solid var(--md-sys-color-primary);
|
|
45
46
|
}
|
|
46
47
|
[notifications-wrap] strong {
|
|
47
|
-
color: var(--
|
|
48
|
+
color: var(--md-sys-color-primary);
|
|
48
49
|
text-transform: capitalize;
|
|
49
50
|
line-height: 2;
|
|
50
51
|
}
|
|
51
|
-
[notifications-wrap]
|
|
52
|
+
[notifications-wrap] md-elevated-button {
|
|
53
|
+
--md-elevated-button-container-height: 24px;
|
|
52
54
|
float: right;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
padding-inline-start: 6px;
|
|
56
|
+
padding-inline-end: 12px;
|
|
55
57
|
}
|
|
56
58
|
[no-notifications] {
|
|
57
59
|
margin: 0;
|
|
58
|
-
padding: var(--
|
|
60
|
+
padding: var(--spacing-large);
|
|
59
61
|
text-align: center;
|
|
60
62
|
font-size: var(--fontsize-default);
|
|
61
63
|
font-weight: bold;
|
|
62
|
-
color: var(--
|
|
64
|
+
color: var(--md-sys-color-secondary);
|
|
63
65
|
}
|
|
64
|
-
div
|
|
66
|
+
div md-icon {
|
|
65
67
|
display: block;
|
|
66
68
|
opacity: 0.3;
|
|
67
69
|
}
|
|
@@ -84,13 +86,11 @@ export class NotificationList extends connect(store)(localize(i18next)(LitElemen
|
|
|
84
86
|
<div notifications-wrap>
|
|
85
87
|
<div>
|
|
86
88
|
<strong>${i18next.t('label.notification list')}</strong>
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@click=${e => this.onclearall()}
|
|
93
|
-
></mwc-button>
|
|
89
|
+
<md-elevated-button outlined dense @click=${e => this.onclearall()}
|
|
90
|
+
><md-icon slot="icon">delete_outline</md-icon>${String(
|
|
91
|
+
i18next.t('label.clear all')
|
|
92
|
+
)}</md-elevated-button
|
|
93
|
+
>
|
|
94
94
|
</div>
|
|
95
95
|
${history.map(
|
|
96
96
|
notification => html`
|
|
@@ -107,7 +107,7 @@ export class NotificationList extends connect(store)(localize(i18next)(LitElemen
|
|
|
107
107
|
`
|
|
108
108
|
: html`
|
|
109
109
|
<div no-notifications @click=${e => window.history.back()}>
|
|
110
|
-
<
|
|
110
|
+
<md-icon>notifications_off</md-icon>${i18next.t('text.no notification available')}
|
|
111
111
|
</div>
|
|
112
112
|
`
|
|
113
113
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import '@material/
|
|
2
|
-
import '@material/
|
|
3
|
-
import '@material/
|
|
1
|
+
import '@material/web/button/elevated-button.js'
|
|
2
|
+
import '@material/web/checkbox/checkbox.js'
|
|
3
|
+
import '@material/web/textfield/filled-text-field.js'
|
|
4
4
|
import '@operato/i18n/ox-i18n.js'
|
|
5
5
|
|
|
6
6
|
import { css, html, LitElement } from 'lit'
|
|
7
|
-
import { customElement
|
|
8
|
-
import { auth } from '@things-factory/auth-base/dist-client'
|
|
7
|
+
import { customElement } from 'lit/decorators.js'
|
|
8
|
+
import { auth } from '@things-factory/auth-base/dist-client/auth.js'
|
|
9
|
+
|
|
9
10
|
import { i18next, localize } from '@operato/i18n'
|
|
10
11
|
import { ScrollbarStyles } from '@operato/styles'
|
|
11
12
|
|
|
@@ -18,8 +19,9 @@ export class NotificationSender extends localize(i18next)(LitElement) {
|
|
|
18
19
|
css`
|
|
19
20
|
:host {
|
|
20
21
|
display: flex;
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
padding: var(--spacing-large);
|
|
23
|
+
background-color: var(--md-sys-color-background);
|
|
24
|
+
color: var(--md-sys-color-on-background);
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
form {
|
|
@@ -27,8 +29,9 @@ export class NotificationSender extends localize(i18next)(LitElement) {
|
|
|
27
29
|
display: flex;
|
|
28
30
|
flex-direction: column;
|
|
29
31
|
}
|
|
32
|
+
|
|
30
33
|
[content] > * {
|
|
31
|
-
margin: var(--
|
|
34
|
+
margin: var(--spacing-medium);
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
[content] {
|
|
@@ -43,13 +46,24 @@ export class NotificationSender extends localize(i18next)(LitElement) {
|
|
|
43
46
|
display: flex;
|
|
44
47
|
flex-direction: row-reverse;
|
|
45
48
|
}
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
|
|
50
|
+
[name='body'] {
|
|
51
|
+
resize: vertical;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
md-elevated-button {
|
|
55
|
+
margin-left: var(--spacing-medium);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
label {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: var(--spacing-medium);
|
|
61
|
+
align-items: center;
|
|
48
62
|
}
|
|
49
63
|
|
|
50
64
|
@media screen and (max-width: 480px) {
|
|
51
65
|
:host {
|
|
52
|
-
padding: var(--
|
|
66
|
+
padding: var(--spacing-medium);
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
69
|
`
|
|
@@ -59,43 +73,45 @@ export class NotificationSender extends localize(i18next)(LitElement) {
|
|
|
59
73
|
return html`
|
|
60
74
|
<form>
|
|
61
75
|
<div content>
|
|
62
|
-
<
|
|
76
|
+
<md-filled-text-field
|
|
63
77
|
type="text"
|
|
64
78
|
name="receivers"
|
|
65
|
-
|
|
79
|
+
label=${String(i18next.t('field.receivers'))}
|
|
66
80
|
placeholder=${auth.credential?.email}
|
|
67
81
|
required
|
|
68
|
-
icon="account_circle
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.label=${i18next.t('field.title')}
|
|
74
|
-
required
|
|
75
|
-
icon="notifications_none"
|
|
76
|
-
></mwc-textfield>
|
|
82
|
+
><md-icon slot="leading-icon">account_circle</md-icon></md-filled-text-field
|
|
83
|
+
>
|
|
84
|
+
<md-filled-text-field type="text" name="title" label=${String(i18next.t('field.title'))} required
|
|
85
|
+
><md-icon slot="leading-icon">notifications_none</md-icon></md-filled-text-field
|
|
86
|
+
>
|
|
77
87
|
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
icon="
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
<md-filled-text-field type="text" name="image" label=${String(i18next.t('field.image'))}
|
|
89
|
+
><md-icon slot="leading-icon">insert_photo</md-icon></md-filled-text-field
|
|
90
|
+
>
|
|
91
|
+
<md-filled-text-field type="text" name="url" label=${String(i18next.t('field.url'))}
|
|
92
|
+
><md-icon slot="leading-icon">link</md-icon></md-filled-text-field
|
|
93
|
+
>
|
|
94
|
+
<md-filled-text-field
|
|
95
|
+
type="textarea"
|
|
96
|
+
name="body"
|
|
97
|
+
label=${String(i18next.t('field.body'))}
|
|
98
|
+
required
|
|
99
|
+
rows="5"
|
|
100
|
+
></md-filled-text-field>
|
|
101
|
+
<label>
|
|
102
|
+
<md-checkbox name="inappmsg"></md-checkbox>
|
|
103
|
+
In-App Message
|
|
104
|
+
</label>
|
|
89
105
|
</div>
|
|
90
106
|
|
|
91
107
|
<div buttons>
|
|
92
|
-
<
|
|
108
|
+
<md-elevated-button raised icon="send" @click=${e => this.ontest()}>
|
|
93
109
|
<ox-i18n msgid="button.notification-send"> </ox-i18n>
|
|
94
|
-
</
|
|
110
|
+
</md-elevated-button>
|
|
95
111
|
|
|
96
|
-
<
|
|
112
|
+
<md-elevated-button type="reset" outlined @click=${e => this.onReset()}>
|
|
97
113
|
<ox-i18n msgid="button.reset"> </ox-i18n>
|
|
98
|
-
</
|
|
114
|
+
</md-elevated-button>
|
|
99
115
|
</div>
|
|
100
116
|
</form>
|
|
101
117
|
`
|