@things-factory/auth-ui 10.1.24 → 10.1.27

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.
Files changed (60) hide show
  1. package/dist-client/components/abstract-auth-page.js +2 -0
  2. package/dist-client/components/abstract-auth-page.js.map +1 -1
  3. package/dist-client/components/abstract-password-reset.js +2 -0
  4. package/dist-client/components/abstract-password-reset.js.map +1 -1
  5. package/dist-client/components/change-password.js +1 -1
  6. package/dist-client/components/change-password.js.map +1 -1
  7. package/dist-client/components/delete-user-popup.js +1 -1
  8. package/dist-client/components/delete-user-popup.js.map +1 -1
  9. package/dist-client/entries/auth/activate.js +2 -0
  10. package/dist-client/entries/auth/activate.js.map +1 -1
  11. package/dist-client/entries/auth/checkin.js +2 -0
  12. package/dist-client/entries/auth/checkin.js.map +1 -1
  13. package/dist-client/entries/auth/result.js +2 -0
  14. package/dist-client/entries/auth/result.js.map +1 -1
  15. package/dist-client/entries/oauth2/oauth2-decision-error-page.js +2 -0
  16. package/dist-client/entries/oauth2/oauth2-decision-error-page.js.map +1 -1
  17. package/dist-client/entries/oauth2/oauth2-decision-page.js +2 -0
  18. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  19. package/dist-client/entries/public/home.js +2 -0
  20. package/dist-client/entries/public/home.js.map +1 -1
  21. package/dist-client/entry-control-size-styles.d.ts +15 -0
  22. package/dist-client/entry-control-size-styles.js +37 -0
  23. package/dist-client/entry-control-size-styles.js.map +1 -0
  24. package/dist-client/pages/app-binding/app-bindings.d.ts +0 -2
  25. package/dist-client/pages/app-binding/app-bindings.js +1 -6
  26. package/dist-client/pages/app-binding/app-bindings.js.map +1 -1
  27. package/dist-client/pages/appliance/home.d.ts +0 -2
  28. package/dist-client/pages/appliance/home.js +1 -6
  29. package/dist-client/pages/appliance/home.js.map +1 -1
  30. package/dist-client/pages/application/applications.d.ts +0 -2
  31. package/dist-client/pages/application/applications.js +1 -6
  32. package/dist-client/pages/application/applications.js.map +1 -1
  33. package/dist-client/pages/attribute/attribute-set-item-list.js +2 -1
  34. package/dist-client/pages/attribute/attribute-set-item-list.js.map +1 -1
  35. package/dist-client/pages/attribute/attribute-set-management.d.ts +0 -5
  36. package/dist-client/pages/attribute/attribute-set-management.js +3 -13
  37. package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
  38. package/dist-client/pages/auth-provider/auth-provider-management.d.ts +0 -2
  39. package/dist-client/pages/auth-provider/auth-provider-management.js +1 -6
  40. package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
  41. package/dist-client/pages/domain/domain-management.d.ts +0 -2
  42. package/dist-client/pages/domain/domain-management.js +1 -6
  43. package/dist-client/pages/domain/domain-management.js.map +1 -1
  44. package/dist-client/pages/domain-owner/domain-owner-management.d.ts +0 -2
  45. package/dist-client/pages/domain-owner/domain-owner-management.js +1 -6
  46. package/dist-client/pages/domain-owner/domain-owner-management.js.map +1 -1
  47. package/dist-client/pages/env-var/env-var-list-page.d.ts +0 -2
  48. package/dist-client/pages/env-var/env-var-list-page.js +1 -6
  49. package/dist-client/pages/env-var/env-var-list-page.js.map +1 -1
  50. package/dist-client/pages/partner/partner-management.d.ts +1 -0
  51. package/dist-client/pages/partner/partner-management.js +36 -13
  52. package/dist-client/pages/partner/partner-management.js.map +1 -1
  53. package/dist-client/pages/role/role-list-page.js +0 -1
  54. package/dist-client/pages/role/role-list-page.js.map +1 -1
  55. package/dist-client/pages/user/user-list-page.js +0 -1
  56. package/dist-client/pages/user/user-list-page.js.map +1 -1
  57. package/dist-client/tsconfig.tsbuildinfo +1 -1
  58. package/dist-server/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +5 -4
  60. package/tests/entry-control-sizes.test.ts +91 -0
