@things-factory/auth-ui 9.0.0-beta.3 → 9.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/bootstrap.d.ts +1 -1
- package/dist-client/bootstrap.js +2 -2
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/abstract-auth-page.d.ts +1 -1
- package/dist-client/components/abstract-auth-page.js +2 -0
- package/dist-client/components/abstract-auth-page.js.map +1 -1
- package/dist-client/components/abstract-password-reset.d.ts +2 -2
- package/dist-client/components/abstract-password-reset.js +4 -4
- package/dist-client/components/abstract-password-reset.js.map +1 -1
- package/dist-client/components/change-password.js +1 -1
- package/dist-client/components/change-password.js.map +1 -1
- package/dist-client/components/invite-user.d.ts +1 -1
- package/dist-client/components/invite-user.js +1 -2
- package/dist-client/components/invite-user.js.map +1 -1
- package/dist-client/components/partner-role-editor.js +1 -1
- package/dist-client/components/partner-role-editor.js.map +1 -1
- package/dist-client/components/profile-component.d.ts +3 -3
- package/dist-client/components/profile-component.js +3 -3
- package/dist-client/components/profile-component.js.map +1 -1
- package/dist-client/components/user-role-editor.d.ts +2 -2
- package/dist-client/components/user-role-editor.js +2 -2
- package/dist-client/components/user-role-editor.js.map +1 -1
- package/dist-client/constants/index.d.ts +1 -1
- package/dist-client/constants/index.js +1 -1
- package/dist-client/constants/index.js.map +1 -1
- package/dist-client/entries/auth/activate.d.ts +1 -1
- package/dist-client/entries/auth/activate.js +1 -1
- package/dist-client/entries/auth/activate.js.map +1 -1
- package/dist-client/entries/auth/checkin.d.ts +1 -1
- package/dist-client/entries/auth/checkin.js +6 -13
- package/dist-client/entries/auth/checkin.js.map +1 -1
- package/dist-client/entries/auth/forgot-password.d.ts +2 -2
- package/dist-client/entries/auth/forgot-password.js +2 -2
- package/dist-client/entries/auth/forgot-password.js.map +1 -1
- package/dist-client/entries/auth/reset-password.d.ts +1 -1
- package/dist-client/entries/auth/reset-password.js +1 -1
- package/dist-client/entries/auth/reset-password.js.map +1 -1
- package/dist-client/entries/auth/result.d.ts +1 -1
- package/dist-client/entries/auth/result.js +1 -1
- package/dist-client/entries/auth/result.js.map +1 -1
- package/dist-client/entries/auth/signin.d.ts +1 -1
- package/dist-client/entries/auth/signin.js +1 -1
- package/dist-client/entries/auth/signin.js.map +1 -1
- package/dist-client/entries/auth/signup.d.ts +3 -1
- package/dist-client/entries/auth/signup.js +32 -2
- package/dist-client/entries/auth/signup.js.map +1 -1
- package/dist-client/entries/auth/unlock-user.d.ts +1 -1
- package/dist-client/entries/auth/unlock-user.js +1 -1
- package/dist-client/entries/auth/unlock-user.js.map +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.js +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
- package/dist-client/entries/public/home.js +2 -2
- package/dist-client/entries/public/home.js.map +1 -1
- package/dist-client/pages/application/application.js +1 -1
- package/dist-client/pages/application/application.js.map +1 -1
- package/dist-client/pages/domain/domain-management.d.ts +3 -1
- package/dist-client/pages/domain/domain-management.js +19 -3
- package/dist-client/pages/domain/domain-management.js.map +1 -1
- package/dist-client/pages/partner/partner-management.d.ts +3 -3
- package/dist-client/pages/partner/partner-management.js +3 -3
- package/dist-client/pages/partner/partner-management.js.map +1 -1
- package/dist-client/pages/profile.d.ts +1 -1
- package/dist-client/pages/profile.js +1 -1
- package/dist-client/pages/profile.js.map +1 -1
- package/dist-client/pages/role/role-management.d.ts +3 -3
- package/dist-client/pages/role/role-management.js +3 -3
- package/dist-client/pages/role/role-management.js.map +1 -1
- package/dist-client/pages/user/user-management.d.ts +4 -4
- package/dist-client/pages/user/user-management.js +4 -4
- package/dist-client/pages/user/user-management.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/translations/en.json +0 -1
- package/translations/ja.json +0 -1
- package/translations/ko.json +0 -1
- package/translations/ms.json +0 -1
- package/translations/zh.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-role-editor.js","sourceRoot":"","sources":["../../client/components/user-role-editor.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,4BAA4B,CAAA;AACnC,OAAO,iBAAiB,CAAA;AAExB,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,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,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAAvD;;QAiE8B,SAAI,GAAQ,EAAE,CAAA;QACb,aAAQ,GAAY,KAAK,CAAA;QAG7C,gBAAW,GAAU,EAAE,CAAA;QACvB,iBAAY,GAAQ,EAAE,CAAA;QACtB,cAAS,GAAU,EAAE,CAAA;QACrB,iBAAY,GAAY,KAAK,CAAA;QAC7B,kBAAa,GAAY,KAAK,CAAA;IAoZzC,CAAC;IAhZC,MAAM;QACJ,MAAM,IAA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A;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,KAAK,CAAA;IACxE,CAAC;;AA3dM,qBAAM,GAAG;IACd,qBAAqB;IACrB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2DF;CACF,AA9DY,CA8DZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAe;AACb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;gDAA0B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAiB;AAEnC;IAAR,KAAK,EAAE;;mDAAwB;AACvB;IAAR,KAAK,EAAE;;oDAAuB;AACtB;IAAR,KAAK,EAAE;;iDAAsB;AACrB;IAAR,KAAK,EAAE;;oDAA8B;AAC7B;IAAR,KAAK,EAAE;;qDAA+B;AAzEnC,cAAc;IADnB,aAAa,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CA6dnB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport './ownership-transfer-popup'\nimport './role-selector'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { RoleSelector } from './role-selector'\nimport { InheritedValueType } from '@operato/data-grist'\n\n@customElement('user-role-editor')\nclass UserRoleEditor extends connect(store)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n border: 1px solid var(--md-sys-color-primary);\n font: normal 15px var(--theme-font);\n color: var(--md-sys-color-secondary);\n }\n ul {\n flex: 1;\n display: grid;\n grid-template-columns: 1fr 1fr;\n column-gap: 20px;\n\n overflow: auto;\n margin: 0;\n padding: var(--spacing-medium);\n list-style: none;\n border: 1px dashed rgba(0, 0, 0, 0.1);\n border-width: 1px 0;\n }\n input[readonly] {\n border: none;\n background-color: transparent;\n color: var(--md-sys-color-secondary);\n font: var(--input-font);\n }\n li {\n padding: var(--spacing-small);\n }\n [detail] {\n background-color: var(--md-sys-color-surface);\n }\n [detail] md-icon {\n --md-icon-size: var(--fontsize-default);\n vertical-align: middle;\n color: var(--md-sys-color-primary);\n }\n [detail] li {\n display: flex;\n }\n [detail] li input {\n flex: 1;\n }\n\n md-elevated-button {\n margin: 5px;\n }\n\n md-outlined-button {\n background-color: var(--md-sys-color-surface-variant);\n }\n\n @media screen and (max-width: 480px) {\n ul {\n grid-template-columns: 1fr;\n }\n }\n `\n ]\n\n @property({ type: Object }) user: any = {}\n @property({ type: Boolean }) activate: boolean = false\n @property({ type: Object }) domainOwner: any\n\n @state() domainRoles: any[] = []\n @state() grantedRoles: any = {}\n @state() userRoles: any[] = []\n @state() isSuperOwner: boolean = false\n @state() isDomainOwner: boolean = false\n\n private me: any\n\n render() {\n const user = this.user || {}\n const domainRoles = this.domainRoles || []\n const grantedRoles = this.grantedRoles || {}\n let currentDomainName = 'roles'\n if (domainRoles?.length) {\n currentDomainName = domainRoles[0].domain.name\n }\n\n return html`\n ${this.activate\n ? html`\n <ul detail>\n ${user.userType === 'user'\n ? html`\n <li>\n <span>\n ${user.username || user.email} (<md-icon>email</md-icon>\n ${user.email})\n </span>\n </li>\n `\n : ''}\n </ul>\n\n <role-selector .user=${this.user} .roles=${domainRoles} .userRoles=${this.userRoles}></role-selector>\n\n ${Object.keys(grantedRoles).map(\n partnerName => html`\n <role-selector\n .roleCategory=${partnerName}\n .user=${this.user}\n .roles=${this.grantedRoles[partnerName]}\n .userRoles=${this.userRoles}\n >\n </role-selector>\n `\n )}\n `\n : ''}\n\n <div class=\"button-container\">\n ${this.isRoleEditable()\n ? html` <md-elevated-button\n @click=${() => {\n const { availableRoles, selectedRoles } = Array.from(\n this.renderRoot.querySelectorAll('role-selector') as NodeListOf<RoleSelector>\n ).reduce(\n (roles, roleSelector) => {\n roles.availableRoles = roles.availableRoles.concat(\n roleSelector.roles.map(r => {\n delete r.domain\n return r\n })\n )\n roles.selectedRoles = roles.selectedRoles.concat(\n roleSelector.selectedRoles().map(r => {\n //@ts-ignore\n delete r.domain\n return r\n })\n )\n return roles\n },\n { availableRoles: [], selectedRoles: [] } as { availableRoles: any[]; selectedRoles: any[] }\n )\n this.onSave(user, availableRoles, selectedRoles)\n }}\n >${String(i18next.t('button.save'))}</md-elevated-button\n >`\n : ''}\n ${user.userType === 'user'\n ? html`\n ${this.isTransferable(user) && this.userRoles && this.userRoles.length > 0\n ? html`\n <md-elevated-button danger @click=${() => this.onTransfer(user)}\n >${String(i18next.t('button.transfer owner'))}</md-elevated-button\n >\n `\n : ''}\n ${this.isPasswordResettable(user)\n ? html`<md-elevated-button danger @click=${() => this.onResetPassword(user)}\n >${String(i18next.t('title.reset password'))}</md-elevated-button\n >`\n : ''}\n `\n : ''}\n ${this.isRemovable(user)\n ? html`\n <md-elevated-button danger @click=${() => this.onDelete(user)}\n >${String(i18next.t('button.delete user'))}</md-elevated-button\n >\n `\n : ''}\n ${this.isActivatable(user)\n ? html`<md-elevated-button danger @click=${() => this.onActivate(user)}\n >${String(i18next.t('button.activate'))}</md-elevated-button\n >`\n : ''}\n ${this.isInactivatable(user)\n ? html`<md-elevated-button danger @click=${() => this.onInactivate(user)}\n >${String(i18next.t('button.deactivate'))}</md-elevated-button\n >`\n : ''}\n </div>\n `\n }\n\n isRemovable(user) {\n return this.isDomainOwner && user.email !== this.me.email && !user.owner\n }\n\n isTransferable(user) {\n return this.activate && (this.isSuperOwner || this.isDomainOwner) && !user.owner\n }\n\n isRoleEditable() {\n return this.activate && (this.domainRoles?.length || Object.keys(this.grantedRoles || {}).length)\n }\n\n isPasswordResettable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && user.email !== this.me.email\n }\n\n isActivatable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && !this.activate\n }\n\n isInactivatable(user) {\n return (\n (this.isSuperOwner || this.isDomainOwner) &&\n user.id !== this.domainOwner.id &&\n user.userType !== 'admin' &&\n this.activate\n )\n }\n\n async updated(changedProps) {\n if (changedProps.has('user')) {\n this.fetchAvailableRoles()\n\n if (this.user?.email) {\n this.userRoles = await this.fetchRolesOnUser(this.user.email)\n } else {\n this.userRoles = []\n }\n }\n }\n\n async fetchRolesOnUser(email) {\n const response = await client.query({\n query: gql`\n query ($email: EmailAddress!) {\n user(email: $email) {\n id\n name\n email\n roles {\n id\n name\n description\n domain {\n id\n }\n }\n }\n }\n `,\n variables: { email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n return response.data.user?.roles || []\n }\n }\n\n async fetchAvailableRoles() {\n const response = await client.query({\n query: gql`\n query roles($inherited: InheritedValueType) {\n roles(inherited: $inherited) {\n items {\n id\n domain {\n name\n }\n name\n description\n }\n total\n }\n grantedRoles {\n id\n role {\n id\n name\n description\n domain {\n name\n }\n }\n }\n }\n `,\n variables: {\n inherited: InheritedValueType.Include\n },\n context: gqlContext()\n })\n\n if (!response.errors?.length) {\n this.domainRoles = response.data.roles.items || []\n this.grantedRoles = response.data.grantedRoles.reduce((grantedRoles, grantedRole) => {\n const { role } = grantedRole\n const { domain } = role\n if (grantedRoles[domain.name]) {\n grantedRoles[domain.name].push(role)\n } else {\n grantedRoles[domain.name] = [role]\n }\n\n return grantedRoles\n }, {})\n } else {\n this.domainRoles = []\n this.grantedRoles = []\n }\n }\n\n async onSave(user, availableRoles, selectedRoles) {\n if (user?.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($username: String!, $availableRoles: [ObjectRef!]!, $selectedRoles: [ObjectRef!]!) {\n updateUserRoles(username: $username, availableRoles: $availableRoles, selectedRoles: $selectedRoles) {\n id\n name\n roles {\n id\n description\n }\n }\n }\n `,\n variables: { username: user.username || user.email, availableRoles, selectedRoles },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.data_updated_successfully'))\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onActivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation activateUser($username: String!) {\n activateUser(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user activated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onInactivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation inactivateUser($username: String!) {\n inactivateUser(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user inactivated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onDelete(user) {\n if (user.owner) {\n await OxPrompt.open({\n type: 'warning',\n title: i18next.t('text.cannot_delete'),\n text: i18next.t('text.x_cannot_delete', {\n x: i18next.t('label.domain-owner')\n }),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n return\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x_user', {\n x: i18next.t('button.delete')\n }),\n confirmButton: { text: i18next.t('button.delete') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation deleteDomaineUser($username: String!) {\n deleteDomainUser(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onTransfer(user) {\n openPopup(\n html`\n <ownership-transfer-popup\n .user=${user}\n @ownershipTransferred=\"${this.dispatchOwnershipTransferred.bind(this)}\"\n ></ownership-transfer-popup>\n `,\n {\n size: 'small',\n title: `${i18next.t('title.owner_transfer')}`\n }\n )\n }\n\n async onResetPassword(user) {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x', { x: i18next.t('title.reset password') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation resetPasswordToDefault($username: String!) {\n resetPasswordToDefault(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.password reset succeed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n }\n }\n }\n\n dispatchUserUpdated() {\n this.dispatchEvent(new CustomEvent('userUpdated'))\n }\n\n dispatchOwnershipTransferred() {\n this.dispatchEvent(new CustomEvent('ownershipTransferred'))\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n\n stateChanged(state) {\n this.me = state.auth?.user || {}\n this.isSuperOwner = this.me.super || false\n this.isDomainOwner = this.me.email === this.domainOwner.email || false\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"user-role-editor.js","sourceRoot":"","sources":["../../client/components/user-role-editor.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,+BAA+B,CAAA;AACtC,OAAO,oBAAoB,CAAA;AAE3B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AA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,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAiB;AAEnC;IAAR,KAAK,EAAE;;mDAAwB;AACvB;IAAR,KAAK,EAAE;;oDAAuB;AACtB;IAAR,KAAK,EAAE;;iDAAsB;AACrB;IAAR,KAAK,EAAE;;oDAA8B;AAC7B;IAAR,KAAK,EAAE;;qDAA+B;AAzEnC,cAAc;IADnB,aAAa,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CA6dnB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport './ownership-transfer-popup.js'\nimport './role-selector.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { ButtonContainerStyles } from '@operato/styles'\nimport { RoleSelector } from './role-selector.js'\nimport { InheritedValueType } from '@operato/data-grist'\n\n@customElement('user-role-editor')\nclass UserRoleEditor extends connect(store)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n border: 1px solid var(--md-sys-color-primary);\n font: normal 15px var(--theme-font);\n color: var(--md-sys-color-secondary);\n }\n ul {\n flex: 1;\n display: grid;\n grid-template-columns: 1fr 1fr;\n column-gap: 20px;\n\n overflow: auto;\n margin: 0;\n padding: var(--spacing-medium);\n list-style: none;\n border: 1px dashed rgba(0, 0, 0, 0.1);\n border-width: 1px 0;\n }\n input[readonly] {\n border: none;\n background-color: transparent;\n color: var(--md-sys-color-secondary);\n font: var(--input-font);\n }\n li {\n padding: var(--spacing-small);\n }\n [detail] {\n background-color: var(--md-sys-color-surface);\n }\n [detail] md-icon {\n --md-icon-size: var(--fontsize-default);\n vertical-align: middle;\n color: var(--md-sys-color-primary);\n }\n [detail] li {\n display: flex;\n }\n [detail] li input {\n flex: 1;\n }\n\n md-elevated-button {\n margin: 5px;\n }\n\n md-outlined-button {\n background-color: var(--md-sys-color-surface-variant);\n }\n\n @media screen and (max-width: 480px) {\n ul {\n grid-template-columns: 1fr;\n }\n }\n `\n ]\n\n @property({ type: Object }) user: any = {}\n @property({ type: Boolean }) activate: boolean = false\n @property({ type: Object }) domainOwner: any\n\n @state() domainRoles: any[] = []\n @state() grantedRoles: any = {}\n @state() userRoles: any[] = []\n @state() isSuperOwner: boolean = false\n @state() isDomainOwner: boolean = false\n\n private me: any\n\n render() {\n const user = this.user || {}\n const domainRoles = this.domainRoles || []\n const grantedRoles = this.grantedRoles || {}\n let currentDomainName = 'roles'\n if (domainRoles?.length) {\n currentDomainName = domainRoles[0].domain.name\n }\n\n return html`\n ${this.activate\n ? html`\n <ul detail>\n ${user.userType === 'user'\n ? html`\n <li>\n <span>\n ${user.username || user.email} (<md-icon>email</md-icon>\n ${user.email})\n </span>\n </li>\n `\n : ''}\n </ul>\n\n <role-selector .user=${this.user} .roles=${domainRoles} .userRoles=${this.userRoles}></role-selector>\n\n ${Object.keys(grantedRoles).map(\n partnerName => html`\n <role-selector\n .roleCategory=${partnerName}\n .user=${this.user}\n .roles=${this.grantedRoles[partnerName]}\n .userRoles=${this.userRoles}\n >\n </role-selector>\n `\n )}\n `\n : ''}\n\n <div class=\"button-container\">\n ${this.isRoleEditable()\n ? html` <md-elevated-button\n @click=${() => {\n const { availableRoles, selectedRoles } = Array.from(\n this.renderRoot.querySelectorAll('role-selector') as NodeListOf<RoleSelector>\n ).reduce(\n (roles, roleSelector) => {\n roles.availableRoles = roles.availableRoles.concat(\n roleSelector.roles.map(r => {\n delete r.domain\n return r\n })\n )\n roles.selectedRoles = roles.selectedRoles.concat(\n roleSelector.selectedRoles().map(r => {\n //@ts-ignore\n delete r.domain\n return r\n })\n )\n return roles\n },\n { availableRoles: [], selectedRoles: [] } as { availableRoles: any[]; selectedRoles: any[] }\n )\n this.onSave(user, availableRoles, selectedRoles)\n }}\n >${String(i18next.t('button.save'))}</md-elevated-button\n >`\n : ''}\n ${user.userType === 'user'\n ? html`\n ${this.isTransferable(user) && this.userRoles && this.userRoles.length > 0\n ? html`\n <md-elevated-button danger @click=${() => this.onTransfer(user)}\n >${String(i18next.t('button.transfer owner'))}</md-elevated-button\n >\n `\n : ''}\n ${this.isPasswordResettable(user)\n ? html`<md-elevated-button danger @click=${() => this.onResetPassword(user)}\n >${String(i18next.t('title.reset password'))}</md-elevated-button\n >`\n : ''}\n `\n : ''}\n ${this.isRemovable(user)\n ? html`\n <md-elevated-button danger @click=${() => this.onDelete(user)}\n >${String(i18next.t('button.delete user'))}</md-elevated-button\n >\n `\n : ''}\n ${this.isActivatable(user)\n ? html`<md-elevated-button danger @click=${() => this.onActivate(user)}\n >${String(i18next.t('button.activate'))}</md-elevated-button\n >`\n : ''}\n ${this.isInactivatable(user)\n ? html`<md-elevated-button danger @click=${() => this.onInactivate(user)}\n >${String(i18next.t('button.deactivate'))}</md-elevated-button\n >`\n : ''}\n </div>\n `\n }\n\n isRemovable(user) {\n return this.isDomainOwner && user.email !== this.me.email && !user.owner\n }\n\n isTransferable(user) {\n return this.activate && (this.isSuperOwner || this.isDomainOwner) && !user.owner\n }\n\n isRoleEditable() {\n return this.activate && (this.domainRoles?.length || Object.keys(this.grantedRoles || {}).length)\n }\n\n isPasswordResettable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && user.email !== this.me.email\n }\n\n isActivatable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && !this.activate\n }\n\n isInactivatable(user) {\n return (\n (this.isSuperOwner || this.isDomainOwner) &&\n user.id !== this.domainOwner.id &&\n user.userType !== 'admin' &&\n this.activate\n )\n }\n\n async updated(changedProps) {\n if (changedProps.has('user')) {\n this.fetchAvailableRoles()\n\n if (this.user?.email) {\n this.userRoles = await this.fetchRolesOnUser(this.user.email)\n } else {\n this.userRoles = []\n }\n }\n }\n\n async fetchRolesOnUser(email) {\n const response = await client.query({\n query: gql`\n query ($email: EmailAddress!) {\n user(email: $email) {\n id\n name\n email\n roles {\n id\n name\n description\n domain {\n id\n }\n }\n }\n }\n `,\n variables: { email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n return response.data.user?.roles || []\n }\n }\n\n async fetchAvailableRoles() {\n const response = await client.query({\n query: gql`\n query roles($inherited: InheritedValueType) {\n roles(inherited: $inherited) {\n items {\n id\n domain {\n name\n }\n name\n description\n }\n total\n }\n grantedRoles {\n id\n role {\n id\n name\n description\n domain {\n name\n }\n }\n }\n }\n `,\n variables: {\n inherited: InheritedValueType.Include\n },\n context: gqlContext()\n })\n\n if (!response.errors?.length) {\n this.domainRoles = response.data.roles.items || []\n this.grantedRoles = response.data.grantedRoles.reduce((grantedRoles, grantedRole) => {\n const { role } = grantedRole\n const { domain } = role\n if (grantedRoles[domain.name]) {\n grantedRoles[domain.name].push(role)\n } else {\n grantedRoles[domain.name] = [role]\n }\n\n return grantedRoles\n }, {})\n } else {\n this.domainRoles = []\n this.grantedRoles = []\n }\n }\n\n async onSave(user, availableRoles, selectedRoles) {\n if (user?.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($username: String!, $availableRoles: [ObjectRef!]!, $selectedRoles: [ObjectRef!]!) {\n updateUserRoles(username: $username, availableRoles: $availableRoles, selectedRoles: $selectedRoles) {\n id\n name\n roles {\n id\n description\n }\n }\n }\n `,\n variables: { username: user.username || user.email, availableRoles, selectedRoles },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.data_updated_successfully'))\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onActivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation activateUser($username: String!) {\n activateUser(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user activated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onInactivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation inactivateUser($username: String!) {\n inactivateUser(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user inactivated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onDelete(user) {\n if (user.owner) {\n await OxPrompt.open({\n type: 'warning',\n title: i18next.t('text.cannot_delete'),\n text: i18next.t('text.x_cannot_delete', {\n x: i18next.t('label.domain-owner')\n }),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n return\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x_user', {\n x: i18next.t('button.delete')\n }),\n confirmButton: { text: i18next.t('button.delete') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation deleteDomaineUser($username: String!) {\n deleteDomainUser(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onTransfer(user) {\n openPopup(\n html`\n <ownership-transfer-popup\n .user=${user}\n @ownershipTransferred=\"${this.dispatchOwnershipTransferred.bind(this)}\"\n ></ownership-transfer-popup>\n `,\n {\n size: 'small',\n title: `${i18next.t('title.owner_transfer')}`\n }\n )\n }\n\n async onResetPassword(user) {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x', { x: i18next.t('title.reset password') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation resetPasswordToDefault($username: String!) {\n resetPasswordToDefault(username: $username)\n }\n `,\n variables: { username: user.username || user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.password reset succeed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n }\n }\n }\n\n dispatchUserUpdated() {\n this.dispatchEvent(new CustomEvent('userUpdated'))\n }\n\n dispatchOwnershipTransferred() {\n this.dispatchEvent(new CustomEvent('ownershipTransferred'))\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n\n stateChanged(state) {\n this.me = state.auth?.user || {}\n this.isSuperOwner = this.me.super || false\n this.isDomainOwner = this.me.email === this.domainOwner.email || false\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './application';
|
|
1
|
+
export * from './application.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './application';
|
|
1
|
+
export * from './application.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './application.js'\n"]}
|
|
@@ -3,7 +3,7 @@ import '@material/web/button/elevated-button.js';
|
|
|
3
3
|
import '@operato/i18n/ox-i18n.js';
|
|
4
4
|
import '@operato/layout/ox-snack-bar.js';
|
|
5
5
|
import '@operato/lottie-player';
|
|
6
|
-
import '../../components/contact-us';
|
|
6
|
+
import '../../components/contact-us.js';
|
|
7
7
|
import { LitElement } from 'lit';
|
|
8
8
|
declare const AuthActivate_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
9
9
|
export declare class AuthActivate extends AuthActivate_base {
|
|
@@ -4,7 +4,7 @@ import '@material/web/button/elevated-button.js';
|
|
|
4
4
|
import '@operato/i18n/ox-i18n.js';
|
|
5
5
|
import '@operato/layout/ox-snack-bar.js';
|
|
6
6
|
import '@operato/lottie-player';
|
|
7
|
-
import '../../components/contact-us';
|
|
7
|
+
import '../../components/contact-us.js';
|
|
8
8
|
import { css, html, LitElement } from 'lit';
|
|
9
9
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
10
10
|
import { i18next, localize } from '@operato/i18n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activate.js","sourceRoot":"","sources":["../../../client/entries/auth/activate.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,0BAA0B,CAAA;AACjC,OAAO,iCAAiC,CAAA;AACxC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG1C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAyH7D,MAAM;QACJ,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEvD,OAAO,IAAI,CAAA;;;qBAGM,IAAI;iCACQ,KAAK;sCACA,WAAW;;;;;;;;;;;;oBAY7B,CAAC,CAAC,EAAE;YACZ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;;;qDAG0C,IAAI,CAAC,KAAK,IAAI,EAAE;;;;;uCAK9B,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;cAEnD,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC;;;qBAGjC,CAAC,CAA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G,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAIzD,CAAA;QAED,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;QAC1B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAA;QAEtB,IAAI,KAAK,GAAG,CAAC,CAAC;YACZ,UAAU,CAAC,GAAG,EAAE;gBACd,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAA;YACzB,CAAC,EAAE,KAAK,CAAC,CAAA;IACb,CAAC;;AA/PM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6GF;CACF,AA/GY,CA+GZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAsB;AAEjC;IAAf,KAAK,CAAC,OAAO,CAAC;8BAAQ,eAAe;0CAAA;AArH3B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAiQxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/layout/ox-snack-bar.js'\nimport '@operato/lottie-player'\nimport '../../components/contact-us'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\n\n@customElement('auth-activate')\nexport class AuthActivate extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .wrap {\n display: block;\n width: 450px;\n min-width: 350px;\n margin: 0 auto;\n text-align: center;\n }\n\n .auth-brand {\n color: #fff;\n }\n\n .auth-brand img {\n margin: 15% auto 5px auto;\n width: 100px;\n border: 3px solid var(--md-sys-color-on-primary);\n border-radius: 25px;\n box-shadow: var(--box-shadow);\n }\n\n .name {\n display: block;\n font: var(--auth-brand-name);\n text-shadow: var(--auth-brand-name-shadow);\n }\n\n h1 {\n margin: 50px 0 0 0;\n padding: 0;\n font-size: 24px;\n color: var(--auth-title-color, var(--md-sys-color-on-primary));\n }\n\n p {\n margin: 0;\n padding: var(--auth-description-padding);\n font: var(--auth-description-font);\n color: var(--auth-description-color, var(--md-sys-color-on-secondary));\n }\n\n #button-area {\n border-top: 1px dashed #ccc;\n padding-top: 10px;\n }\n\n md-elevated-button {\n --md-elevated-button-horizontal-padding: var(--spacing-medium);\n --md-elevated-button-ink-color: var(--md-sys-color-primary);\n }\n\n contact-us {\n display: flex;\n padding: 50px;\n flex-direction: column;\n }\n\n .lottie-container {\n width: 100%;\n height: 300px;\n position: absolute;\n left: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n position: absolute;\n bottom: -6%;\n width: 100%;\n height: auto;\n }\n\n @media (max-width: 450px) {\n .wrap {\n width: 85%;\n min-width: 320px;\n padding-bottom: 100px;\n }\n\n .auth-form {\n grid-template-columns: 1fr;\n }\n\n .auth-brand img {\n margin: 12% auto 5px auto;\n width: 75px;\n }\n\n .lottie-container {\n overflow: hidden;\n height: 200px;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n width: 1200px;\n left: -30%;\n }\n }\n `\n ]\n\n @property({ type: Object }) data: any\n @property({ type: String }) email?: string | null\n\n @query('#form') form!: HTMLFormElement\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n return html`\n <div class=\"wrap\">\n <div class=\"auth-brand\">\n <img src=${icon} />\n <strong class=\"name\">${title}</strong>\n <span class=\"welcome-msg\">${description}</span>\n </div>\n\n <h1><ox-i18n msgid=\"text.your account is not activated\"></ox-i18n></h1>\n\n <!--description message container-->\n <p></p>\n\n <form\n id=\"form\"\n action=\"/auth/resend-verification-email\"\n method=\"POST\"\n @submit=${e => {\n this.requestResend(e)\n }}\n hidden\n >\n <input name=\"email\" type=\"hidden\" .value=${this.email || ''} required />\n <button id=\"submit-button\" type=\"submit\"><ox-i18n msgid=\"label.change password\"></ox-i18n></button>\n </form>\n\n <div id=\"button-area\">\n <md-elevated-button @click=${e => this.requestResend(e)}>\n <md-icon slot=\"icon\">mail_outline</md-icon>\n ${i18next.t('label.send activation email')}\n </md-elevated-button>\n <md-elevated-button\n @click=${e => {\n window.location.replace('/auth/signin')\n }}\n >\n <md-icon slot=\"icon\">home</md-icon>\n ${i18next.t('button.go to home')}\n </md-elevated-button>\n </div>\n <contact-us></contact-us>\n\n <!--lottie animation begin-->\n <div class=\"lottie-container\">\n <lottie-player autoplay loop src=\"../../assets/images/background-animation.json\"></lottie-player>\n </div>\n <!--lottie animation end-->\n </div>\n\n <ox-snack-bar id=\"snackbar\"></ox-snack-bar>\n `\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 firstUpdated() {\n var searchParams = new URLSearchParams(window.location.search)\n this.email = searchParams.get('email')\n }\n\n updated(changed) {\n if (changed.has('data')) {\n this.email = this.data?.email\n }\n }\n\n async requestResend(e) {\n var timer\n var formData = new FormData(this.form)\n var button = e.target\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/resend-verification-email', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n if (response) {\n this.showSnackbar({\n level: response.ok ? 'info' : 'error',\n message: await response.text()\n })\n }\n } catch (e) {\n } finally {\n button.disabled = false\n clearTimeout(timer)\n }\n }\n\n showSnackbar({ level, message, timer = 3000 }: { level: 'info' | 'error'; message: string; timer?: number }) {\n const snackbar = this.renderRoot.querySelector('#snackbar') as HTMLElement & {\n level: 'info' | 'error'\n message: string\n active: boolean\n }\n\n snackbar.level = level\n snackbar.message = message\n snackbar.active = true\n\n if (timer > -1)\n setTimeout(() => {\n snackbar.active = false\n }, timer)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activate.js","sourceRoot":"","sources":["../../../client/entries/auth/activate.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,0BAA0B,CAAA;AACjC,OAAO,iCAAiC,CAAA;AACxC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG1C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAyH7D,MAAM;QACJ,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEvD,OAAO,IAAI,CAAA;;;qBAGM,IAAI;iCACQ,KAAK;sCACA,WAAW;;;;;;;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;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;QACb,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;YACvB,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IAED,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,IAAI,EAAgE;QACzG,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAIzD,CAAA;QAED,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAA;QACtB,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAA;QAC1B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAA;QAEtB,IAAI,KAAK,GAAG,CAAC,CAAC;YACZ,UAAU,CAAC,GAAG,EAAE;gBACd,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAA;YACzB,CAAC,EAAE,KAAK,CAAC,CAAA;IACb,CAAC;;AA/PM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6GF;CACF,AA/GY,CA+GZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAsB;AAEjC;IAAf,KAAK,CAAC,OAAO,CAAC;8BAAQ,eAAe;0CAAA;AArH3B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAiQxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/layout/ox-snack-bar.js'\nimport '@operato/lottie-player'\nimport '../../components/contact-us.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\n\n@customElement('auth-activate')\nexport class AuthActivate extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .wrap {\n display: block;\n width: 450px;\n min-width: 350px;\n margin: 0 auto;\n text-align: center;\n }\n\n .auth-brand {\n color: #fff;\n }\n\n .auth-brand img {\n margin: 15% auto 5px auto;\n width: 100px;\n border: 3px solid var(--md-sys-color-on-primary);\n border-radius: 25px;\n box-shadow: var(--box-shadow);\n }\n\n .name {\n display: block;\n font: var(--auth-brand-name);\n text-shadow: var(--auth-brand-name-shadow);\n }\n\n h1 {\n margin: 50px 0 0 0;\n padding: 0;\n font-size: 24px;\n color: var(--auth-title-color, var(--md-sys-color-on-primary));\n }\n\n p {\n margin: 0;\n padding: var(--auth-description-padding);\n font: var(--auth-description-font);\n color: var(--auth-description-color, var(--md-sys-color-on-secondary));\n }\n\n #button-area {\n border-top: 1px dashed #ccc;\n padding-top: 10px;\n }\n\n md-elevated-button {\n --md-elevated-button-horizontal-padding: var(--spacing-medium);\n --md-elevated-button-ink-color: var(--md-sys-color-primary);\n }\n\n contact-us {\n display: flex;\n padding: 50px;\n flex-direction: column;\n }\n\n .lottie-container {\n width: 100%;\n height: 300px;\n position: absolute;\n left: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n position: absolute;\n bottom: -6%;\n width: 100%;\n height: auto;\n }\n\n @media (max-width: 450px) {\n .wrap {\n width: 85%;\n min-width: 320px;\n padding-bottom: 100px;\n }\n\n .auth-form {\n grid-template-columns: 1fr;\n }\n\n .auth-brand img {\n margin: 12% auto 5px auto;\n width: 75px;\n }\n\n .lottie-container {\n overflow: hidden;\n height: 200px;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n width: 1200px;\n left: -30%;\n }\n }\n `\n ]\n\n @property({ type: Object }) data: any\n @property({ type: String }) email?: string | null\n\n @query('#form') form!: HTMLFormElement\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n return html`\n <div class=\"wrap\">\n <div class=\"auth-brand\">\n <img src=${icon} />\n <strong class=\"name\">${title}</strong>\n <span class=\"welcome-msg\">${description}</span>\n </div>\n\n <h1><ox-i18n msgid=\"text.your account is not activated\"></ox-i18n></h1>\n\n <!--description message container-->\n <p></p>\n\n <form\n id=\"form\"\n action=\"/auth/resend-verification-email\"\n method=\"POST\"\n @submit=${e => {\n this.requestResend(e)\n }}\n hidden\n >\n <input name=\"email\" type=\"hidden\" .value=${this.email || ''} required />\n <button id=\"submit-button\" type=\"submit\"><ox-i18n msgid=\"label.change password\"></ox-i18n></button>\n </form>\n\n <div id=\"button-area\">\n <md-elevated-button @click=${e => this.requestResend(e)}>\n <md-icon slot=\"icon\">mail_outline</md-icon>\n ${i18next.t('label.send activation email')}\n </md-elevated-button>\n <md-elevated-button\n @click=${e => {\n window.location.replace('/auth/signin')\n }}\n >\n <md-icon slot=\"icon\">home</md-icon>\n ${i18next.t('button.go to home')}\n </md-elevated-button>\n </div>\n <contact-us></contact-us>\n\n <!--lottie animation begin-->\n <div class=\"lottie-container\">\n <lottie-player autoplay loop src=\"../../assets/images/background-animation.json\"></lottie-player>\n </div>\n <!--lottie animation end-->\n </div>\n\n <ox-snack-bar id=\"snackbar\"></ox-snack-bar>\n `\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 firstUpdated() {\n var searchParams = new URLSearchParams(window.location.search)\n this.email = searchParams.get('email')\n }\n\n updated(changed) {\n if (changed.has('data')) {\n this.email = this.data?.email\n }\n }\n\n async requestResend(e) {\n var timer\n var formData = new FormData(this.form)\n var button = e.target\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/resend-verification-email', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n if (response) {\n this.showSnackbar({\n level: response.ok ? 'info' : 'error',\n message: await response.text()\n })\n }\n } catch (e) {\n } finally {\n button.disabled = false\n clearTimeout(timer)\n }\n }\n\n showSnackbar({ level, message, timer = 3000 }: { level: 'info' | 'error'; message: string; timer?: number }) {\n const snackbar = this.renderRoot.querySelector('#snackbar') as HTMLElement & {\n level: 'info' | 'error'\n message: string\n active: boolean\n }\n\n snackbar.level = level\n snackbar.message = message\n snackbar.active = true\n\n if (timer > -1)\n setTimeout(() => {\n snackbar.active = false\n }, timer)\n }\n}\n"]}
|
|
@@ -7,14 +7,14 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { ScrollbarStyles } from '@operato/styles';
|
|
9
9
|
import { isSafari } from '@operato/utils';
|
|
10
|
-
import { AUTH_STYLE_SIGN } from '../../auth-style-sign';
|
|
10
|
+
import { AUTH_STYLE_SIGN } from '../../auth-style-sign.js';
|
|
11
11
|
let AuthCheckIn = class AuthCheckIn extends localize(i18next)(LitElement) {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.domains = [];
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
var _a
|
|
17
|
+
var _a;
|
|
18
18
|
var { icon, title, description } = this.applicationMeta;
|
|
19
19
|
return html `
|
|
20
20
|
<div class="content md-typescale-display-medium">
|
|
@@ -47,13 +47,6 @@ let AuthCheckIn = class AuthCheckIn extends localize(i18next)(LitElement) {
|
|
|
47
47
|
<md-elevated-button @click=${() => (location.pathname = '/auth/signout')}
|
|
48
48
|
>${String(i18next.t('button.logout'))}</md-elevated-button
|
|
49
49
|
>
|
|
50
|
-
|
|
51
|
-
${((_b = this.domainType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'company'
|
|
52
|
-
? html `<md-elevated-button
|
|
53
|
-
@click=${e => { var _a; return (location.href = `/public/business-register?email=${(_a = this.user) === null || _a === void 0 ? void 0 : _a.email}`); }}
|
|
54
|
-
>${String(i18next.t('button.register business domain'))}</md-elevated-button
|
|
55
|
-
> `
|
|
56
|
-
: ''}
|
|
57
50
|
</div>
|
|
58
51
|
|
|
59
52
|
${isSafari()
|
|
@@ -71,7 +64,7 @@ let AuthCheckIn = class AuthCheckIn extends localize(i18next)(LitElement) {
|
|
|
71
64
|
if (changed.has('data')) {
|
|
72
65
|
this.domains = this.data.domains;
|
|
73
66
|
this.user = this.data.user;
|
|
74
|
-
this.
|
|
67
|
+
this.domainTypes = this.data.domainTypes;
|
|
75
68
|
this.redirectTo = this.data.redirectTo;
|
|
76
69
|
this.requestUpdate();
|
|
77
70
|
}
|
|
@@ -178,9 +171,9 @@ __decorate([
|
|
|
178
171
|
__metadata("design:type", Array)
|
|
179
172
|
], AuthCheckIn.prototype, "domains", void 0);
|
|
180
173
|
__decorate([
|
|
181
|
-
property({ type:
|
|
182
|
-
__metadata("design:type",
|
|
183
|
-
], AuthCheckIn.prototype, "
|
|
174
|
+
property({ type: Array }),
|
|
175
|
+
__metadata("design:type", Array)
|
|
176
|
+
], AuthCheckIn.prototype, "domainTypes", void 0);
|
|
184
177
|
__decorate([
|
|
185
178
|
property({ type: Object }),
|
|
186
179
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../../client/entries/auth/checkin.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../../client/entries/auth/checkin.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAGnD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAvD;;QA+EsB,YAAO,GAAU,EAAE,CAAA;IAwFhD,CAAC;IAjFC,MAAM;;QACJ,IAAI,EAAE,IAAI,EAAE,KAAK,EA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EAAE,CAAC;;yCAAU;AAjF1B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAuKvB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport '@operato/lottie-player'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { isSafari } from '@operato/utils'\n\nimport { AUTH_STYLE_SIGN } from '../../auth-style-sign.js'\n\n@customElement('auth-checkin')\nexport class AuthCheckIn extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n margin: auto;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n height: 100vh;\n height: 100dvh;\n }\n\n .header {\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n height: var(--checkin-header-height);\n }\n\n .content {\n flex: 1;\n overflow: auto;\n }\n\n .domains {\n margin: var(--spacing-large) 0;\n padding: 0;\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n border-radius: var(--border-radius);\n border: var(--border-dim-color);\n list-style: none;\n }\n\n li {\n border-bottom: var(--border-dim-color);\n padding: var(--spacing-medium) var(--spacing-large);\n font-size: 18px;\n text-align: left;\n\n cursor: pointer;\n }\n\n li:hover {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n }\n\n li span {\n display: block;\n font: normal var(--fontsize-default) var(--theme-font);\n }\n\n li md-icon {\n float: right;\n margin: 10px 0 0 0;\n opacity: 0.5;\n }\n\n .button-container {\n text-align: center;\n }\n\n .button-container md-elevated-button {\n margin-left: var(--spacing-small);\n }\n\n @media (max-width: 450px) {\n .button-container md-elevated-button {\n width: 100%;\n margin: var(--spacing-medium) 0 0 0;\n }\n }\n `,\n AUTH_STYLE_SIGN\n ]\n\n @property({ type: Object }) data: any\n @property({ type: Array }) domains: any[] = []\n @property({ type: Array }) domainTypes?: string[]\n @property({ type: Object }) user: any\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n private redirectTo?: string\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n return html`\n <div class=\"content md-typescale-display-medium\">\n <div class=\"wrap\">\n <div class=\"auth-brand\">\n <img src=${icon || ''} />\n <strong class=\"name\">${title}</strong>\n <span class=\"welcome-msg\">${description}</span>\n </div>\n\n <h3>${i18next.t('label.select_domain')}</h3>\n\n ${this.domains?.length\n ? html`\n <ul class=\"domains\">\n ${this.domains.map(\n domain => html`\n <li\n @click=${() =>\n (location.href = `/auth/checkin/${domain.subdomain}?redirect_to=${encodeURIComponent(this.redirectTo || '/')}`)}\n >\n <md-icon>keyboard_arrow_right</md-icon>\n <strong>${domain.name}</strong>\n <span>${domain.description} </span>\n </li>\n `\n )}\n </ul>\n `\n : html` <h3>${i18next.t('text.no domain available')}</h3> `}\n\n <div class=\"button-container\">\n <md-elevated-button @click=${() => (location.pathname = '/auth/signout')}\n >${String(i18next.t('button.logout'))}</md-elevated-button\n >\n </div>\n\n ${isSafari()\n ? html``\n : html`\n <div class=\"lottie-container\">\n <lottie-player autoplay loop src=\"../../assets/images/background-animation.json\"></lottie-player>\n </div>\n `}\n </div>\n </div>\n `\n }\n\n updated(changed) {\n if (changed.has('data')) {\n this.domains = this.data.domains\n this.user = this.data.user\n this.domainTypes = this.data.domainTypes\n this.redirectTo = this.data.redirectTo\n\n this.requestUpdate()\n }\n }\n\n navigateToUrl(url) {\n location.pathname = url\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,8 +1,8 @@
|
|
|
1
1
|
import '@material/web/button/elevated-button.js';
|
|
2
2
|
import '@material/web/button/text-button.js';
|
|
3
3
|
import '@operato/i18n/ox-i18n.js';
|
|
4
|
-
import '../../components/profile-component';
|
|
5
|
-
import { AbstractAuthPage } from '../../components/abstract-auth-page';
|
|
4
|
+
import '../../components/profile-component.js';
|
|
5
|
+
import { AbstractAuthPage } from '../../components/abstract-auth-page.js';
|
|
6
6
|
export declare class ForgotPassword extends AbstractAuthPage {
|
|
7
7
|
emailInput: HTMLInputElement;
|
|
8
8
|
button: HTMLInputElement;
|
|
@@ -2,11 +2,11 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import '@material/web/button/elevated-button.js';
|
|
3
3
|
import '@material/web/button/text-button.js';
|
|
4
4
|
import '@operato/i18n/ox-i18n.js';
|
|
5
|
-
import '../../components/profile-component';
|
|
5
|
+
import '../../components/profile-component.js';
|
|
6
6
|
import { html } from 'lit';
|
|
7
7
|
import { customElement, query } from 'lit/decorators.js';
|
|
8
8
|
import { i18next } from '@operato/i18n';
|
|
9
|
-
import { AbstractAuthPage } from '../../components/abstract-auth-page';
|
|
9
|
+
import { AbstractAuthPage } from '../../components/abstract-auth-page.js';
|
|
10
10
|
let ForgotPassword = class ForgotPassword extends AbstractAuthPage {
|
|
11
11
|
get pageName() {
|
|
12
12
|
return 'forgot password';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.js","sourceRoot":"","sources":["../../../client/entries/auth/forgot-password.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,qCAAqC,CAAA;AAE5C,OAAO,0BAA0B,CAAA;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"forgot-password.js","sourceRoot":"","sources":["../../../client/entries/auth/forgot-password.ts"],"names":[],"mappings":";AAAA,OAA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CAAA;IACJ,CAAC;CACF,CAAA;AAhGkB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8BAAc,gBAAgB;kDAAA;AACrB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;8BAAU,gBAAgB;8CAAA;AAFvC,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAiG1B","sourcesContent":["import '@material/web/button/elevated-button.js'\nimport '@material/web/button/text-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '../../components/profile-component.js'\n\nimport { html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { AbstractAuthPage } from '../../components/abstract-auth-page.js'\n\n@customElement('forgot-password')\nexport class ForgotPassword extends AbstractAuthPage {\n @query('#email') emailInput!: HTMLInputElement\n @query('#submit-button') button!: HTMLInputElement\n\n get pageName() {\n return 'forgot password'\n }\n\n get actionUrl() {\n return '/auth/forgot-password'\n }\n\n get formfields() {\n const email = this.data?.email || ''\n\n return html`\n <div class=\"field\">\n <md-filled-text-field\n name=\"email\"\n type=\"email\"\n label=${String(i18next.t('label.email'))}\n .value=${email}\n required\n @input=${(e: Event) => {\n const target = e.target as HTMLInputElement\n if (target.validity.typeMismatch) {\n target.setCustomValidity(i18next.t('text.invalid-email'))\n } else {\n target.setCustomValidity('')\n }\n }}\n ><md-icon slot=\"leading-icon\">mail</md-icon></md-filled-text-field\n >\n </div>\n <md-elevated-button\n id=\"submit-button\"\n class=\"ui button\"\n type=\"button\"\n @click=${e => {\n this._onSubmit(e)\n return false\n }}\n >\n <ox-i18n msgid=\"button.submit\"></ox-i18n>\n </md-elevated-button>\n `\n }\n\n get links() {\n return html`\n <a class=\"link\" href=\"/auth/signin\">\n <md-text-button><ox-i18n msgid=\"field.sign in\"></ox-i18n></md-text-button>\n </a>\n `\n }\n\n async submit() {\n var timer\n var formData = new FormData(this.formEl)\n\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n this.button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/forgot-password', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n this.showSnackbar({\n message: await response.text(),\n level: response.ok ? 'info' : 'error'\n })\n } catch (e) {\n } finally {\n this.button.disabled = false\n clearTimeout(timer)\n }\n }\n\n showSnackbar({ message, level }) {\n super.showSnackbar({\n level,\n message\n })\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractPasswordReset } from '../../components/abstract-password-reset';
|
|
1
|
+
import { AbstractPasswordReset } from '../../components/abstract-password-reset.js';
|
|
2
2
|
export declare class ResetPassword extends AbstractPasswordReset {
|
|
3
3
|
get pageName(): string;
|
|
4
4
|
get actionUrl(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { AbstractPasswordReset } from '../../components/abstract-password-reset';
|
|
3
|
+
import { AbstractPasswordReset } from '../../components/abstract-password-reset.js';
|
|
4
4
|
let ResetPassword = class ResetPassword extends AbstractPasswordReset {
|
|
5
5
|
get pageName() {
|
|
6
6
|
return 'reset password';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password.js","sourceRoot":"","sources":["../../../client/entries/auth/reset-password.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reset-password.js","sourceRoot":"","sources":["../../../client/entries/auth/reset-password.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAG5E,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,qBAAqB;IACtD,IAAI,QAAQ;QACV,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,sBAAsB,CAAA;IAC/B,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,uBAAuB,CAAA;IAChC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,gBAAgB,CAAA;IACzB,CAAC;CACF,CAAA;AAhBY,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAgBzB","sourcesContent":["import { customElement } from 'lit/decorators.js'\n\nimport { AbstractPasswordReset } from '../../components/abstract-password-reset.js'\n\n@customElement('reset-password')\nexport class ResetPassword extends AbstractPasswordReset {\n get pageName() {\n return 'reset password'\n }\n\n get actionUrl() {\n return '/auth/reset-password'\n }\n\n get submitButtonLabel() {\n return 'label.change password'\n }\n\n get title() {\n return 'reset password'\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@material/web/button/elevated-button.js';
|
|
2
2
|
import '@operato/lottie-player';
|
|
3
|
-
import '../../components/profile-component';
|
|
3
|
+
import '../../components/profile-component.js';
|
|
4
4
|
import { LitElement } from 'lit';
|
|
5
5
|
declare const AuthResult_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
6
6
|
export declare class AuthResult extends AuthResult_base {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/web/button/elevated-button.js';
|
|
3
3
|
import '@operato/lottie-player';
|
|
4
|
-
import '../../components/profile-component';
|
|
4
|
+
import '../../components/profile-component.js';
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { customElement, property } from 'lit/decorators.js';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../client/entries/auth/result.ts"],"names":[],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evated-button.js'\n\nimport '@operato/lottie-player'\nimport '../../components/profile-component.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { isSafari } from '@operato/utils'\n\n@customElement('auth-result')\nexport class AuthResult extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n .wrap {\n display: block;\n width: 450px;\n min-width: 350px;\n margin: 0 auto;\n text-align: center;\n }\n .auth-brand {\n color: #fff;\n }\n .auth-brand img {\n margin: 15% auto 5px auto;\n width: 100px;\n border: 3px solid var(--md-sys-color-on-primary);\n border-radius: 25px;\n box-shadow: var(--box-shadow);\n }\n .name {\n display: block;\n font: var(--auth-brand-name);\n text-shadow: var(--auth-brand-name-shadow);\n }\n h1 {\n margin: 50px 0 0 0;\n padding: 0;\n font-size: 24px;\n color: var(--auth-title-color, var(--md-sys-color-on-primary));\n }\n p {\n margin: 0;\n padding: var(--auth-description-padding);\n font: var(--auth-description-font);\n color: var(--auth-description-color, var(--md-sys-color-on-secondary));\n }\n :host *:focus {\n outline: none;\n }\n .user {\n background: url(/assets/images/icon-profile.png) center top no-repeat;\n margin: var(--profile-icon-margin);\n padding: 180px 20px 20px 20px;\n color: var(--md-sys-color-secondary);\n font: var(--header-bar-title);\n text-align: center;\n }\n\n label {\n font: bold 14px var(--theme-font);\n color: var(--md-sys-color-primary);\n }\n\n #button-area {\n border-top: 1px dashed rgba(0, 0, 0, 0.1);\n padding-top: 10px;\n }\n\n md-elevated-button {\n --md-button-horizontal-padding: var(--spacing-medium);\n --md-button-ink-color: var(--md-sys-color-primary);\n }\n\n .lottie-container {\n width: 100%;\n height: 300px;\n position: absolute;\n left: 0;\n bottom: 0;\n pointer-events: none;\n }\n .lottie-container lottie-player {\n position: absolute;\n bottom: -6%;\n width: 100%;\n height: auto;\n }\n\n @media (max-width: 450px) {\n .wrap {\n width: 85%;\n min-width: 320px;\n padding-bottom: 100px;\n }\n .auth-form {\n grid-template-columns: 1fr;\n }\n .auth-brand img {\n margin: 12% auto 5px auto;\n width: 75px;\n }\n .lottie-container {\n overflow: hidden;\n height: 200px;\n pointer-events: none;\n }\n .lottie-container lottie-player {\n width: 1200px;\n left: -30%;\n }\n }\n `\n ]\n\n @property({ type: Object }) data: any\n @property({ type: String }) message?: string\n @property({ type: String }) resultType?: string\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n updated(changed) {\n if (changed.has('data')) {\n this.message = this.data.message\n this.resultType = this.data.resultType || 'congratulations'\n }\n }\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n return html`\n <div class=\"wrap ${this.resultType}\">\n <div class=\"auth-brand\">\n <img src=${icon} />\n <strong class=\"name\">${title}</strong>\n <span class=\"welcome-msg\">${description}</span>\n </div>\n\n <div id=\"message-area\">\n <h1>${this.message || ''}</h1>\n\n <!--description message container-->\n <p></p>\n </div>\n <div id=\"button-area\">\n <md-elevated-button\n @click=${e => {\n window.location.replace('/auth/signin')\n }}\n >\n <md-icon slot=\"icon\">home</md-icon>\n ${i18next.t('button.go to home')}\n </md-elevated-button>\n </div>\n\n ${isSafari()\n ? html``\n : html`\n <div class=\"lottie-container\">\n <lottie-player autoplay loop src=\"../../assets/images/background-animation.json\"></lottie-player>\n </div>\n `}\n </div>\n `\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,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
import { AbstractSign } from '../../components/abstract-sign';
|
|
3
|
+
import { AbstractSign } from '../../components/abstract-sign.js';
|
|
4
4
|
let AuthSignin = class AuthSignin extends AbstractSign {
|
|
5
5
|
get pageName() {
|
|
6
6
|
return 'sign in';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signin.js","sourceRoot":"","sources":["../../../client/entries/auth/signin.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"signin.js","sourceRoot":"","sources":["../../../client/entries/auth/signin.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAGzD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,YAAY;IAC1C,IAAI,QAAQ;QACV,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,cAAc,CAAA;IACvB,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAZY,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAYtB","sourcesContent":["import { customElement } from 'lit/decorators.js'\n\nimport { AbstractSign } from '../../components/abstract-sign.js'\n\n@customElement('auth-signin')\nexport class AuthSignin extends AbstractSign {\n get pageName() {\n return 'sign in'\n }\n\n get actionUrl() {\n return '/auth/signin'\n }\n\n get autocompletable() {\n return true\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@operato/i18n/ox-i18n.js';
|
|
2
|
-
import { AbstractSign } from '../../components/abstract-sign';
|
|
2
|
+
import { AbstractSign } from '../../components/abstract-sign.js';
|
|
3
3
|
export declare class AuthSignup extends AbstractSign {
|
|
4
4
|
private passwordPattern?;
|
|
5
5
|
private passwordHelp?;
|
|
@@ -7,6 +7,8 @@ export declare class AuthSignup extends AbstractSign {
|
|
|
7
7
|
get actionUrl(): string;
|
|
8
8
|
confirmPass: HTMLInputElement;
|
|
9
9
|
get formfields(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
updated(changed: Map<string | number | symbol, unknown>): void;
|
|
11
|
+
submit(): Promise<void>;
|
|
10
12
|
languageUpdated(): void;
|
|
11
13
|
get links(): import("lit-html").TemplateResult<1>;
|
|
12
14
|
}
|
|
@@ -3,8 +3,8 @@ import '@operato/i18n/ox-i18n.js';
|
|
|
3
3
|
import { html } from 'lit';
|
|
4
4
|
import { customElement, query } from 'lit/decorators.js';
|
|
5
5
|
import { i18next } from '@operato/i18n';
|
|
6
|
-
import { AbstractSign } from '../../components/abstract-sign';
|
|
7
|
-
import { generatePasswordPatternHelp, generatePasswordPatternRegExp } from '../../utils/password-rule';
|
|
6
|
+
import { AbstractSign } from '../../components/abstract-sign.js';
|
|
7
|
+
import { generatePasswordPatternHelp, generatePasswordPatternRegExp } from '../../utils/password-rule.js';
|
|
8
8
|
let AuthSignup = class AuthSignup extends AbstractSign {
|
|
9
9
|
get pageName() {
|
|
10
10
|
return 'sign up';
|
|
@@ -87,6 +87,36 @@ let AuthSignup = class AuthSignup extends AbstractSign {
|
|
|
87
87
|
</md-elevated-button>
|
|
88
88
|
`;
|
|
89
89
|
}
|
|
90
|
+
updated(changed) {
|
|
91
|
+
super.updated(changed);
|
|
92
|
+
if (changed.has('data')) {
|
|
93
|
+
const { recaptchaSiteKey } = this.data;
|
|
94
|
+
if (recaptchaSiteKey) {
|
|
95
|
+
const script = document.createElement('script');
|
|
96
|
+
script.src = `https://www.google.com/recaptcha/enterprise.js?render=${recaptchaSiteKey}`;
|
|
97
|
+
document.head.appendChild(script);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async submit() {
|
|
102
|
+
const { recaptchaSiteKey } = this.data;
|
|
103
|
+
if (recaptchaSiteKey) {
|
|
104
|
+
const form = this.formEl;
|
|
105
|
+
const action = 'signup';
|
|
106
|
+
grecaptcha.enterprise.ready(async () => {
|
|
107
|
+
const token = await grecaptcha.enterprise.execute(recaptchaSiteKey, { action });
|
|
108
|
+
var recaptchaResponse = document.createElement('input');
|
|
109
|
+
recaptchaResponse.setAttribute('type', 'hidden');
|
|
110
|
+
recaptchaResponse.setAttribute('name', 'recaptcha-response');
|
|
111
|
+
recaptchaResponse.setAttribute('value', token);
|
|
112
|
+
form.appendChild(recaptchaResponse);
|
|
113
|
+
form.submit();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
this.formEl.submit();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
90
120
|
languageUpdated() {
|
|
91
121
|
this.passwordPattern = generatePasswordPatternRegExp(this.data.passwordRule).source;
|
|
92
122
|
this.passwordHelp = generatePasswordPatternHelp(this.data.passwordRule);
|