@isoftdata/svelte-user-configuration 1.0.20 → 1.0.22

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.
@@ -1,6 +1,7 @@
1
1
  <script>import { getContext } from "svelte";
2
2
  import Icon from "@isoftdata/svelte-icon";
3
3
  import Input from "@isoftdata/svelte-input";
4
+ import { translate as defaultTranslate } from "@isoftdata/utility-string";
4
5
  import Button from "@isoftdata/svelte-button";
5
6
  import TextArea from "@isoftdata/svelte-textarea";
6
7
  import PasswordSetModal from "./PasswordSetModal.svelte";
@@ -26,7 +27,7 @@ let passwordSetModal;
26
27
  let deactivateUserModal;
27
28
  let passwordRecoveryModal;
28
29
  let activationPINInput;
29
- const { t: translate } = getContext("i18next") || { t: (_key, fallback) => fallback };
30
+ const { t: translate } = getContext("i18next") || { t: defaultTranslate };
30
31
  async function getNewActivationPIN(sendEmail = false) {
31
32
  let confirmationMessage = sendEmail ? translate("configuration.user.permissions.sendNewActivationPINMessage", "Are you sure you want to send a new activation PIN? The user will receive an email with the new activation PIN.") : translate("configuration.user.permissions.generateNewActivationPINMessage", "Are you sure you want to generate a new activation PIN?");
32
33
  if (confirm(confirmationMessage)) {
@@ -151,7 +152,7 @@ $: isCreatingNewUser = userAccount.id === null;
151
152
  {/if}
152
153
  {#if activationPIN && userAccount.userActivationData?.activationPINExpiration}
153
154
  <small class="text-danger"
154
- >{translate('configuratioin.user.activationPINExpireText', 'Activation PIN expires on {{date}}', {
155
+ >{translate('configuratioin.user.activationPINExpireText', 'Activation PIN expires on {{- date}}', {
155
156
  date: userAccount.userActivationData.activationPINExpiration.toLocaleString(),
156
157
  })}</small
157
158
  >
@@ -163,10 +164,9 @@ $: isCreatingNewUser = userAccount.id === null;
163
164
  size="sm"
164
165
  outline
165
166
  iconClass="paper-plane"
167
+ disabled={!canEditAccountInfo}
166
168
  on:click={() => {
167
- if (userAccount.recoveryEmail) {
168
- passwordRecoveryModal.open(userAccount.workEmail, userAccount.lastPasswordResetDate)
169
- }
169
+ passwordRecoveryModal.open(userAccount.workEmail, userAccount.lastPasswordResetDate)
170
170
  }}
171
171
  >
172
172
  {translate('configuration.user.sendResetToken', 'Send Reset Token')}...
@@ -176,6 +176,7 @@ $: isCreatingNewUser = userAccount.id === null;
176
176
  size="sm"
177
177
  outline
178
178
  iconClass="key"
179
+ disabled={!canEditAccountInfo}
179
180
  on:click={() => passwordSetModal.open(userAccount)}
180
181
  >
181
182
  {translate('configuration.user.setPassword', 'Set Password')}...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-user-configuration",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -67,6 +67,7 @@
67
67
  "@isoftdata/svelte-select": "^1.5.0",
68
68
  "@isoftdata/svelte-table": "^1.16.0",
69
69
  "@isoftdata/svelte-textarea": "^1.2.0",
70
+ "@isoftdata/utility-string": "^2.1.0",
70
71
  "just-camel-case": "^6.2.0",
71
72
  "klona": "^2.0.6"
72
73
  }