@@ -1 +1 @@
1
- {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/entries/public/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,yCAAyC,CAA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import { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { i18next, localize } from '@operato/i18n'\n\n@customElement('home-page')\nexport class HomePage extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: block;\n position: relative;\n }\n\n .signin {\n position: absolute;\n right: 20px;\n top: 10px;\n display: inline-block;\n padding: 12px 24px;\n font-size: 16px;\n font-weight: bold;\n color: var(--md-sys-color-on-tertiary-container);\n background-color: var(--md-sys-color-tertiary-container);\n border: none;\n border-radius: 4px;\n text-align: center;\n text-decoration: none;\n transition:\n background-color 0.3s,\n transform 0.3s;\n }\n\n .signin:hover {\n color: var(--md-sys-color-tertiary-container);\n background-color: var(--md-sys-color-on-tertiary-container);\n transform: translateY(-2px);\n }\n\n .signin:active {\n color: var(--md-sys-color-on-tertiary-container);\n background-color: var(--md-sys-color-tertiary-container);\n transform: translateY(0);\n }\n\n [message] {\n background-color: var(--md-sys-color-secondary-container);\n padding: 60px 50px 0 50px;\n color: var(--md-sys-color-on-secondary-container);\n text-align: center;\n font-size: 20px;\n }\n\n [message] strong {\n display: block;\n font-size: 2.5rem;\n }\n\n [message] img {\n width: 800px;\n max-width: 90%;\n display: block;\n margin: auto;\n margin-top: -15px;\n }\n\n [ticket] {\n display: grid;\n grid-template-columns: 96px 1fr;\n width: 450px;\n margin: auto;\n margin-top: -20px;\n margin-bottom: 60px;\n }\n\n [brand] {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 12px;\n overflow: hidden;\n background-color: var(--md-sys-color-primary);\n box-shadow: var(--box-shadow);\n border-right: 3px dotted var(--md-sys-color-secondary-container);\n text-align: center;\n }\n\n [ticket] [content] {\n border-radius: 12px;\n background-color: var(--md-sys-color-tertiary-container);\n padding: var(--spacing-medium) var(--spacing-large);\n box-shadow: var(--box-shadow);\n }\n\n fieldset {\n border: none;\n margin: 0;\n padding: 0;\n }\n\n legend {\n margin: 0;\n padding: var(--spacing-small) 0 var(--spacing-medium) 0;\n font-weight: bold;\n color: var(--legend-color);\n text-transform: uppercase;\n }\n\n input {\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n border: var(--md-sys-color-outline);\n border-radius: var(--border-radius);\n padding: var(--spacing-medium);\n font: var(--input-font);\n }\n\n input[type='text'] {\n min-width: 190px;\n }\n\n input:focus {\n outline: none;\n }\n\n @media screen and (max-width: 480px) {\n [message] {\n padding: 60px 10px 0 10px;\n text-align: center;\n font-size: 14px;\n }\n [message] strong {\n margin-bottom: 15px;\n font-size: 1.6rem;\n line-height: 1.2em;\n }\n [message] img {\n max-width: 100%;\n }\n\n legend {\n padding: 0;\n }\n\n [ticket] {\n display: grid;\n grid-template-columns: 0 1fr;\n width: 90%;\n margin: auto;\n margin-top: -15px;\n margin-bottom: 60px;\n }\n [brand] {\n border: 0;\n }\n [content] {\n border: 1px solid var(--md-sys-color-primary);\n }\n\n fieldset {\n text-align: center;\n }\n input[type='text'] {\n width: calc(100% - 20px);\n margin: var(--spacing-small) 0 var(--spacing-medium) 0;\n text-align: center;\n }\n fieldset md-text-button {\n width: 100%;\n }\n }\n `\n ]\n\n @property({ type: String, attribute: true }) tagline?: string\n @property({ type: String, attribute: true }) explanation1?: string\n @property({ type: String, attribute: true }) explanation2?: string\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n render() {\n var { icon, title } = this.applicationMeta\n\n const tagline = this.tagline || `Join the ${title} Business Program`\n const explanation1 = this.explanation1 || 'Create your free account today.'\n const explanation2 = this.explanation2 || 'Everything you need to go from where you are, to where you want to be.'\n\n return html`\n <a\n class=\"signin\"\n @click=${e => {\n e.preventDefault()\n window.location.href = '/auth/signin'\n }}\n >\n ${i18next.t('button.sign_in')}</a\n >\n\n <div message>\n <strong>${tagline}</strong> ${explanation1} <br />\n ${explanation2}\n <img src=\"/assets/images/invitation.png\" />\n </div>\n\n <div ticket>\n <div brand><img src=${ifDefined(icon)} /></div>\n <div content>\n <form action=\"/auth/join\" accept-charset=\"utf-8\" name=\"join\" method=\"post\">\n <fieldset>\n <legend>${title} invitation ticket</legend>\n <input type=\"email\" name=\"email\" placeholder=\"Enter your email address\" />\n <input type=\"submit\" value=\"join now\" />\n </fieldset>\n </form>\n </div>\n </div>\n `\n }\n\n @query('input[type=email]') firstInput!: HTMLInputElement\n\n firstUpdated() {\n setTimeout(() => {\n this.firstInput.focus()\n }, 100)\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink: HTMLLinkElement | null = document.querySelector('link[rel=\"application-icon\"]')\n var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-name\"]')\n var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-description\"]')\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta ? titleMeta.content : 'Things Factory',\n description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n}\n"]}
1
+ {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/entries/public/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAGpE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;aAClD,WAAM,GAAG;QACd,sBAAsB;QACtB,GAAG,CAAA;;;;;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AAsC,CAAC,CAAA;YAE5G,IAAI,CAAC,gBAAgB,GAAG;gBACtB,IAAI,EAAE,QAAQ,EAAE,IAAI;gBACpB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB;gBACvD,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;aAChF,CAAA;QACH,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;;AAnE4C;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;yCAAiB;AAChB;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;8CAAsB;AACrB;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;8CAAsB;AA2CtC;IAA3B,KAAK,CAAC,mBAAmB,CAAC;8BAAc,gBAAgB;4CAAA;AAtN9C,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA6OpB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/button/elevated-button.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { EntryControlSizeStyles } from '../../entry-control-size-styles.js'\n\n@customElement('home-page')\nexport class HomePage extends localize(i18next)(LitElement) {\n static styles = [\n EntryControlSizeStyles,\n css`\n :host {\n display: block;\n position: relative;\n }\n\n .signin {\n position: absolute;\n right: 20px;\n top: 10px;\n display: inline-block;\n padding: 12px 24px;\n font-size: 16px;\n font-weight: bold;\n color: var(--md-sys-color-on-tertiary-container);\n background-color: var(--md-sys-color-tertiary-container);\n border: none;\n border-radius: 4px;\n text-align: center;\n text-decoration: none;\n transition:\n background-color 0.3s,\n transform 0.3s;\n }\n\n .signin:hover {\n color: var(--md-sys-color-tertiary-container);\n background-color: var(--md-sys-color-on-tertiary-container);\n transform: translateY(-2px);\n }\n\n .signin:active {\n color: var(--md-sys-color-on-tertiary-container);\n background-color: var(--md-sys-color-tertiary-container);\n transform: translateY(0);\n }\n\n [message] {\n background-color: var(--md-sys-color-secondary-container);\n padding: 60px 50px 0 50px;\n color: var(--md-sys-color-on-secondary-container);\n text-align: center;\n font-size: 20px;\n }\n\n [message] strong {\n display: block;\n font-size: 2.5rem;\n }\n\n [message] img {\n width: 800px;\n max-width: 90%;\n display: block;\n margin: auto;\n margin-top: -15px;\n }\n\n [ticket] {\n display: grid;\n grid-template-columns: 96px 1fr;\n width: 450px;\n margin: auto;\n margin-top: -20px;\n margin-bottom: 60px;\n }\n\n [brand] {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 12px;\n overflow: hidden;\n background-color: var(--md-sys-color-primary);\n box-shadow: var(--box-shadow);\n border-right: 3px dotted var(--md-sys-color-secondary-container);\n text-align: center;\n }\n\n [ticket] [content] {\n border-radius: 12px;\n background-color: var(--md-sys-color-tertiary-container);\n padding: var(--spacing-medium) var(--spacing-large);\n box-shadow: var(--box-shadow);\n }\n\n fieldset {\n border: none;\n margin: 0;\n padding: 0;\n }\n\n legend {\n margin: 0;\n padding: var(--spacing-small) 0 var(--spacing-medium) 0;\n font-weight: bold;\n color: var(--legend-color);\n text-transform: uppercase;\n }\n\n input {\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n border: var(--md-sys-color-outline);\n border-radius: var(--border-radius);\n padding: var(--spacing-medium);\n font: var(--input-font);\n }\n\n input[type='text'] {\n min-width: 190px;\n }\n\n input:focus {\n outline: none;\n }\n\n @media screen and (max-width: 480px) {\n [message] {\n padding: 60px 10px 0 10px;\n text-align: center;\n font-size: 14px;\n }\n [message] strong {\n margin-bottom: 15px;\n font-size: 1.6rem;\n line-height: 1.2em;\n }\n [message] img {\n max-width: 100%;\n }\n\n legend {\n padding: 0;\n }\n\n [ticket] {\n display: grid;\n grid-template-columns: 0 1fr;\n width: 90%;\n margin: auto;\n margin-top: -15px;\n margin-bottom: 60px;\n }\n [brand] {\n border: 0;\n }\n [content] {\n border: 1px solid var(--md-sys-color-primary);\n }\n\n fieldset {\n text-align: center;\n }\n input[type='text'] {\n width: calc(100% - 20px);\n margin: var(--spacing-small) 0 var(--spacing-medium) 0;\n text-align: center;\n }\n fieldset md-text-button {\n width: 100%;\n }\n }\n `\n ]\n\n @property({ type: String, attribute: true }) tagline?: string\n @property({ type: String, attribute: true }) explanation1?: string\n @property({ type: String, attribute: true }) explanation2?: string\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n render() {\n var { icon, title } = this.applicationMeta\n\n const tagline = this.tagline || `Join the ${title} Business Program`\n const explanation1 = this.explanation1 || 'Create your free account today.'\n const explanation2 = this.explanation2 || 'Everything you need to go from where you are, to where you want to be.'\n\n return html`\n <a\n class=\"signin\"\n @click=${e => {\n e.preventDefault()\n window.location.href = '/auth/signin'\n }}\n >\n ${i18next.t('button.sign_in')}</a\n >\n\n <div message>\n <strong>${tagline}</strong> ${explanation1} <br />\n ${explanation2}\n <img src=\"/assets/images/invitation.png\" />\n </div>\n\n <div ticket>\n <div brand><img src=${ifDefined(icon)} /></div>\n <div content>\n <form action=\"/auth/join\" accept-charset=\"utf-8\" name=\"join\" method=\"post\">\n <fieldset>\n <legend>${title} invitation ticket</legend>\n <input type=\"email\" name=\"email\" placeholder=\"Enter your email address\" />\n <input type=\"submit\" value=\"join now\" />\n </fieldset>\n </form>\n </div>\n </div>\n `\n }\n\n @query('input[type=email]') firstInput!: HTMLInputElement\n\n firstUpdated() {\n setTimeout(() => {\n this.firstInput.focus()\n }, 100)\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink: HTMLLinkElement | null = document.querySelector('link[rel=\"application-icon\"]')\n var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-name\"]')\n var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-description\"]')\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta ? titleMeta.content : 'Things Factory',\n description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The sign-in family keeps Material's own control sizes.
3
+ *
4
+ * Office screens are compact: the shell theme sets Material buttons to 32px (material-theme.css).
5
+ * A sign-in, sign-up, password or consent screen holds nothing but a few fields and buttons, so its
6
+ * buttons keep Material's 40px next to the 56px text fields (user decision 2026-09-17).
7
+ *
8
+ * A custom property set to `initial` is empty, so a Material component falls back to its own default
9
+ * (button 40px). No Material value is written here, and the shell's values reach
10
+ * every other screen unchanged.
11
+ *
12
+ * The list is every Material size the shell theme sets; tests/entry-control-sizes.test.ts fails when
13
+ * the theme gains one this list does not reset, or when a sign-in family element leaves it out.
14
+ */
15
+ export declare const EntryControlSizeStyles: import("lit").CSSResult;
@@ -0,0 +1,37 @@
1
+ import { css } from 'lit';
2
+ /**
3
+ * The sign-in family keeps Material's own control sizes.
4
+ *
5
+ * Office screens are compact: the shell theme sets Material buttons to 32px (material-theme.css).
6
+ * A sign-in, sign-up, password or consent screen holds nothing but a few fields and buttons, so its
7
+ * buttons keep Material's 40px next to the 56px text fields (user decision 2026-09-17).
8
+ *
9
+ * A custom property set to `initial` is empty, so a Material component falls back to its own default
10
+ * (button 40px). No Material value is written here, and the shell's values reach
11
+ * every other screen unchanged.
12
+ *
13
+ * The list is every Material size the shell theme sets; tests/entry-control-sizes.test.ts fails when
14
+ * the theme gains one this list does not reset, or when a sign-in family element leaves it out.
15
+ */
16
+ export const EntryControlSizeStyles = css `
17
+ :host {
18
+ --md-filled-button-container-height: initial;
19
+ --md-outlined-button-container-height: initial;
20
+ --md-text-button-container-height: initial;
21
+ --md-elevated-button-container-height: initial;
22
+ --md-filled-tonal-button-container-height: initial;
23
+ }
24
+
25
+ /*
26
+ * ButtonContainerStyles points the Material buttons inside .button-container at the page action
27
+ * height (32px). The consent page lays its buttons out with it; they keep Material's height too.
28
+ */
29
+ :host .button-container {
30
+ --md-filled-button-container-height: initial;
31
+ --md-outlined-button-container-height: initial;
32
+ --md-text-button-container-height: initial;
33
+ --md-elevated-button-container-height: initial;
34
+ --md-filled-tonal-button-container-height: initial;
35
+ }
36
+ `;
37
+ //# sourceMappingURL=entry-control-size-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-control-size-styles.js","sourceRoot":"","sources":["../client/entry-control-size-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;CAoBxC,CAAA","sourcesContent":["import { css } from 'lit'\n\n/**\n * The sign-in family keeps Material's own control sizes.\n *\n * Office screens are compact: the shell theme sets Material buttons to 32px (material-theme.css).\n * A sign-in, sign-up, password or consent screen holds nothing but a few fields and buttons, so its\n * buttons keep Material's 40px next to the 56px text fields (user decision 2026-09-17).\n *\n * A custom property set to `initial` is empty, so a Material component falls back to its own default\n * (button 40px). No Material value is written here, and the shell's values reach\n * every other screen unchanged.\n *\n * The list is every Material size the shell theme sets; tests/entry-control-sizes.test.ts fails when\n * the theme gains one this list does not reset, or when a sign-in family element leaves it out.\n */\nexport const EntryControlSizeStyles = css`\n :host {\n --md-filled-button-container-height: initial;\n --md-outlined-button-container-height: initial;\n --md-text-button-container-height: initial;\n --md-elevated-button-container-height: initial;\n --md-filled-tonal-button-container-height: initial;\n }\n\n /*\n * ButtonContainerStyles points the Material buttons inside .button-container at the page action\n * height (32px). The consent page lays its buttons out with it; they keep Material's height too.\n */\n :host .button-container {\n --md-filled-button-container-height: initial;\n --md-outlined-button-container-height: initial;\n --md-text-button-container-height: initial;\n --md-elevated-button-container-height: initial;\n --md-filled-tonal-button-container-height: initial;\n }\n`\n"]}
@@ -1,6 +1,5 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import '@operato/data-grist/ox-grist.js';
3
- import '@operato/context/ox-context-page-toolbar.js';
4
3
  import type { FetchOption } from '@operato/data-grist';
5
4
  import { PageView } from '@operato/shell';
6
5
  import '../../components/app-binding-detail.js';
@@ -51,7 +50,6 @@ export declare class AppBindings extends AppBindings_base {
51
50
  action: () => void;
52
51
  icon: string;
53
52
  }[];
54
- toolbar: boolean;
55
53
  };
56
54
  render(): import("lit-html").TemplateResult<1>;
57
55
  pageInitialized(): Promise<void>;
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
3
  import '@operato/data-grist/ox-grist.js';
4
- import '@operato/context/ox-context-page-toolbar.js';
5
4
  import gql from 'graphql-tag';
6
5
  import { css, html } from 'lit';
7
6
  import { customElement, property, query } from 'lit/decorators.js';
@@ -82,8 +81,7 @@ let AppBindings = class AppBindings extends p13n(localize(i18next)(PageView)) {
82
81
  action: () => navigate('applications'),
83
82
  icon: 'apps'
84
83
  }
85
- ],
86
- toolbar: false
84
+ ]
87
85
  };
