@things-factory/auth-ui 4.0.41 → 4.0.45

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.
Binary file
@@ -3,8 +3,8 @@ import '@operato/i18n'
3
3
 
4
4
  import { html } from 'lit-html'
5
5
 
6
+ import { TOOL_POSITION } from '@operato/layout'
6
7
  import { auth } from '@things-factory/auth-base'
7
- import { TOOL_POSITION } from '@things-factory/layout-base'
8
8
  import { ADD_MORENDA } from '@things-factory/more-base'
9
9
  import { navigate, store } from '@things-factory/shell'
10
10
 
@@ -4,7 +4,7 @@ import '@material/mwc-icon-button'
4
4
  import '@material/mwc-textfield'
5
5
  import '@operato/lottie-player'
6
6
  import '@operato/i18n/ox-i18n-selector.js'
7
- import '@things-factory/layout-ui/client/layouts/snack-bar'
7
+ import '@operato/layout/ox-snack-bar.js'
8
8
 
9
9
  import { css, html, LitElement } from 'lit'
10
10
 
@@ -115,7 +115,7 @@ export class AbstractAuthPage extends localize(i18next)(LitElement) {
115
115
  </div>
116
116
 
117
117
  <mwc-icon-button home icon="home" @click=${e => (window.location.href = '/')}></mwc-icon-button>
118
- <snack-bar id="snackbar" level="error" .message=${this.message}></snack-bar>
118
+ <ox-snack-bar id="snackbar" level="error" .message=${this.message}></ox-snack-bar>
119
119
 
120
120
  ${isSafari()
121
121
  ? html``
@@ -3,6 +3,7 @@ import '@material/mwc-textfield'
3
3
  import '@operato/lottie-player'
4
4
  import '../components/profile-component'
5
5
  import '@operato/i18n/ox-i18n-selector.js'
6
+ import '@operato/layout/ox-snack-bar.js'
6
7
 
7
8
  import { css, html } from 'lit'
8
9
 
@@ -124,7 +125,7 @@ export class AbstractPasswordReset extends AbstractAuthPage {
124
125
  </form>
125
126
  </div>
126
127
  </div>
127
- <snack-bar id="snackbar" level="error" .message=${this.message}></snack-bar>
128
+ <ox-snack-bar id="snackbar" level="error" .message=${this.message}></ox-snack-bar>
128
129
 
129
130
  ${isSafari()
130
131
  ? html``
@@ -1,8 +1,8 @@
1
1
  import { css, html, LitElement } from 'lit'
2
2
 
3
3
  import { i18next, localize } from '@operato/i18n'
4
+ import { notify } from '@operato/layout'
4
5
  import { auth } from '@things-factory/auth-base'
5
- import { notify } from '@things-factory/layout-base'
6
6
 
7
7
  export class DeleteUserPopup extends localize(i18next)(LitElement) {
8
8
  static get styles() {
@@ -6,8 +6,8 @@ import './my-login-history'
6
6
  import { css, html, LitElement } from 'lit'
7
7
 
8
8
  import { i18next, localize } from '@operato/i18n'
9
+ import { notify, openPopup } from '@operato/layout'
9
10
  import { auth } from '@things-factory/auth-base'
10
- import { notify, openPopup } from '@things-factory/layout-base'
11
11
 
12
12
  export class ProfileComponent extends localize(i18next)(LitElement) {
13
13
  static get properties() {
@@ -6,7 +6,7 @@ import { css, html, LitElement } from 'lit'
6
6
  import { connect } from 'pwa-helpers/connect-mixin'
7
7
 
8
8
  import { i18next } from '@operato/i18n'
9
- import { openPopup } from '@things-factory/layout-base'
9
+ import { openPopup } from '@operato/layout'
10
10
  import { client, CustomAlert, gqlContext, store } from '@things-factory/shell'
11
11
 
12
12
  class UserRoleEditor extends connect(store)(LitElement) {
@@ -1,5 +1,5 @@
1
1
  import '@material/mwc-button'
2
- import '@things-factory/layout-ui/client/layouts/snack-bar'
2
+ import '@operato/layout/ox-snack-bar.js'
3
3
  import '@operato/lottie-player'
4
4
 
5
5
  import { css, html, LitElement } from 'lit'
@@ -161,7 +161,7 @@ export class AuthActivate extends localize(i18next)(LitElement) {
161
161
  </div>
162
162
  <!--lottie animation end-->
163
163
  </div>
164
- <snack-bar id="snackbar"></snack-bar>
164
+ <ox-snack-bar id="snackbar"></ox-snack-bar>
165
165
  `
166
166
  }
167
167
 
@@ -1,5 +1,4 @@
1
1
  import '@material/mwc-button'
2
- import '@things-factory/layout-ui/client/layouts/snack-bar'
3
2
  import '../../components/profile-component'
4
3
 
5
4
  import { html } from 'lit'
@@ -1,8 +1,8 @@
1
- import { LitElement, css, html } from 'lit'
2
- import { PageView, client, navigate, store } from '@things-factory/shell'
3
-
4
- import { connect } from 'pwa-helpers/connect-mixin.js'
5
1
  import gql from 'graphql-tag'
2
+ import { css, html } from 'lit'
3
+ import { connect } from 'pwa-helpers/connect-mixin.js'
4
+
5
+ import { client, navigate, PageView, store } from '@things-factory/shell'
6
6
 
7
7
  class ApplicationRegister extends connect(store)(PageView) {
8
8
  static get styles() {
@@ -185,7 +185,7 @@ class ApplicationRegister extends connect(store)(PageView) {
185
185
 
186
186
  const response = await client.mutate({
187
187
  mutation: gql`
188
- mutation($application: NewApplication!) {
188
+ mutation ($application: NewApplication!) {
189
189
  createApplication(application: $application) {
190
190
  id
191
191
  }
@@ -1,4 +1,6 @@
1
- import '@operato/data-grist'
1
+ import '@operato/data-grist/ox-grist.js'
2
+ import '@operato/data-grist/ox-filters-form.js'
3
+ import '@operato/data-grist/ox-sorters-control.js'
2
4
  import '../../components/create-domain-popup'
3
5
 
4
6
  import gql from 'graphql-tag'
@@ -6,21 +8,23 @@ import { css, html } from 'lit'
6
8
  import { connect } from 'pwa-helpers/connect-mixin'
7
9
 
8
10
  import { i18next, localize } from '@operato/i18n'
9
- import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
11
+ import { openPopup } from '@operato/layout'
12
+ import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
10
13
  import { isMobileDevice } from '@operato/utils'
11
- import { openPopup } from '@things-factory/layout-base'
12
14
  import { client, PageView, store } from '@things-factory/shell'
13
15
 
14
16
  export class DomainManagement extends connect(store)(localize(i18next)(PageView)) {
15
17
  static get properties() {
16
18
  return {
17
19
  active: String,
18
- config: Object
20
+ config: Object,
21
+ mode: String
19
22
  }
20
23
  }
21
24
 
22
25
  static get styles() {
23
26
  return [
27
+ CommonGristStyles,
24
28
  ScrollbarStyles,
25
29
  css`
26
30
  :host {
@@ -29,25 +33,16 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
29
33
 
30
34
  overflow: hidden;
31
35
  }
32
-
33
- ox-grist {
34
- overflow-y: auto;
35
- flex: 1;
36
- }
37
-
38
- #filters {
39
- display: flex;
40
- flex-direction: row;
41
- justify-content: space-between;
42
- }
43
-
44
- #filters > * {
45
- padding: var(--padding-default) var(--padding-wide);
46
- }
47
36
  `
48
37
  ]
49
38
  }
50
39
 
40
+ constructor() {
41
+ super()
42
+
43
+ this.mode = isMobileDevice() ? 'LIST' : 'GRID'
44
+ }
45
+
51
46
  get context() {
52
47
  return {
53
48
  title: i18next.t('text.domain management'),
@@ -56,11 +51,6 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
56
51
  title: i18next.t('button.save'),
57
52
  action: this.onUpdateDomains.bind(this),
58
53
  ...CommonButtonStyles.save
59
- },
60
- {
61
- title: i18next.t('button.add'),
62
- action: this.onCreateDomain.bind(this),
63
- ...CommonButtonStyles.add
64
54
  }
65
55
  ]
66
56
  }
@@ -68,22 +58,45 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
68
58
 
69
59
  render() {
70
60
  return html`
71
- <ox-grist
72
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
73
- .config=${this.config}
74
- .fetchHandler="${this.fetchHandler.bind(this)}"
75
- >
76
- <div id="filters" slot="headroom">
77
- <ox-filters-form @change=${e => this.dataGrist.fetch()}></ox-filters-form>
61
+ <ox-grist .mode=${this.mode} .config=${this.config} .fetchHandler=${this.fetchHandler.bind(this)}>
62
+ <div slot="headroom">
63
+ <div id="filters">
64
+ <ox-filters-form></ox-filters-form>
65
+ </div>
66
+
67
+ <div id="sorters">
68
+ Sort
69
+ <mwc-icon
70
+ @click=${e => {
71
+ const target = e.currentTarget
72
+ this.renderRoot.querySelector('#sorter-control').open({
73
+ right: 0,
74
+ top: target.offsetTop + target.offsetHeight
75
+ })
76
+ }}
77
+ >expand_more</mwc-icon
78
+ >
79
+ <ox-popup id="sorter-control">
80
+ <ox-sorters-control> </ox-sorters-control>
81
+ </ox-popup>
82
+ </div>
83
+
84
+ <div id="modes">
85
+ <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${this.mode == 'GRID'}>grid_on</mwc-icon>
86
+ <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${this.mode == 'LIST'}
87
+ >format_list_bulleted</mwc-icon
88
+ >
89
+ <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${this.mode == 'CARD'}>apps</mwc-icon>
90
+ </div>
91
+
92
+ <div id="add">
93
+ <button><mwc-icon @click=${this.onCreateDomain.bind(this)}>add</mwc-icon></button>
94
+ </div>
78
95
  </div>
79
96
  </ox-grist>
80
97
  `
81
98
  }
82
99
 
83
- get searchForm() {
84
- return this.renderRoot.querySelector('ox-filters-form')
85
- }
86
-
87
100
  get dataGrist() {
88
101
  return this.renderRoot.querySelector('ox-grist')
89
102
  }
@@ -116,6 +129,7 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
116
129
  editable: false
117
130
  },
118
131
  filter: 'search',
132
+ sortable: true,
119
133
  width: 200
120
134
  },
121
135
  {
@@ -170,9 +184,7 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
170
184
  }
171
185
  }
172
186
 
173
- async fetchHandler({ page, limit, sorters = [] }) {
174
- const filters = (await this.searchForm.getQueryFilters()) || []
175
-
187
+ async fetchHandler({ page, limit, sortings = [], filters = [] }) {
176
188
  const response = await client.query({
177
189
  query: gql`
178
190
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
@@ -192,7 +204,7 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
192
204
  variables: {
193
205
  filters,
194
206
  pagination: { page, limit },
195
- sortings: sorters
207
+ sortings
196
208
  }
197
209
  })
198
210
 
@@ -228,6 +240,7 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
228
240
  })
229
241
 
230
242
  if (!response.errors) {
243
+ this.dataGrist.fetch()
231
244
  return this.showToast(i18next.t('text.updated_successfully'))
232
245
  }
233
246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/auth-ui",
3
- "version": "4.0.41",
3
+ "version": "4.0.45",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -30,14 +30,14 @@
30
30
  "@material/mwc-icon-button": "^0.25.3",
31
31
  "@material/mwc-textarea": "^0.25.3",
32
32
  "@material/mwc-textfield": "^0.25.3",
33
- "@operato/data-grist": "^0.3.21",
34
- "@operato/i18n": "^0.3.21",
35
- "@operato/lottie-player": "^0.3.21",
36
- "@things-factory/auth-base": "^4.0.41",
37
- "@things-factory/i18n-base": "^4.0.41",
38
- "@things-factory/layout-ui": "^4.0.41",
39
- "@things-factory/more-base": "^4.0.41",
33
+ "@operato/data-grist": "^0.3.28",
34
+ "@operato/i18n": "^0.3.28",
35
+ "@operato/layout": "^0.3.28",
36
+ "@operato/lottie-player": "^0.3.28",
37
+ "@things-factory/auth-base": "^4.0.45",
38
+ "@things-factory/i18n-base": "^4.0.45",
39
+ "@things-factory/more-base": "^4.0.45",
40
40
  "clipboard": "^2.0.6"
41
41
  },
42
- "gitHead": "1dd445b5b5e5b9e37291dc274886131199d7bf6a"
42
+ "gitHead": "6c37578551d77fed098e5eed4cd2cc9eb9c0dd4b"
43
43
  }