@abpjs/ui 0.2.0-next.14 → 0.2.0-next.15
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/CHANGELOG.md +9 -0
- package/dist/guard.d.ts +70 -7
- package/dist/guard.js +850 -356
- package/dist/guard.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/guard.js
CHANGED
|
@@ -371,7 +371,66 @@ var ar_default = {
|
|
|
371
371
|
"secondFactor.kinds.email": "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",
|
|
372
372
|
"secondFactor.kinds.sms": "\u0631\u0633\u0627\u0644\u0629 \u0646\u0635\u064A\u0629",
|
|
373
373
|
"secondFactor.kinds.whatsapp": "\u0648\u0627\u062A\u0633\u0627\u0628",
|
|
374
|
-
"secondFactor.kinds.passkey": "\u0645\u0641\u062A\u0627\u062D \u0645\u0631\u0648\u0631"
|
|
374
|
+
"secondFactor.kinds.passkey": "\u0645\u0641\u062A\u0627\u062D \u0645\u0631\u0648\u0631",
|
|
375
|
+
"secondFactor.title": "\u0627\u0644\u062A\u062D\u0642\u0642 \u0628\u062E\u0637\u0648\u062A\u064A\u0646",
|
|
376
|
+
"secondFactor.panelHint": "\u0645\u0641\u062A\u0627\u062D \u0645\u0631\u0648\u0631\u060C \u0623\u0648 \u0631\u0645\u0632 \u0645\u0646 \u062A\u0637\u0628\u064A\u0642 \u0639\u0644\u0649 \u0647\u0627\u062A\u0641\u0643\u060C \u0628\u0639\u062F \u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631\u060C \u0641\u0644\u0627 \u062A\u0643\u0641\u064A \u0643\u0644\u0645\u0629 \u0645\u0631\u0648\u0631 \u0645\u0633\u0631\u0648\u0642\u0629 \u0648\u062D\u062F\u0647\u0627 \u0644\u062F\u062E\u0648\u0644 \u0623\u062D\u062F.",
|
|
377
|
+
"secondFactor.on": "\u0645\u0641\u0639\u0651\u0644",
|
|
378
|
+
"secondFactor.off": "\u0645\u062A\u0648\u0642\u0641",
|
|
379
|
+
"secondFactor.modeHint.off": "\u0644\u0627 \u062A\u0637\u0644\u0628 \u0645\u062C\u0645\u0648\u0639\u0627\u062A\u0643 \u0639\u0627\u0645\u0644\u064B\u0627 \u062B\u0627\u0646\u064A\u064B\u0627. \u0625\u0646 \u0623\u0639\u062F\u062F\u062A \u0648\u0627\u062D\u062F\u064B\u0627 \u0641\u0633\u064A\u064F\u0637\u0644\u0628 \u0645\u0646\u0643 \u0639\u0646\u062F \u0643\u0644 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644.",
|
|
380
|
+
"secondFactor.modeHint.optional": "\u062A\u062A\u064A\u062D \u0645\u062C\u0645\u0648\u0639\u0627\u062A\u0643 \u0639\u0627\u0645\u0644\u064B\u0627 \u062B\u0627\u0646\u064A\u064B\u0627. \u0625\u0646 \u0623\u0639\u062F\u062F\u062A \u0648\u0627\u062D\u062F\u064B\u0627 \u0641\u0633\u064A\u064F\u0637\u0644\u0628 \u0645\u0646\u0643 \u0639\u0646\u062F \u0643\u0644 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644.",
|
|
381
|
+
"secondFactor.modeHint.required": "\u062A\u0634\u062A\u0631\u0637 \u0645\u062C\u0645\u0648\u0639\u0627\u062A\u0643 \u0639\u0627\u0645\u0644\u064B\u0627 \u062B\u0627\u0646\u064A\u064B\u0627 \u0639\u0646\u062F \u0643\u0644 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644.",
|
|
382
|
+
"secondFactor.modeHint.strong": "\u062A\u0634\u062A\u0631\u0637 \u0645\u062C\u0645\u0648\u0639\u0627\u062A\u0643 \u0639\u0627\u0645\u0644\u064B\u0627 \u062B\u0627\u0646\u064A\u064B\u0627 \u0639\u0646\u062F \u0643\u0644 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u060C \u0645\u0646 \u062A\u0637\u0628\u064A\u0642 \u0645\u0635\u0627\u062F\u0642\u0629.",
|
|
383
|
+
"secondFactor.added": "\u0623\u064F\u0636\u064A\u0641",
|
|
384
|
+
"secondFactor.lastUsed": "\u0622\u062E\u0631 \u0627\u0633\u062A\u062E\u062F\u0627\u0645",
|
|
385
|
+
"secondFactor.never": "\u0644\u0645 \u064A\u064F\u0633\u062A\u062E\u062F\u0645 \u0628\u0639\u062F",
|
|
386
|
+
"secondFactor.none": "\u0644\u0645 \u064A\u064F\u0639\u062F\u0651 \u0639\u0627\u0645\u0644 \u062B\u0627\u0646\u064D \u0628\u0639\u062F.",
|
|
387
|
+
"secondFactor.remove": "\u0625\u0632\u0627\u0644\u0629",
|
|
388
|
+
"secondFactor.removeTitle": "\u0625\u0632\u0627\u0644\u0629 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629 \u0647\u0630\u0627\u061F",
|
|
389
|
+
"secondFactor.removeHint": "\u062A\u062A\u0648\u0642\u0641 \u0631\u0645\u0648\u0632\u0647 \u0639\u0646 \u0627\u0644\u0639\u0645\u0644. \u0648\u0625\u0646 \u0644\u0645 \u064A\u0628\u0642\u064E \u0644\u0643 \u0639\u0627\u0645\u0644 \u062B\u0627\u0646\u064D\u060C \u062A\u062A\u0648\u0642\u0641 \u0631\u0645\u0648\u0632 \u0627\u0644\u0627\u0633\u062A\u0631\u062F\u0627\u062F \u0623\u064A\u0636\u064B\u0627.",
|
|
390
|
+
"secondFactor.removed": "\u0623\u064F\u0632\u064A\u0644 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629.",
|
|
391
|
+
"secondFactor.setUp": "\u0625\u0639\u062F\u0627\u062F \u062A\u0637\u0628\u064A\u0642 \u0645\u0635\u0627\u062F\u0642\u0629",
|
|
392
|
+
"secondFactor.addAnother": "\u0625\u0636\u0627\u0641\u0629 \u062A\u0637\u0628\u064A\u0642 \u0645\u0635\u0627\u062F\u0642\u0629 \u0622\u062E\u0631",
|
|
393
|
+
"secondFactor.recoveryLeft": "{count, plural, =0 {\u0644\u0645 \u062A\u0628\u0642\u064E \u0631\u0645\u0648\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F} one {\u0628\u0642\u064A \u0631\u0645\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F \u0648\u0627\u062D\u062F} two {\u0628\u0642\u064A \u0631\u0645\u0632\u0627 \u0627\u0633\u062A\u0631\u062F\u0627\u062F} few {\u0628\u0642\u064A\u062A # \u0631\u0645\u0648\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F} many {\u0628\u0642\u064A # \u0631\u0645\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F} other {\u0628\u0642\u064A # \u0631\u0645\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F}}",
|
|
394
|
+
"secondFactor.renew": "\u0631\u0645\u0648\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F \u062C\u062F\u064A\u062F\u0629",
|
|
395
|
+
"secondFactor.renewTitle": "\u0625\u0646\u0634\u0627\u0621 \u0631\u0645\u0648\u0632 \u0627\u0633\u062A\u0631\u062F\u0627\u062F \u062C\u062F\u064A\u062F\u0629\u061F",
|
|
396
|
+
"secondFactor.renewHint": "\u062A\u062A\u0648\u0642\u0641 \u0631\u0645\u0648\u0632 \u0627\u0644\u0627\u0633\u062A\u0631\u062F\u0627\u062F \u0627\u0644\u0642\u062F\u064A\u0645\u0629 \u0639\u0646 \u0627\u0644\u0639\u0645\u0644.",
|
|
397
|
+
"secondFactor.setup.scan": "\u0627\u0645\u0633\u062D \u0631\u0645\u0632 QR \u0647\u0630\u0627 \u0628\u062A\u0637\u0628\u064A\u0642 \u0645\u0635\u0627\u062F\u0642\u0629\u060C \u0645\u062B\u0644 Microsoft Authenticator \u0623\u0648 Google Authenticator \u0623\u0648 1Password.",
|
|
398
|
+
"secondFactor.setup.qrAlt": "\u0631\u0645\u0632 QR \u0644\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629",
|
|
399
|
+
"secondFactor.setup.cantScan": "\u0644\u0627 \u064A\u0645\u0643\u0646\u0643 \u0645\u0633\u062D\u0647\u061F \u0623\u062F\u062E\u0644 \u0647\u0630\u0627 \u0627\u0644\u0645\u0641\u062A\u0627\u062D \u0641\u064A \u0627\u0644\u062A\u0637\u0628\u064A\u0642 \u0628\u062F\u0644\u064B\u0627 \u0645\u0646 \u0630\u0644\u0643:",
|
|
400
|
+
"secondFactor.setup.onThisDevice": "\u0627\u0641\u062A\u062D\u0647 \u0641\u064A \u062A\u0637\u0628\u064A\u0642 \u0645\u0635\u0627\u062F\u0642\u0629 \u0639\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u062C\u0647\u0627\u0632",
|
|
401
|
+
"secondFactor.setup.code": "\u0627\u0644\u0631\u0645\u0632 \u0645\u0646 \u0627\u0644\u062A\u0637\u0628\u064A\u0642",
|
|
402
|
+
"secondFactor.setup.codeHint": "\u0627\u0644\u0623\u0631\u0642\u0627\u0645 \u0627\u0644\u0633\u062A\u0629 \u0627\u0644\u062A\u064A \u064A\u0639\u0631\u0636\u0647\u0627 \u0627\u0644\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0622\u0646.",
|
|
403
|
+
"secondFactor.setup.verify": "\u062A\u062D\u0642\u0642",
|
|
404
|
+
"secondFactor.setup.wrongCode": "\u0644\u0645 \u064A\u062A\u0637\u0627\u0628\u0642 \u0627\u0644\u0631\u0645\u0632. \u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u0644\u0648\u0642\u062A \u0639\u0644\u0649 \u0647\u0627\u062A\u0641\u0643\u060C \u0648\u0623\u062F\u062E\u0644 \u0627\u0644\u0631\u0645\u0632 \u0627\u0644\u0630\u064A \u064A\u0639\u0631\u0636\u0647 \u0627\u0644\u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0622\u0646.",
|
|
405
|
+
"secondFactor.setup.cancel": "\u0625\u0644\u063A\u0627\u0621",
|
|
406
|
+
"secondFactor.setup.done": "\u0623\u064F\u0639\u062F\u0651 \u062A\u0637\u0628\u064A\u0642 \u0627\u0644\u0645\u0635\u0627\u062F\u0642\u0629.",
|
|
407
|
+
"secondFactor.recovery.title": "\u0631\u0645\u0648\u0632 \u0627\u0644\u0627\u0633\u062A\u0631\u062F\u0627\u062F",
|
|
408
|
+
"secondFactor.recovery.hint": "\u0643\u0644 \u0631\u0645\u0632 \u064A\u064F\u062F\u062E\u0644\u0643 \u0645\u0631\u0629 \u0648\u0627\u062D\u062F\u0629 \u0625\u0646 \u0641\u0642\u062F\u062A \u0647\u0627\u062A\u0641\u0643. \u0627\u062D\u0641\u0638\u0647\u0627 \u0641\u064A \u0645\u0643\u0627\u0646 \u0622\u0645\u0646: \u0644\u0646 \u062A\u064F\u0639\u0631\u0636 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",
|
|
409
|
+
"secondFactor.recovery.copy": "\u0646\u0633\u062E",
|
|
410
|
+
"secondFactor.recovery.download": "\u062A\u0646\u0632\u064A\u0644",
|
|
411
|
+
"secondFactor.recovery.copied": "\u0646\u064F\u0633\u062E\u062A \u0631\u0645\u0648\u0632 \u0627\u0644\u0627\u0633\u062A\u0631\u062F\u0627\u062F.",
|
|
412
|
+
"secondFactor.recovery.copyFailed": "\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0646\u0633\u062E: \u062D\u062F\u0651\u062F\u0647\u0627 \u0648\u0627\u0646\u0633\u062E\u0647\u0627 \u0628\u0646\u0641\u0633\u0643.",
|
|
413
|
+
"secondFactor.recovery.saved": "\u062D\u0641\u0638\u062A\u0647\u0627",
|
|
414
|
+
"secondFactor.recovery.fileHeader": "\u0631\u0645\u0648\u0632 \u0627\u0644\u0627\u0633\u062A\u0631\u062F\u0627\u062F \u0644\u0640 {site}. \u0643\u0644 \u0631\u0645\u0632 \u064A\u064F\u062F\u062E\u0644\u0643 \u0645\u0631\u0629 \u0648\u0627\u062D\u062F\u0629.",
|
|
415
|
+
"secondFactor.alsoBy": "\u064A\u0645\u0643\u0646\u0643 \u0623\u064A\u0636\u064B\u0627 \u0627\u0644\u062D\u0635\u0648\u0644 \u0639\u0644\u0649 \u0631\u0645\u0632 \u0639\u0628\u0631 {list}.",
|
|
416
|
+
"secondFactor.addPasskey": "\u0623\u0636\u0641 \u0645\u0641\u062A\u0627\u062D \u0645\u0631\u0648\u0631",
|
|
417
|
+
"secondFactor.passkeyHint": "\u0633\u0645\u0650\u0651\u0647 \u0628\u0627\u0633\u0645 \u0627\u0644\u062C\u0647\u0627\u0632\u060C \u062B\u0645 \u0627\u062A\u0628\u0639 \u0645\u0627 \u064A\u0637\u0644\u0628\u0647.",
|
|
418
|
+
"secondFactor.passkeyName": "\u0627\u0633\u0645 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631",
|
|
419
|
+
"secondFactor.passkeyNameDefault": "\u0645\u0641\u062A\u0627\u062D \u0645\u0631\u0648\u0631",
|
|
420
|
+
"secondFactor.passkeyCreate": "\u0623\u0646\u0634\u0626 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631",
|
|
421
|
+
"secondFactor.passkeyAdded": "\u0623\u064F\u0636\u064A\u0641 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631.",
|
|
422
|
+
"secondFactor.passkeyCancelled": "\u0644\u0645 \u064A\u064F\u0646\u0634\u0623 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631.",
|
|
423
|
+
"secondFactor.passkeyRemoved": "\u0623\u064F\u0632\u064A\u0644 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631.",
|
|
424
|
+
"secondFactor.removePasskeyTitle": "\u0625\u0632\u0627\u0644\u0629 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631 \u0647\u0630\u0627\u061F",
|
|
425
|
+
"secondFactor.removePasskeyHint": "\u0644\u0646 \u064A\u0639\u0645\u0644 \u0628\u0639\u062F \u0630\u0644\u0643 \u0644\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0623\u0648 \u0644\u062A\u0623\u0643\u064A\u062F \u0647\u0648\u064A\u062A\u0643.",
|
|
426
|
+
"secondFactor.rename": "\u0625\u0639\u0627\u062F\u0629 \u062A\u0633\u0645\u064A\u0629",
|
|
427
|
+
"secondFactor.renameTitle": "\u0625\u0639\u0627\u062F\u0629 \u062A\u0633\u0645\u064A\u0629 \u0645\u0641\u062A\u0627\u062D \u0627\u0644\u0645\u0631\u0648\u0631",
|
|
428
|
+
"secondFactor.save": "\u062D\u0641\u0638",
|
|
429
|
+
"secondFactor.cancel": "\u0625\u0644\u063A\u0627\u0621",
|
|
430
|
+
"secondFactor.required.title": "\u0623\u0639\u062F\u0651 \u0645\u0641\u062A\u0627\u062D \u0645\u0631\u0648\u0631 \u0623\u0648 \u062A\u0637\u0628\u064A\u0642 \u0645\u0635\u0627\u062F\u0642\u0629",
|
|
431
|
+
"secondFactor.required.by": "\u064A\u062D\u062A\u0627\u062C \u0645\u062F\u064A\u0631\u0648 \u0627\u0644\u0645\u0648\u0642\u0639 \u0625\u0644\u0649 \u0623\u062D\u062F\u0647\u0645\u0627. \u0623\u0639\u062F\u0651\u0647 \u0642\u0628\u0644 {date}\u061B \u0628\u0639\u062F \u0630\u0644\u0643 \u064A\u0637\u0644\u0628\u0647 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0623\u0648\u0644\u064B\u0627.",
|
|
432
|
+
"secondFactor.required.overdue": "\u064A\u062D\u062A\u0627\u062C \u0645\u062F\u064A\u0631\u0648 \u0627\u0644\u0645\u0648\u0642\u0639 \u0625\u0644\u0649 \u0623\u062D\u062F\u0647\u0645\u0627\u060C \u0648\u0642\u062F \u0645\u0636\u0649 \u0627\u0644\u0645\u0648\u0639\u062F: \u0623\u0639\u062F\u0651\u0647 \u0627\u0644\u0622\u0646.",
|
|
433
|
+
"secondFactor.required.setUp": "\u0623\u0639\u062F\u0651\u0647"
|
|
375
434
|
};
|
|
376
435
|
|
|
377
436
|
// src/areas/guard/texts/en.json
|
|
@@ -736,7 +795,66 @@ var en_default = {
|
|
|
736
795
|
"secondFactor.kinds.email": "email",
|
|
737
796
|
"secondFactor.kinds.sms": "SMS",
|
|
738
797
|
"secondFactor.kinds.whatsapp": "WhatsApp",
|
|
739
|
-
"secondFactor.kinds.passkey": "Passkey"
|
|
798
|
+
"secondFactor.kinds.passkey": "Passkey",
|
|
799
|
+
"secondFactor.title": "Two-factor sign-in",
|
|
800
|
+
"secondFactor.panelHint": "A passkey, or a code from an app on your phone, after your password, so a stolen password alone doesn't get anyone in.",
|
|
801
|
+
"secondFactor.on": "On",
|
|
802
|
+
"secondFactor.off": "Off",
|
|
803
|
+
"secondFactor.modeHint.off": "Your groups don't ask for a second factor. Set one up and you'll be asked for it at every sign-in.",
|
|
804
|
+
"secondFactor.modeHint.optional": "Your groups offer a second factor. Set one up and you'll be asked for it at every sign-in.",
|
|
805
|
+
"secondFactor.modeHint.required": "Your groups require a second factor at every sign-in.",
|
|
806
|
+
"secondFactor.modeHint.strong": "Your groups require a second factor at every sign-in, from an authenticator app.",
|
|
807
|
+
"secondFactor.added": "Added",
|
|
808
|
+
"secondFactor.lastUsed": "Last used",
|
|
809
|
+
"secondFactor.never": "Not yet",
|
|
810
|
+
"secondFactor.none": "No second factor set up yet.",
|
|
811
|
+
"secondFactor.remove": "Remove",
|
|
812
|
+
"secondFactor.removeTitle": "Remove this authenticator app?",
|
|
813
|
+
"secondFactor.removeHint": "Its codes stop working. With no second factor left, your recovery codes stop working too.",
|
|
814
|
+
"secondFactor.removed": "Authenticator app removed.",
|
|
815
|
+
"secondFactor.setUp": "Set up an authenticator app",
|
|
816
|
+
"secondFactor.addAnother": "Add another authenticator app",
|
|
817
|
+
"secondFactor.recoveryLeft": "{count, plural, =0 {No recovery codes left} one {# recovery code left} other {# recovery codes left}}",
|
|
818
|
+
"secondFactor.renew": "New recovery codes",
|
|
819
|
+
"secondFactor.renewTitle": "Make new recovery codes?",
|
|
820
|
+
"secondFactor.renewHint": "Your old recovery codes stop working.",
|
|
821
|
+
"secondFactor.setup.scan": "Scan this QR code with an authenticator app, such as Microsoft Authenticator, Google Authenticator or 1Password.",
|
|
822
|
+
"secondFactor.setup.qrAlt": "QR code for your authenticator app",
|
|
823
|
+
"secondFactor.setup.cantScan": "Can't scan it? Enter this key in the app instead:",
|
|
824
|
+
"secondFactor.setup.onThisDevice": "Open in an authenticator app on this device",
|
|
825
|
+
"secondFactor.setup.code": "Code from the app",
|
|
826
|
+
"secondFactor.setup.codeHint": "The six digits the app shows now.",
|
|
827
|
+
"secondFactor.setup.verify": "Verify",
|
|
828
|
+
"secondFactor.setup.wrongCode": "That code didn't match. Check the time on your phone, and enter the code the app shows now.",
|
|
829
|
+
"secondFactor.setup.cancel": "Cancel",
|
|
830
|
+
"secondFactor.setup.done": "Authenticator app set up.",
|
|
831
|
+
"secondFactor.recovery.title": "Your recovery codes",
|
|
832
|
+
"secondFactor.recovery.hint": "Each code signs you in once if you lose your phone. Keep them somewhere safe: they won't be shown again.",
|
|
833
|
+
"secondFactor.recovery.copy": "Copy",
|
|
834
|
+
"secondFactor.recovery.download": "Download",
|
|
835
|
+
"secondFactor.recovery.copied": "Recovery codes copied.",
|
|
836
|
+
"secondFactor.recovery.copyFailed": "Couldn't copy: select them and copy them yourself.",
|
|
837
|
+
"secondFactor.recovery.saved": "I've saved them",
|
|
838
|
+
"secondFactor.recovery.fileHeader": "Recovery codes for {site}. Each signs you in once.",
|
|
839
|
+
"secondFactor.alsoBy": "You can also get a code by {list}.",
|
|
840
|
+
"secondFactor.addPasskey": "Add a passkey",
|
|
841
|
+
"secondFactor.passkeyHint": "Name it after the device, then follow its prompt.",
|
|
842
|
+
"secondFactor.passkeyName": "Name for this passkey",
|
|
843
|
+
"secondFactor.passkeyNameDefault": "Passkey",
|
|
844
|
+
"secondFactor.passkeyCreate": "Create the passkey",
|
|
845
|
+
"secondFactor.passkeyAdded": "Passkey added.",
|
|
846
|
+
"secondFactor.passkeyCancelled": "The passkey wasn't created.",
|
|
847
|
+
"secondFactor.passkeyRemoved": "Passkey removed.",
|
|
848
|
+
"secondFactor.removePasskeyTitle": "Remove this passkey?",
|
|
849
|
+
"secondFactor.removePasskeyHint": "It stops working for signing in and confirming it's you.",
|
|
850
|
+
"secondFactor.rename": "Rename",
|
|
851
|
+
"secondFactor.renameTitle": "Rename this passkey",
|
|
852
|
+
"secondFactor.save": "Save",
|
|
853
|
+
"secondFactor.cancel": "Cancel",
|
|
854
|
+
"secondFactor.required.title": "Set up a passkey or an authenticator app",
|
|
855
|
+
"secondFactor.required.by": "Site admins need one. Set it up by {date}; after that, signing in asks you to first.",
|
|
856
|
+
"secondFactor.required.overdue": "Site admins need one, and the date has passed: set it up now.",
|
|
857
|
+
"secondFactor.required.setUp": "Set it up"
|
|
740
858
|
};
|
|
741
859
|
|
|
742
860
|
// src/areas/guard/texts.ts
|
|
@@ -1344,7 +1462,7 @@ function AccountScreen({ id, routes = guardRoutes() }) {
|
|
|
1344
1462
|
|
|
1345
1463
|
// src/areas/guard/AccountsScreen.tsx
|
|
1346
1464
|
import { useState as useState3 } from "react";
|
|
1347
|
-
import { HStack as HStack7, Input as Input2, SimpleGrid, Stack as Stack6, Text as
|
|
1465
|
+
import { HStack as HStack7, Input as Input2, SimpleGrid, Stack as Stack6, Text as Text8 } from "@chakra-ui/react";
|
|
1348
1466
|
import {
|
|
1349
1467
|
Button as Button6,
|
|
1350
1468
|
DataTable as DataTable5,
|
|
@@ -1352,6 +1470,7 @@ import {
|
|
|
1352
1470
|
errorText,
|
|
1353
1471
|
Field,
|
|
1354
1472
|
InlineAlert as InlineAlert5,
|
|
1473
|
+
ListFooter,
|
|
1355
1474
|
notify as notify4,
|
|
1356
1475
|
PageHeader as PageHeader2,
|
|
1357
1476
|
Panel as Panel6,
|
|
@@ -1362,7 +1481,7 @@ import {
|
|
|
1362
1481
|
useAreaListSource,
|
|
1363
1482
|
useAreaRequest as useAreaRequest6,
|
|
1364
1483
|
useCan as useCan2,
|
|
1365
|
-
useFormatters as
|
|
1484
|
+
useFormatters as useFormatters5,
|
|
1366
1485
|
useListState
|
|
1367
1486
|
} from "@abpjs/ui";
|
|
1368
1487
|
|
|
@@ -1409,79 +1528,51 @@ function DuplicatesPanel({ routes = guardRoutes() }) {
|
|
|
1409
1528
|
) });
|
|
1410
1529
|
}
|
|
1411
1530
|
|
|
1412
|
-
// src/areas/guard/ListFooter.tsx
|
|
1413
|
-
import { Flex, Text as Text8 } from "@chakra-ui/react";
|
|
1414
|
-
import { formatMessage, Pagination, useAbpLabels, useAbpLocale as useAbpLocale2, useFormatters as useFormatters5 } from "@abpjs/ui";
|
|
1415
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1416
|
-
function ListFooter({ list }) {
|
|
1417
|
-
const labels = useAbpLabels().queryList;
|
|
1418
|
-
const { locale } = useAbpLocale2();
|
|
1419
|
-
const fmt = useFormatters5();
|
|
1420
|
-
const { page, pageSize } = list.query;
|
|
1421
|
-
const from = list.total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
1422
|
-
const to = Math.min(page * pageSize, list.total);
|
|
1423
|
-
if (list.rows === void 0 || list.total === 0) return null;
|
|
1424
|
-
return /* @__PURE__ */ jsxs8(Flex, { gap: "3", align: "center", justify: "space-between", wrap: "wrap", children: [
|
|
1425
|
-
/* @__PURE__ */ jsx8(
|
|
1426
|
-
Pagination,
|
|
1427
|
-
{
|
|
1428
|
-
...list.pagination,
|
|
1429
|
-
disabled: list.refreshing,
|
|
1430
|
-
label: labels.pages,
|
|
1431
|
-
previous: labels.previous,
|
|
1432
|
-
next: labels.next,
|
|
1433
|
-
pageLabel: (n) => formatMessage(locale, labels.page, { page: fmt.number(n) })
|
|
1434
|
-
}
|
|
1435
|
-
),
|
|
1436
|
-
/* @__PURE__ */ jsx8(Text8, { textStyle: "caption", color: "fg.muted", fontVariantNumeric: "tabular-nums", "aria-live": "polite", children: formatMessage(locale, labels.range, { from: fmt.number(from), to: fmt.number(to), total: fmt.number(list.total) }) })
|
|
1437
|
-
] });
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
1531
|
// src/areas/guard/AccountsScreen.tsx
|
|
1441
|
-
import { Fragment as Fragment3, jsx as
|
|
1532
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1442
1533
|
var INTERNAL_DIRECTORY = "00000000-0000-0000-0000-00000000d001";
|
|
1443
1534
|
var STATUSES = ["Active", "Inactive", "Locked"];
|
|
1444
1535
|
function AccountsScreen({ routes = guardRoutes(), source }) {
|
|
1445
1536
|
const t = useGuardNs("accounts");
|
|
1446
1537
|
const tc = useGuardNs("common");
|
|
1447
1538
|
const ts = useGuardNs("status.account");
|
|
1448
|
-
const fmt =
|
|
1539
|
+
const fmt = useFormatters5();
|
|
1449
1540
|
const can = useCan2();
|
|
1450
1541
|
const admin = can("guard.site.admin");
|
|
1451
1542
|
const served = useAreaListSource("guard", "/accounts/page", { sortFields: { lastSignIn: "lastLoginAt" } });
|
|
1452
1543
|
const list = useListState(source ?? served, { initial: { sort: { columnId: "username", direction: "asc" } } });
|
|
1453
1544
|
const [creating, setCreating] = useState3(false);
|
|
1454
1545
|
const columns = [
|
|
1455
|
-
{ id: "username", header: tc("username"), sortValue: (a) => a.username, cell: (a) => /* @__PURE__ */
|
|
1546
|
+
{ id: "username", header: tc("username"), sortValue: (a) => a.username, cell: (a) => /* @__PURE__ */ jsx8(RecordKey3, { value: a.username, href: routes.account(a.id) }), skeleton: "key" },
|
|
1456
1547
|
{ id: "displayName", header: tc("displayName"), sortValue: (a) => a.displayName, cell: (a) => a.displayName || EMPTY_VALUE3, skeleton: "person" },
|
|
1457
1548
|
{
|
|
1458
1549
|
id: "email",
|
|
1459
1550
|
header: tc("email"),
|
|
1460
1551
|
sortValue: (a) => a.email,
|
|
1461
|
-
cell: (a) => a.email ? /* @__PURE__ */
|
|
1552
|
+
cell: (a) => a.email ? /* @__PURE__ */ jsx8(Text8, { as: "span", color: "fg.muted", dir: "ltr", wordBreak: "break-all", children: a.email }) : EMPTY_VALUE3
|
|
1462
1553
|
},
|
|
1463
1554
|
{ id: "directory", header: tc("directory"), cell: (a) => a.directoryName },
|
|
1464
|
-
{ id: "status", header: tc("status"), sortValue: (a) => a.status, cell: (a) => /* @__PURE__ */
|
|
1555
|
+
{ id: "status", header: tc("status"), sortValue: (a) => a.status, cell: (a) => /* @__PURE__ */ jsx8(AccountStatusPill, { status: a.status }), skeleton: "pill" },
|
|
1465
1556
|
{
|
|
1466
1557
|
id: "lastSignIn",
|
|
1467
1558
|
header: tc("lastSignIn"),
|
|
1468
1559
|
nowrap: true,
|
|
1469
1560
|
sortValue: (a) => a.lastLoginAt ? new Date(a.lastLoginAt) : null,
|
|
1470
|
-
cell: (a) => /* @__PURE__ */
|
|
1561
|
+
cell: (a) => /* @__PURE__ */ jsx8(Text8, { as: "span", color: "fg.muted", children: fmt.dateTime(a.lastLoginAt) }),
|
|
1471
1562
|
skeleton: "date"
|
|
1472
1563
|
}
|
|
1473
1564
|
];
|
|
1474
|
-
return /* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1565
|
+
return /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1566
|
+
/* @__PURE__ */ jsx8(
|
|
1476
1567
|
PageHeader2,
|
|
1477
1568
|
{
|
|
1478
1569
|
title: t("title"),
|
|
1479
1570
|
description: t("subtitle"),
|
|
1480
|
-
actions: !creating && admin && /* @__PURE__ */
|
|
1571
|
+
actions: !creating && admin && /* @__PURE__ */ jsx8(Button6, { variant: "primary", onClick: () => setCreating(true), children: t("create") })
|
|
1481
1572
|
}
|
|
1482
1573
|
),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
creating && /* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ jsxs8(Stack6, { gap: "section", children: [
|
|
1575
|
+
creating && /* @__PURE__ */ jsx8(
|
|
1485
1576
|
CreateAccount,
|
|
1486
1577
|
{
|
|
1487
1578
|
onDone: (created) => {
|
|
@@ -1492,9 +1583,9 @@ function AccountsScreen({ routes = guardRoutes(), source }) {
|
|
|
1492
1583
|
onCancel: () => setCreating(false)
|
|
1493
1584
|
}
|
|
1494
1585
|
),
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsxs8(Stack6, { gap: "field", children: [
|
|
1587
|
+
/* @__PURE__ */ jsxs8(HStack7, { gap: "2", wrap: "wrap", children: [
|
|
1588
|
+
/* @__PURE__ */ jsx8(
|
|
1498
1589
|
SearchInput,
|
|
1499
1590
|
{
|
|
1500
1591
|
size: "sm",
|
|
@@ -1505,7 +1596,7 @@ function AccountsScreen({ routes = guardRoutes(), source }) {
|
|
|
1505
1596
|
"aria-label": t("search")
|
|
1506
1597
|
}
|
|
1507
1598
|
),
|
|
1508
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ jsx8(
|
|
1509
1600
|
SelectField,
|
|
1510
1601
|
{
|
|
1511
1602
|
size: "sm",
|
|
@@ -1517,10 +1608,10 @@ function AccountsScreen({ routes = guardRoutes(), source }) {
|
|
|
1517
1608
|
}
|
|
1518
1609
|
)
|
|
1519
1610
|
] }),
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ jsx8(DataTable5, { "aria-label": t("title"), columns, getRowId: (a) => a.id, empty: t("empty"), ...list.table }),
|
|
1612
|
+
/* @__PURE__ */ jsx8(ListFooter, { list })
|
|
1522
1613
|
] }),
|
|
1523
|
-
admin && /* @__PURE__ */
|
|
1614
|
+
admin && /* @__PURE__ */ jsx8(DuplicatesPanel, { routes })
|
|
1524
1615
|
] })
|
|
1525
1616
|
] });
|
|
1526
1617
|
}
|
|
@@ -1547,20 +1638,20 @@ function CreateAccount({ onDone, onCancel }) {
|
|
|
1547
1638
|
}
|
|
1548
1639
|
}
|
|
1549
1640
|
const set = (k) => (e) => setForm((f) => ({ ...f, [k]: e.target.value }));
|
|
1550
|
-
return /* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ jsx8(Panel6, { title: t("createTitle"), description: t("createHint"), children: /* @__PURE__ */ jsx8("form", { onSubmit: submit, children: /* @__PURE__ */ jsxs8(Stack6, { gap: "field", children: [
|
|
1642
|
+
/* @__PURE__ */ jsxs8(SimpleGrid, { columns: { base: 1, md: 2 }, gap: "field", children: [
|
|
1643
|
+
/* @__PURE__ */ jsx8(Field, { label: tc("username"), required: true, children: /* @__PURE__ */ jsx8(Input2, { value: form.username, onChange: set("username"), autoComplete: "off" }) }),
|
|
1644
|
+
/* @__PURE__ */ jsx8(Field, { label: tc("displayName"), required: true, children: /* @__PURE__ */ jsx8(Input2, { value: form.displayName, onChange: set("displayName") }) }),
|
|
1645
|
+
/* @__PURE__ */ jsx8(
|
|
1555
1646
|
Field,
|
|
1556
1647
|
{
|
|
1557
1648
|
label: tc("email"),
|
|
1558
|
-
optionalText: /* @__PURE__ */
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1649
|
+
optionalText: /* @__PURE__ */ jsx8(Text8, { as: "span", color: "fg.subtle", children: tc("optional") }),
|
|
1650
|
+
children: /* @__PURE__ */ jsx8(Input2, { type: "email", value: form.email, onChange: set("email"), dir: "ltr" })
|
|
1560
1651
|
}
|
|
1561
1652
|
),
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
internal.length > 1 && /* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ jsx8(Field, { label: tc("password"), required: true, children: /* @__PURE__ */ jsx8(Input2, { type: "password", value: form.password, onChange: set("password"), autoComplete: "new-password" }) }),
|
|
1654
|
+
internal.length > 1 && /* @__PURE__ */ jsx8(Field, { label: tc("directory"), children: /* @__PURE__ */ jsx8(
|
|
1564
1655
|
SelectField,
|
|
1565
1656
|
{
|
|
1566
1657
|
value: directoryId,
|
|
@@ -1569,22 +1660,22 @@ function CreateAccount({ onDone, onCancel }) {
|
|
|
1569
1660
|
}
|
|
1570
1661
|
) })
|
|
1571
1662
|
] }),
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ jsx8(InlineAlert5, { tone: "danger", children: error }),
|
|
1664
|
+
/* @__PURE__ */ jsxs8(HStack7, { gap: "2", children: [
|
|
1665
|
+
/* @__PURE__ */ jsx8(Button6, { type: "submit", variant: "primary", loading: busy, children: t("createSubmit") }),
|
|
1666
|
+
/* @__PURE__ */ jsx8(Button6, { onClick: onCancel, children: tc("cancel") })
|
|
1576
1667
|
] })
|
|
1577
1668
|
] }) }) });
|
|
1578
1669
|
}
|
|
1579
1670
|
|
|
1580
1671
|
// src/areas/guard/AnonymousScreen.tsx
|
|
1581
|
-
import { Text as
|
|
1672
|
+
import { Text as Text9 } from "@chakra-ui/react";
|
|
1582
1673
|
import { Trash2 } from "lucide-react";
|
|
1583
|
-
import { AppLink as AppLink4, DataTable as DataTable6, IconButton, InlineAlert as InlineAlert6, notify as notify5, PageHeader as PageHeader3, Panel as Panel7, errorText as errorText2, useApiQuery as useApiQuery5, useAreaRequest as useAreaRequest7, useConfirm as useConfirm2, useFormatters as
|
|
1584
|
-
import { Fragment as Fragment4, jsx as
|
|
1674
|
+
import { AppLink as AppLink4, DataTable as DataTable6, IconButton, InlineAlert as InlineAlert6, notify as notify5, PageHeader as PageHeader3, Panel as Panel7, errorText as errorText2, useApiQuery as useApiQuery5, useAreaRequest as useAreaRequest7, useConfirm as useConfirm2, useFormatters as useFormatters6 } from "@abpjs/ui";
|
|
1675
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1585
1676
|
function AnonymousScreen({ roleName }) {
|
|
1586
1677
|
const t = useGuardNs("anonymousAccess");
|
|
1587
|
-
const fmt =
|
|
1678
|
+
const fmt = useFormatters6();
|
|
1588
1679
|
const confirm = useConfirm2();
|
|
1589
1680
|
const request = useAreaRequest7("guard");
|
|
1590
1681
|
const grants = useApiQuery5("guard", "/anonymous");
|
|
@@ -1599,26 +1690,26 @@ function AnonymousScreen({ roleName }) {
|
|
|
1599
1690
|
notify5.error(errorText2(e));
|
|
1600
1691
|
}
|
|
1601
1692
|
}
|
|
1602
|
-
return /* @__PURE__ */
|
|
1603
|
-
/* @__PURE__ */
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
1694
|
+
/* @__PURE__ */ jsx9(PageHeader3, { title: t("title"), description: t("subtitle") }),
|
|
1695
|
+
/* @__PURE__ */ jsx9(InlineAlert6, { tone: "danger", children: grants.error }),
|
|
1696
|
+
/* @__PURE__ */ jsx9(Panel7, { flush: true, children: /* @__PURE__ */ jsx9(
|
|
1606
1697
|
DataTable6,
|
|
1607
1698
|
{
|
|
1608
1699
|
"aria-label": t("title"),
|
|
1609
1700
|
rows: grants.data,
|
|
1610
1701
|
loading: grants.loading,
|
|
1611
1702
|
getRowId: (g) => g.id,
|
|
1612
|
-
empty: /* @__PURE__ */
|
|
1703
|
+
empty: /* @__PURE__ */ jsx9(Text9, { color: "fg.muted", children: t("empty") }),
|
|
1613
1704
|
columns: [
|
|
1614
1705
|
{ id: "role", header: t("role"), cell: (g) => role(g) },
|
|
1615
|
-
{ id: "scope", header: t("scope"), cell: (g) => g.href ? /* @__PURE__ */
|
|
1706
|
+
{ id: "scope", header: t("scope"), cell: (g) => g.href ? /* @__PURE__ */ jsx9(AppLink4, { href: g.href, children: g.scope }) : g.scope },
|
|
1616
1707
|
{ id: "since", header: t("since"), nowrap: true, cell: (g) => fmt.dateTime(g.createdAt) },
|
|
1617
1708
|
{
|
|
1618
1709
|
id: "actions",
|
|
1619
|
-
header: /* @__PURE__ */
|
|
1710
|
+
header: /* @__PURE__ */ jsx9(Text9, { as: "span", srOnly: true, children: t("revoke") }),
|
|
1620
1711
|
align: "end",
|
|
1621
|
-
cell: (g) => /* @__PURE__ */
|
|
1712
|
+
cell: (g) => /* @__PURE__ */ jsx9(IconButton, { size: "sm", variant: "ghost", "aria-label": t("revoke"), onClick: () => void revoke(g), children: /* @__PURE__ */ jsx9(Trash2, {}) })
|
|
1622
1713
|
}
|
|
1623
1714
|
]
|
|
1624
1715
|
}
|
|
@@ -1648,10 +1739,10 @@ import {
|
|
|
1648
1739
|
|
|
1649
1740
|
// src/areas/guard/DirectoryForm.tsx
|
|
1650
1741
|
import { useState as useState4 } from "react";
|
|
1651
|
-
import { Fieldset, HStack as HStack8, Input as Input3, SimpleGrid as SimpleGrid2, Stack as Stack7, Text as
|
|
1742
|
+
import { Fieldset, HStack as HStack8, Input as Input3, SimpleGrid as SimpleGrid2, Stack as Stack7, Text as Text10 } from "@chakra-ui/react";
|
|
1652
1743
|
import { Button as Button7, CheckboxField, errorText as errorText3, Field as Field2, HostSlot as HostSlot2, InlineAlert as InlineAlert7, SelectField as SelectField2, TranslatedInput as TranslatedInput2 } from "@abpjs/ui";
|
|
1653
1744
|
import { fromNamesValue, toNamesValue } from "@abpjs/ui/rules";
|
|
1654
|
-
import { jsx as
|
|
1745
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1655
1746
|
function defaultsFor(type) {
|
|
1656
1747
|
const out = {};
|
|
1657
1748
|
for (const s of type?.settings ?? []) out[s.name] = s.defaultValue ?? "";
|
|
@@ -1690,9 +1781,9 @@ function DirectoryForm({ mode, types, initial, onSubmit, onCancel, fallbackSetti
|
|
|
1690
1781
|
setBusy(false);
|
|
1691
1782
|
}
|
|
1692
1783
|
}
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx10("form", { onSubmit: submit, children: /* @__PURE__ */ jsxs10(Stack7, { gap: "field", children: [
|
|
1785
|
+
/* @__PURE__ */ jsxs10(SimpleGrid2, { columns: { base: 1, md: 2 }, gap: "field", children: [
|
|
1786
|
+
/* @__PURE__ */ jsx10(Field2, { label: t("name"), required: true, children: /* @__PURE__ */ jsx10(
|
|
1696
1787
|
TranslatedInput2,
|
|
1697
1788
|
{
|
|
1698
1789
|
value: toNamesValue(input.name, input.names),
|
|
@@ -1703,7 +1794,7 @@ function DirectoryForm({ mode, types, initial, onSubmit, onCancel, fallbackSetti
|
|
|
1703
1794
|
}
|
|
1704
1795
|
}
|
|
1705
1796
|
) }),
|
|
1706
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ jsx10(Field2, { label: t("type"), required: true, children: mode === "create" ? /* @__PURE__ */ jsx10(
|
|
1707
1798
|
SelectField2,
|
|
1708
1799
|
{
|
|
1709
1800
|
value: input.type,
|
|
@@ -1716,8 +1807,8 @@ function DirectoryForm({ mode, types, initial, onSubmit, onCancel, fallbackSetti
|
|
|
1716
1807
|
}))
|
|
1717
1808
|
]
|
|
1718
1809
|
}
|
|
1719
|
-
) : /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1810
|
+
) : /* @__PURE__ */ jsx10(Input3, { value: type?.displayName ?? input.type, readOnly: true }) }),
|
|
1811
|
+
/* @__PURE__ */ jsx10(Field2, { label: t("syncInterval"), helperText: t("syncIntervalHint"), children: /* @__PURE__ */ jsx10(
|
|
1721
1812
|
Input3,
|
|
1722
1813
|
{
|
|
1723
1814
|
type: "number",
|
|
@@ -1726,17 +1817,17 @@ function DirectoryForm({ mode, types, initial, onSubmit, onCancel, fallbackSetti
|
|
|
1726
1817
|
onChange: (e) => set("syncIntervalMinutes", e.target.value === "" ? null : Number(e.target.value))
|
|
1727
1818
|
}
|
|
1728
1819
|
) }),
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
1820
|
+
/* @__PURE__ */ jsxs10(Stack7, { gap: "2", justify: "flex-end", pb: "1", children: [
|
|
1821
|
+
/* @__PURE__ */ jsx10(CheckboxField, { label: t("active"), checked: input.isActive, onCheckedChange: (v) => set("isActive", v) }),
|
|
1822
|
+
/* @__PURE__ */ jsx10(CheckboxField, { label: t("signInEnabled"), checked: input.authenticationEnabled, onCheckedChange: (v) => set("authenticationEnabled", v) })
|
|
1732
1823
|
] })
|
|
1733
1824
|
] }),
|
|
1734
|
-
type && type.capabilities.length > 0 && /* @__PURE__ */
|
|
1735
|
-
definitions.length > 0 && /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
input.type && /* @__PURE__ */
|
|
1739
|
-
/* @__PURE__ */
|
|
1825
|
+
type && type.capabilities.length > 0 && /* @__PURE__ */ jsx10(Text10, { textStyle: "caption", color: "fg.muted", children: t("capabilities", { list: type.capabilities.join(", ") }) }),
|
|
1826
|
+
definitions.length > 0 && /* @__PURE__ */ jsxs10(Fieldset.Root, { layerStyle: "sunken", p: "panel", children: [
|
|
1827
|
+
/* @__PURE__ */ jsx10(Fieldset.Legend, { textStyle: "label", px: "1", children: t("connectionSettings") }),
|
|
1828
|
+
/* @__PURE__ */ jsxs10(Fieldset.Content, { gap: "field", children: [
|
|
1829
|
+
input.type && /* @__PURE__ */ jsx10(HostSlot2, { name: "guard.directory.presets", context: { type: input.type, apply: applyPreset } }),
|
|
1830
|
+
/* @__PURE__ */ jsx10(SimpleGrid2, { columns: { base: 1, md: 2 }, gap: "field", children: definitions.map((d) => /* @__PURE__ */ jsx10(Field2, { label: d.label || d.name, helperText: d.help ?? void 0, required: d.required && !(d.secret && mode === "edit"), children: /* @__PURE__ */ jsx10(
|
|
1740
1831
|
Input3,
|
|
1741
1832
|
{
|
|
1742
1833
|
type: d.secret ? "password" : "text",
|
|
@@ -1749,20 +1840,20 @@ function DirectoryForm({ mode, types, initial, onSubmit, onCancel, fallbackSetti
|
|
|
1749
1840
|
) }, d.name)) })
|
|
1750
1841
|
] })
|
|
1751
1842
|
] }),
|
|
1752
|
-
/* @__PURE__ */
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
onCancel && /* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ jsx10(InlineAlert7, { tone: "danger", children: error }),
|
|
1844
|
+
/* @__PURE__ */ jsxs10(HStack8, { gap: "2", children: [
|
|
1845
|
+
/* @__PURE__ */ jsx10(Button7, { type: "submit", variant: "primary", loading: busy, disabled: !input.type, children: mode === "create" ? t("create") : t("save") }),
|
|
1846
|
+
onCancel && /* @__PURE__ */ jsx10(Button7, { onClick: onCancel, children: tc("cancel") })
|
|
1756
1847
|
] })
|
|
1757
1848
|
] }) });
|
|
1758
1849
|
}
|
|
1759
1850
|
function DirectoryWarnings({ title, warnings }) {
|
|
1760
1851
|
if (!warnings || warnings.length === 0) return null;
|
|
1761
|
-
return /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsx10(InlineAlert7, { tone: "warning", title, "data-testid": "directory-warnings", children: /* @__PURE__ */ jsx10(Stack7, { gap: "0.5", as: "ul", listStyle: "none", children: warnings.map((w) => /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(Text10, { dir: "auto", children: w }) }, w)) }) });
|
|
1762
1853
|
}
|
|
1763
1854
|
|
|
1764
1855
|
// src/areas/guard/DirectoriesScreen.tsx
|
|
1765
|
-
import { Fragment as Fragment5, jsx as
|
|
1856
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1766
1857
|
var EMPTY_INPUT = {
|
|
1767
1858
|
name: "",
|
|
1768
1859
|
type: "",
|
|
@@ -1824,61 +1915,61 @@ function DirectoriesScreen({ routes = guardRoutes() }) {
|
|
|
1824
1915
|
{
|
|
1825
1916
|
id: "name",
|
|
1826
1917
|
header: tc("name"),
|
|
1827
|
-
cell: (d) => /* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
!d.connectorAvailable && /* @__PURE__ */
|
|
1830
|
-
d.warnings && d.warnings.length > 0 && /* @__PURE__ */
|
|
1918
|
+
cell: (d) => /* @__PURE__ */ jsxs11(Stack8, { gap: "1", align: "flex-start", children: [
|
|
1919
|
+
/* @__PURE__ */ jsx11(AppLink5, { href: routes.directory(d.id), fontWeight: "medium", children: d.name }),
|
|
1920
|
+
!d.connectorAvailable && /* @__PURE__ */ jsx11(StatusPill6, { tone: "warning", title: d.pluginKey ? t("pluginDisabledHint", { plugin: d.pluginKey }) : void 0, children: t("connectorDisabled") }),
|
|
1921
|
+
d.warnings && d.warnings.length > 0 && /* @__PURE__ */ jsx11(StatusPill6, { tone: "warning", title: d.warnings.join("\n"), children: t("warnings", { count: d.warnings.length }) })
|
|
1831
1922
|
] })
|
|
1832
1923
|
},
|
|
1833
1924
|
{ id: "type", header: tc("type"), cell: (d) => d.typeDisplayName || d.type },
|
|
1834
|
-
{ id: "active", header: tc("active"), cell: (d) => /* @__PURE__ */
|
|
1835
|
-
{ id: "signIn", header: t("signIn"), cell: (d) => /* @__PURE__ */
|
|
1925
|
+
{ id: "active", header: tc("active"), cell: (d) => /* @__PURE__ */ jsx11(FlagPill, { value: d.isActive, yes: tc("active"), no: tc("inactive") }), skeleton: "pill" },
|
|
1926
|
+
{ id: "signIn", header: t("signIn"), cell: (d) => /* @__PURE__ */ jsx11(FlagPill, { value: d.authenticationEnabled, yes: tc("enabled"), no: tc("disabled") }), skeleton: "pill" },
|
|
1836
1927
|
{ id: "users", header: tc("users"), numeric: true, cell: (d) => d.userCount },
|
|
1837
1928
|
{ id: "groups", header: tc("groups"), numeric: true, cell: (d) => d.groupCount },
|
|
1838
|
-
{ id: "lastSync", header: t("lastSync"), cell: (d) => /* @__PURE__ */
|
|
1929
|
+
{ id: "lastSync", header: t("lastSync"), cell: (d) => /* @__PURE__ */ jsx11(SyncStatus, { d }), skeleton: "pill" },
|
|
1839
1930
|
{
|
|
1840
1931
|
id: "actions",
|
|
1841
1932
|
header: tc("actions"),
|
|
1842
1933
|
align: "end",
|
|
1843
1934
|
nowrap: true,
|
|
1844
1935
|
// Its buttons as their ghosts while the list loads, so a placeholder row is as tall as a real one.
|
|
1845
|
-
skeleton: () => /* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1936
|
+
skeleton: () => /* @__PURE__ */ jsx11(Loading2, { when: true, children: /* @__PURE__ */ jsxs11(HStack9, { gap: "1", justify: "flex-end", children: [
|
|
1937
|
+
/* @__PURE__ */ jsx11(IconButton2, { size: "sm", "aria-label": t("moveUp", { name: "" }), children: /* @__PURE__ */ jsx11(ArrowUp, {}) }),
|
|
1938
|
+
/* @__PURE__ */ jsx11(IconButton2, { size: "sm", "aria-label": t("moveDown", { name: "" }), children: /* @__PURE__ */ jsx11(ArrowDown, {}) }),
|
|
1939
|
+
/* @__PURE__ */ jsxs11(Button8, { size: "sm", children: [
|
|
1940
|
+
/* @__PURE__ */ jsx11(RefreshCw, {}),
|
|
1850
1941
|
t("syncNow")
|
|
1851
1942
|
] })
|
|
1852
1943
|
] }) }),
|
|
1853
1944
|
cell: (d) => {
|
|
1854
1945
|
const i = list.indexOf(d);
|
|
1855
|
-
return /* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
/* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsxs11(HStack9, { gap: "1", justify: "flex-end", children: [
|
|
1947
|
+
/* @__PURE__ */ jsx11(IconButton2, { size: "sm", "aria-label": t("moveUp", { name: d.name }), disabled: i === 0 || action.busy, onClick: () => move(i, -1), children: /* @__PURE__ */ jsx11(ArrowUp, {}) }),
|
|
1948
|
+
/* @__PURE__ */ jsx11(IconButton2, { size: "sm", "aria-label": t("moveDown", { name: d.name }), disabled: i === list.length - 1 || action.busy, onClick: () => move(i, 1), children: /* @__PURE__ */ jsx11(ArrowDown, {}) }),
|
|
1949
|
+
/* @__PURE__ */ jsx11(Tooltip, { content: t("connectorDisabled"), disabled: d.connectorAvailable, children: /* @__PURE__ */ jsxs11(Button8, { size: "sm", disabled: syncing != null || !d.connectorAvailable, loading: syncing === d.id, onClick: () => sync(d), children: [
|
|
1950
|
+
/* @__PURE__ */ jsx11(RefreshCw, {}),
|
|
1860
1951
|
t("syncNow")
|
|
1861
1952
|
] }) })
|
|
1862
1953
|
] });
|
|
1863
1954
|
}
|
|
1864
1955
|
}
|
|
1865
1956
|
];
|
|
1866
|
-
return /* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1958
|
+
/* @__PURE__ */ jsx11(
|
|
1868
1959
|
PageHeader4,
|
|
1869
1960
|
{
|
|
1870
1961
|
title: t("title"),
|
|
1871
1962
|
description: t("subtitle"),
|
|
1872
|
-
actions: !adding && /* @__PURE__ */
|
|
1963
|
+
actions: !adding && /* @__PURE__ */ jsx11(Button8, { variant: "primary", onClick: () => {
|
|
1873
1964
|
setAdded(null);
|
|
1874
1965
|
setAdding(true);
|
|
1875
1966
|
}, children: t("add") })
|
|
1876
1967
|
}
|
|
1877
1968
|
),
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
adding && /* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ jsxs11(Stack8, { gap: "section", children: [
|
|
1970
|
+
adding && /* @__PURE__ */ jsx11(Panel8, { title: t("add"), children: types.error ? /* @__PURE__ */ jsx11(InlineAlert8, { tone: "danger", children: types.error }) : (
|
|
1880
1971
|
// The form is there while the types load, its fields as their ghosts.
|
|
1881
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ jsx11(Loading2, { when: !types.data, children: /* @__PURE__ */ jsx11(
|
|
1882
1973
|
DirectoryForm,
|
|
1883
1974
|
{
|
|
1884
1975
|
mode: "create",
|
|
@@ -1893,10 +1984,10 @@ function DirectoriesScreen({ routes = guardRoutes() }) {
|
|
|
1893
1984
|
}
|
|
1894
1985
|
) })
|
|
1895
1986
|
) }),
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
added && /* @__PURE__ */
|
|
1898
|
-
notice && /* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ jsx11(InlineAlert8, { tone: "danger", children: action.error }),
|
|
1988
|
+
added && /* @__PURE__ */ jsx11(DirectoryWarnings, { title: t("addedWithWarnings", { name: added.name }), warnings: added.warnings }),
|
|
1989
|
+
notice && /* @__PURE__ */ jsx11(InlineAlert8, { tone: notice.ok ? "success" : "warning", children: notice.text }),
|
|
1990
|
+
/* @__PURE__ */ jsx11(Panel8, { flush: true, children: /* @__PURE__ */ jsx11(
|
|
1900
1991
|
DataTable7,
|
|
1901
1992
|
{
|
|
1902
1993
|
"aria-label": t("title"),
|
|
@@ -1915,7 +2006,7 @@ function DirectoriesScreen({ routes = guardRoutes() }) {
|
|
|
1915
2006
|
|
|
1916
2007
|
// src/areas/guard/DirectoryScreen.tsx
|
|
1917
2008
|
import { useMemo, useState as useState6 } from "react";
|
|
1918
|
-
import { Box, Grid, HStack as HStack10, Input as Input4, List, Stack as Stack9, Text as
|
|
2009
|
+
import { Box, Grid, HStack as HStack10, Input as Input4, List, Stack as Stack9, Text as Text11 } from "@chakra-ui/react";
|
|
1919
2010
|
import {
|
|
1920
2011
|
AppLink as AppLink6,
|
|
1921
2012
|
Button as Button9,
|
|
@@ -1934,17 +2025,17 @@ import {
|
|
|
1934
2025
|
useApiQuery as useApiQuery7,
|
|
1935
2026
|
useAreaRequest as useAreaRequest9,
|
|
1936
2027
|
useConfirm as useConfirm3,
|
|
1937
|
-
useFormatters as
|
|
2028
|
+
useFormatters as useFormatters7,
|
|
1938
2029
|
useNavigate as useNavigate2
|
|
1939
2030
|
} from "@abpjs/ui";
|
|
1940
|
-
import { Fragment as Fragment6, jsx as
|
|
2031
|
+
import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1941
2032
|
var STEPS = ["Connection", "FindUser", "Authenticate", "Precedence"];
|
|
1942
2033
|
var PLACEHOLDER = { name: "", type: "", isActive: true, authenticationEnabled: true, syncIntervalMinutes: 60, settings: {} };
|
|
1943
2034
|
function DirectoryScreen({ id, routes = guardRoutes() }) {
|
|
1944
2035
|
const t = useGuardNs("directoryDetail");
|
|
1945
2036
|
const tc = useGuardNs("common");
|
|
1946
2037
|
const tn = useGuardNs("nav");
|
|
1947
|
-
const fmt =
|
|
2038
|
+
const fmt = useFormatters7();
|
|
1948
2039
|
const confirm = useConfirm3();
|
|
1949
2040
|
const navigate = useNavigate2();
|
|
1950
2041
|
const request = useAreaRequest9("guard");
|
|
@@ -2016,17 +2107,17 @@ function DirectoryScreen({ id, routes = guardRoutes() }) {
|
|
|
2016
2107
|
});
|
|
2017
2108
|
if (done) navigate(routes.directories);
|
|
2018
2109
|
}
|
|
2019
|
-
if (dirs.error) return /* @__PURE__ */
|
|
2110
|
+
if (dirs.error) return /* @__PURE__ */ jsx12(InlineAlert9, { tone: "danger", children: dirs.error });
|
|
2020
2111
|
const loading = !dirs.data || !types.data;
|
|
2021
2112
|
if (!loading && (!dir || !initial))
|
|
2022
|
-
return /* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
/* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
2114
|
+
/* @__PURE__ */ jsx12(PageHeader5, { breadcrumbs: [{ label: tn("directories"), href: routes.directories }], title: t("notFound") }),
|
|
2115
|
+
/* @__PURE__ */ jsx12(AppLink6, { href: routes.directories, children: t("back") })
|
|
2025
2116
|
] });
|
|
2026
2117
|
const runColumns = [
|
|
2027
2118
|
{ id: "started", header: t("started"), nowrap: true, cell: (r) => fmt.dateTime(r.startedAt), skeleton: "date", skeletonWidth: 17 },
|
|
2028
2119
|
{ id: "finished", header: t("finished"), nowrap: true, cell: (r) => fmt.dateTime(r.finishedAt), skeleton: "date", skeletonWidth: 17 },
|
|
2029
|
-
{ id: "result", header: t("result"), cell: (r) => /* @__PURE__ */
|
|
2120
|
+
{ id: "result", header: t("result"), cell: (r) => /* @__PURE__ */ jsx12(SyncResultPill, { succeeded: r.succeeded ?? null }), skeleton: "pill" },
|
|
2030
2121
|
{ id: "added", header: t("added"), numeric: true, cell: (r) => r.usersAdded },
|
|
2031
2122
|
{ id: "updated", header: t("updated"), numeric: true, cell: (r) => r.usersUpdated },
|
|
2032
2123
|
{ id: "deactivated", header: t("deactivated"), numeric: true, cell: (r) => r.usersDeactivated },
|
|
@@ -2035,41 +2126,41 @@ function DirectoryScreen({ id, routes = guardRoutes() }) {
|
|
|
2035
2126
|
{
|
|
2036
2127
|
id: "error",
|
|
2037
2128
|
header: t("error"),
|
|
2038
|
-
cell: (r) => r.error && /* @__PURE__ */
|
|
2129
|
+
cell: (r) => r.error && /* @__PURE__ */ jsx12(Text11, { as: "span", textStyle: "caption", color: "fg.danger", wordBreak: "break-word", maxW: "xs", display: "block", children: r.error })
|
|
2039
2130
|
}
|
|
2040
2131
|
];
|
|
2041
|
-
return /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2132
|
+
return /* @__PURE__ */ jsxs12(Loading3, { when: loading, children: [
|
|
2133
|
+
/* @__PURE__ */ jsx12(
|
|
2043
2134
|
PageHeader5,
|
|
2044
2135
|
{
|
|
2045
2136
|
breadcrumbs: [{ label: tn("directories"), href: routes.directories }, { label: dir?.name }],
|
|
2046
2137
|
title: dir?.name,
|
|
2047
|
-
meta: /* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
dir ? /* @__PURE__ */
|
|
2051
|
-
dir ? /* @__PURE__ */
|
|
2052
|
-
dir && !dir.connectorAvailable && /* @__PURE__ */
|
|
2138
|
+
meta: /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
2139
|
+
/* @__PURE__ */ jsx12(Text11, { as: "span", children: /* @__PURE__ */ jsx12(TextSlot2, { width: 8, children: dir && (dir.typeDisplayName || dir.type) }) }),
|
|
2140
|
+
/* @__PURE__ */ jsx12(Text11, { as: "span", children: /* @__PURE__ */ jsx12(TextSlot2, { width: 8, children: dir && t("order", { order: dir.order }) }) }),
|
|
2141
|
+
dir ? /* @__PURE__ */ jsx12(FlagPill, { value: dir.isActive, yes: tc("active"), no: tc("inactive") }) : /* @__PURE__ */ jsx12(StatusPill7, {}),
|
|
2142
|
+
dir ? /* @__PURE__ */ jsx12(FlagPill, { value: dir.authenticationEnabled, yes: t("signInEnabled"), no: t("signInDisabled") }) : /* @__PURE__ */ jsx12(StatusPill7, {}),
|
|
2143
|
+
dir && !dir.connectorAvailable && /* @__PURE__ */ jsx12(StatusPill7, { tone: "warning", children: t("connectorDisabled") })
|
|
2053
2144
|
] }),
|
|
2054
|
-
actions: /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
/* @__PURE__ */
|
|
2057
|
-
dir?.type !== "internal" && /* @__PURE__ */
|
|
2145
|
+
actions: /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
2146
|
+
/* @__PURE__ */ jsx12(Button9, { onClick: testConnection, disabled: action.busy || dir?.connectorAvailable === false, children: t("testConnection") }),
|
|
2147
|
+
/* @__PURE__ */ jsx12(Button9, { onClick: syncNow, disabled: action.busy || dir?.connectorAvailable === false, children: t("syncNow") }),
|
|
2148
|
+
dir?.type !== "internal" && /* @__PURE__ */ jsx12(Button9, { danger: true, onClick: remove, disabled: action.busy, children: tc("delete") })
|
|
2058
2149
|
] })
|
|
2059
2150
|
}
|
|
2060
2151
|
),
|
|
2061
|
-
/* @__PURE__ */
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
dir && /* @__PURE__ */
|
|
2064
|
-
test && /* @__PURE__ */
|
|
2152
|
+
/* @__PURE__ */ jsxs12(Stack9, { gap: "section", children: [
|
|
2153
|
+
/* @__PURE__ */ jsx12(InlineAlert9, { tone: "danger", children: action.error }),
|
|
2154
|
+
dir && /* @__PURE__ */ jsx12(DirectoryWarnings, { title: t("warningsTitle"), warnings: dir.warnings }),
|
|
2155
|
+
test && /* @__PURE__ */ jsxs12(InlineAlert9, { tone: test.succeeded ? "success" : "warning", title: test.succeeded ? t("connectionSucceeded") : t("connectionFailed"), children: [
|
|
2065
2156
|
test.message,
|
|
2066
2157
|
test.succeeded && test.usersFound != null && test.groupsFound != null && ` ${t("found", { users: num(test.usersFound), groups: num(test.groupsFound) })}`
|
|
2067
2158
|
] }),
|
|
2068
|
-
syncMsg && /* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
-
saved && /* @__PURE__ */
|
|
2072
|
-
/* @__PURE__ */
|
|
2159
|
+
syncMsg && /* @__PURE__ */ jsx12(InlineAlert9, { tone: syncMsg.ok ? "success" : "warning", children: syncMsg.text }),
|
|
2160
|
+
/* @__PURE__ */ jsxs12(Grid, { templateColumns: { base: "minmax(0, 1fr)", lg: "minmax(0, 1fr) {sizes.sidePanel}" }, gap: "section", alignItems: "start", children: [
|
|
2161
|
+
/* @__PURE__ */ jsx12(Panel9, { title: t("settings"), children: /* @__PURE__ */ jsxs12(Stack9, { gap: "field", children: [
|
|
2162
|
+
saved && /* @__PURE__ */ jsx12(InlineAlert9, { tone: "success", children: t("saved") }),
|
|
2163
|
+
/* @__PURE__ */ jsx12(
|
|
2073
2164
|
DirectoryForm,
|
|
2074
2165
|
{
|
|
2075
2166
|
mode: "edit",
|
|
@@ -2081,8 +2172,8 @@ function DirectoryScreen({ id, routes = guardRoutes() }) {
|
|
|
2081
2172
|
loading ? "loading" : formKey
|
|
2082
2173
|
)
|
|
2083
2174
|
] }) }),
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ jsxs12(Stack9, { gap: "section", children: [
|
|
2176
|
+
/* @__PURE__ */ jsx12(Panel9, { title: t("summary"), children: /* @__PURE__ */ jsx12(
|
|
2086
2177
|
PropertyList3,
|
|
2087
2178
|
{
|
|
2088
2179
|
size: "sm",
|
|
@@ -2094,15 +2185,15 @@ function DirectoryScreen({ id, routes = guardRoutes() }) {
|
|
|
2094
2185
|
value: dir && (dir.syncIntervalMinutes ? t("minutes", { count: num(dir.syncIntervalMinutes) }) : t("onDemand"))
|
|
2095
2186
|
},
|
|
2096
2187
|
{ label: t("plugin"), value: dir && (dir.pluginKey ?? t("builtIn")) },
|
|
2097
|
-
{ label: t("lastSync"), value: dir && /* @__PURE__ */
|
|
2188
|
+
{ label: t("lastSync"), value: dir && /* @__PURE__ */ jsx12(SyncStatus, { d: dir }) }
|
|
2098
2189
|
]
|
|
2099
2190
|
}
|
|
2100
2191
|
) }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx12(TestLoginPanel, { directoryId: id, disabled: dir?.connectorAvailable === false })
|
|
2102
2193
|
] })
|
|
2103
2194
|
] }),
|
|
2104
|
-
dir && /* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2195
|
+
dir && /* @__PURE__ */ jsx12(HostSlot3, { name: "guard.directory.panel", context: { directoryId: dir.id, directoryType: dir.type } }),
|
|
2196
|
+
/* @__PURE__ */ jsx12(Panel9, { title: t("syncRuns"), flush: true, children: /* @__PURE__ */ jsx12(
|
|
2106
2197
|
DataTable8,
|
|
2107
2198
|
{
|
|
2108
2199
|
"aria-label": t("syncRuns"),
|
|
@@ -2148,26 +2239,26 @@ function TestLoginPanel({ directoryId, disabled }) {
|
|
|
2148
2239
|
...STEPS.map((step) => ({ step, label: ts(step), r: result.steps.find((s) => s.step === step) })),
|
|
2149
2240
|
...result.steps.filter((s) => !known.has(s.step)).map((s) => ({ step: s.step, label: s.step, r: s }))
|
|
2150
2241
|
] : [];
|
|
2151
|
-
return /* @__PURE__ */
|
|
2152
|
-
/* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ jsx12(Panel9, { title: t("testLogin"), description: t("testLoginHint"), children: /* @__PURE__ */ jsxs12(Stack9, { gap: "stack", children: [
|
|
2243
|
+
/* @__PURE__ */ jsx12("form", { onSubmit: submit, children: /* @__PURE__ */ jsxs12(Stack9, { gap: "stack", children: [
|
|
2244
|
+
/* @__PURE__ */ jsx12(Field3, { label: tc("username"), required: true, children: /* @__PURE__ */ jsx12(Input4, { size: "sm", value: username, onChange: (e) => setUsername(e.target.value), autoComplete: "off" }) }),
|
|
2245
|
+
/* @__PURE__ */ jsx12(Field3, { label: tc("password"), required: true, children: /* @__PURE__ */ jsx12(Input4, { size: "sm", type: "password", value: password, onChange: (e) => setPassword(e.target.value), autoComplete: "new-password" }) }),
|
|
2246
|
+
/* @__PURE__ */ jsx12(Button9, { type: "submit", size: "sm", w: "full", loading: busy, disabled, children: t("runTest") })
|
|
2156
2247
|
] }) }),
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
result && /* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ jsx12(InlineAlert9, { tone: "danger", size: "sm", children: error }),
|
|
2249
|
+
result && /* @__PURE__ */ jsx12(List.Root, { as: "ol", gap: "2", listStyle: "none", "aria-label": t("testSteps"), children: rows.map(({ step, label, r }) => /* @__PURE__ */ jsx12(List.Item, { layerStyle: "sunken", px: "3", py: "2", children: /* @__PURE__ */ jsxs12(Box, { w: "full", children: [
|
|
2250
|
+
/* @__PURE__ */ jsxs12(HStack10, { justify: "space-between", gap: "2", children: [
|
|
2251
|
+
/* @__PURE__ */ jsx12(Text11, { textStyle: "label", children: label }),
|
|
2252
|
+
/* @__PURE__ */ jsx12(PassFail, { ok: r ? r.succeeded : null })
|
|
2162
2253
|
] }),
|
|
2163
|
-
r?.message && /* @__PURE__ */
|
|
2254
|
+
r?.message && /* @__PURE__ */ jsx12(Text11, { textStyle: "caption", color: "fg.muted", mt: "1", children: r.message })
|
|
2164
2255
|
] }) }, step)) })
|
|
2165
2256
|
] }) });
|
|
2166
2257
|
}
|
|
2167
2258
|
|
|
2168
2259
|
// src/areas/guard/GroupScreen.tsx
|
|
2169
2260
|
import { useEffect, useState as useState9 } from "react";
|
|
2170
|
-
import { Grid as Grid2, HStack as HStack13, Input as Input5, List as List3, Stack as Stack11, Text as
|
|
2261
|
+
import { Grid as Grid2, HStack as HStack13, Input as Input5, List as List3, Stack as Stack11, Text as Text14, Textarea } from "@chakra-ui/react";
|
|
2171
2262
|
import {
|
|
2172
2263
|
AppLink as AppLink8,
|
|
2173
2264
|
Button as Button10,
|
|
@@ -2190,29 +2281,30 @@ import {
|
|
|
2190
2281
|
useApiQuery as useApiQuery8,
|
|
2191
2282
|
useAreaRequest as useAreaRequest12,
|
|
2192
2283
|
useConfirm as useConfirm4,
|
|
2193
|
-
useNavigate as useNavigate3
|
|
2284
|
+
useNavigate as useNavigate3,
|
|
2285
|
+
useSettledValue
|
|
2194
2286
|
} from "@abpjs/ui";
|
|
2195
2287
|
import { fromNamesValue as fromNamesValue2, splitList, toNamesValue as toNamesValue2 } from "@abpjs/ui/rules";
|
|
2196
2288
|
|
|
2197
2289
|
// src/areas/guard/GroupTree.tsx
|
|
2198
2290
|
import { useState as useState7 } from "react";
|
|
2199
|
-
import { Box as Box2, HStack as HStack11, List as List2, Text as
|
|
2291
|
+
import { Box as Box2, HStack as HStack11, List as List2, Text as Text12 } from "@chakra-ui/react";
|
|
2200
2292
|
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
2201
2293
|
import { AppLink as AppLink7, DirectionalIcon, errorText as errorText5, IconButton as IconButton3, StatusPill as StatusPill8, useAreaRequest as useAreaRequest10 } from "@abpjs/ui";
|
|
2202
|
-
import { jsx as
|
|
2294
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2203
2295
|
function GroupTree({ rootId, rootName, rootMembers, routes = guardRoutes() }) {
|
|
2204
|
-
return /* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ jsxs13(Box2, { textStyle: "md", role: "tree", "aria-label": rootName, children: [
|
|
2297
|
+
/* @__PURE__ */ jsx13(Text12, { fontWeight: "medium", children: rootName }),
|
|
2298
|
+
/* @__PURE__ */ jsx13(Children, { members: rootMembers, ancestors: [rootId], routes })
|
|
2207
2299
|
] });
|
|
2208
2300
|
}
|
|
2209
2301
|
function Children({ members, ancestors, routes }) {
|
|
2210
2302
|
const t = useGuardNs("groupDetail");
|
|
2211
2303
|
const groups = members.filter((m) => m.memberType === "Group");
|
|
2212
2304
|
const accountCount = members.length - groups.length;
|
|
2213
|
-
return /* @__PURE__ */
|
|
2214
|
-
groups.map((g) => /* @__PURE__ */
|
|
2215
|
-
accountCount > 0 && /* @__PURE__ */
|
|
2305
|
+
return /* @__PURE__ */ jsxs13(List2.Root, { role: "group", listStyle: "none", ms: "2", ps: "3", borderInlineStartWidth: "1px", borderColor: "border", gap: "0.5", py: "0.5", children: [
|
|
2306
|
+
groups.map((g) => /* @__PURE__ */ jsx13(Node, { member: g, ancestors, routes }, g.memberId)),
|
|
2307
|
+
accountCount > 0 && /* @__PURE__ */ jsx13(List2.Item, { textStyle: "caption", color: "fg.muted", ps: "6", children: t("accountCount", { count: accountCount }) })
|
|
2216
2308
|
] });
|
|
2217
2309
|
}
|
|
2218
2310
|
function Node({ member, ancestors, routes }) {
|
|
@@ -2234,33 +2326,33 @@ function Node({ member, ancestors, routes }) {
|
|
|
2234
2326
|
}
|
|
2235
2327
|
}
|
|
2236
2328
|
}
|
|
2237
|
-
return /* @__PURE__ */
|
|
2238
|
-
/* @__PURE__ */
|
|
2239
|
-
cyclic ? /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsxs13(List2.Item, { role: "treeitem", "aria-expanded": cyclic ? void 0 : open, display: "block", children: [
|
|
2330
|
+
/* @__PURE__ */ jsxs13(HStack11, { gap: "1", children: [
|
|
2331
|
+
cyclic ? /* @__PURE__ */ jsx13(Box2, { boxSize: "control.xs", flexShrink: "0" }) : /* @__PURE__ */ jsx13(
|
|
2240
2332
|
IconButton3,
|
|
2241
2333
|
{
|
|
2242
2334
|
size: "xs",
|
|
2243
2335
|
"aria-label": open ? t("collapse", { name: member.name }) : t("expand", { name: member.name }),
|
|
2244
2336
|
onClick: toggle,
|
|
2245
|
-
children: open ? /* @__PURE__ */
|
|
2337
|
+
children: open ? /* @__PURE__ */ jsx13(ChevronDown, {}) : /* @__PURE__ */ jsx13(DirectionalIcon, { children: /* @__PURE__ */ jsx13(ChevronRight, {}) })
|
|
2246
2338
|
}
|
|
2247
2339
|
),
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
cyclic && /* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsx13(AppLink7, { href: routes.group(member.memberId), children: member.name }),
|
|
2341
|
+
cyclic && /* @__PURE__ */ jsx13(StatusPill8, { tone: "warning", children: t("cycle") })
|
|
2250
2342
|
] }),
|
|
2251
|
-
open && !cyclic && /* @__PURE__ */
|
|
2252
|
-
error && /* @__PURE__ */
|
|
2253
|
-
!detail && !error && /* @__PURE__ */
|
|
2254
|
-
detail && /* @__PURE__ */
|
|
2343
|
+
open && !cyclic && /* @__PURE__ */ jsxs13(Box2, { children: [
|
|
2344
|
+
error && /* @__PURE__ */ jsx13(Text12, { textStyle: "caption", color: "fg.danger", ms: "7", children: error }),
|
|
2345
|
+
!detail && !error && /* @__PURE__ */ jsx13(Text12, { textStyle: "caption", color: "fg.muted", ms: "7", children: t("loadingTree") }),
|
|
2346
|
+
detail && /* @__PURE__ */ jsx13(Children, { members: detail.members, ancestors: [...ancestors, member.memberId], routes })
|
|
2255
2347
|
] })
|
|
2256
2348
|
] });
|
|
2257
2349
|
}
|
|
2258
2350
|
|
|
2259
2351
|
// src/areas/guard/GroupTwoFactorPanel.tsx
|
|
2260
2352
|
import { useState as useState8 } from "react";
|
|
2261
|
-
import { Box as Box3, chakra, HStack as HStack12, Stack as Stack10, Text as
|
|
2353
|
+
import { Box as Box3, chakra, HStack as HStack12, Stack as Stack10, Text as Text13 } from "@chakra-ui/react";
|
|
2262
2354
|
import { errorText as errorText6, Indicator, InlineAlert as InlineAlert10, notify as notify6, Panel as Panel10, useAreaRequest as useAreaRequest11 } from "@abpjs/ui";
|
|
2263
|
-
import { jsx as
|
|
2355
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2264
2356
|
var TWO_FACTOR_MODES = ["off", "optional", "required", "strong"];
|
|
2265
2357
|
function GroupTwoFactorPanel({ group, onSaved }) {
|
|
2266
2358
|
const t = useGuardNs("groupDetail.twoFactor");
|
|
@@ -2281,9 +2373,9 @@ function GroupTwoFactorPanel({ group, onSaved }) {
|
|
|
2281
2373
|
setError(errorText6(e));
|
|
2282
2374
|
}
|
|
2283
2375
|
}
|
|
2284
|
-
return /* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2376
|
+
return /* @__PURE__ */ jsx14(Panel10, { title: t("title"), description: t("hint"), "data-testid": "group-two-factor", children: /* @__PURE__ */ jsxs14(Stack10, { gap: "2", children: [
|
|
2377
|
+
/* @__PURE__ */ jsx14(InlineAlert10, { tone: "danger", children: error }),
|
|
2378
|
+
/* @__PURE__ */ jsx14(HStack12, { gap: "1", p: "1", rounded: "l2", bg: "bg.subtle", w: "fit-content", maxW: "full", wrap: "wrap", role: "radiogroup", "aria-label": t("title"), children: TWO_FACTOR_MODES.map((choice) => /* @__PURE__ */ jsxs14(
|
|
2287
2379
|
chakra.button,
|
|
2288
2380
|
{
|
|
2289
2381
|
type: "button",
|
|
@@ -2301,18 +2393,18 @@ function GroupTwoFactorPanel({ group, onSaved }) {
|
|
|
2301
2393
|
onClick: () => void choose(choice),
|
|
2302
2394
|
"data-testid": `two-factor-${choice}`,
|
|
2303
2395
|
children: [
|
|
2304
|
-
mode === choice && /* @__PURE__ */
|
|
2305
|
-
/* @__PURE__ */
|
|
2396
|
+
mode === choice && /* @__PURE__ */ jsx14(Indicator, { group: `two-factor-${group.id}`, css: { position: "absolute", inset: 0, rounded: "l1", bg: "bg.panel", boxShadow: "xs" } }),
|
|
2397
|
+
/* @__PURE__ */ jsx14(Box3, { as: "span", position: "relative", children: t(`modes.${choice}`) })
|
|
2306
2398
|
]
|
|
2307
2399
|
},
|
|
2308
2400
|
choice
|
|
2309
2401
|
)) }),
|
|
2310
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx14(Text13, { textStyle: "body.sm", color: "fg.muted", "aria-live": "polite", children: t(`modeHints.${mode}`) })
|
|
2311
2403
|
] }) });
|
|
2312
2404
|
}
|
|
2313
2405
|
|
|
2314
2406
|
// src/areas/guard/GroupScreen.tsx
|
|
2315
|
-
import { Fragment as Fragment7, jsx as
|
|
2407
|
+
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2316
2408
|
function GroupScreen({ id, routes = guardRoutes() }) {
|
|
2317
2409
|
const t = useGuardNs("groupDetail");
|
|
2318
2410
|
const tg = useGuardNs("groups");
|
|
@@ -2347,7 +2439,7 @@ function GroupScreen({ id, routes = guardRoutes() }) {
|
|
|
2347
2439
|
});
|
|
2348
2440
|
if (ok) navigate(routes.groups);
|
|
2349
2441
|
}
|
|
2350
|
-
if (detail.error && !detail.data) return /* @__PURE__ */
|
|
2442
|
+
if (detail.error && !detail.data) return /* @__PURE__ */ jsx15(InlineAlert11, { tone: "danger", children: detail.error });
|
|
2351
2443
|
const group = detail.data?.group;
|
|
2352
2444
|
const members = detail.data?.members;
|
|
2353
2445
|
const parents = detail.data?.parents;
|
|
@@ -2358,16 +2450,16 @@ function GroupScreen({ id, routes = guardRoutes() }) {
|
|
|
2358
2450
|
id: "type",
|
|
2359
2451
|
header: tc("type"),
|
|
2360
2452
|
sortValue: (m) => m.memberType === "Group" ? 0 : 1,
|
|
2361
|
-
cell: (m) => m.memberType === "Group" ? /* @__PURE__ */
|
|
2453
|
+
cell: (m) => m.memberType === "Group" ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "info", children: tc("group") }) : /* @__PURE__ */ jsx15(StatusPill9, { children: tc("account") }),
|
|
2362
2454
|
skeleton: "pill"
|
|
2363
2455
|
},
|
|
2364
2456
|
{
|
|
2365
2457
|
id: "name",
|
|
2366
2458
|
header: tc("name"),
|
|
2367
2459
|
sortValue: (m) => m.name,
|
|
2368
|
-
cell: (m) => /* @__PURE__ */
|
|
2369
|
-
m.memberType === "Group" ? /* @__PURE__ */
|
|
2370
|
-
m.displayName && m.displayName !== m.name && /* @__PURE__ */
|
|
2460
|
+
cell: (m) => /* @__PURE__ */ jsxs15(HStack13, { gap: "2", wrap: "wrap", children: [
|
|
2461
|
+
m.memberType === "Group" ? /* @__PURE__ */ jsx15(AppLink8, { href: routes.group(m.memberId), fontWeight: "medium", children: m.name }) : /* @__PURE__ */ jsx15(RecordKey4, { value: m.name, href: routes.account(m.memberId) }),
|
|
2462
|
+
m.displayName && m.displayName !== m.name && /* @__PURE__ */ jsx15(Text14, { as: "span", textStyle: "caption", color: "fg.muted", children: m.displayName })
|
|
2371
2463
|
] }),
|
|
2372
2464
|
skeleton: "key"
|
|
2373
2465
|
},
|
|
@@ -2376,15 +2468,15 @@ function GroupScreen({ id, routes = guardRoutes() }) {
|
|
|
2376
2468
|
id: "source",
|
|
2377
2469
|
header: tc("source"),
|
|
2378
2470
|
sortValue: (m) => m.source,
|
|
2379
|
-
cell: (m) => m.source === "Directory" ? /* @__PURE__ */
|
|
2471
|
+
cell: (m) => m.source === "Directory" ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "info", children: t("fromDirectory") }) : m.source === "Domain" ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "info", children: t("byDomain") }) : m.source === "Import" ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "info", children: t("fromImport") }) : /* @__PURE__ */ jsx15(StatusPill9, { tone: "accent", children: t("manual") }),
|
|
2380
2472
|
skeleton: "pill"
|
|
2381
2473
|
},
|
|
2382
2474
|
{
|
|
2383
2475
|
id: "actions",
|
|
2384
|
-
header: /* @__PURE__ */
|
|
2476
|
+
header: /* @__PURE__ */ jsx15(Text14, { as: "span", srOnly: true, children: tc("actions") }),
|
|
2385
2477
|
align: "end",
|
|
2386
|
-
cell: (m) => m.removable && /* @__PURE__ */
|
|
2387
|
-
skeleton: () => /* @__PURE__ */
|
|
2478
|
+
cell: (m) => m.removable && /* @__PURE__ */ jsx15(Button10, { size: "sm", variant: "ghost", danger: true, onClick: () => removeMember(m), disabled: action.busy, children: t("remove") }),
|
|
2479
|
+
skeleton: () => /* @__PURE__ */ jsx15(Button10, { size: "sm", variant: "ghost", danger: true, children: t("remove") })
|
|
2388
2480
|
}
|
|
2389
2481
|
];
|
|
2390
2482
|
const effectiveColumns = [
|
|
@@ -2392,34 +2484,34 @@ function GroupScreen({ id, routes = guardRoutes() }) {
|
|
|
2392
2484
|
id: "username",
|
|
2393
2485
|
header: tc("username"),
|
|
2394
2486
|
sortValue: (m) => m.username,
|
|
2395
|
-
cell: (m) => /* @__PURE__ */
|
|
2487
|
+
cell: (m) => /* @__PURE__ */ jsx15(RecordKey4, { value: m.username, href: routes.account(m.accountId) }),
|
|
2396
2488
|
skeleton: "key"
|
|
2397
2489
|
},
|
|
2398
2490
|
{ id: "displayName", header: tc("displayName"), sortValue: (m) => m.displayName, cell: (m) => m.displayName, skeleton: "person" },
|
|
2399
|
-
{ id: "path", header: tc("path"), sortValue: (m) => m.path.length, cell: (m) => /* @__PURE__ */
|
|
2491
|
+
{ id: "path", header: tc("path"), sortValue: (m) => m.path.length, cell: (m) => /* @__PURE__ */ jsx15(PathChips2, { path: m.path }), skeleton: () => /* @__PURE__ */ jsx15(PathChips2, { path: [], loading: true }) }
|
|
2400
2492
|
];
|
|
2401
|
-
return /* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ jsxs15(Loading4, { when: !detail.data, children: [
|
|
2494
|
+
/* @__PURE__ */ jsx15(
|
|
2403
2495
|
PageHeader6,
|
|
2404
2496
|
{
|
|
2405
2497
|
breadcrumbs: [{ label: tn("groups"), href: routes.groups }, { label: group && written(group.name, group.names) }],
|
|
2406
2498
|
title: group && written(group.name, group.names),
|
|
2407
2499
|
description: group?.description ?? void 0,
|
|
2408
|
-
meta: /* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2411
|
-
!group ? /* @__PURE__ */
|
|
2412
|
-
!group ? /* @__PURE__ */
|
|
2413
|
-
group && group.twoFactor && group.twoFactor !== "off" && /* @__PURE__ */
|
|
2500
|
+
meta: /* @__PURE__ */ jsxs15(Fragment7, { children: [
|
|
2501
|
+
/* @__PURE__ */ jsx15(Text14, { as: "span", children: /* @__PURE__ */ jsx15(TextSlot3, { width: 10, children: group?.directoryName }) }),
|
|
2502
|
+
/* @__PURE__ */ jsx15(StatusPill9, { dot: false, children: group && tg(`kinds.${group.kind}`) }),
|
|
2503
|
+
!group ? /* @__PURE__ */ jsx15(StatusPill9, {}) : group.isLocal ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "accent", children: tg("local") }) : /* @__PURE__ */ jsx15(StatusPill9, { tone: "info", children: tg("synced") }),
|
|
2504
|
+
!group ? /* @__PURE__ */ jsx15(StatusPill9, {}) : group.writable ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "success", children: t("writable") }) : /* @__PURE__ */ jsx15(StatusPill9, { children: tg("readOnly") }),
|
|
2505
|
+
group && group.twoFactor && group.twoFactor !== "off" && /* @__PURE__ */ jsx15(StatusPill9, { tone: "accent", "data-testid": "group-two-factor-pill", children: tf("pill", { mode: tf(`modes.${group.twoFactor}`) }) })
|
|
2414
2506
|
] }),
|
|
2415
|
-
actions: (!group || group.isLocal && !group.computed) && /* @__PURE__ */
|
|
2507
|
+
actions: (!group || group.isLocal && !group.computed) && /* @__PURE__ */ jsx15(Button10, { danger: true, onClick: deleteGroup, disabled: action.busy, children: t("delete") })
|
|
2416
2508
|
}
|
|
2417
2509
|
),
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
group && group.writable && group.isLocal && /* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsxs15(Stack11, { gap: "section", children: [
|
|
2511
|
+
/* @__PURE__ */ jsx15(InlineAlert11, { tone: "danger", children: action.error }),
|
|
2512
|
+
group && group.writable && group.isLocal && /* @__PURE__ */ jsx15(GroupNames, { group, onSaved: reload }),
|
|
2513
|
+
/* @__PURE__ */ jsxs15(Grid2, { templateColumns: { base: "minmax(0, 1fr)", lg: "minmax(0, 1fr) {sizes.sidePanel}" }, gap: "section", alignItems: "start", children: [
|
|
2514
|
+
/* @__PURE__ */ jsx15(Panel11, { title: /* @__PURE__ */ jsx15(TextSlot3, { width: 18, children: t("directMembers", { count: members?.length ?? 0 }) }), flush: true, children: /* @__PURE__ */ jsx15(
|
|
2423
2515
|
DataTable9,
|
|
2424
2516
|
{
|
|
2425
2517
|
"aria-label": t("directMembers", { count: members?.length ?? 0 }),
|
|
@@ -2430,18 +2522,18 @@ function GroupScreen({ id, routes = guardRoutes() }) {
|
|
|
2430
2522
|
empty: t("noMembers")
|
|
2431
2523
|
}
|
|
2432
2524
|
) }),
|
|
2433
|
-
/* @__PURE__ */
|
|
2434
|
-
/* @__PURE__ */
|
|
2435
|
-
/* @__PURE__ */
|
|
2436
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ jsxs15(Stack11, { gap: "section", children: [
|
|
2526
|
+
/* @__PURE__ */ jsx15(Panel11, { title: /* @__PURE__ */ jsx15(TextSlot3, { width: 14, children: t("memberOf", { count: parents?.length ?? 0 }) }), children: !parents ? /* @__PURE__ */ jsx15(Text14, { textStyle: "body", children: /* @__PURE__ */ jsx15(TextBone, { width: t("notNested").length }) }) : parents.length === 0 ? /* @__PURE__ */ jsx15(Text14, { textStyle: "body", color: "fg.muted", children: t("notNested") }) : /* @__PURE__ */ jsx15(List3.Root, { listStyle: "none", gap: "1.5", children: parents.map((p) => /* @__PURE__ */ jsx15(List3.Item, { children: /* @__PURE__ */ jsxs15(HStack13, { justify: "space-between", gap: "2", w: "full", children: [
|
|
2527
|
+
/* @__PURE__ */ jsx15(AppLink8, { href: routes.group(p.id), children: written(p.name, p.names) }),
|
|
2528
|
+
/* @__PURE__ */ jsx15(Text14, { as: "span", textStyle: "caption", color: "fg.muted", children: p.directoryName })
|
|
2437
2529
|
] }) }, p.id)) }) }),
|
|
2438
|
-
group && detail.data && /* @__PURE__ */
|
|
2439
|
-
group && members && hasGroupMembers && /* @__PURE__ */
|
|
2530
|
+
group && detail.data && /* @__PURE__ */ jsx15(GroupTwoFactorPanel, { group, onSaved: (updated) => detail.data && detail.setData({ ...detail.data, group: updated }) }, group.id),
|
|
2531
|
+
group && members && hasGroupMembers && /* @__PURE__ */ jsx15(Panel11, { title: t("nestedGroups"), children: /* @__PURE__ */ jsx15(GroupTree, { rootId: group.id, rootName: group.name, rootMembers: members, routes }, treeKey) })
|
|
2440
2532
|
] })
|
|
2441
2533
|
] }),
|
|
2442
|
-
group?.kind === "organization" && /* @__PURE__ */
|
|
2443
|
-
!group || group.writable ? /* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2534
|
+
group?.kind === "organization" && /* @__PURE__ */ jsx15(OrganizationPanel, { group, onSaved: reload }),
|
|
2535
|
+
!group || group.writable ? /* @__PURE__ */ jsx15(AddMember, { groupId: group?.id ?? id, existing: members ?? [], onAdded: reload }) : /* @__PURE__ */ jsx15(InlineAlert11, { tone: "neutral", children: group.computed ? t(group.kind === "ou" ? "ouNotice" : "directoryNotice") : t("readOnlyNotice") }),
|
|
2536
|
+
/* @__PURE__ */ jsx15(Panel11, { title: /* @__PURE__ */ jsx15(TextSlot3, { width: 22, children: t("effectiveMembers", { count: effectiveMembers?.length ?? 0 }) }), flush: true, children: /* @__PURE__ */ jsx15(
|
|
2445
2537
|
DataTable9,
|
|
2446
2538
|
{
|
|
2447
2539
|
"aria-label": t("effectiveMembers", { count: effectiveMembers?.length ?? 0 }),
|
|
@@ -2482,27 +2574,19 @@ function OrganizationPanel({ group, onSaved }) {
|
|
|
2482
2574
|
await onSaved();
|
|
2483
2575
|
}
|
|
2484
2576
|
}
|
|
2485
|
-
return /* @__PURE__ */
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
-
/* @__PURE__ */
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ jsx15(Panel11, { title: t("organization"), description: t("organizationHint"), "data-testid": "organization", children: /* @__PURE__ */ jsxs15(Stack11, { gap: "field", maxW: "2xl", children: [
|
|
2578
|
+
/* @__PURE__ */ jsx15(Field4, { label: tg("domains"), helperText: tg("domainsHint"), children: /* @__PURE__ */ jsx15(Input5, { value: domains, onChange: (e) => setDomains(e.target.value), dir: "ltr", placeholder: "acme.com" }) }),
|
|
2579
|
+
/* @__PURE__ */ jsx15(Field4, { label: t("attributes"), helperText: t("attributesHint"), children: /* @__PURE__ */ jsx15(Textarea, { value: attributes, onChange: (e) => setAttributes(e.target.value), rows: 4, fontFamily: "mono", fontSize: "sm" }) }),
|
|
2580
|
+
/* @__PURE__ */ jsx15(InlineAlert11, { tone: "danger", children: action.error }),
|
|
2581
|
+
/* @__PURE__ */ jsx15(HStack13, { children: /* @__PURE__ */ jsx15(Button10, { onClick: () => void save(), loading: action.busy, children: t("saveOrganization") }) })
|
|
2490
2582
|
] }) });
|
|
2491
2583
|
}
|
|
2492
|
-
function useSettled(value, delay = 250) {
|
|
2493
|
-
const [settled, setSettled] = useState9(value);
|
|
2494
|
-
useEffect(() => {
|
|
2495
|
-
const timer = setTimeout(() => setSettled(value), delay);
|
|
2496
|
-
return () => clearTimeout(timer);
|
|
2497
|
-
}, [value, delay]);
|
|
2498
|
-
return settled;
|
|
2499
|
-
}
|
|
2500
2584
|
function AddMember({ groupId, existing, onAdded }) {
|
|
2501
2585
|
const t = useGuardNs("groupDetail");
|
|
2502
2586
|
const tc = useGuardNs("common");
|
|
2503
2587
|
const request = useAreaRequest12("guard");
|
|
2504
2588
|
const [query, setQuery] = useState9("");
|
|
2505
|
-
const settled =
|
|
2589
|
+
const settled = useSettledValue(query.trim());
|
|
2506
2590
|
const [accounts, setAccounts] = useState9([]);
|
|
2507
2591
|
const [groups, setGroups] = useState9([]);
|
|
2508
2592
|
const [searchError, setSearchError] = useState9(null);
|
|
@@ -2549,27 +2633,27 @@ function AddMember({ groupId, existing, onAdded }) {
|
|
|
2549
2633
|
id: "type",
|
|
2550
2634
|
header: tc("type"),
|
|
2551
2635
|
width: "24",
|
|
2552
|
-
cell: (c) => c.kind === "Group" ? /* @__PURE__ */
|
|
2636
|
+
cell: (c) => c.kind === "Group" ? /* @__PURE__ */ jsx15(StatusPill9, { tone: "info", children: tc("group") }) : /* @__PURE__ */ jsx15(StatusPill9, { children: tc("account") })
|
|
2553
2637
|
},
|
|
2554
2638
|
{
|
|
2555
2639
|
id: "name",
|
|
2556
2640
|
header: tc("name"),
|
|
2557
|
-
cell: (c) => c.kind === "Group" ? /* @__PURE__ */
|
|
2558
|
-
/* @__PURE__ */
|
|
2559
|
-
/* @__PURE__ */
|
|
2641
|
+
cell: (c) => c.kind === "Group" ? /* @__PURE__ */ jsx15(Text14, { as: "span", fontWeight: "medium", children: c.group.name }) : /* @__PURE__ */ jsxs15(HStack13, { gap: "2", children: [
|
|
2642
|
+
/* @__PURE__ */ jsx15(RecordKey4, { value: c.account.username }),
|
|
2643
|
+
/* @__PURE__ */ jsx15(Text14, { as: "span", textStyle: "caption", color: "fg.muted", children: c.account.displayName })
|
|
2560
2644
|
] })
|
|
2561
2645
|
},
|
|
2562
2646
|
{ id: "directory", header: tc("directory"), cell: (c) => c.kind === "Group" ? c.group.directoryName : c.account.directoryName },
|
|
2563
2647
|
{
|
|
2564
2648
|
id: "add",
|
|
2565
|
-
header: /* @__PURE__ */
|
|
2649
|
+
header: /* @__PURE__ */ jsx15(Text14, { as: "span", srOnly: true, children: tc("actions") }),
|
|
2566
2650
|
align: "end",
|
|
2567
2651
|
cell: (c) => {
|
|
2568
2652
|
const member = c.kind === "Group" ? isMember("Group", c.group.id) : isMember("Account", c.account.id);
|
|
2569
2653
|
if (member)
|
|
2570
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ jsx15(Text14, { as: "span", textStyle: "caption", color: "fg.muted", children: t("alreadyMember") });
|
|
2571
2655
|
const key = keyOf(c);
|
|
2572
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ jsx15(
|
|
2573
2657
|
Button10,
|
|
2574
2658
|
{
|
|
2575
2659
|
size: "sm",
|
|
@@ -2582,12 +2666,12 @@ function AddMember({ groupId, existing, onAdded }) {
|
|
|
2582
2666
|
}
|
|
2583
2667
|
}
|
|
2584
2668
|
];
|
|
2585
|
-
return /* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
/* @__PURE__ */
|
|
2589
|
-
settled && candidates.length === 0 && !searchError && /* @__PURE__ */
|
|
2590
|
-
candidates.length > 0 && /* @__PURE__ */
|
|
2669
|
+
return /* @__PURE__ */ jsx15(Panel11, { title: t("addMember"), children: /* @__PURE__ */ jsxs15(Stack11, { gap: "stack", children: [
|
|
2670
|
+
/* @__PURE__ */ jsx15(SearchInput2, { maxW: "md", placeholder: t("searchMembers"), value: query, onChange: (e) => setQuery(e.target.value), "aria-label": t("searchMembers") }),
|
|
2671
|
+
/* @__PURE__ */ jsx15(InlineAlert11, { tone: "danger", children: error }),
|
|
2672
|
+
/* @__PURE__ */ jsx15(InlineAlert11, { tone: "danger", children: searchError }),
|
|
2673
|
+
settled && candidates.length === 0 && !searchError && /* @__PURE__ */ jsx15(Text14, { textStyle: "body", color: "fg.muted", children: t("noMatches") }),
|
|
2674
|
+
candidates.length > 0 && /* @__PURE__ */ jsx15(Panel11, { flush: true, children: /* @__PURE__ */ jsx15(DataTable9, { size: "sm", "aria-label": t("addMember"), columns, rows: candidates, getRowId: keyOf }) })
|
|
2591
2675
|
] }) });
|
|
2592
2676
|
}
|
|
2593
2677
|
function GroupNames({ group, onSaved }) {
|
|
@@ -2609,18 +2693,18 @@ function GroupNames({ group, onSaved }) {
|
|
|
2609
2693
|
});
|
|
2610
2694
|
if (ok) await onSaved();
|
|
2611
2695
|
}
|
|
2612
|
-
return /* @__PURE__ */
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2696
|
+
return /* @__PURE__ */ jsx15(Panel11, { title: t("names"), description: t("namesHint"), children: /* @__PURE__ */ jsxs15("form", { onSubmit: save, children: [
|
|
2697
|
+
/* @__PURE__ */ jsxs15(HStack13, { gap: "2", align: "start", wrap: "wrap", children: [
|
|
2698
|
+
/* @__PURE__ */ jsx15(TranslatedInput3, { value, onChange: setValue, "aria-label": tc("name"), suggest: false }),
|
|
2699
|
+
/* @__PURE__ */ jsx15(Button10, { type: "submit", loading: action.busy, disabled: !name || unchanged, children: t("saveNames") })
|
|
2616
2700
|
] }),
|
|
2617
|
-
/* @__PURE__ */
|
|
2701
|
+
/* @__PURE__ */ jsx15(InlineAlert11, { tone: "danger", children: action.error })
|
|
2618
2702
|
] }) });
|
|
2619
2703
|
}
|
|
2620
2704
|
|
|
2621
2705
|
// src/areas/guard/GroupsScreen.tsx
|
|
2622
2706
|
import { useState as useState10 } from "react";
|
|
2623
|
-
import { HStack as HStack14, Input as Input6, SimpleGrid as SimpleGrid3, Stack as Stack12, Text as
|
|
2707
|
+
import { HStack as HStack14, Input as Input6, SimpleGrid as SimpleGrid3, Stack as Stack12, Text as Text15 } from "@chakra-ui/react";
|
|
2624
2708
|
import {
|
|
2625
2709
|
AppLink as AppLink9,
|
|
2626
2710
|
Button as Button11,
|
|
@@ -2629,6 +2713,7 @@ import {
|
|
|
2629
2713
|
errorText as errorText8,
|
|
2630
2714
|
Field as Field5,
|
|
2631
2715
|
InlineAlert as InlineAlert12,
|
|
2716
|
+
ListFooter as ListFooter2,
|
|
2632
2717
|
notify as notify8,
|
|
2633
2718
|
PageHeader as PageHeader7,
|
|
2634
2719
|
Panel as Panel12,
|
|
@@ -2643,7 +2728,7 @@ import {
|
|
|
2643
2728
|
useListState as useListState2
|
|
2644
2729
|
} from "@abpjs/ui";
|
|
2645
2730
|
import { fromNamesValue as fromNamesValue3, splitList as splitList2 } from "@abpjs/ui/rules";
|
|
2646
|
-
import { Fragment as Fragment8, jsx as
|
|
2731
|
+
import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2647
2732
|
var KINDS = ["standard", "directory", "ou", "organization"];
|
|
2648
2733
|
function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
2649
2734
|
const t = useGuardNs("groups");
|
|
@@ -2660,35 +2745,35 @@ function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
|
2660
2745
|
id: "name",
|
|
2661
2746
|
header: tc("name"),
|
|
2662
2747
|
sortValue: (g) => g.name,
|
|
2663
|
-
cell: (g) => /* @__PURE__ */
|
|
2748
|
+
cell: (g) => /* @__PURE__ */ jsx16(AppLink9, { href: routes.group(g.id), fontWeight: "medium", children: written(g.name, g.names) })
|
|
2664
2749
|
},
|
|
2665
|
-
{ id: "kind", header: t("kind"), sortValue: (g) => g.kind, cell: (g) => /* @__PURE__ */
|
|
2750
|
+
{ id: "kind", header: t("kind"), sortValue: (g) => g.kind, cell: (g) => /* @__PURE__ */ jsx16(StatusPill10, { dot: false, children: t(`kinds.${g.kind}`) }), skeleton: "pill" },
|
|
2666
2751
|
{
|
|
2667
2752
|
id: "description",
|
|
2668
2753
|
header: tc("description"),
|
|
2669
|
-
cell: (g) => g.description ? /* @__PURE__ */
|
|
2754
|
+
cell: (g) => g.description ? /* @__PURE__ */ jsx16(Text15, { as: "span", color: "fg.muted", children: g.description }) : EMPTY_VALUE4
|
|
2670
2755
|
},
|
|
2671
2756
|
{ id: "directory", header: tc("directory"), sortValue: (g) => g.directoryName, cell: (g) => g.directoryName },
|
|
2672
2757
|
{
|
|
2673
2758
|
id: "source",
|
|
2674
2759
|
header: tc("source"),
|
|
2675
|
-
cell: (g) => g.isLocal ? /* @__PURE__ */
|
|
2760
|
+
cell: (g) => g.isLocal ? /* @__PURE__ */ jsx16(StatusPill10, { tone: "accent", children: t("local") }) : /* @__PURE__ */ jsx16(StatusPill10, { tone: "info", children: t("synced") }),
|
|
2676
2761
|
skeleton: "pill"
|
|
2677
2762
|
},
|
|
2678
2763
|
{ id: "members", header: t("directMembers"), numeric: true, cell: (g) => num(g.directMemberCount) },
|
|
2679
2764
|
{ id: "memberGroups", header: t("memberGroups"), numeric: true, cell: (g) => num(g.memberGroupCount) }
|
|
2680
2765
|
];
|
|
2681
|
-
return /* @__PURE__ */
|
|
2682
|
-
/* @__PURE__ */
|
|
2766
|
+
return /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
2767
|
+
/* @__PURE__ */ jsx16(
|
|
2683
2768
|
PageHeader7,
|
|
2684
2769
|
{
|
|
2685
2770
|
title: t("title"),
|
|
2686
2771
|
description: t("subtitle"),
|
|
2687
|
-
actions: !creating && admin && /* @__PURE__ */
|
|
2772
|
+
actions: !creating && admin && /* @__PURE__ */ jsx16(Button11, { variant: "primary", onClick: () => setCreating(true), children: t("create") })
|
|
2688
2773
|
}
|
|
2689
2774
|
),
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
creating && /* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ jsxs16(Stack12, { gap: "section", children: [
|
|
2776
|
+
creating && /* @__PURE__ */ jsx16(
|
|
2692
2777
|
CreateGroup,
|
|
2693
2778
|
{
|
|
2694
2779
|
directories: dirs.data ?? [],
|
|
@@ -2700,9 +2785,9 @@ function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
|
2700
2785
|
}
|
|
2701
2786
|
}
|
|
2702
2787
|
),
|
|
2703
|
-
/* @__PURE__ */
|
|
2704
|
-
/* @__PURE__ */
|
|
2705
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ jsxs16(Stack12, { gap: "field", children: [
|
|
2789
|
+
/* @__PURE__ */ jsxs16(HStack14, { gap: "2", wrap: "wrap", children: [
|
|
2790
|
+
/* @__PURE__ */ jsx16(
|
|
2706
2791
|
SearchInput3,
|
|
2707
2792
|
{
|
|
2708
2793
|
size: "sm",
|
|
@@ -2713,7 +2798,7 @@ function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
|
2713
2798
|
"aria-label": t("searchPlaceholder")
|
|
2714
2799
|
}
|
|
2715
2800
|
),
|
|
2716
|
-
/* @__PURE__ */
|
|
2801
|
+
/* @__PURE__ */ jsx16(
|
|
2717
2802
|
SelectField3,
|
|
2718
2803
|
{
|
|
2719
2804
|
size: "sm",
|
|
@@ -2724,7 +2809,7 @@ function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
|
2724
2809
|
options: [{ value: "", label: t("allDirectories") }, ...(dirs.data ?? []).map((d) => ({ value: d.id, label: d.name }))]
|
|
2725
2810
|
}
|
|
2726
2811
|
),
|
|
2727
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ jsx16(
|
|
2728
2813
|
SelectField3,
|
|
2729
2814
|
{
|
|
2730
2815
|
size: "sm",
|
|
@@ -2736,8 +2821,8 @@ function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
|
2736
2821
|
}
|
|
2737
2822
|
)
|
|
2738
2823
|
] }),
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ jsx16(DataTable10, { "aria-label": t("title"), columns, getRowId: (g) => g.id, empty: t("empty"), ...list.table }),
|
|
2825
|
+
/* @__PURE__ */ jsx16(ListFooter2, { list })
|
|
2741
2826
|
] })
|
|
2742
2827
|
] })
|
|
2743
2828
|
] });
|
|
@@ -2777,11 +2862,11 @@ function CreateGroup({ directories, onDone, onCancel }) {
|
|
|
2777
2862
|
setBusy(false);
|
|
2778
2863
|
}
|
|
2779
2864
|
}
|
|
2780
|
-
return /* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2784
|
-
/* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ jsx16(Panel12, { title: t("create"), children: /* @__PURE__ */ jsx16("form", { onSubmit: submit, children: /* @__PURE__ */ jsxs16(Stack12, { gap: "field", children: [
|
|
2866
|
+
/* @__PURE__ */ jsxs16(SimpleGrid3, { columns: { base: 1, md: 3 }, gap: "field", children: [
|
|
2867
|
+
/* @__PURE__ */ jsx16(Field5, { label: tc("name"), required: true, children: /* @__PURE__ */ jsx16(TranslatedInput4, { value: nameValue, onChange: setNameValue, "aria-label": tc("name") }) }),
|
|
2868
|
+
/* @__PURE__ */ jsx16(Field5, { label: tc("description"), children: /* @__PURE__ */ jsx16(Input6, { value: description, onChange: (e) => setDescription(e.target.value) }) }),
|
|
2869
|
+
/* @__PURE__ */ jsx16(Field5, { label: tc("directory"), helperText: t("directoryHint"), children: /* @__PURE__ */ jsx16(
|
|
2785
2870
|
SelectField3,
|
|
2786
2871
|
{
|
|
2787
2872
|
value: directoryId,
|
|
@@ -2792,7 +2877,7 @@ function CreateGroup({ directories, onDone, onCancel }) {
|
|
|
2792
2877
|
]
|
|
2793
2878
|
}
|
|
2794
2879
|
) }),
|
|
2795
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ jsx16(Field5, { label: t("kind"), helperText: t("kindHint"), children: /* @__PURE__ */ jsx16(
|
|
2796
2881
|
SelectField3,
|
|
2797
2882
|
{
|
|
2798
2883
|
value: kind,
|
|
@@ -2800,19 +2885,19 @@ function CreateGroup({ directories, onDone, onCancel }) {
|
|
|
2800
2885
|
options: ["standard", "organization"].map((k) => ({ value: k, label: t(`kinds.${k}`) }))
|
|
2801
2886
|
}
|
|
2802
2887
|
) }),
|
|
2803
|
-
kind === "organization" && /* @__PURE__ */
|
|
2888
|
+
kind === "organization" && /* @__PURE__ */ jsx16(Field5, { label: t("domains"), helperText: t("domainsHint"), children: /* @__PURE__ */ jsx16(Input6, { value: domains, onChange: (e) => setDomains(e.target.value), dir: "ltr", placeholder: "acme.com" }) })
|
|
2804
2889
|
] }),
|
|
2805
|
-
/* @__PURE__ */
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2890
|
+
/* @__PURE__ */ jsx16(InlineAlert12, { tone: "danger", children: error }),
|
|
2891
|
+
/* @__PURE__ */ jsxs16(HStack14, { gap: "2", children: [
|
|
2892
|
+
/* @__PURE__ */ jsx16(Button11, { type: "submit", variant: "primary", loading: busy, children: t("create") }),
|
|
2893
|
+
/* @__PURE__ */ jsx16(Button11, { onClick: onCancel, children: tc("cancel") })
|
|
2809
2894
|
] })
|
|
2810
2895
|
] }) }) });
|
|
2811
2896
|
}
|
|
2812
2897
|
|
|
2813
2898
|
// src/areas/guard/MergeScreen.tsx
|
|
2814
2899
|
import { useEffect as useEffect2, useState as useState11 } from "react";
|
|
2815
|
-
import { HStack as HStack15, Input as Input7, SimpleGrid as SimpleGrid4, Stack as Stack13, Text as
|
|
2900
|
+
import { HStack as HStack15, Input as Input7, SimpleGrid as SimpleGrid4, Stack as Stack13, Text as Text16 } from "@chakra-ui/react";
|
|
2816
2901
|
import {
|
|
2817
2902
|
boneWidth,
|
|
2818
2903
|
Button as Button12,
|
|
@@ -2832,10 +2917,10 @@ import {
|
|
|
2832
2917
|
useApiAction as useApiAction9,
|
|
2833
2918
|
useApiQuery as useApiQuery10,
|
|
2834
2919
|
useAreaRequest as useAreaRequest14,
|
|
2835
|
-
useFormatters as
|
|
2920
|
+
useFormatters as useFormatters8,
|
|
2836
2921
|
useNavigate as useNavigate4
|
|
2837
2922
|
} from "@abpjs/ui";
|
|
2838
|
-
import { Fragment as Fragment9, jsx as
|
|
2923
|
+
import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2839
2924
|
function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
2840
2925
|
const t = useGuardNs("merge");
|
|
2841
2926
|
const tn = useGuardNs("nav");
|
|
@@ -2863,7 +2948,7 @@ function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
|
2863
2948
|
() => request(`/accounts/${id}/merge/preview`, { method: "POST", body: { survivorId: survivor.id } }).then(setPreview)
|
|
2864
2949
|
);
|
|
2865
2950
|
}, [id, survivor]);
|
|
2866
|
-
if (source.error && !source.data) return /* @__PURE__ */
|
|
2951
|
+
if (source.error && !source.data) return /* @__PURE__ */ jsx17(InlineAlert13, { tone: "danger", children: source.error });
|
|
2867
2952
|
const account = source.data?.account;
|
|
2868
2953
|
const confirmed = !preview?.needsConfirmation || confirm.trim().toLowerCase() === account?.username.toLowerCase();
|
|
2869
2954
|
async function merge() {
|
|
@@ -2881,8 +2966,8 @@ function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
|
2881
2966
|
}
|
|
2882
2967
|
}
|
|
2883
2968
|
const search = async (text) => (await request(`/accounts?${new URLSearchParams({ search: text })}`)).filter((a) => a.id !== account?.id && !a.mergedIntoId);
|
|
2884
|
-
return /* @__PURE__ */
|
|
2885
|
-
/* @__PURE__ */
|
|
2969
|
+
return /* @__PURE__ */ jsxs17(Loading5, { when: !source.data, children: [
|
|
2970
|
+
/* @__PURE__ */ jsx17(
|
|
2886
2971
|
PageHeader8,
|
|
2887
2972
|
{
|
|
2888
2973
|
breadcrumbs: [
|
|
@@ -2891,11 +2976,11 @@ function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
|
2891
2976
|
{ label: t("pageTitle") }
|
|
2892
2977
|
],
|
|
2893
2978
|
title: t("pageTitle"),
|
|
2894
|
-
description: /* @__PURE__ */
|
|
2979
|
+
description: /* @__PURE__ */ jsx17(TextSlot4, { width: t("pageHint", { username: "" }).length + 16, children: t("pageHint", { username: account?.username ?? "" }) })
|
|
2895
2980
|
}
|
|
2896
2981
|
),
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
account?.mergedIntoId ? /* @__PURE__ */
|
|
2982
|
+
/* @__PURE__ */ jsxs17(Stack13, { gap: "section", children: [
|
|
2983
|
+
account?.mergedIntoId ? /* @__PURE__ */ jsx17(InlineAlert13, { tone: "warning", children: t("alreadyMerged", { survivor: source.data?.mergedIntoUsername ?? "" }) }) : /* @__PURE__ */ jsx17(Panel13, { title: t("chooseTitle"), description: t("chooseHint"), children: /* @__PURE__ */ jsx17(Field6, { label: t("survivor"), children: /* @__PURE__ */ jsx17(
|
|
2899
2984
|
SearchPicker,
|
|
2900
2985
|
{
|
|
2901
2986
|
"aria-label": t("survivor"),
|
|
@@ -2905,10 +2990,10 @@ function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
|
2905
2990
|
known: [],
|
|
2906
2991
|
getId: (a) => a.id,
|
|
2907
2992
|
label: (a) => `${a.displayName} (@${a.username})`,
|
|
2908
|
-
renderOption: (a) => /* @__PURE__ */
|
|
2909
|
-
/* @__PURE__ */
|
|
2993
|
+
renderOption: (a) => /* @__PURE__ */ jsxs17(Fragment9, { children: [
|
|
2994
|
+
/* @__PURE__ */ jsx17(Text16, { as: "span", textStyle: "body.sm", fontWeight: "medium", children: a.displayName }),
|
|
2910
2995
|
" ",
|
|
2911
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsxs17(Text16, { as: "span", textStyle: "caption", color: "fg.muted", dir: "ltr", children: [
|
|
2912
2997
|
"@",
|
|
2913
2998
|
a.username,
|
|
2914
2999
|
" \xB7 ",
|
|
@@ -2920,26 +3005,26 @@ function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
|
2920
3005
|
messages: { placeholder: t("searchPlaceholder"), searching: t("searching"), noMatches: t("noMatches"), noKnown: t("noMatches") }
|
|
2921
3006
|
}
|
|
2922
3007
|
) }) }),
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
survivor && (preview || loading.busy) && /* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */
|
|
3008
|
+
/* @__PURE__ */ jsx17(InlineAlert13, { tone: "danger", children: loading.error }),
|
|
3009
|
+
survivor && (preview || loading.busy) && /* @__PURE__ */ jsxs17(Loading5, { when: !preview, children: [
|
|
3010
|
+
/* @__PURE__ */ jsxs17(SimpleGrid4, { columns: { base: 1, md: 2 }, gap: "section", children: [
|
|
3011
|
+
/* @__PURE__ */ jsx17(Side, { title: t("sourceTitle"), hint: t("sourceHint"), account: preview?.source, routes }),
|
|
3012
|
+
/* @__PURE__ */ jsx17(Side, { title: t("survivorTitle"), hint: t("survivorHint"), account: preview?.survivor, routes })
|
|
2928
3013
|
] }),
|
|
2929
|
-
/* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
preview?.needsConfirmation && /* @__PURE__ */
|
|
2932
|
-
/* @__PURE__ */
|
|
2933
|
-
/* @__PURE__ */
|
|
3014
|
+
/* @__PURE__ */ jsx17(Panel13, { title: t("previewTitle"), description: t("previewHint"), "data-testid": "merge-preview", children: preview ? /* @__PURE__ */ jsx17(Parts, { preview }) : /* @__PURE__ */ jsx17(PartsComing, {}) }),
|
|
3015
|
+
/* @__PURE__ */ jsx17(Panel13, { title: t("confirmTitle"), children: /* @__PURE__ */ jsxs17(Stack13, { gap: "field", maxW: "xl", children: [
|
|
3016
|
+
preview?.needsConfirmation && /* @__PURE__ */ jsxs17(Fragment9, { children: [
|
|
3017
|
+
/* @__PURE__ */ jsx17(InlineAlert13, { tone: "warning", children: preview.sameDirectory ? t("activeWarning", { username: account?.username ?? "" }) : t("activeOtherDirectory", { username: account?.username ?? "" }) }),
|
|
3018
|
+
/* @__PURE__ */ jsx17(Field6, { label: t("typeUsername", { username: account?.username ?? "" }), children: /* @__PURE__ */ jsx17(Input7, { value: confirm, onChange: (e) => setConfirm(e.target.value), autoComplete: "off", dir: "ltr" }) })
|
|
2934
3019
|
] }),
|
|
2935
|
-
/* @__PURE__ */
|
|
2936
|
-
/* @__PURE__ */
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
3020
|
+
/* @__PURE__ */ jsx17(Text16, { textStyle: "body.sm", color: "fg.muted", children: t("noUndo") }),
|
|
3021
|
+
/* @__PURE__ */ jsx17(InlineAlert13, { tone: "danger", children: merging.error }),
|
|
3022
|
+
/* @__PURE__ */ jsxs17(HStack15, { gap: "2", children: [
|
|
3023
|
+
/* @__PURE__ */ jsx17(Button12, { variant: "primary", danger: true, onClick: merge, loading: merging.busy, disabled: !confirmed, children: t("mergeButton", {
|
|
2939
3024
|
source: preview?.source.username ?? account?.username ?? "",
|
|
2940
3025
|
survivor: preview?.survivor.username ?? survivor.username
|
|
2941
3026
|
}) }),
|
|
2942
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx17(Button12, { onClick: () => navigate(routes.account(account?.id ?? id)), children: tc("cancel") })
|
|
2943
3028
|
] })
|
|
2944
3029
|
] }) })
|
|
2945
3030
|
] })
|
|
@@ -2948,56 +3033,444 @@ function MergeScreen({ id, into, routes = guardRoutes() }) {
|
|
|
2948
3033
|
}
|
|
2949
3034
|
function Side({ title, hint, account, routes }) {
|
|
2950
3035
|
const tc = useGuardNs("common");
|
|
2951
|
-
const fmt =
|
|
2952
|
-
return /* @__PURE__ */
|
|
3036
|
+
const fmt = useFormatters8();
|
|
3037
|
+
return /* @__PURE__ */ jsx17(Panel13, { title, description: hint, children: /* @__PURE__ */ jsx17(
|
|
2953
3038
|
PropertyList4,
|
|
2954
3039
|
{
|
|
2955
3040
|
items: [
|
|
2956
|
-
{ label: tc("username"), value: /* @__PURE__ */
|
|
3041
|
+
{ label: tc("username"), value: /* @__PURE__ */ jsx17(RecordKey5, { value: account?.username, href: account && routes.account(account.id) }) },
|
|
2957
3042
|
{ label: tc("displayName"), value: account?.displayName },
|
|
2958
3043
|
{ label: tc("email"), value: account && (account.email ?? EMPTY_VALUE5) },
|
|
2959
3044
|
{ label: tc("directory"), value: account?.directoryName },
|
|
2960
|
-
{ label: tc("status"), value: account ? /* @__PURE__ */
|
|
3045
|
+
{ label: tc("status"), value: account ? /* @__PURE__ */ jsx17(AccountStatusPill, { status: account.status }) : /* @__PURE__ */ jsx17(StatusPill11, {}) },
|
|
2961
3046
|
{ label: tc("lastSignIn"), value: account && fmt.dateTime(account.lastLoginAt) }
|
|
2962
3047
|
]
|
|
2963
3048
|
}
|
|
2964
3049
|
) });
|
|
2965
3050
|
}
|
|
2966
3051
|
function PartsComing() {
|
|
2967
|
-
return /* @__PURE__ */
|
|
2968
|
-
/* @__PURE__ */
|
|
2969
|
-
/* @__PURE__ */
|
|
3052
|
+
return /* @__PURE__ */ jsx17(SimpleGrid4, { columns: { base: 1, md: 3 }, gap: "field", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxs17(Stack13, { gap: "1", children: [
|
|
3053
|
+
/* @__PURE__ */ jsx17(Text16, { fontWeight: "medium", children: /* @__PURE__ */ jsx17(TextBone2, { width: boneWidth(i, 8, 14) }) }),
|
|
3054
|
+
/* @__PURE__ */ jsx17(Text16, { textStyle: "body.sm", children: /* @__PURE__ */ jsx17(TextBone2, { width: boneWidth(i + 3, 12, 22) }) })
|
|
2970
3055
|
] }, i)) });
|
|
2971
3056
|
}
|
|
2972
3057
|
function Parts({ preview }) {
|
|
2973
3058
|
const t = useGuardNs("merge");
|
|
2974
3059
|
const partLabel = usePartLabel();
|
|
2975
3060
|
const moving = preview.parts.filter((p) => p.counts.length > 0 || p.error);
|
|
2976
|
-
if (moving.length === 0) return /* @__PURE__ */
|
|
2977
|
-
return /* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
p.error ? /* @__PURE__ */
|
|
3061
|
+
if (moving.length === 0) return /* @__PURE__ */ jsx17(Text16, { color: "fg.muted", children: t("nothing") });
|
|
3062
|
+
return /* @__PURE__ */ jsx17(SimpleGrid4, { columns: { base: 1, md: 3 }, gap: "field", children: moving.map((p) => /* @__PURE__ */ jsxs17(Stack13, { gap: "1", children: [
|
|
3063
|
+
/* @__PURE__ */ jsx17(Text16, { fontWeight: "medium", children: partLabel(p.key, p.plugin) }),
|
|
3064
|
+
p.error ? /* @__PURE__ */ jsx17(InlineAlert13, { tone: "warning", children: t("pluginError", { error: p.error }) }) : /* @__PURE__ */ jsx17(CountList, { counts: p.counts })
|
|
2980
3065
|
] }, p.key)) });
|
|
2981
3066
|
}
|
|
2982
3067
|
|
|
2983
|
-
// src/areas/guard/
|
|
3068
|
+
// src/areas/guard/MySecondFactorsPanel.tsx
|
|
3069
|
+
import { useEffect as useEffect4, useState as useState13 } from "react";
|
|
3070
|
+
import { HStack as HStack17, Input as Input9, Stack as Stack15, Text as Text18 } from "@chakra-ui/react";
|
|
3071
|
+
import {
|
|
3072
|
+
AbpApiError,
|
|
3073
|
+
Button as Button14,
|
|
3074
|
+
createPasskey,
|
|
3075
|
+
DataTable as DataTable11,
|
|
3076
|
+
errorText as errorText10,
|
|
3077
|
+
Field as Field8,
|
|
3078
|
+
FormDialog,
|
|
3079
|
+
InlineAlert as InlineAlert15,
|
|
3080
|
+
notify as notify11,
|
|
3081
|
+
Panel as Panel14,
|
|
3082
|
+
passkeysSupported,
|
|
3083
|
+
StatusPill as StatusPill12,
|
|
3084
|
+
useApiQuery as useApiQuery11,
|
|
3085
|
+
useAreaRequest as useAreaRequest15,
|
|
3086
|
+
useConfirm as useConfirm5,
|
|
3087
|
+
useFormatters as useFormatters9
|
|
3088
|
+
} from "@abpjs/ui";
|
|
3089
|
+
|
|
3090
|
+
// src/areas/guard/SecondFactorParts.tsx
|
|
2984
3091
|
import { useEffect as useEffect3, useState as useState12 } from "react";
|
|
2985
|
-
import { HStack as HStack16, Input as Input8, Stack as Stack14 } from "@chakra-ui/react";
|
|
2986
|
-
import {
|
|
3092
|
+
import { Box as Box4, chakra as chakra2, Grid as Grid3, HStack as HStack16, Image, Input as Input8, Stack as Stack14, Text as Text17 } from "@chakra-ui/react";
|
|
3093
|
+
import { AppLink as AppLink10, Button as Button13, errorText as errorText9, Field as Field7, InlineAlert as InlineAlert14, looksLikeCode, notify as notify10 } from "@abpjs/ui";
|
|
3094
|
+
import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3095
|
+
function groupedKey(secret) {
|
|
3096
|
+
return secret.replace(/(.{4})/g, "$1 ").trim();
|
|
3097
|
+
}
|
|
3098
|
+
function useSenderName() {
|
|
3099
|
+
const t = useGuardNs("secondFactor");
|
|
3100
|
+
return (sender) => {
|
|
3101
|
+
const key = `sender.${sender.method.replace(/\W/g, "_")}`;
|
|
3102
|
+
const own = t(key);
|
|
3103
|
+
if (own !== `secondFactor.${key}`) return own;
|
|
3104
|
+
return sender.method === "email" ? t("kinds.email") : sender.name;
|
|
3105
|
+
};
|
|
3106
|
+
}
|
|
3107
|
+
function CodeInput({
|
|
3108
|
+
recovery,
|
|
3109
|
+
value,
|
|
3110
|
+
onChange,
|
|
3111
|
+
autoFocus = true
|
|
3112
|
+
}) {
|
|
3113
|
+
return /* @__PURE__ */ jsx18(
|
|
3114
|
+
Input8,
|
|
3115
|
+
{
|
|
3116
|
+
value,
|
|
3117
|
+
onChange: (e) => onChange(e.target.value),
|
|
3118
|
+
autoFocus,
|
|
3119
|
+
autoComplete: "one-time-code",
|
|
3120
|
+
inputMode: recovery ? "text" : "numeric",
|
|
3121
|
+
maxLength: recovery ? 16 : 7,
|
|
3122
|
+
dir: "ltr",
|
|
3123
|
+
textAlign: "start",
|
|
3124
|
+
fontFamily: "mono",
|
|
3125
|
+
letterSpacing: recovery ? void 0 : "0.2em",
|
|
3126
|
+
width: recovery ? "48" : "32",
|
|
3127
|
+
"data-testid": "second-factor-code"
|
|
3128
|
+
}
|
|
3129
|
+
);
|
|
3130
|
+
}
|
|
3131
|
+
function AppSetup({ start, confirm, onDone, onCancel }) {
|
|
3132
|
+
const t = useGuardNs("secondFactor.setup");
|
|
3133
|
+
const [enrolment, setEnrolment] = useState12(null);
|
|
3134
|
+
const [code, setCode] = useState12("");
|
|
3135
|
+
const [error, setError] = useState12(null);
|
|
3136
|
+
const [busy, setBusy] = useState12(false);
|
|
3137
|
+
useEffect3(() => {
|
|
3138
|
+
let live = true;
|
|
3139
|
+
start().then(
|
|
3140
|
+
(e) => live && setEnrolment(e),
|
|
3141
|
+
(e) => live && setError(errorText9(e))
|
|
3142
|
+
);
|
|
3143
|
+
return () => {
|
|
3144
|
+
live = false;
|
|
3145
|
+
};
|
|
3146
|
+
}, []);
|
|
3147
|
+
async function verify(e) {
|
|
3148
|
+
e.preventDefault();
|
|
3149
|
+
setBusy(true);
|
|
3150
|
+
setError(null);
|
|
3151
|
+
try {
|
|
3152
|
+
const result = await confirm(code.replace(/\D/g, ""));
|
|
3153
|
+
if (result === false) {
|
|
3154
|
+
setError(t("wrongCode"));
|
|
3155
|
+
setCode("");
|
|
3156
|
+
return;
|
|
3157
|
+
}
|
|
3158
|
+
onDone(result);
|
|
3159
|
+
} catch (e2) {
|
|
3160
|
+
setError(errorText9(e2));
|
|
3161
|
+
} finally {
|
|
3162
|
+
setBusy(false);
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
return /* @__PURE__ */ jsx18("form", { onSubmit: (e) => void verify(e), "data-testid": "app-setup", children: /* @__PURE__ */ jsxs18(Stack14, { gap: "field", children: [
|
|
3166
|
+
/* @__PURE__ */ jsx18(Text17, { color: "fg.muted", children: t("scan") }),
|
|
3167
|
+
/* @__PURE__ */ jsxs18(Grid3, { templateColumns: { base: "1fr", sm: "auto minmax(0, 1fr)" }, gap: "5", alignItems: "center", children: [
|
|
3168
|
+
/* @__PURE__ */ jsx18(Box4, { bg: "white", p: "2", rounded: "l2", borderWidth: "1px", w: "fit-content", children: enrolment ? /* @__PURE__ */ jsx18(Image, { src: enrolment.qr, alt: t("qrAlt"), width: "44", height: "44", "data-testid": "app-setup-qr" }) : /* @__PURE__ */ jsx18(Box4, { width: "44", height: "44" }) }),
|
|
3169
|
+
/* @__PURE__ */ jsxs18(Stack14, { gap: "2", minW: "0", children: [
|
|
3170
|
+
/* @__PURE__ */ jsx18(Text17, { textStyle: "body.sm", color: "fg.muted", children: t("cantScan") }),
|
|
3171
|
+
/* @__PURE__ */ jsx18(
|
|
3172
|
+
Box4,
|
|
3173
|
+
{
|
|
3174
|
+
as: "code",
|
|
3175
|
+
dir: "ltr",
|
|
3176
|
+
textAlign: "start",
|
|
3177
|
+
fontFamily: "mono",
|
|
3178
|
+
fontSize: "sm",
|
|
3179
|
+
bg: "bg.muted",
|
|
3180
|
+
p: "2",
|
|
3181
|
+
rounded: "l2",
|
|
3182
|
+
wordBreak: "break-all",
|
|
3183
|
+
"data-testid": "app-setup-secret",
|
|
3184
|
+
children: enrolment ? groupedKey(enrolment.secret) : " "
|
|
3185
|
+
}
|
|
3186
|
+
),
|
|
3187
|
+
enrolment && /* @__PURE__ */ jsx18(AppLink10, { href: enrolment.address, textStyle: "body.sm", children: t("onThisDevice") })
|
|
3188
|
+
] })
|
|
3189
|
+
] }),
|
|
3190
|
+
/* @__PURE__ */ jsx18(Field7, { label: t("code"), helperText: t("codeHint"), children: /* @__PURE__ */ jsx18(CodeInput, { value: code, onChange: setCode, autoFocus: false }) }),
|
|
3191
|
+
/* @__PURE__ */ jsx18(InlineAlert14, { tone: "danger", children: error }),
|
|
3192
|
+
/* @__PURE__ */ jsxs18(HStack16, { children: [
|
|
3193
|
+
/* @__PURE__ */ jsx18(Button13, { type: "submit", loading: busy, disabled: !enrolment || !looksLikeCode(code, false), children: t("verify") }),
|
|
3194
|
+
onCancel && /* @__PURE__ */ jsx18(Button13, { variant: "secondary", onClick: onCancel, disabled: busy, children: t("cancel") })
|
|
3195
|
+
] })
|
|
3196
|
+
] }) });
|
|
3197
|
+
}
|
|
3198
|
+
function RecoveryCodes({ codes, onSaved, savedLabel }) {
|
|
3199
|
+
const t = useGuardNs("secondFactor.recovery");
|
|
3200
|
+
function text() {
|
|
3201
|
+
const site = typeof window === "undefined" ? "" : window.location.host;
|
|
3202
|
+
return `${t("fileHeader", { site })}
|
|
3203
|
+
|
|
3204
|
+
${codes.join("\n")}
|
|
3205
|
+
`;
|
|
3206
|
+
}
|
|
3207
|
+
async function copy() {
|
|
3208
|
+
try {
|
|
3209
|
+
await navigator.clipboard.writeText(text());
|
|
3210
|
+
notify10.success(t("copied"));
|
|
3211
|
+
} catch {
|
|
3212
|
+
notify10.error(t("copyFailed"));
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
function download() {
|
|
3216
|
+
const url = URL.createObjectURL(new Blob([text()], { type: "text/plain" }));
|
|
3217
|
+
const link = document.createElement("a");
|
|
3218
|
+
link.href = url;
|
|
3219
|
+
link.download = `${window.location.hostname}-recovery-codes.txt`;
|
|
3220
|
+
link.click();
|
|
3221
|
+
URL.revokeObjectURL(url);
|
|
3222
|
+
}
|
|
3223
|
+
return /* @__PURE__ */ jsxs18(Stack14, { gap: "field", "data-testid": "recovery-codes", children: [
|
|
3224
|
+
/* @__PURE__ */ jsx18(InlineAlert14, { tone: "warning", children: t("hint") }),
|
|
3225
|
+
/* @__PURE__ */ jsx18(Grid3, { templateColumns: "repeat(2, max-content)", columnGap: "6", rowGap: "1.5", dir: "ltr", bg: "bg.muted", p: "3", rounded: "l2", w: "fit-content", children: codes.map((c) => /* @__PURE__ */ jsx18(chakra2.code, { fontFamily: "mono", fontSize: "sm", children: c }, c)) }),
|
|
3226
|
+
/* @__PURE__ */ jsxs18(HStack16, { wrap: "wrap", children: [
|
|
3227
|
+
/* @__PURE__ */ jsx18(Button13, { variant: "secondary", onClick: () => void copy(), children: t("copy") }),
|
|
3228
|
+
/* @__PURE__ */ jsx18(Button13, { variant: "secondary", onClick: download, children: t("download") }),
|
|
3229
|
+
/* @__PURE__ */ jsx18(Button13, { onClick: onSaved, "data-testid": "recovery-codes-saved", children: savedLabel ?? t("saved") })
|
|
3230
|
+
] })
|
|
3231
|
+
] });
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
// src/areas/guard/MySecondFactorsPanel.tsx
|
|
3235
|
+
import { Fragment as Fragment10, jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3236
|
+
function MySecondFactorsPanel({ setUpNow = false, onSetUpChosen, onChange }) {
|
|
3237
|
+
const t = useGuardNs("secondFactor");
|
|
3238
|
+
const fmt = useFormatters9();
|
|
3239
|
+
const confirm = useConfirm5();
|
|
3240
|
+
const request = useAreaRequest15("guard");
|
|
3241
|
+
const mine = useApiQuery11("guard", "/me/second-factors");
|
|
3242
|
+
const nameOf = useSenderName();
|
|
3243
|
+
const [choice, setChoice] = useState13(null);
|
|
3244
|
+
const settingUp = choice ?? setUpNow;
|
|
3245
|
+
const [codes, setCodes] = useState13(null);
|
|
3246
|
+
const [error, setError] = useState13(null);
|
|
3247
|
+
const canPasskey = passkeysSupported();
|
|
3248
|
+
const [addingPasskey, setAddingPasskey] = useState13(false);
|
|
3249
|
+
const [passkeyName, setPasskeyName] = useState13("");
|
|
3250
|
+
const [busy, setBusy] = useState13(false);
|
|
3251
|
+
const [renaming, setRenaming] = useState13(null);
|
|
3252
|
+
const [newName, setNewName] = useState13("");
|
|
3253
|
+
const data = mine.data;
|
|
3254
|
+
const factors = data?.factors ?? [];
|
|
3255
|
+
useEffect4(() => {
|
|
3256
|
+
if (setUpNow) document.getElementById("second-factor")?.scrollIntoView({ block: "start" });
|
|
3257
|
+
}, [setUpNow]);
|
|
3258
|
+
function setSettingUp(next) {
|
|
3259
|
+
onSetUpChosen?.(next);
|
|
3260
|
+
setChoice(next);
|
|
3261
|
+
}
|
|
3262
|
+
async function remove(factor) {
|
|
3263
|
+
const passkey = factor.kind === "passkey";
|
|
3264
|
+
const yes = await confirm({
|
|
3265
|
+
title: passkey ? t("removePasskeyTitle") : t("removeTitle"),
|
|
3266
|
+
description: passkey ? t("removePasskeyHint") : t("removeHint"),
|
|
3267
|
+
confirmLabel: t("remove"),
|
|
3268
|
+
danger: true
|
|
3269
|
+
});
|
|
3270
|
+
if (!yes) return;
|
|
3271
|
+
setError(null);
|
|
3272
|
+
try {
|
|
3273
|
+
await request(`/me/second-factors/${factor.id}`, { method: "DELETE" });
|
|
3274
|
+
notify11.success(passkey ? t("passkeyRemoved") : t("removed"));
|
|
3275
|
+
await mine.reload();
|
|
3276
|
+
onChange?.();
|
|
3277
|
+
} catch (e) {
|
|
3278
|
+
setError(errorText10(e));
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
async function renew() {
|
|
3282
|
+
if (!await confirm({ title: t("renewTitle"), description: t("renewHint"), confirmLabel: t("renew") })) return;
|
|
3283
|
+
setError(null);
|
|
3284
|
+
try {
|
|
3285
|
+
setCodes((await request("/me/second-factors/recovery-codes", { method: "POST" })).recoveryCodes);
|
|
3286
|
+
await mine.reload();
|
|
3287
|
+
} catch (e) {
|
|
3288
|
+
setError(errorText10(e));
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
async function addPasskey() {
|
|
3292
|
+
setBusy(true);
|
|
3293
|
+
setError(null);
|
|
3294
|
+
try {
|
|
3295
|
+
const options = await request("/me/passkeys/options", { method: "POST" });
|
|
3296
|
+
const credential = await createPasskey(options);
|
|
3297
|
+
if (!credential) {
|
|
3298
|
+
setError(t("passkeyCancelled"));
|
|
3299
|
+
return;
|
|
3300
|
+
}
|
|
3301
|
+
const added = await request("/me/passkeys", {
|
|
3302
|
+
method: "POST",
|
|
3303
|
+
body: { name: passkeyName.trim() || t("passkeyNameDefault"), credential }
|
|
3304
|
+
});
|
|
3305
|
+
setAddingPasskey(false);
|
|
3306
|
+
notify11.success(t("passkeyAdded"));
|
|
3307
|
+
if (added.recoveryCodes?.length) setCodes(added.recoveryCodes);
|
|
3308
|
+
await mine.reload();
|
|
3309
|
+
onChange?.();
|
|
3310
|
+
} catch (e) {
|
|
3311
|
+
setError(errorText10(e));
|
|
3312
|
+
} finally {
|
|
3313
|
+
setBusy(false);
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
async function rename() {
|
|
3317
|
+
if (!renaming) return;
|
|
3318
|
+
await request(`/me/passkeys/${renaming.id}`, { method: "PUT", body: { name: newName.trim() } });
|
|
3319
|
+
setRenaming(null);
|
|
3320
|
+
await mine.reload();
|
|
3321
|
+
}
|
|
3322
|
+
async function confirmCode(code) {
|
|
3323
|
+
try {
|
|
3324
|
+
return (await request("/me/second-factors/app/confirm", { method: "POST", body: { code } })).recoveryCodes;
|
|
3325
|
+
} catch (e) {
|
|
3326
|
+
if (e instanceof AbpApiError && e.code === "second_factor_failed") return false;
|
|
3327
|
+
throw e;
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
const hasApp = factors.some((f) => f.kind === "app");
|
|
3331
|
+
const actions = !settingUp && !addingPasskey && !codes && data && !data.disabled && /* @__PURE__ */ jsxs19(HStack17, { gap: "2", wrap: "wrap", children: [
|
|
3332
|
+
canPasskey && /* @__PURE__ */ jsx19(
|
|
3333
|
+
Button14,
|
|
3334
|
+
{
|
|
3335
|
+
size: "sm",
|
|
3336
|
+
variant: factors.length ? "secondary" : "primary",
|
|
3337
|
+
onClick: () => {
|
|
3338
|
+
setPasskeyName(t("passkeyNameDefault"));
|
|
3339
|
+
setError(null);
|
|
3340
|
+
setAddingPasskey(true);
|
|
3341
|
+
},
|
|
3342
|
+
"data-testid": "passkey-add",
|
|
3343
|
+
children: t("addPasskey")
|
|
3344
|
+
}
|
|
3345
|
+
),
|
|
3346
|
+
/* @__PURE__ */ jsx19(Button14, { size: "sm", variant: factors.length || canPasskey ? "secondary" : "primary", onClick: () => setSettingUp(true), "data-testid": "second-factor-set-up", children: hasApp ? t("addAnother") : t("setUp") })
|
|
3347
|
+
] });
|
|
3348
|
+
return /* @__PURE__ */ jsxs19(Panel14, { id: "second-factor", title: t("title"), description: t("panelHint"), actions, "data-testid": "second-factor", children: [
|
|
3349
|
+
/* @__PURE__ */ jsxs19(Stack15, { gap: "field", children: [
|
|
3350
|
+
/* @__PURE__ */ jsx19(InlineAlert15, { tone: "danger", children: mine.error ?? error }),
|
|
3351
|
+
data?.disabled && /* @__PURE__ */ jsx19(InlineAlert15, { tone: "neutral", children: t("disabled") }),
|
|
3352
|
+
data && /* @__PURE__ */ jsxs19(HStack17, { gap: "2", wrap: "wrap", children: [
|
|
3353
|
+
factors.length > 0 && !data.disabled ? /* @__PURE__ */ jsx19(StatusPill12, { tone: "success", children: t("on") }) : /* @__PURE__ */ jsx19(StatusPill12, { children: t("off") }),
|
|
3354
|
+
/* @__PURE__ */ jsx19(Text18, { color: "fg.muted", textStyle: "body.sm", "data-testid": "second-factor-mode", children: t(`modeHint.${data.mode}`) })
|
|
3355
|
+
] }),
|
|
3356
|
+
data?.senders && data.senders.length > 0 && /* @__PURE__ */ jsx19(Text18, { color: "fg.muted", textStyle: "body.sm", "data-testid": "second-factor-senders", children: t("alsoBy", { list: data.senders.map((s) => `${nameOf(s)} (${s.to})`).join(", ") }) }),
|
|
3357
|
+
settingUp && /* @__PURE__ */ jsx19(
|
|
3358
|
+
AppSetup,
|
|
3359
|
+
{
|
|
3360
|
+
start: () => request("/me/second-factors/app", { method: "POST" }),
|
|
3361
|
+
confirm: confirmCode,
|
|
3362
|
+
onCancel: () => setSettingUp(false),
|
|
3363
|
+
onDone: (made) => {
|
|
3364
|
+
setSettingUp(false);
|
|
3365
|
+
notify11.success(t("setup.done"));
|
|
3366
|
+
setCodes(made);
|
|
3367
|
+
void mine.reload();
|
|
3368
|
+
onChange?.();
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
),
|
|
3372
|
+
addingPasskey && /* @__PURE__ */ jsx19(
|
|
3373
|
+
"form",
|
|
3374
|
+
{
|
|
3375
|
+
onSubmit: (e) => {
|
|
3376
|
+
e.preventDefault();
|
|
3377
|
+
void addPasskey();
|
|
3378
|
+
},
|
|
3379
|
+
"data-testid": "passkey-add-form",
|
|
3380
|
+
children: /* @__PURE__ */ jsxs19(Stack15, { gap: "field", maxW: "md", children: [
|
|
3381
|
+
/* @__PURE__ */ jsx19(Text18, { color: "fg.muted", textStyle: "body.sm", children: t("passkeyHint") }),
|
|
3382
|
+
/* @__PURE__ */ jsx19(Field8, { label: t("passkeyName"), children: /* @__PURE__ */ jsx19(Input9, { value: passkeyName, maxLength: 64, autoFocus: true, onChange: (e) => setPasskeyName(e.target.value), "data-testid": "passkey-name" }) }),
|
|
3383
|
+
/* @__PURE__ */ jsxs19(HStack17, { children: [
|
|
3384
|
+
/* @__PURE__ */ jsx19(Button14, { type: "submit", loading: busy, "data-testid": "passkey-create", children: t("passkeyCreate") }),
|
|
3385
|
+
/* @__PURE__ */ jsx19(Button14, { variant: "secondary", onClick: () => setAddingPasskey(false), disabled: busy, children: t("cancel") })
|
|
3386
|
+
] })
|
|
3387
|
+
] })
|
|
3388
|
+
}
|
|
3389
|
+
),
|
|
3390
|
+
codes && /* @__PURE__ */ jsx19(RecoveryCodes, { codes, onSaved: () => setCodes(null) }),
|
|
3391
|
+
!settingUp && !addingPasskey && !codes && /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
3392
|
+
/* @__PURE__ */ jsx19(
|
|
3393
|
+
DataTable11,
|
|
3394
|
+
{
|
|
3395
|
+
"aria-label": t("title"),
|
|
3396
|
+
size: "sm",
|
|
3397
|
+
rows: data?.factors,
|
|
3398
|
+
loading: mine.loading,
|
|
3399
|
+
skeletonRows: 1,
|
|
3400
|
+
getRowId: (f) => f.id,
|
|
3401
|
+
empty: t("none"),
|
|
3402
|
+
columns: [
|
|
3403
|
+
{
|
|
3404
|
+
id: "kind",
|
|
3405
|
+
header: t("title"),
|
|
3406
|
+
cell: (f) => f.kind === "passkey" ? /* @__PURE__ */ jsxs19(Stack15, { gap: "0", children: [
|
|
3407
|
+
/* @__PURE__ */ jsx19(Text18, { fontWeight: "medium", children: f.name || t("kinds.passkey") }),
|
|
3408
|
+
/* @__PURE__ */ jsx19(Text18, { textStyle: "caption", color: "fg.muted", children: f.provider ? `${t("kinds.passkey")} \xB7 ${f.provider}` : t("kinds.passkey") })
|
|
3409
|
+
] }) : /* @__PURE__ */ jsx19(Text18, { fontWeight: "medium", children: t(`kinds.${f.kind}`) })
|
|
3410
|
+
},
|
|
3411
|
+
{ id: "added", header: t("added"), nowrap: true, cell: (f) => fmt.dateTime(f.createdAt) },
|
|
3412
|
+
{ id: "used", header: t("lastUsed"), nowrap: true, cell: (f) => f.lastUsedAt ? fmt.dateTime(f.lastUsedAt) : t("never") },
|
|
3413
|
+
{
|
|
3414
|
+
id: "remove",
|
|
3415
|
+
header: "",
|
|
3416
|
+
cell: (f) => /* @__PURE__ */ jsxs19(HStack17, { gap: "2", justify: "flex-end", children: [
|
|
3417
|
+
f.kind === "passkey" && /* @__PURE__ */ jsx19(
|
|
3418
|
+
Button14,
|
|
3419
|
+
{
|
|
3420
|
+
size: "sm",
|
|
3421
|
+
variant: "ghost",
|
|
3422
|
+
onClick: () => {
|
|
3423
|
+
setNewName(f.name ?? "");
|
|
3424
|
+
setRenaming(f);
|
|
3425
|
+
},
|
|
3426
|
+
children: t("rename")
|
|
3427
|
+
}
|
|
3428
|
+
),
|
|
3429
|
+
/* @__PURE__ */ jsx19(Button14, { size: "sm", variant: "secondary", onClick: () => void remove(f), children: t("remove") })
|
|
3430
|
+
] })
|
|
3431
|
+
}
|
|
3432
|
+
]
|
|
3433
|
+
}
|
|
3434
|
+
),
|
|
3435
|
+
factors.length > 0 && /* @__PURE__ */ jsxs19(HStack17, { justify: "space-between", wrap: "wrap", gap: "2", children: [
|
|
3436
|
+
/* @__PURE__ */ jsx19(Text18, { textStyle: "body.sm", color: "fg.muted", "data-testid": "recovery-left", children: t("recoveryLeft", { count: num(data?.recoveryCodesLeft ?? 0) }) }),
|
|
3437
|
+
/* @__PURE__ */ jsx19(Button14, { size: "sm", variant: "secondary", onClick: () => void renew(), children: t("renew") })
|
|
3438
|
+
] })
|
|
3439
|
+
] })
|
|
3440
|
+
] }),
|
|
3441
|
+
/* @__PURE__ */ jsx19(
|
|
3442
|
+
FormDialog,
|
|
3443
|
+
{
|
|
3444
|
+
open: renaming != null,
|
|
3445
|
+
onOpenChange: (open) => !open && setRenaming(null),
|
|
3446
|
+
title: t("renameTitle"),
|
|
3447
|
+
submitLabel: t("save"),
|
|
3448
|
+
onSubmit: rename,
|
|
3449
|
+
submitDisabled: !newName.trim(),
|
|
3450
|
+
children: /* @__PURE__ */ jsx19(Field8, { label: t("passkeyName"), required: true, children: /* @__PURE__ */ jsx19(Input9, { value: newName, maxLength: 64, required: true, onChange: (e) => setNewName(e.target.value), "data-testid": "passkey-rename" }) })
|
|
3451
|
+
}
|
|
3452
|
+
)
|
|
3453
|
+
] });
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3456
|
+
// src/areas/guard/SignUpScreen.tsx
|
|
3457
|
+
import { useEffect as useEffect5, useState as useState14 } from "react";
|
|
3458
|
+
import { HStack as HStack18, Input as Input10, Stack as Stack16 } from "@chakra-ui/react";
|
|
3459
|
+
import { Button as Button15, Field as Field9, InlineAlert as InlineAlert16, notify as notify12, PageHeader as PageHeader9, Panel as Panel15, SelectField as SelectField4, SwitchField, useApiAction as useApiAction10, useApiQuery as useApiQuery12, useAreaRequest as useAreaRequest16 } from "@abpjs/ui";
|
|
2987
3460
|
import { splitList as splitList3 } from "@abpjs/ui/rules";
|
|
2988
|
-
import { jsx as
|
|
3461
|
+
import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2989
3462
|
function SignUpScreen() {
|
|
2990
3463
|
const t = useGuardNs("signUpSettings");
|
|
2991
|
-
const request =
|
|
2992
|
-
const settings =
|
|
2993
|
-
const directories =
|
|
3464
|
+
const request = useAreaRequest16("guard");
|
|
3465
|
+
const settings = useApiQuery12("guard", "/signup/settings");
|
|
3466
|
+
const directories = useApiQuery12("guard", "/directories");
|
|
2994
3467
|
const action = useApiAction10();
|
|
2995
|
-
const [form, setForm] =
|
|
2996
|
-
|
|
3468
|
+
const [form, setForm] = useState14({ enabled: false, directoryId: "", domains: "" });
|
|
3469
|
+
useEffect5(() => {
|
|
2997
3470
|
const s = settings.data;
|
|
2998
3471
|
if (s) setForm({ enabled: s.enabled, directoryId: s.directoryId ?? "", domains: s.emailDomains.join(", ") });
|
|
2999
3472
|
}, [settings.data]);
|
|
3000
|
-
if (settings.error) return /* @__PURE__ */
|
|
3473
|
+
if (settings.error) return /* @__PURE__ */ jsx20(InlineAlert16, { tone: "danger", children: settings.error });
|
|
3001
3474
|
const internal = (directories.data ?? []).filter((d) => d.type === "internal");
|
|
3002
3475
|
const chosen = internal.find((d) => d.id === form.directoryId);
|
|
3003
3476
|
async function save() {
|
|
@@ -3009,14 +3482,14 @@ function SignUpScreen() {
|
|
|
3009
3482
|
);
|
|
3010
3483
|
if (saved) {
|
|
3011
3484
|
settings.setData(saved);
|
|
3012
|
-
|
|
3485
|
+
notify12.success(t("saved"));
|
|
3013
3486
|
}
|
|
3014
3487
|
}
|
|
3015
|
-
return /* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3488
|
+
return /* @__PURE__ */ jsxs20(Stack16, { gap: "section", children: [
|
|
3489
|
+
/* @__PURE__ */ jsx20(PageHeader9, { title: t("title"), description: t("subtitle") }),
|
|
3490
|
+
/* @__PURE__ */ jsx20(Panel15, { "data-testid": "signup-settings", loading: !settings.data, children: /* @__PURE__ */ jsxs20(Stack16, { gap: "field", maxW: "2xl", children: [
|
|
3491
|
+
/* @__PURE__ */ jsx20(SwitchField, { label: t("enabled"), checked: form.enabled, onCheckedChange: (c) => setForm({ ...form, enabled: c }) }),
|
|
3492
|
+
/* @__PURE__ */ jsx20(Field9, { label: t("directory"), helperText: t("directoryHint"), children: /* @__PURE__ */ jsx20(
|
|
3020
3493
|
SelectField4,
|
|
3021
3494
|
{
|
|
3022
3495
|
value: form.directoryId,
|
|
@@ -3024,13 +3497,28 @@ function SignUpScreen() {
|
|
|
3024
3497
|
options: [{ value: "", label: t("chooseDirectory") }, ...internal.map((d) => ({ value: d.id, label: d.name }))]
|
|
3025
3498
|
}
|
|
3026
3499
|
) }),
|
|
3027
|
-
/* @__PURE__ */
|
|
3028
|
-
chosen && /* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3030
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx20(Field9, { label: t("domains"), helperText: t("domainsHint"), children: /* @__PURE__ */ jsx20(Input10, { value: form.domains, onChange: (e) => setForm({ ...form, domains: e.target.value }), dir: "ltr", placeholder: "acme.com, example.org" }) }),
|
|
3501
|
+
chosen && /* @__PURE__ */ jsx20(InlineAlert16, { tone: "info", children: t("grantHint", { group: `${chosen.name} (everyone)` }) }),
|
|
3502
|
+
/* @__PURE__ */ jsx20(InlineAlert16, { tone: "danger", children: action.error }),
|
|
3503
|
+
/* @__PURE__ */ jsx20(HStack18, { children: /* @__PURE__ */ jsx20(Button15, { onClick: () => void save(), loading: action.busy, children: t("save") }) })
|
|
3031
3504
|
] }) })
|
|
3032
3505
|
] });
|
|
3033
3506
|
}
|
|
3507
|
+
|
|
3508
|
+
// src/areas/guard/StrongFactorBanner.tsx
|
|
3509
|
+
import { Box as Box5 } from "@chakra-ui/react";
|
|
3510
|
+
import { AppLink as AppLink11, InlineAlert as InlineAlert17, useFormatters as useFormatters10 } from "@abpjs/ui";
|
|
3511
|
+
import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3512
|
+
function StrongFactorBanner({ strongFactor, setUpHref }) {
|
|
3513
|
+
const t = useGuardTexts();
|
|
3514
|
+
const fmt = useFormatters10();
|
|
3515
|
+
if (!strongFactor || strongFactor.has || !strongFactor.requiredBy) return null;
|
|
3516
|
+
return /* @__PURE__ */ jsx21(Box5, { mb: "section", "data-testid": "strong-factor-banner", children: /* @__PURE__ */ jsxs21(InlineAlert17, { tone: strongFactor.overdue ? "danger" : "warning", title: t("secondFactor.required.title"), children: [
|
|
3517
|
+
t(strongFactor.overdue ? "secondFactor.required.overdue" : "secondFactor.required.by", { date: fmt.dateTime(strongFactor.requiredBy) }),
|
|
3518
|
+
" ",
|
|
3519
|
+
/* @__PURE__ */ jsx21(AppLink11, { href: setUpHref, children: t("secondFactor.required.setUp") })
|
|
3520
|
+
] }) });
|
|
3521
|
+
}
|
|
3034
3522
|
export {
|
|
3035
3523
|
AccountEmailsPanel,
|
|
3036
3524
|
AccountNameEditor,
|
|
@@ -3039,6 +3527,8 @@ export {
|
|
|
3039
3527
|
AccountStatusPill,
|
|
3040
3528
|
AccountsScreen,
|
|
3041
3529
|
AnonymousScreen,
|
|
3530
|
+
AppSetup,
|
|
3531
|
+
CodeInput,
|
|
3042
3532
|
CountList,
|
|
3043
3533
|
DirectoriesScreen,
|
|
3044
3534
|
DirectoryForm,
|
|
@@ -3050,15 +3540,18 @@ export {
|
|
|
3050
3540
|
GroupTree,
|
|
3051
3541
|
GroupTwoFactorPanel,
|
|
3052
3542
|
GroupsScreen,
|
|
3053
|
-
ListFooter,
|
|
3054
3543
|
MergeScreen,
|
|
3055
3544
|
MergesPanel,
|
|
3545
|
+
MySecondFactorsPanel,
|
|
3056
3546
|
PassFail,
|
|
3057
3547
|
PluginStatePill,
|
|
3548
|
+
RecoveryCodes,
|
|
3058
3549
|
SignUpScreen,
|
|
3550
|
+
StrongFactorBanner,
|
|
3059
3551
|
SyncResultPill,
|
|
3060
3552
|
SyncStatus,
|
|
3061
3553
|
TWO_FACTOR_MODES,
|
|
3554
|
+
groupedKey,
|
|
3062
3555
|
guardRoutes,
|
|
3063
3556
|
num,
|
|
3064
3557
|
useAccountCan,
|
|
@@ -3066,6 +3559,7 @@ export {
|
|
|
3066
3559
|
useGuardNs,
|
|
3067
3560
|
useGuardTexts,
|
|
3068
3561
|
usePartLabel,
|
|
3562
|
+
useSenderName,
|
|
3069
3563
|
useWrittenName,
|
|
3070
3564
|
withParts
|
|
3071
3565
|
};
|