88
86
  }
89
87
  render() {
@@ -94,9 +92,6 @@ let AppBindings = class AppBindings extends p13n(localize(i18next)(PageView)) {
94
92
  .fetchHandler=${this.fetchHandler.bind(this)}
95
93
  .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')}
96
94
  >
97
- <div slot="headroom" class="header">
98
- <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
99
- </div>
100
95
  </ox-grist>
101
96
 
102
97
  ${this.failed ? html `<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}
@@ -1 +1 @@
1
- {"version":3,"file":"app-bindings.js","sourceRoot":"","sources":["../../../client/pages/app-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UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAA;QAEvF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QAEpB,OAAO;YACL,KAAK;YACL,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;SAChG,CAAA;IACH,CAAC;;AA9K4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;2CAAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCAAoE;AAGlE;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;2CAAwB;AAEzB;IAA1B,KAAK,CAAC,UAAU,CAAC;;0CAA0B;AAhCjC,WAAW;IADvB,aAAa,CAAC,mBAAmB,CAAC;GACtB,WAAW,CAwMvB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport '@operato/data-grist/ox-grist.js'\nimport '@operato/context/ox-context-page-toolbar.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport type { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { navigate, PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport '../../components/app-binding-detail.js'\nimport { listOutcome, pageFromResponse } from '../../utils/list-result.js'\n\n/**\n * Applications bound to this domain.\n *\n * A binding is a `User` row with `userType: 'application'` — the account an application signs\n * in as. The list shows who it is and what it may do; what it signs in *with* is elsewhere.\n *\n * ── The server answers honestly now ──────────────────────────────────────────\n * Until dde62cd6a1 this query paged before it filtered: the database took a page of users of\n * every type, JavaScript kept the applications among them, and the total reported how many\n * survived that one page. A grid told there were three when there were thirty never offered a\n * second page. Wiring paging up was pointless until that was fixed; it works now.\n *\n * ── ⚠ The refresh token is not asked for, and a test holds that ──────────────\n * AppBinding's refresh token is the application's actual credential — oauth2-server.ts writes\n * it into the password column verbatim, not hashed — and the field carries its own\n * privilege directive for security:query.\n *\n * A credential that can be exchanged for access tokens does not belong in a grid cell, where\n * it sits in plain text beside a name for anyone who can open the screen, and in any\n * screenshot of it. `app-binding-list-query.test.ts` fails if the word appears here.\n */\n@customElement('app-bindings-page')\nexport class AppBindings extends p13n(localize(i18next)(PageView)) {\n static styles = [\n CommonGristStyles,\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n [failed] {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-error);\n font: var(--label-font, inherit);\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) config: any\n @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'\n\n /** The last fetch did not answer. Distinct from answering with nothing. */\n @property({ type: Boolean }) failed: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.bound applications'),\n help: 'auth/application',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n actions: [\n {\n title: i18next.t('text.applications'),\n action: () => navigate('applications'),\n icon: 'apps'\n }\n ],\n toolbar: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${this.mode}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n </ox-grist>\n\n ${this.failed ? html`<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}\n `\n }\n\n async pageInitialized() {\n this.config = {\n rows: { appendable: false, selectable: { multiple: false } },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'chevron_right',\n title: i18next.t('button.detail'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) {\n this.openDetail(record.id)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n sortable: true,\n width: 180\n },\n {\n type: 'string',\n name: 'applicationName',\n header: i18next.t('label.application'),\n record: { editable: false },\n width: 180\n },\n {\n type: 'string',\n name: 'email',\n header: i18next.t('field.email'),\n record: { editable: false },\n sortable: true,\n width: 220\n },\n {\n type: 'string',\n name: 'scope',\n header: i18next.t('field.scope'),\n record: { editable: false },\n width: 220\n },\n {\n type: 'string',\n name: 'status',\n header: i18next.t('field.status'),\n record: { align: 'center', editable: false },\n sortable: true,\n width: 130\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated at'),\n sortable: true,\n width: 180\n }\n ]\n }\n }\n\n /*\n * A binding is not authored — it is what an application ends up with after the OAuth flow —\n * so this popup shows one and offers the two things a person can do to it. `app-binding/{id}`\n * was a route; nothing outside auth-ui linked to it.\n */\n private openDetail(appBindingId: string) {\n const popup = openPopup(\n html`<app-binding-detail\n .appBindingId=${appBindingId}\n @app-binding-changed=${() => this.grist.fetch()}\n @close=${() => popup.close()}\n ></app-binding-detail>`,\n {\n backdrop: true,\n size: 'medium',\n title: i18next.t('text.bound application')\n }\n )\n }\n\n async pageUpdated(_changes: any, _lifecycle: any) {\n if (this.active) {\n await this.updateComplete\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n appBindings(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n email\n status\n scope\n updatedAt\n application {\n id\n name\n }\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings },\n context: gqlContext()\n })\n\n const { items, total, failed } = listOutcome(pageFromResponse(response, 'appBindings'))\n\n this.failed = failed\n\n return {\n total,\n records: items.map((item: any) => ({ ...item, applicationName: item.application?.name || '' }))\n }\n }\n}\n"]}
1
+ {"version":3,"file":"app-bindings.js","sourceRoot":"","sources":["../../../client/pages/app-binding/app-bindings.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,eA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;0CAA0B;AAhCjC,WAAW;IADvB,aAAa,CAAC,mBAAmB,CAAC;GACtB,WAAW,CAoMvB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport '@operato/data-grist/ox-grist.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport type { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { navigate, PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport '../../components/app-binding-detail.js'\nimport { listOutcome, pageFromResponse } from '../../utils/list-result.js'\n\n/**\n * Applications bound to this domain.\n *\n * A binding is a `User` row with `userType: 'application'` — the account an application signs\n * in as. The list shows who it is and what it may do; what it signs in *with* is elsewhere.\n *\n * ── The server answers honestly now ──────────────────────────────────────────\n * Until dde62cd6a1 this query paged before it filtered: the database took a page of users of\n * every type, JavaScript kept the applications among them, and the total reported how many\n * survived that one page. A grid told there were three when there were thirty never offered a\n * second page. Wiring paging up was pointless until that was fixed; it works now.\n *\n * ── ⚠ The refresh token is not asked for, and a test holds that ──────────────\n * AppBinding's refresh token is the application's actual credential — oauth2-server.ts writes\n * it into the password column verbatim, not hashed — and the field carries its own\n * privilege directive for security:query.\n *\n * A credential that can be exchanged for access tokens does not belong in a grid cell, where\n * it sits in plain text beside a name for anyone who can open the screen, and in any\n * screenshot of it. `app-binding-list-query.test.ts` fails if the word appears here.\n */\n@customElement('app-bindings-page')\nexport class AppBindings extends p13n(localize(i18next)(PageView)) {\n static styles = [\n CommonGristStyles,\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n [failed] {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-error);\n font: var(--label-font, inherit);\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) config: any\n @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'\n\n /** The last fetch did not answer. Distinct from answering with nothing. */\n @property({ type: Boolean }) failed: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.bound applications'),\n help: 'auth/application',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n actions: [\n {\n title: i18next.t('text.applications'),\n action: () => navigate('applications'),\n icon: 'apps'\n }\n ]\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${this.mode}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n </ox-grist>\n\n ${this.failed ? html`<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}\n `\n }\n\n async pageInitialized() {\n this.config = {\n rows: { appendable: false, selectable: { multiple: false } },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'chevron_right',\n title: i18next.t('button.detail'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) {\n this.openDetail(record.id)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n sortable: true,\n width: 180\n },\n {\n type: 'string',\n name: 'applicationName',\n header: i18next.t('label.application'),\n record: { editable: false },\n width: 180\n },\n {\n type: 'string',\n name: 'email',\n header: i18next.t('field.email'),\n record: { editable: false },\n sortable: true,\n width: 220\n },\n {\n type: 'string',\n name: 'scope',\n header: i18next.t('field.scope'),\n record: { editable: false },\n width: 220\n },\n {\n type: 'string',\n name: 'status',\n header: i18next.t('field.status'),\n record: { align: 'center', editable: false },\n sortable: true,\n width: 130\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated at'),\n sortable: true,\n width: 180\n }\n ]\n }\n }\n\n /*\n * A binding is not authored — it is what an application ends up with after the OAuth flow —\n * so this popup shows one and offers the two things a person can do to it. `app-binding/{id}`\n * was a route; nothing outside auth-ui linked to it.\n */\n private openDetail(appBindingId: string) {\n const popup = openPopup(\n html`<app-binding-detail\n .appBindingId=${appBindingId}\n @app-binding-changed=${() => this.grist.fetch()}\n @close=${() => popup.close()}\n ></app-binding-detail>`,\n {\n backdrop: true,\n size: 'medium',\n title: i18next.t('text.bound application')\n }\n )\n }\n\n async pageUpdated(_changes: any, _lifecycle: any) {\n if (this.active) {\n await this.updateComplete\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n appBindings(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n email\n status\n scope\n updatedAt\n application {\n id\n name\n }\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings },\n context: gqlContext()\n })\n\n const { items, total, failed } = listOutcome(pageFromResponse(response, 'appBindings'))\n\n this.failed = failed\n\n return {\n total,\n records: items.map((item: any) => ({ ...item, applicationName: item.application?.name || '' }))\n }\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import '@operato/data-grist/ox-grist.js';
3
- import '@operato/context/ox-context-page-toolbar.js';
4
3
  import type { FetchOption } from '@operato/data-grist';
5
4
  import { PageView } from '@operato/shell';
6
5
  import '../../components/appliance-editor.js';
@@ -49,7 +48,6 @@ export declare class Appliances extends Appliances_base {
49
48
  action: () => void;
50
49
  icon: string;
51
50
  }[];
52
- toolbar: boolean;
53
51
  };
54
52
  render(): import("lit-html").TemplateResult<1>;
55
53
  pageInitialized(): Promise<void>;
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
3
  import '@operato/data-grist/ox-grist.js';
4
- import '@operato/context/ox-context-page-toolbar.js';
5
4
  import gql from 'graphql-tag';
6
5
  import { css, html } from 'lit';
7
6
  import { customElement, property, query } from 'lit/decorators.js';
@@ -80,8 +79,7 @@ let Appliances = class Appliances extends p13n(localize(i18next)(PageView)) {
80
79
  action: () => this.openEditor(),
81
80
  icon: 'add'
82
81
  }
83
- ],
84
- toolbar: false
82
+ ]
85
83
  };
86
84
  }
87
85
  render() {
@@ -92,9 +90,6 @@ let Appliances = class Appliances extends p13n(localize(i18next)(PageView)) {
92
90
  .fetchHandler=${this.fetchHandler.bind(this)}
93
91
  .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')}
94
92
  >
95
- <div slot="headroom" class="header">
96
- <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
97
- </div>
98
93
  </ox-grist>
99
94
 
100
95
  ${this.failed ? html `<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}
@@ -1 +1 @@
1
- {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/pages/appliance/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,iCAAiC,CAAA;AACxC,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,C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AAA;IAClC,CAAC;;AAjL4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;0CAAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAAoE;AAGlE;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;0CAAwB;AAEzB;IAA1B,KAAK,CAAC,UAAU,CAAC;;yCAA0B;AAhCjC,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CA2MtB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport '@operato/data-grist/ox-grist.js'\nimport '@operato/context/ox-context-page-toolbar.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport type { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport '../../components/appliance-editor.js'\nimport { listOutcome, pageFromResponse } from '../../utils/list-result.js'\n\n/**\n * Registered appliances.\n *\n * ── What this screen looked like before ──────────────────────────────────────\n * A hand-written table with no paging, sorting or search, and three columns that were not\n * data: \"API health\" printed OK, \"Installs\" printed 1, \"status\" printed draft, identical on\n * every row. An appliance that had never checked in read exactly like one reporting fine.\n * Those are gone — Appliance declares none of the three — and the columns here are the\n * fields it does declare.\n *\n * ── ⚠ The access token is not asked for, and a test holds that ──────────────\n * `Appliance.accessToken` carries its own\n * `@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)`. A list\n * is the wrong place for it regardless of who may read it: a token in a grid cell is a token\n * in plain text beside a name, visible to everyone who can open the screen and to anyone\n * looking over their shoulder. The screens that genuinely need it ask one record at a time.\n *\n * `appliance-list-query.test.ts` fails if the word reappears here.\n */\n@customElement('appliance-home')\nexport class Appliances extends p13n(localize(i18next)(PageView)) {\n static styles = [\n CommonGristStyles,\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n [failed] {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-error);\n font: var(--label-font, inherit);\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) config: any\n @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'\n\n /** The last fetch did not answer. Distinct from answering with nothing. */\n @property({ type: Boolean }) failed: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.appliances'),\n help: 'auth/appliance',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n actions: [\n {\n title: i18next.t('button.register'),\n action: () => this.openEditor(),\n icon: 'add'\n }\n ],\n toolbar: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${this.mode}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n </ox-grist>\n\n ${this.failed ? html`<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}\n `\n }\n\n async pageInitialized() {\n this.config = {\n rows: { appendable: false, selectable: { multiple: false } },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'chevron_right',\n title: i18next.t('button.detail'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) {\n this.openEditor(record.id)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n sortable: true,\n width: 180\n },\n {\n type: 'string',\n name: 'serialNo',\n header: i18next.t('field.serial-no'),\n record: { editable: false },\n sortable: true,\n width: 160\n },\n {\n type: 'string',\n name: 'brand',\n header: i18next.t('field.brand'),\n record: { editable: false },\n sortable: true,\n width: 140\n },\n {\n type: 'string',\n name: 'model',\n header: i18next.t('field.model'),\n record: { editable: false },\n sortable: true,\n width: 140\n },\n {\n type: 'string',\n name: 'netmask',\n header: i18next.t('field.netmask'),\n record: { editable: false },\n width: 160\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false },\n width: 240\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated at'),\n sortable: true,\n width: 180\n }\n ]\n }\n }\n\n /*\n * Registering and editing both happen here, over the list, the way every other resource in\n * this package works. `appliance-register` and `appliance/{id}` were routes; nothing outside\n * auth-ui linked to either.\n */\n private openEditor(applianceId?: string) {\n const popup = openPopup(\n html`<appliance-editor\n .applianceId=${applianceId}\n @appliance-changed=${() => this.grist.fetch()}\n @close=${() => popup.close()}\n ></appliance-editor>`,\n {\n backdrop: true,\n size: 'medium',\n title: applianceId ? i18next.t('text.appliance') : i18next.t('text.register new appliance')\n }\n )\n }\n\n async pageUpdated(_changes: any, _lifecycle: any) {\n if (this.active) {\n await this.updateComplete\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n appliances(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n serialNo\n brand\n model\n netmask\n description\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings },\n context: gqlContext()\n })\n\n const { items, total, failed } = listOutcome(pageFromResponse(response, 'appliances'))\n\n this.failed = failed\n\n return { total, records: items }\n }\n}\n"]}
1
+ {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/pages/appliance/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC,OAAO,sCAAsC,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;IAA1D;;QAyBwB,WAAM,GAAY,KAAK,CAAA;QAExB,SAAI,GAA6B,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;QAE/F,2EAA2E;QAC9C,WAAM,GAAY,KAAK,CAAA;IAyKtD,CAAC;aAtMQ,WAAM,GAAG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IAAI,EAAE,KAAK,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAe;QAC1E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;OAgBT;YACD,SAAS,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE;YAC7D,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAA;QAEtF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QAEpB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;IAClC,CAAC;;AA7K4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;0CAAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAAoE;AAGlE;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;0CAAwB;AAEzB;IAA1B,KAAK,CAAC,UAAU,CAAC;;yCAA0B;AAhCjC,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CAuMtB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport '@operato/data-grist/ox-grist.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport type { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport '../../components/appliance-editor.js'\nimport { listOutcome, pageFromResponse } from '../../utils/list-result.js'\n\n/**\n * Registered appliances.\n *\n * ── What this screen looked like before ──────────────────────────────────────\n * A hand-written table with no paging, sorting or search, and three columns that were not\n * data: \"API health\" printed OK, \"Installs\" printed 1, \"status\" printed draft, identical on\n * every row. An appliance that had never checked in read exactly like one reporting fine.\n * Those are gone — Appliance declares none of the three — and the columns here are the\n * fields it does declare.\n *\n * ── ⚠ The access token is not asked for, and a test holds that ──────────────\n * `Appliance.accessToken` carries its own\n * `@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)`. A list\n * is the wrong place for it regardless of who may read it: a token in a grid cell is a token\n * in plain text beside a name, visible to everyone who can open the screen and to anyone\n * looking over their shoulder. The screens that genuinely need it ask one record at a time.\n *\n * `appliance-list-query.test.ts` fails if the word reappears here.\n */\n@customElement('appliance-home')\nexport class Appliances extends p13n(localize(i18next)(PageView)) {\n static styles = [\n CommonGristStyles,\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n [failed] {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-error);\n font: var(--label-font, inherit);\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) config: any\n @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'\n\n /** The last fetch did not answer. Distinct from answering with nothing. */\n @property({ type: Boolean }) failed: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.appliances'),\n help: 'auth/appliance',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n actions: [\n {\n title: i18next.t('button.register'),\n action: () => this.openEditor(),\n icon: 'add'\n }\n ]\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${this.mode}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n </ox-grist>\n\n ${this.failed ? html`<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}\n `\n }\n\n async pageInitialized() {\n this.config = {\n rows: { appendable: false, selectable: { multiple: false } },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'chevron_right',\n title: i18next.t('button.detail'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) {\n this.openEditor(record.id)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n sortable: true,\n width: 180\n },\n {\n type: 'string',\n name: 'serialNo',\n header: i18next.t('field.serial-no'),\n record: { editable: false },\n sortable: true,\n width: 160\n },\n {\n type: 'string',\n name: 'brand',\n header: i18next.t('field.brand'),\n record: { editable: false },\n sortable: true,\n width: 140\n },\n {\n type: 'string',\n name: 'model',\n header: i18next.t('field.model'),\n record: { editable: false },\n sortable: true,\n width: 140\n },\n {\n type: 'string',\n name: 'netmask',\n header: i18next.t('field.netmask'),\n record: { editable: false },\n width: 160\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false },\n width: 240\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated at'),\n sortable: true,\n width: 180\n }\n ]\n }\n }\n\n /*\n * Registering and editing both happen here, over the list, the way every other resource in\n * this package works. `appliance-register` and `appliance/{id}` were routes; nothing outside\n * auth-ui linked to either.\n */\n private openEditor(applianceId?: string) {\n const popup = openPopup(\n html`<appliance-editor\n .applianceId=${applianceId}\n @appliance-changed=${() => this.grist.fetch()}\n @close=${() => popup.close()}\n ></appliance-editor>`,\n {\n backdrop: true,\n size: 'medium',\n title: applianceId ? i18next.t('text.appliance') : i18next.t('text.register new appliance')\n }\n )\n }\n\n async pageUpdated(_changes: any, _lifecycle: any) {\n if (this.active) {\n await this.updateComplete\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n appliances(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n serialNo\n brand\n model\n netmask\n description\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings },\n context: gqlContext()\n })\n\n const { items, total, failed } = listOutcome(pageFromResponse(response, 'appliances'))\n\n this.failed = failed\n\n return { total, records: items }\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import '@operato/data-grist/ox-grist.js';
3
- import '@operato/context/ox-context-page-toolbar.js';
4
3
  import type { FetchOption } from '@operato/data-grist';
5
4
  import { PageView } from '@operato/shell';
6
5
  import '../../components/application-editor.js';
@@ -49,7 +48,6 @@ export declare class Applications extends Applications_base {
49
48
  action: () => void;
50
49
  icon: string;
51
50
  }[];
52
- toolbar: boolean;
53
51
  };
54
52
  render(): import("lit-html").TemplateResult<1>;
55
53
  pageInitialized(): Promise<void>;
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
3
  import '@operato/data-grist/ox-grist.js';
4
- import '@operato/context/ox-context-page-toolbar.js';
5
4
  import gql from 'graphql-tag';
6
5
  import { css, html } from 'lit';
7
6
  import { customElement, property, query } from 'lit/decorators.js';
@@ -81,8 +80,7 @@ let Applications = class Applications extends p13n(localize(i18next)(PageView))
81
80
  action: () => this.openEditor(),
82
81
  icon: 'add'
83
82
  }
84
- ],
85
- toolbar: false
83
+ ]
86
84
  };
87
85
  }
88
86
  render() {
@@ -93,9 +91,6 @@ let Applications = class Applications extends p13n(localize(i18next)(PageView))
93
91
  .fetchHandler=${this.fetchHandler.bind(this)}
94
92
  .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')}
95
93
  >
96
- <div slot="headroom" class="header">
97
- <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
98
- </div>
99
94
  </ox-grist>
100
95
 
101
96
  ${this.failed ? html `<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}
@@ -1 +1 @@
1
- {"version":3,"file":"applications.js","sourceRoot":"","sources":["../../../client/pages/application/applications.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,iCAAiC,CAAA;AACxC,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC,OAAO,wCAAwC,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AAEI,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\nimport '@operato/context/ox-context-page-toolbar.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport type { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport '../../components/application-editor.js'\nimport { applicationStatusLabel } from '../../utils/application-status.js'\nimport { listOutcome, pageFromResponse } from '../../utils/list-result.js'\n\n/**\n * Registered applications.\n *\n * ── What this screen looked like before ──────────────────────────────────────\n * A hand-written `<table>` with no paging, no sort and no search, and three columns that\n * were not data at all: \"API health\" printed OK, \"Installs\" printed 1, \"status\" printed\n * draft — written into the markup, identical on every row. The previous commit removed the\n * two the server cannot answer and made status real. This one gives the list the same shape\n * as every other list in the product.\n *\n * The server was already ready for it: `applications` takes ListParam and declares\n * `searchables: ['name', 'description']`, so paging, sorting and the header's search box all\n * work by passing the grist's own options through.\n *\n * ── Why the row does not carry health or install counts ──────────────────────\n * Because Application does not declare them. If they arrive one day, they are columns; until\n * then the screen says what it knows. See `utils/application-status.ts` for the matching rule\n * on values the screen has no word for.\n */\n@customElement('applications-page')\nexport class Applications extends p13n(localize(i18next)(PageView)) {\n static styles = [\n CommonGristStyles,\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n [failed] {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-error);\n font: var(--label-font, inherit);\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) config: any\n @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'\n\n /** The last fetch did not answer. Distinct from answering with nothing. */\n @property({ type: Boolean }) failed: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.applications'),\n help: 'auth/application',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n actions: [\n {\n title: i18next.t('button.register'),\n action: () => this.openEditor(),\n icon: 'add'\n }\n ],\n toolbar: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${this.mode}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <div slot=\"headroom\" class=\"header\">\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}></ox-context-page-toolbar>\n </div>\n </ox-grist>\n\n ${this.failed ? html`<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}\n `\n }\n\n async pageInitialized() {\n this.config = {\n rows: { appendable: false, selectable: { multiple: false } },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'chevron_right',\n title: i18next.t('button.detail'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) {\n this.openEditor(record.id)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n sortable: true,\n width: 200\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false },\n width: 260\n },\n {\n type: 'string',\n name: 'type',\n header: i18next.t('field.type'),\n record: { align: 'center', editable: false },\n sortable: true,\n width: 120\n },\n {\n type: 'string',\n name: 'statusLabel',\n header: i18next.t('field.status'),\n record: { align: 'center', editable: false },\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated at'),\n sortable: true,\n width: 180\n }\n ]\n }\n }\n\n /*\n * Registering and editing both happen over the list, the way every other resource in this\n * package works. `application-register` and `application/{id}` were routes; nothing outside\n * auth-ui linked to either.\n */\n private openEditor(applicationId?: string) {\n const popup = openPopup(\n html`<application-editor\n .applicationId=${applicationId}\n @application-changed=${() => this.grist.fetch()}\n @close=${() => popup.close()}\n ></application-editor>`,\n {\n backdrop: true,\n size: 'medium',\n title: applicationId ? i18next.t('text.application') : i18next.t('text.register new application')\n }\n )\n }\n\n async pageUpdated(_changes: any, _lifecycle: any) {\n if (this.active) {\n await this.updateComplete\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n applications(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n type\n status\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings },\n context: gqlContext()\n })\n\n const { items, total, failed } = listOutcome(pageFromResponse(response, 'applications'))\n\n this.failed = failed\n\n /*\n * The status is turned into words here rather than in a cell renderer so the rule lives\n * in one tested place — a value this screen has no word for is printed as it arrived.\n */\n return {\n total,\n records: items.map((item: any) => ({\n ...item,\n statusLabel: applicationStatusLabel(item.status, (key: string) => i18next.t(key))\n }))\n }\n }\n}\n"]}
1
+ {"version":3,"file":"applications.js","sourceRoot":"","sources":["../../../client/pages/application/applications.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EA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AAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAoE;AAGlE;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4CAAwB;AAEzB;IAA1B,KAAK,CAAC,UAAU,CAAC;;2CAA0B;AAhCjC,YAAY;IADxB,aAAa,CAAC,mBAAmB,CAAC;GACtB,YAAY,CA+LxB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport '@operato/data-grist/ox-grist.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport type { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { p13n } from '@operato/p13n'\n\nimport '../../components/application-editor.js'\nimport { applicationStatusLabel } from '../../utils/application-status.js'\nimport { listOutcome, pageFromResponse } from '../../utils/list-result.js'\n\n/**\n * Registered applications.\n *\n * ── What this screen looked like before ──────────────────────────────────────\n * A hand-written `<table>` with no paging, no sort and no search, and three columns that\n * were not data at all: \"API health\" printed OK, \"Installs\" printed 1, \"status\" printed\n * draft — written into the markup, identical on every row. The previous commit removed the\n * two the server cannot answer and made status real. This one gives the list the same shape\n * as every other list in the product.\n *\n * The server was already ready for it: `applications` takes ListParam and declares\n * `searchables: ['name', 'description']`, so paging, sorting and the header's search box all\n * work by passing the grist's own options through.\n *\n * ── Why the row does not carry health or install counts ──────────────────────\n * Because Application does not declare them. If they arrive one day, they are columns; until\n * then the screen says what it knows. See `utils/application-status.ts` for the matching rule\n * on values the screen has no word for.\n */\n@customElement('applications-page')\nexport class Applications extends p13n(localize(i18next)(PageView)) {\n static styles = [\n CommonGristStyles,\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n [failed] {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-error);\n font: var(--label-font, inherit);\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) config: any\n @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'\n\n /** The last fetch did not answer. Distinct from answering with nothing. */\n @property({ type: Boolean }) failed: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.applications'),\n help: 'auth/application',\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n actions: [\n {\n title: i18next.t('button.register'),\n action: () => this.openEditor(),\n icon: 'add'\n }\n ]\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${this.mode}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n </ox-grist>\n\n ${this.failed ? html`<div failed>${i18next.t('text.the list could not be loaded')}</div>` : ''}\n `\n }\n\n async pageInitialized() {\n this.config = {\n rows: { appendable: false, selectable: { multiple: false } },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'chevron_right',\n title: i18next.t('button.detail'),\n handlers: {\n click: (_columns: any, _data: any, _column: any, record: any) => {\n if (record?.id) {\n this.openEditor(record.id)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n sortable: true,\n width: 200\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false },\n width: 260\n },\n {\n type: 'string',\n name: 'type',\n header: i18next.t('field.type'),\n record: { align: 'center', editable: false },\n sortable: true,\n width: 120\n },\n {\n type: 'string',\n name: 'statusLabel',\n header: i18next.t('field.status'),\n record: { align: 'center', editable: false },\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated at'),\n sortable: true,\n width: 180\n }\n ]\n }\n }\n\n /*\n * Registering and editing both happen over the list, the way every other resource in this\n * package works. `application-register` and `application/{id}` were routes; nothing outside\n * auth-ui linked to either.\n */\n private openEditor(applicationId?: string) {\n const popup = openPopup(\n html`<application-editor\n .applicationId=${applicationId}\n @application-changed=${() => this.grist.fetch()}\n @close=${() => popup.close()}\n ></application-editor>`,\n {\n backdrop: true,\n size: 'medium',\n title: applicationId ? i18next.t('text.application') : i18next.t('text.register new application')\n }\n )\n }\n\n async pageUpdated(_changes: any, _lifecycle: any) {\n if (this.active) {\n await this.updateComplete\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n applications(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n type\n status\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters, pagination: { page, limit }, sortings },\n context: gqlContext()\n })\n\n const { items, total, failed } = listOutcome(pageFromResponse(response, 'applications'))\n\n this.failed = failed\n\n /*\n * The status is turned into words here rather than in a cell renderer so the rule lives\n * in one tested place — a value this screen has no word for is printed as it arrived.\n */\n return {\n total,\n records: items.map((item: any) => ({\n ...item,\n statusLabel: applicationStatusLabel(item.status, (key: string) => i18next.t(key))\n }))\n }\n }\n}\n"]}
@@ -3,6 +3,7 @@ import '@material/web/icon/icon.js';
3
3
  import gql from 'graphql-tag';
4
4
  import { css, html, LitElement } from 'lit';
5
5
  import { customElement, property, query, state } from 'lit/decorators.js';
6
+ import { OxPrompt } from '@operato/popup';
6
7
  import { client } from '@operato/graphql';
7
8
  import { i18next, localize } from '@operato/i18n';
8
9
  import { isMobileDevice } from '@operato/utils';
@@ -207,7 +208,7 @@ let AttributeSetItemList = class AttributeSetItemList extends localize(i18next)(
207
208
  }
208
209
  }
209
210
  async deleteAttributeSetItems() {
210
- if (!confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
211
+ if (!await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) {
211
212
  return;
212
213
  }
213
214
  this.grist.deleteSelectedRecords(false);
@@ -1 +1 @@
1
- {"version":3,"file":"attribute-set-item-list.js","sourceRoot":"","sources":["../../../client/pages/attribute/attribute-set-item-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;aAKvD,WAAM,GAAG;QACd,kBAAkB;QAClB,GAAG,CAAA;;;;;;;;;;;KAWF;KACF,AAdY,CAcZ;IAID,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,WAAW;wBACV,IAAI,CAAC,YA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EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE;gBACrB,KAAK,EAAE;oBACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO;oBAC9B,MAAM,EAAE,GAAG;iBACZ;aACF;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACrB,MAAM,QAAQ,CAAC,aAAa,CAC1B,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE;wBAC7C,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;qBAC5B,CAAC;iBACH;aACF,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,uBAAuB;QACnC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAC3E,OAAM;QACR,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC;;AA5N2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAe;AAEjC;IAAR,KAAK,EAAE;;yDAAiB;AAkBE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;mDAAA;AArBxC,oBAAoB;IADzB,aAAa,CAAC,yBAAyB,CAAC;GACnC,oBAAoB,CA8NzB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport gql from 'graphql-tag'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { CommonHeaderStyles } from '@operato/styles'\n\n@customElement('attribute-set-item-list')\nclass AttributeSetItemList extends localize(i18next)(LitElement) {\n @property({ type: Object }) attribute: any\n\n @state() gristConfig: any\n\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @query('ox-grist') private grist!: DataGrist\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button danger @click=${this.deleteAttributeSetItems.bind(this)}>\n <md-icon>delete_forever</md-icon>${i18next.t('button.delete')}\n </button>\n <button @click=${this.updateAttributeSetItems.bind(this)} done>\n <md-icon>save</md-icon>${i18next.t('button.save')}\n </button>\n </div>\n `\n }\n\n async firstUpdated() {\n this.gristConfig = {\n list: { fields: ['name', 'description', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n width: 140\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'varname',\n name: 'tag',\n header: i18next.t('field.tag'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'checkbox',\n name: 'hidden',\n label: true,\n header: i18next.t('field.hidden'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n options: ['', 'number', 'text', 'select', 'boolean', 'date', 'datetime', 'file', 'secret'],\n editable: true\n },\n width: 120\n },\n {\n type: 'parameters',\n name: 'options',\n header: i18next.t('field.options'),\n record: {\n editable: true,\n renderer: 'json5',\n options: async (value, column, record, row, field) => {\n return {\n name: record.type,\n help: '',\n spec:\n record.type === 'select'\n ? [\n {\n type: 'options' /* property-editor type */,\n name: 'options',\n label: 'options'\n }\n ]\n : [],\n context: this.grist,\n objectified: true\n }\n }\n },\n width: 120\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n }\n\n async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {\n const attributes = this.attribute.items || []\n\n return {\n total: attributes.length,\n records: attributes\n }\n }\n\n private async updateAttributeSetItems() {\n this.grist.commit()\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $patch: AttributeSetPatch!) {\n updateAttributeSet(id: $id, patch: $patch) {\n entity\n }\n }\n `,\n variables: {\n id: this.attribute.id,\n patch: {\n items: this.grist.data.records,\n cuFlag: 'M'\n }\n }\n })\n\n if (!response.errors) {\n await document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.info_x_successfully', {\n x: i18next.t('button.save')\n })\n }\n })\n )\n }\n }\n\n private async deleteAttributeSetItems() {\n if (!confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n return\n }\n\n this.grist.deleteSelectedRecords(false)\n }\n}\n"]}
1
+ {"version":3,"file":"attribute-set-item-list.js","sourceRoot":"","sources":["../../../client/pages/attribute/attribute-set-item-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OA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qBAC5B,CAAC;iBACH;aACF,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,uBAAuB;QACnC,IAAI,CAAC,MAAM,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAC3E,OAAM;QACR,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC;;AA5N2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAe;AAEjC;IAAR,KAAK,EAAE;;yDAAiB;AAkBE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;mDAAA;AArBxC,oBAAoB;IADzB,aAAa,CAAC,yBAAyB,CAAC;GACnC,oBAAoB,CA8NzB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport gql from 'graphql-tag'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { OxPrompt } from '@operato/popup'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { CommonHeaderStyles } from '@operato/styles'\n\n@customElement('attribute-set-item-list')\nclass AttributeSetItemList extends localize(i18next)(LitElement) {\n @property({ type: Object }) attribute: any\n\n @state() gristConfig: any\n\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @query('ox-grist') private grist!: DataGrist\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button danger @click=${this.deleteAttributeSetItems.bind(this)}>\n <md-icon>delete_forever</md-icon>${i18next.t('button.delete')}\n </button>\n <button @click=${this.updateAttributeSetItems.bind(this)} done>\n <md-icon>save</md-icon>${i18next.t('button.save')}\n </button>\n </div>\n `\n }\n\n async firstUpdated() {\n this.gristConfig = {\n list: { fields: ['name', 'description', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'add',\n handlers: {\n click: 'record-copy'\n }\n },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n width: 140\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'varname',\n name: 'tag',\n header: i18next.t('field.tag'),\n record: {\n editable: true\n },\n width: 180\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'checkbox',\n name: 'hidden',\n label: true,\n header: i18next.t('field.hidden'),\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n options: ['', 'number', 'text', 'select', 'boolean', 'date', 'datetime', 'file', 'secret'],\n editable: true\n },\n width: 120\n },\n {\n type: 'parameters',\n name: 'options',\n header: i18next.t('field.options'),\n record: {\n editable: true,\n renderer: 'json5',\n options: async (value, column, record, row, field) => {\n return {\n name: record.type,\n help: '',\n spec:\n record.type === 'select'\n ? [\n {\n type: 'options' /* property-editor type */,\n name: 'options',\n label: 'options'\n }\n ]\n : [],\n context: this.grist,\n objectified: true\n }\n }\n },\n width: 120\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n }\n\n async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {\n const attributes = this.attribute.items || []\n\n return {\n total: attributes.length,\n records: attributes\n }\n }\n\n private async updateAttributeSetItems() {\n this.grist.commit()\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $patch: AttributeSetPatch!) {\n updateAttributeSet(id: $id, patch: $patch) {\n entity\n }\n }\n `,\n variables: {\n id: this.attribute.id,\n patch: {\n items: this.grist.data.records,\n cuFlag: 'M'\n }\n }\n })\n\n if (!response.errors) {\n await document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.info_x_successfully', {\n x: i18next.t('button.save')\n })\n }\n })\n )\n }\n }\n\n private async deleteAttributeSetItems() {\n if (!await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) {\n return\n }\n\n this.grist.deleteSelectedRecords(false)\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import '@operato/data-grist';
3
- import '@operato/context/ox-context-page-toolbar.js';
4
3
  import './attribute-set-item-list.js';
5
4
  import { FetchOption } from '@operato/data-grist';
6
5
  import { PageView } from '@operato/shell';
@@ -21,9 +20,6 @@ export declare class AttributeSetManagementPage extends AttributeSetManagementPa
21
20
  handler: (search: string) => void;
22
21
  value: string;
23
22
  };
24
- filter: {
25
- handler: () => void;
26
- };
27
23
  actions: ({
28
24
  title: string;
29
25
  action: () => Promise<void>;
@@ -37,7 +33,6 @@ export declare class AttributeSetManagementPage extends AttributeSetManagementPa
37
33
  danger: boolean;
38
34
  };
39
35
  })[];
40
- toolbar: boolean;
41
36
  };
42
37
  render(): import("lit-html").TemplateResult<1>;
43
38
  pageInitialized(lifecycle: any): Promise<void>;
@@ -1,11 +1,11 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@material/web/icon/icon.js';
3
3
  import '@operato/data-grist';
4
- import '@operato/context/ox-context-page-toolbar.js';
5
4
  import './attribute-set-item-list.js';
6
5
  import gql from 'graphql-tag';
7
6
  import { css, html } from 'lit';
8
7
  import { customElement, query, state } from 'lit/decorators.js';
8
+ import { OxPrompt } from '@operato/popup';
9
9
  import { DataGrist } from '@operato/data-grist';
10
10
  import { client } from '@operato/graphql';
11
11
  import { i18next, localize } from '@operato/i18n';
@@ -43,10 +43,6 @@ let AttributeSetManagementPage = class AttributeSetManagementPage extends p13n(l
43
43
  this.grist.searchText = search;
44
44
  },
45
45
  value: this.grist?.searchText || '' },
46
- filter: { handler: () => {
47
- this.grist.toggleHeadroom();
48
- }
49
- },
50
46
  // help: 'system/attribute',
51
47
  actions: [
52
48
  { title: i18next.t('button.save'),
@@ -59,8 +55,7 @@ let AttributeSetManagementPage = class AttributeSetManagementPage extends p13n(l
59
55
  emphasis: { danger: true
60
56
  }
61
57
  }
62
- ],
63
- toolbar: false };
58
+ ] };
64
59
  }
65
60
  render() {
66
61
  const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
@@ -72,11 +67,6 @@ let AttributeSetManagementPage = class AttributeSetManagementPage extends p13n(l
72
67
  .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')}
73
68
  ?url-params-sensitive=${this.active}
74
69
  >
75
- <div slot="headroom" class="header">
76
- <div class="title">${i18next.t('title.attributes')}</div>
77
-
78
- <ox-context-page-toolbar class="actions" .context=${this.context}> </ox-context-page-toolbar>
79
- </div>
80
70
 
81
71
  <ox-grist-personalizer slot="setting"></ox-grist-personalizer>
82
72
  </ox-grist>
@@ -170,7 +160,7 @@ let AttributeSetManagementPage = class AttributeSetManagementPage extends p13n(l
170
160
  };
171
161
  }
172
162
  async deleteAttributeSet() {
173
- if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
163
+ if (await OxPrompt.confirmDelete({ count: this.grist?.selected?.length })) {
174
164
  const ids = this.grist.selected.map(record => record.id);
175
165
  if (ids && ids.length > 0) {
176
166
  const response = await client.mutate({ mutation: gql `