@proteinjs/user-ui 1.10.2 → 1.11.1
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 +24 -0
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/src/form/InviteRecordFormCustomization.d.ts +14 -5
- package/dist/src/form/InviteRecordFormCustomization.d.ts.map +1 -1
- package/dist/src/form/InviteRecordFormCustomization.js +56 -5
- package/dist/src/form/InviteRecordFormCustomization.js.map +1 -1
- package/dist/test/InviteRecordFormCustomization.test.js +5 -3
- package/dist/test/InviteRecordFormCustomization.test.js.map +1 -1
- package/dist/test/InviteResend.test.d.ts +2 -0
- package/dist/test/InviteResend.test.d.ts.map +1 -0
- package/dist/test/InviteResend.test.js +145 -0
- package/dist/test/InviteResend.test.js.map +1 -0
- package/dist/test/UserRecordFormCustomization.test.js +2 -2
- package/dist/test/UserRecordFormCustomization.test.js.map +1 -1
- package/generated/index.ts +1 -1
- package/index.ts +1 -1
- package/package.json +3 -3
- package/src/form/InviteRecordFormCustomization.tsx +45 -6
- package/test/InviteRecordFormCustomization.test.ts +5 -3
- package/test/InviteResend.test.ts +91 -0
- package/test/UserRecordFormCustomization.test.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.11.1](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.11.0...@proteinjs/user-ui@1.11.1) (2026-09-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @proteinjs/user-ui
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.11.0](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.10.2...@proteinjs/user-ui@1.11.0) (2026-09-17)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **invites:** the invite record form drops the generic Save — the table's db doors close generic writes, so it could only ever fail; the row's acts are Resend and Revoke ([2eca245](https://github.com/proteinjs/user/commit/2eca2451d63b764d558bc42214166ab18b27e304))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **invites:** a re-send door on SignupService — the standing token retired, a fresh one minted on the same row and emailed again; a Resend act on the invite record form ([b3b54e3](https://github.com/proteinjs/user/commit/b3b54e3f8728d856e8632d7a8e2688b549cb82d9))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [1.10.2](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.10.1...@proteinjs/user-ui@1.10.2) (2026-09-13)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @proteinjs/user-ui
|
package/dist/generated/index.js
CHANGED
|
@@ -21,7 +21,7 @@ require("@proteinjs/server-api");
|
|
|
21
21
|
require("@proteinjs/ui");
|
|
22
22
|
require("@proteinjs/user");
|
|
23
23
|
/** Generate Source Graph */
|
|
24
|
-
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"canManageUsers\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/user-ui/UserRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"UserRecordFormCustomization\",\"filePath\":\"src/form/UserRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/UserRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldRenderer\",\"returnType\":{\"packageName\":\"\",\"name\":\"RecordFormFieldRenderer<User> | undefined\",\"filePath\":null,\"qualifiedName\":\"/RecordFormFieldRenderer<User> | undefined\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fieldName\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"user\",\"type\":{\"packageName\":\"@proteinjs/user\",\"name\":\"User\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user/User\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"user\",\"type\":{\"packageName\":\"\",\"name\":\"User | undefined\",\"filePath\":null,\"qualifiedName\":\"/User | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"asRows\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"layout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}}],\"edges\":[{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/UserRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"}]}";
|
|
24
|
+
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"resendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"canManageUsers\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/user-ui/UserRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"UserRecordFormCustomization\",\"filePath\":\"src/form/UserRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/UserRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldRenderer\",\"returnType\":{\"packageName\":\"\",\"name\":\"RecordFormFieldRenderer<User> | undefined\",\"filePath\":null,\"qualifiedName\":\"/RecordFormFieldRenderer<User> | undefined\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fieldName\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"user\",\"type\":{\"packageName\":\"@proteinjs/user\",\"name\":\"User\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user/User\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"user\",\"type\":{\"packageName\":\"\",\"name\":\"User | undefined\",\"filePath\":null,\"qualifiedName\":\"/User | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"asRows\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"layout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}}],\"edges\":[{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/UserRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"}]}";
|
|
25
25
|
/** Generate Source Links */
|
|
26
26
|
var InviteRecordFormCustomization_1 = require("../src/form/InviteRecordFormCustomization");
|
|
27
27
|
var UserRecordFormCustomization_1 = require("../src/form/UserRecordFormCustomization");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,4BAA0B;AAC1B,iCAA+B;AAC/B,yBAAuB;AACvB,2BAAyB;AAGzB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,4BAA0B;AAC1B,iCAA+B;AAC/B,yBAAuB;AACvB,2BAAyB;AAGzB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,yqUAAyqU,CAAC;AAG9rU,4BAA4B;AAE5B,2FAA0F;AAC1F,uFAAsF;AACtF,8DAAiE;AACjE,4CAA+C;AAC/C,4DAA+D;AAC/D,8CAAiD;AAEjD,IAAM,WAAW,GAAG;IACnB,kDAAkD,EAAE,6DAA6B;IACjF,gDAAgD,EAAE,yDAA2B;IAC7E,uCAAuC,EAAE,mCAAkB;IAC3D,8BAA8B,EAAE,iBAAS;IACzC,sCAAsC,EAAE,iCAAiB;IACzD,+BAA+B,EAAE,mBAAU;CAC3C,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ __exportStar(require("./src/pageAuth"), exports);
|
|
|
19
19
|
__exportStar(require("./src/presence/UserPresenceReporter"), exports);
|
|
20
20
|
__exportStar(require("./src/presence/installUserPresenceReporter"), exports);
|
|
21
21
|
// The logged-out surface's building blocks, exported so a consumer app's own public pages
|
|
22
|
-
// (e.g.
|
|
22
|
+
// (e.g. a /request-invite page) render with the same auth look instead of forking the styling.
|
|
23
23
|
__exportStar(require("./src/auth/AuthLayout"), exports);
|
|
24
24
|
__exportStar(require("./src/auth/AuthTextField"), exports);
|
|
25
25
|
__exportStar(require("./src/auth/AuthButton"), exports);
|
|
@@ -3,18 +3,27 @@ import { RecordFormCustomization } from '@proteinjs/db-ui';
|
|
|
3
3
|
import { Invite } from '@proteinjs/user';
|
|
4
4
|
/**
|
|
5
5
|
* Makes the invite record surface the ONE place invites are managed: the new-record form sends an
|
|
6
|
-
* invite, and an existing invite row can be revoked.
|
|
6
|
+
* invite, and an existing invite row can be re-sent or revoked.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the
|
|
10
|
-
* link;
|
|
11
|
-
*
|
|
8
|
+
* All three actions go through `SignupService` rather than raw record writes, because an invite is
|
|
9
|
+
* more than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the
|
|
10
|
+
* signup link; re-sending retires the earlier token, mints a fresh one and emails it again; revoking
|
|
11
|
+
* is the invite domain's own delete. Inserting or deleting the row directly would produce invites
|
|
12
|
+
* that can never be redeemed.
|
|
12
13
|
*/
|
|
13
14
|
export declare class InviteRecordFormCustomization extends RecordFormCustomization {
|
|
14
15
|
table: import("@proteinjs/db").Table<Invite>;
|
|
15
16
|
getFieldLayout(invite: Invite | undefined, defaultFieldLayout: string[] | string[][]): string[] | string[][];
|
|
16
17
|
getFormButtons(invite: Invite | undefined, defaultFormButtons: FormButtons<any>): FormButtons<any>;
|
|
17
18
|
private sendButton;
|
|
19
|
+
/**
|
|
20
|
+
* Re-sends a standing invite through `SignupService.resendInvite`: the earlier link stops working
|
|
21
|
+
* and a fresh one is emailed. The row stays, so the form re-lands on itself — after a beat, because
|
|
22
|
+
* the generic form paints its message and navigates in the same tick, and the navigation remounts
|
|
23
|
+
* the page (a re-land without the beat would eat the confirmation); the reload then shows the
|
|
24
|
+
* row's fresh token and expiry.
|
|
25
|
+
*/
|
|
26
|
+
private resendButton;
|
|
18
27
|
private revokeButton;
|
|
19
28
|
/**
|
|
20
29
|
* The same 'users'-permission gate the service door carries, so these actions aren't offered to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InviteRecordFormCustomization.d.ts","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"InviteRecordFormCustomization.d.ts","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAmC,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAoB,MAAM,EAAsC,MAAM,iBAAiB,CAAC;AAG/F;;;;;;;;;GASG;AACH,qBAAa,6BAA8B,SAAQ,uBAAuB;IACjE,KAAK,wCAAiB;IAE7B,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE;IAK5G,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;IAclG,OAAO,CAAC,UAAU;IA+BlB;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,YAAY;IAsBpB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAGvB"}
|
|
@@ -68,12 +68,13 @@ var user_1 = require("@proteinjs/user");
|
|
|
68
68
|
var util_1 = require("@proteinjs/util");
|
|
69
69
|
/**
|
|
70
70
|
* Makes the invite record surface the ONE place invites are managed: the new-record form sends an
|
|
71
|
-
* invite, and an existing invite row can be revoked.
|
|
71
|
+
* invite, and an existing invite row can be re-sent or revoked.
|
|
72
72
|
*
|
|
73
|
-
*
|
|
74
|
-
* than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the
|
|
75
|
-
* link;
|
|
76
|
-
*
|
|
73
|
+
* All three actions go through `SignupService` rather than raw record writes, because an invite is
|
|
74
|
+
* more than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the
|
|
75
|
+
* signup link; re-sending retires the earlier token, mints a fresh one and emails it again; revoking
|
|
76
|
+
* is the invite domain's own delete. Inserting or deleting the row directly would produce invites
|
|
77
|
+
* that can never be redeemed.
|
|
77
78
|
*/
|
|
78
79
|
var InviteRecordFormCustomization = /** @class */ (function (_super) {
|
|
79
80
|
__extends(InviteRecordFormCustomization, _super);
|
|
@@ -90,7 +91,12 @@ var InviteRecordFormCustomization = /** @class */ (function (_super) {
|
|
|
90
91
|
var formButtons = __assign({}, defaultFormButtons);
|
|
91
92
|
delete formButtons['create'];
|
|
92
93
|
delete formButtons['delete'];
|
|
94
|
+
// No generic Save either: the invite table's db doors close generic writes (query/delete only —
|
|
95
|
+
// a raw update would be refused at the door), so Save could only ever fail; the row's acts are
|
|
96
|
+
// Resend and Revoke.
|
|
97
|
+
delete formButtons['save'];
|
|
93
98
|
formButtons['send'] = this.sendButton(invite);
|
|
99
|
+
formButtons['resend'] = this.resendButton(invite);
|
|
94
100
|
formButtons['revoke'] = this.revokeButton(invite);
|
|
95
101
|
return formButtons;
|
|
96
102
|
};
|
|
@@ -130,6 +136,51 @@ var InviteRecordFormCustomization = /** @class */ (function (_super) {
|
|
|
130
136
|
progressMessage: function () { return "Sending invite"; },
|
|
131
137
|
};
|
|
132
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Re-sends a standing invite through `SignupService.resendInvite`: the earlier link stops working
|
|
141
|
+
* and a fresh one is emailed. The row stays, so the form re-lands on itself — after a beat, because
|
|
142
|
+
* the generic form paints its message and navigates in the same tick, and the navigation remounts
|
|
143
|
+
* the page (a re-land without the beat would eat the confirmation); the reload then shows the
|
|
144
|
+
* row's fresh token and expiry.
|
|
145
|
+
*/
|
|
146
|
+
InviteRecordFormCustomization.prototype.resendButton = function (invite) {
|
|
147
|
+
var _this = this;
|
|
148
|
+
return {
|
|
149
|
+
name: 'Resend',
|
|
150
|
+
accessibility: {
|
|
151
|
+
hidden: !invite || !this.canManageUsers(),
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
color: 'primary',
|
|
155
|
+
variant: 'contained',
|
|
156
|
+
},
|
|
157
|
+
redirect: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
158
|
+
return __generator(this, function (_a) {
|
|
159
|
+
switch (_a.label) {
|
|
160
|
+
case 0: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1400); })];
|
|
161
|
+
case 1:
|
|
162
|
+
_a.sent();
|
|
163
|
+
return [2 /*return*/, { path: (0, db_ui_1.recordFormLink)(user_1.tables.Invite.name, invite.id) }];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}); },
|
|
167
|
+
onClick: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
168
|
+
var response;
|
|
169
|
+
return __generator(this, function (_a) {
|
|
170
|
+
switch (_a.label) {
|
|
171
|
+
case 0: return [4 /*yield*/, (0, user_1.getSignupService)().resendInvite(invite.email)];
|
|
172
|
+
case 1:
|
|
173
|
+
response = _a.sent();
|
|
174
|
+
if (response.sent === false) {
|
|
175
|
+
return [2 /*return*/, response.error || 'Failed to resend invite.'];
|
|
176
|
+
}
|
|
177
|
+
return [2 /*return*/, "Resent invite to ".concat(invite.email)];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}); },
|
|
181
|
+
progressMessage: function () { return "Resending invite"; },
|
|
182
|
+
};
|
|
183
|
+
};
|
|
133
184
|
InviteRecordFormCustomization.prototype.revokeButton = function (invite) {
|
|
134
185
|
var _this = this;
|
|
135
186
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InviteRecordFormCustomization.js","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"InviteRecordFormCustomization.js","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA4F;AAC5F,wCAA+F;AAC/F,wCAA6C;AAE7C;;;;;;;;;GASG;AACH;IAAmD,iDAAuB;IAA1E;QAAA,qEAoHC;QAnHQ,WAAK,GAAG,aAAM,CAAC,MAAM,CAAC;;IAmH/B,CAAC;IAjHC,sDAAc,GAAd,UAAe,MAA0B,EAAE,kBAAyC;QAClF,wGAAwG;QACxG,OAAO,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,sDAAc,GAAd,UAAe,MAA0B,EAAE,kBAAoC;QAC7E,IAAM,WAAW,gBAAQ,kBAAkB,CAAE,CAAC;QAC9C,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC7B,gGAAgG;QAChG,+FAA+F;QAC/F,qBAAqB;QACrB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;QAC3B,WAAW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,uBAAe,EAAC,aAAM,CAAC,MAAM,CAAC,EAAE,EAAC;;iBACjD;YACD,OAAO,EAAE;;;gCACP,qBAAM,IAAA,uBAAgB,GAAE,CAAC,YAAY,CAAE,MAAiB,CAAC,KAAK,CAAC,EAAA;;4BAA/D,SAA+D,CAAC;4BAChE,sBAAO,4BAAsB,MAAiB,CAAC,KAAK,CAAE,EAAC;;;iBACxD;YACD,eAAe,EAAE,cAAM,OAAA,iBAAiB,EAAjB,CAAiB;SACzC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACK,sDAAc,GAAtB;QACE,OAAO,eAAQ,CAAC,aAAa,CAAC,uBAAgB,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IACH,oCAAC;AAAD,CAAC,AApHD,CAAmD,+BAAuB,GAoHzE;AApHY,sEAA6B"}
|
|
@@ -4,7 +4,7 @@ var user_1 = require("@proteinjs/user");
|
|
|
4
4
|
var InviteRecordFormCustomization_1 = require("../src/form/InviteRecordFormCustomization");
|
|
5
5
|
var setRoles = function (roles) {
|
|
6
6
|
user_1.UserAuth.userRepo = {
|
|
7
|
-
getUser: function () { return ({ email: 'someone@
|
|
7
|
+
getUser: function () { return ({ email: 'someone@example.com', roles: roles }); },
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
var setMapping = function (mapping) {
|
|
@@ -18,7 +18,7 @@ var defaultFormButtons = function () { return ({
|
|
|
18
18
|
create: { name: 'Create', style: {} },
|
|
19
19
|
}); };
|
|
20
20
|
var defaultFieldLayout = ['email', 'token', 'tokenExpiresAt', 'invitedBy'];
|
|
21
|
-
var existingInvite = { id: 'invite-1', email: 'invitee@
|
|
21
|
+
var existingInvite = { id: 'invite-1', email: 'invitee@example.com' };
|
|
22
22
|
var visibleButtons = function (record) {
|
|
23
23
|
var buttons = new InviteRecordFormCustomization_1.InviteRecordFormCustomization().getFormButtons(record, defaultFormButtons());
|
|
24
24
|
return Object.keys(buttons).filter(function (name) { var _a; return !((_a = buttons[name].accessibility) === null || _a === void 0 ? void 0 : _a.hidden); });
|
|
@@ -28,11 +28,13 @@ describe('Invite record form customization', function () {
|
|
|
28
28
|
user_1.UserAuth.userRepo = undefined;
|
|
29
29
|
user_1.UserAuth.permissionRolesMapping = undefined;
|
|
30
30
|
});
|
|
31
|
-
it('replaces raw record create/delete with send/revoke', function () {
|
|
31
|
+
it('replaces raw record create/save/delete with send/resend/revoke (the db doors refuse generic writes)', function () {
|
|
32
32
|
setRoles(['admin']);
|
|
33
33
|
var buttons = new InviteRecordFormCustomization_1.InviteRecordFormCustomization().getFormButtons(existingInvite, defaultFormButtons());
|
|
34
34
|
expect(Object.keys(buttons)).not.toContain('create');
|
|
35
|
+
expect(Object.keys(buttons)).not.toContain('save');
|
|
35
36
|
expect(Object.keys(buttons)).not.toContain('delete');
|
|
37
|
+
expect(Object.keys(buttons)).toEqual(expect.arrayContaining(['send', 'resend', 'revoke']));
|
|
36
38
|
});
|
|
37
39
|
it('offers an admin Send invite on the new-record form and Revoke on an existing invite', function () {
|
|
38
40
|
setRoles(['admin']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InviteRecordFormCustomization.test.js","sourceRoot":"","sources":["../../test/InviteRecordFormCustomization.test.ts"],"names":[],"mappings":";;AACA,wCAAmD;AACnD,2FAA0F;AAiB1F,IAAM,QAAQ,GAAG,UAAC,KAAe;IAC9B,eAAyC,CAAC,QAAQ,GAAG;QACpD,OAAO,EAAE,cAAM,OAAA,CAAC,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"InviteRecordFormCustomization.test.js","sourceRoot":"","sources":["../../test/InviteRecordFormCustomization.test.ts"],"names":[],"mappings":";;AACA,wCAAmD;AACnD,2FAA0F;AAiB1F,IAAM,QAAQ,GAAG,UAAC,KAAe;IAC9B,eAAyC,CAAC,QAAQ,GAAG;QACpD,OAAO,EAAE,cAAM,OAAA,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,OAAA,EAAE,CAAC,EAA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":""}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var db_ui_1 = require("@proteinjs/db-ui");
|
|
51
|
+
var user_1 = require("@proteinjs/user");
|
|
52
|
+
var InviteRecordFormCustomization_1 = require("../src/form/InviteRecordFormCustomization");
|
|
53
|
+
var signupService = {
|
|
54
|
+
resendInvite: jest.fn(),
|
|
55
|
+
};
|
|
56
|
+
jest.mock('@proteinjs/user', function () { return (__assign(__assign({}, jest.requireActual('@proteinjs/user')), { getSignupService: function () { return signupService; } })); });
|
|
57
|
+
var setRoles = function (roles) {
|
|
58
|
+
user_1.UserAuth.userRepo = {
|
|
59
|
+
getUser: function () { return ({ email: 'someone@example.com', roles: roles }); },
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
var defaultFormButtons = function () { return ({
|
|
63
|
+
delete: { name: 'Delete', style: {} },
|
|
64
|
+
save: { name: 'Save', style: {} },
|
|
65
|
+
create: { name: 'Create', style: {} },
|
|
66
|
+
}); };
|
|
67
|
+
var existingInvite = { id: 'invite-1', email: 'invitee@example.com' };
|
|
68
|
+
var buttons = function (record) {
|
|
69
|
+
return new InviteRecordFormCustomization_1.InviteRecordFormCustomization().getFormButtons(record, defaultFormButtons());
|
|
70
|
+
};
|
|
71
|
+
var visible = function (record) {
|
|
72
|
+
return Object.keys(buttons(record)).filter(function (name) { var _a; return !((_a = buttons(record)[name].accessibility) === null || _a === void 0 ? void 0 : _a.hidden); });
|
|
73
|
+
};
|
|
74
|
+
describe('Resend on the invite record form', function () {
|
|
75
|
+
afterEach(function () {
|
|
76
|
+
user_1.UserAuth.userRepo = undefined;
|
|
77
|
+
signupService.resendInvite.mockReset();
|
|
78
|
+
});
|
|
79
|
+
it('is offered on an existing invite beside Revoke, and not on the new-record form', function () {
|
|
80
|
+
setRoles(['admin']);
|
|
81
|
+
expect(visible(existingInvite)).toEqual(expect.arrayContaining(['resend', 'revoke']));
|
|
82
|
+
expect(visible(existingInvite)).not.toContain('send');
|
|
83
|
+
expect(visible(undefined)).not.toContain('resend');
|
|
84
|
+
expect(buttons(existingInvite).resend.name).toBe('Resend');
|
|
85
|
+
});
|
|
86
|
+
it('is never offered to a caller without the users permission', function () {
|
|
87
|
+
setRoles([]);
|
|
88
|
+
expect(visible(existingInvite)).not.toContain('resend');
|
|
89
|
+
});
|
|
90
|
+
it('re-sends through the service door and names the address on success', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
91
|
+
var message;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
setRoles(['admin']);
|
|
96
|
+
signupService.resendInvite.mockResolvedValue({ sent: true });
|
|
97
|
+
return [4 /*yield*/, buttons(existingInvite).resend.onClick({}, {})];
|
|
98
|
+
case 1:
|
|
99
|
+
message = _a.sent();
|
|
100
|
+
expect(signupService.resendInvite).toHaveBeenCalledWith('invitee@example.com');
|
|
101
|
+
expect(message).toBe('Resent invite to invitee@example.com');
|
|
102
|
+
return [2 /*return*/];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); });
|
|
106
|
+
it("surfaces the door's own refusal verbatim", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
+
var message;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
switch (_a.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
setRoles(['admin']);
|
|
112
|
+
signupService.resendInvite.mockResolvedValue({ sent: false, error: 'No invite exists for that email.' });
|
|
113
|
+
return [4 /*yield*/, buttons(existingInvite).resend.onClick({}, {})];
|
|
114
|
+
case 1:
|
|
115
|
+
message = _a.sent();
|
|
116
|
+
expect(message).toBe('No invite exists for that email.');
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}); });
|
|
121
|
+
it("re-lands on the invite's own record (the fresh token and expiry show on reload)", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
|
+
var redirect;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
jest.useFakeTimers();
|
|
127
|
+
_a.label = 1;
|
|
128
|
+
case 1:
|
|
129
|
+
_a.trys.push([1, , 3, 4]);
|
|
130
|
+
setRoles(['admin']);
|
|
131
|
+
redirect = buttons(existingInvite).resend.redirect({}, {});
|
|
132
|
+
jest.advanceTimersByTime(1400);
|
|
133
|
+
return [4 /*yield*/, expect(redirect).resolves.toEqual({ path: (0, db_ui_1.recordFormLink)('invite', 'invite-1') })];
|
|
134
|
+
case 2:
|
|
135
|
+
_a.sent();
|
|
136
|
+
return [3 /*break*/, 4];
|
|
137
|
+
case 3:
|
|
138
|
+
jest.useRealTimers();
|
|
139
|
+
return [7 /*endfinally*/];
|
|
140
|
+
case 4: return [2 /*return*/];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}); });
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=InviteResend.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InviteResend.test.js","sourceRoot":"","sources":["../../test/InviteResend.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,0CAAkD;AAClD,wCAAmD;AACnD,2FAA0F;AAE1F,IAAM,aAAa,GAAG;IACpB,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE;CACxB,CAAC;AACF,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,cAAM,OAAA,uBAC9B,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,KACxC,gBAAgB,EAAE,cAAM,OAAA,aAAa,EAAb,CAAa,IACrC,EAHiC,CAGjC,CAAC,CAAC;AAMJ,IAAM,QAAQ,GAAG,UAAC,KAAe;IAC9B,eAAyC,CAAC,QAAQ,GAAG;QACpD,OAAO,EAAE,cAAM,OAAA,CAAC,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,OAAA,EAAE,CAAC,EAAzC,CAAyC;KACzD,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,kBAAkB,GAAG,cAAwB,OAAA,CAAC;IAClD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACrC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IACjC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;CACtC,CAAC,EAJiD,CAIjD,CAAC;AAEH,IAAM,cAAc,GAAG,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAY,CAAC;AAElF,IAAM,OAA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AAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;oBAC/B,qBAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAA,sBAAc,EAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,CAAC,EAAA;;oBAAvF,SAAuF,CAAC;;;oBAExF,IAAI,CAAC,aAAa,EAAE,CAAC;;;;;SAExB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -102,7 +102,7 @@ var rolesService = {
|
|
|
102
102
|
jest.mock('@proteinjs/user', function () { return (__assign(__assign({}, jest.requireActual('@proteinjs/user')), { getRolesService: function () { return rolesService; } })); });
|
|
103
103
|
var setCallerRoles = function (roles) {
|
|
104
104
|
user_1.UserAuth.userRepo = {
|
|
105
|
-
getUser: function () { return ({ email: 'caller@
|
|
105
|
+
getUser: function () { return ({ email: 'caller@example.com', roles: roles }); },
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
var setMapping = function (mapping) {
|
|
@@ -117,7 +117,7 @@ var catalog = [
|
|
|
117
117
|
];
|
|
118
118
|
var userRecord = function (overrides) {
|
|
119
119
|
if (overrides === void 0) { overrides = {}; }
|
|
120
|
-
return (__assign({ id: 'user-1', name: 'Ada', email: 'ada@
|
|
120
|
+
return (__assign({ id: 'user-1', name: 'Ada', email: 'ada@example.com', roles: ['ops'], status: 'active' }, overrides));
|
|
121
121
|
};
|
|
122
122
|
describe('User record form customization', function () {
|
|
123
123
|
var container;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserRecordFormCustomization.test.js","sourceRoot":"","sources":["../../test/UserRecordFormCustomization.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,gDAA0B;AAC1B,2CAAoD;AACpD,mDAA2C;AAG3C,wCAAyF;AACzF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F,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC;YACxE,CAAC,MAAM,EAAE,OAAO,CAAC;YACjB,CAAC,OAAO,CAAC;YACT,CAAC,UAAU,EAAE,eAAe,CAAC;YAC7B,CAAC,WAAW,EAAE,QAAQ,CAAC;YACvB,CAAC,SAAS,EAAE,SAAS,CAAC;SACvB,CAAC,CAAC;QACH,oEAAoE;QACpE,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/generated/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import '@proteinjs/user';
|
|
|
9
9
|
/** Generate Source Graph */
|
|
10
10
|
|
|
11
11
|
const sourceGraph =
|
|
12
|
-
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"/Omit"},{"v":"@proteinjs/user-ui/InviteRecordFormCustomization","value":{"packageName":"@proteinjs/user-ui","name":"InviteRecordFormCustomization","filePath":"src/form/InviteRecordFormCustomization.tsx","qualifiedName":"@proteinjs/user-ui/InviteRecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFieldLayout","returnType":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}},{"name":"defaultFieldLayout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]},{"name":"getFormButtons","returnType":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}},{"name":"defaultFormButtons","type":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null}}]},{"name":"sendButton","returnType":{"packageName":"","name":"FormButton<any>","filePath":null,"qualifiedName":"/FormButton<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}}]},{"name":"revokeButton","returnType":{"packageName":"","name":"FormButton<any>","filePath":null,"qualifiedName":"/FormButton<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}}]},{"name":"canManageUsers","returnType":{"packageName":"","name":"boolean","filePath":null,"qualifiedName":"/boolean","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":null,"qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"@proteinjs/db-ui/RecordFormCustomization"},{"v":"@proteinjs/user-ui/UserRecordFormCustomization","value":{"packageName":"@proteinjs/user-ui","name":"UserRecordFormCustomization","filePath":"src/form/UserRecordFormCustomization.tsx","qualifiedName":"@proteinjs/user-ui/UserRecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFieldRenderer","returnType":{"packageName":"","name":"RecordFormFieldRenderer<User> | undefined","filePath":null,"qualifiedName":"/RecordFormFieldRenderer<User> | undefined","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"fieldName","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"user","type":{"packageName":"@proteinjs/user","name":"User","filePath":null,"qualifiedName":"@proteinjs/user/User","typeParameters":null,"directParents":null}}]},{"name":"getFieldLayout","returnType":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"user","type":{"packageName":"","name":"User | undefined","filePath":null,"qualifiedName":"/User | undefined","typeParameters":null,"directParents":null}},{"name":"defaultFieldLayout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]},{"name":"asRows","returnType":{"packageName":"","name":"string[][]","filePath":null,"qualifiedName":"/string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"layout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":null,"qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"@proteinjs/user-ui/forgotPasswordPage","value":{"packageName":"@proteinjs/user-ui","name":"forgotPasswordPage","filePath":"src/pages/ForgotPassword.tsx","qualifiedName":"@proteinjs/user-ui/forgotPasswordPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/ui/Page"},{"v":"@proteinjs/user-ui/loginPage","value":{"packageName":"@proteinjs/user-ui","name":"loginPage","filePath":"src/pages/Login.tsx","qualifiedName":"@proteinjs/user-ui/loginPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-ui/passwordResetPage","value":{"packageName":"@proteinjs/user-ui","name":"passwordResetPage","filePath":"src/pages/PasswordReset.tsx","qualifiedName":"@proteinjs/user-ui/passwordResetPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-ui/signupPage","value":{"packageName":"@proteinjs/user-ui","name":"signupPage","filePath":"src/pages/Signup.tsx","qualifiedName":"@proteinjs/user-ui/signupPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}}],"edges":[{"v":"@proteinjs/user-ui/InviteRecordFormCustomization","w":"@proteinjs/db-ui/RecordFormCustomization","value":"extends class"},{"v":"@proteinjs/user-ui/UserRecordFormCustomization","w":"@proteinjs/db-ui/RecordFormCustomization","value":"extends class"},{"v":"@proteinjs/user-ui/forgotPasswordPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/user-ui/loginPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/user-ui/passwordResetPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/user-ui/signupPage","w":"@proteinjs/ui/Page","value":"has type"}]}';
|
|
12
|
+
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"/Omit"},{"v":"@proteinjs/user-ui/InviteRecordFormCustomization","value":{"packageName":"@proteinjs/user-ui","name":"InviteRecordFormCustomization","filePath":"src/form/InviteRecordFormCustomization.tsx","qualifiedName":"@proteinjs/user-ui/InviteRecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFieldLayout","returnType":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}},{"name":"defaultFieldLayout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]},{"name":"getFormButtons","returnType":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}},{"name":"defaultFormButtons","type":{"packageName":"","name":"FormButtons<any>","filePath":null,"qualifiedName":"/FormButtons<any>","typeParameters":null,"directParents":null}}]},{"name":"sendButton","returnType":{"packageName":"","name":"FormButton<any>","filePath":null,"qualifiedName":"/FormButton<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}}]},{"name":"resendButton","returnType":{"packageName":"","name":"FormButton<any>","filePath":null,"qualifiedName":"/FormButton<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}}]},{"name":"revokeButton","returnType":{"packageName":"","name":"FormButton<any>","filePath":null,"qualifiedName":"/FormButton<any>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"invite","type":{"packageName":"","name":"Invite | undefined","filePath":null,"qualifiedName":"/Invite | undefined","typeParameters":null,"directParents":null}}]},{"name":"canManageUsers","returnType":{"packageName":"","name":"boolean","filePath":null,"qualifiedName":"/boolean","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":null,"qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"@proteinjs/db-ui/RecordFormCustomization"},{"v":"@proteinjs/user-ui/UserRecordFormCustomization","value":{"packageName":"@proteinjs/user-ui","name":"UserRecordFormCustomization","filePath":"src/form/UserRecordFormCustomization.tsx","qualifiedName":"@proteinjs/user-ui/UserRecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"getFieldRenderer","returnType":{"packageName":"","name":"RecordFormFieldRenderer<User> | undefined","filePath":null,"qualifiedName":"/RecordFormFieldRenderer<User> | undefined","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"fieldName","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"user","type":{"packageName":"@proteinjs/user","name":"User","filePath":null,"qualifiedName":"@proteinjs/user/User","typeParameters":null,"directParents":null}}]},{"name":"getFieldLayout","returnType":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"user","type":{"packageName":"","name":"User | undefined","filePath":null,"qualifiedName":"/User | undefined","typeParameters":null,"directParents":null}},{"name":"defaultFieldLayout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]},{"name":"asRows","returnType":{"packageName":"","name":"string[][]","filePath":null,"qualifiedName":"/string[][]","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"layout","type":{"packageName":"","name":"string[] | string[][]","filePath":null,"qualifiedName":"/string[] | string[][]","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/db-ui","name":"RecordFormCustomization","filePath":null,"qualifiedName":"@proteinjs/db-ui/RecordFormCustomization","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"@proteinjs/user-ui/forgotPasswordPage","value":{"packageName":"@proteinjs/user-ui","name":"forgotPasswordPage","filePath":"src/pages/ForgotPassword.tsx","qualifiedName":"@proteinjs/user-ui/forgotPasswordPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/ui/Page"},{"v":"@proteinjs/user-ui/loginPage","value":{"packageName":"@proteinjs/user-ui","name":"loginPage","filePath":"src/pages/Login.tsx","qualifiedName":"@proteinjs/user-ui/loginPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-ui/passwordResetPage","value":{"packageName":"@proteinjs/user-ui","name":"passwordResetPage","filePath":"src/pages/PasswordReset.tsx","qualifiedName":"@proteinjs/user-ui/passwordResetPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-ui/signupPage","value":{"packageName":"@proteinjs/user-ui","name":"signupPage","filePath":"src/pages/Signup.tsx","qualifiedName":"@proteinjs/user-ui/signupPage","type":{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":[{"packageName":"@proteinjs/ui","name":"Page","filePath":null,"qualifiedName":"@proteinjs/ui/Page","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}}],"edges":[{"v":"@proteinjs/user-ui/InviteRecordFormCustomization","w":"@proteinjs/db-ui/RecordFormCustomization","value":"extends class"},{"v":"@proteinjs/user-ui/UserRecordFormCustomization","w":"@proteinjs/db-ui/RecordFormCustomization","value":"extends class"},{"v":"@proteinjs/user-ui/forgotPasswordPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/user-ui/loginPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/user-ui/passwordResetPage","w":"@proteinjs/ui/Page","value":"has type"},{"v":"@proteinjs/user-ui/signupPage","w":"@proteinjs/ui/Page","value":"has type"}]}';
|
|
13
13
|
|
|
14
14
|
/** Generate Source Links */
|
|
15
15
|
|
package/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './src/presence/UserPresenceReporter';
|
|
|
4
4
|
export * from './src/presence/installUserPresenceReporter';
|
|
5
5
|
|
|
6
6
|
// The logged-out surface's building blocks, exported so a consumer app's own public pages
|
|
7
|
-
// (e.g.
|
|
7
|
+
// (e.g. a /request-invite page) render with the same auth look instead of forking the styling.
|
|
8
8
|
export * from './src/auth/AuthLayout';
|
|
9
9
|
export * from './src/auth/AuthTextField';
|
|
10
10
|
export * from './src/auth/AuthButton';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/user-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "User ui components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@proteinjs/reflection": "^1.2.0",
|
|
30
30
|
"@proteinjs/server-api": "^3.0.11",
|
|
31
31
|
"@proteinjs/ui": "^4.14.0",
|
|
32
|
-
"@proteinjs/user": "^1.
|
|
32
|
+
"@proteinjs/user": "^1.20.1",
|
|
33
33
|
"@proteinjs/util": "^1.6.1",
|
|
34
34
|
"moment": "2.29.4",
|
|
35
35
|
"react": "18.2.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
},
|
|
57
57
|
"main": "./dist/generated/index.js",
|
|
58
58
|
"types": "./dist/generated/index.d.ts",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "ae04a205d52875798ff9320f51d934f7f131b646"
|
|
60
60
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Fields, FormButton, FormButtons } from '@proteinjs/ui';
|
|
2
|
-
import { RecordFormCustomization, recordTableLink } from '@proteinjs/db-ui';
|
|
2
|
+
import { RecordFormCustomization, recordFormLink, recordTableLink } from '@proteinjs/db-ui';
|
|
3
3
|
import { getSignupService, Invite, tables, UserAuth, USER_PERMISSIONS } from '@proteinjs/user';
|
|
4
4
|
import { emailRegex } from '@proteinjs/util';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Makes the invite record surface the ONE place invites are managed: the new-record form sends an
|
|
8
|
-
* invite, and an existing invite row can be revoked.
|
|
8
|
+
* invite, and an existing invite row can be re-sent or revoked.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the
|
|
12
|
-
* link;
|
|
13
|
-
*
|
|
10
|
+
* All three actions go through `SignupService` rather than raw record writes, because an invite is
|
|
11
|
+
* more than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the
|
|
12
|
+
* signup link; re-sending retires the earlier token, mints a fresh one and emails it again; revoking
|
|
13
|
+
* is the invite domain's own delete. Inserting or deleting the row directly would produce invites
|
|
14
|
+
* that can never be redeemed.
|
|
14
15
|
*/
|
|
15
16
|
export class InviteRecordFormCustomization extends RecordFormCustomization {
|
|
16
17
|
public table = tables.Invite;
|
|
@@ -24,7 +25,12 @@ export class InviteRecordFormCustomization extends RecordFormCustomization {
|
|
|
24
25
|
const formButtons = { ...defaultFormButtons };
|
|
25
26
|
delete formButtons['create'];
|
|
26
27
|
delete formButtons['delete'];
|
|
28
|
+
// No generic Save either: the invite table's db doors close generic writes (query/delete only —
|
|
29
|
+
// a raw update would be refused at the door), so Save could only ever fail; the row's acts are
|
|
30
|
+
// Resend and Revoke.
|
|
31
|
+
delete formButtons['save'];
|
|
27
32
|
formButtons['send'] = this.sendButton(invite);
|
|
33
|
+
formButtons['resend'] = this.resendButton(invite);
|
|
28
34
|
formButtons['revoke'] = this.revokeButton(invite);
|
|
29
35
|
return formButtons;
|
|
30
36
|
}
|
|
@@ -60,6 +66,39 @@ export class InviteRecordFormCustomization extends RecordFormCustomization {
|
|
|
60
66
|
};
|
|
61
67
|
}
|
|
62
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Re-sends a standing invite through `SignupService.resendInvite`: the earlier link stops working
|
|
71
|
+
* and a fresh one is emailed. The row stays, so the form re-lands on itself — after a beat, because
|
|
72
|
+
* the generic form paints its message and navigates in the same tick, and the navigation remounts
|
|
73
|
+
* the page (a re-land without the beat would eat the confirmation); the reload then shows the
|
|
74
|
+
* row's fresh token and expiry.
|
|
75
|
+
*/
|
|
76
|
+
private resendButton(invite: Invite | undefined): FormButton<any> {
|
|
77
|
+
return {
|
|
78
|
+
name: 'Resend',
|
|
79
|
+
accessibility: {
|
|
80
|
+
hidden: !invite || !this.canManageUsers(),
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
color: 'primary',
|
|
84
|
+
variant: 'contained',
|
|
85
|
+
},
|
|
86
|
+
redirect: async () => {
|
|
87
|
+
await new Promise((resolve) => setTimeout(resolve, 1400));
|
|
88
|
+
return { path: recordFormLink(tables.Invite.name, (invite as Invite).id) };
|
|
89
|
+
},
|
|
90
|
+
onClick: async () => {
|
|
91
|
+
const response = await getSignupService().resendInvite((invite as Invite).email);
|
|
92
|
+
if (response.sent === false) {
|
|
93
|
+
return response.error || 'Failed to resend invite.';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return `Resent invite to ${(invite as Invite).email}`;
|
|
97
|
+
},
|
|
98
|
+
progressMessage: () => `Resending invite`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
63
102
|
private revokeButton(invite: Invite | undefined): FormButton<any> {
|
|
64
103
|
return {
|
|
65
104
|
name: 'Revoke',
|
|
@@ -19,7 +19,7 @@ type UserAuthInternals = {
|
|
|
19
19
|
|
|
20
20
|
const setRoles = (roles: string[]) => {
|
|
21
21
|
(UserAuth as unknown as UserAuthInternals).userRepo = {
|
|
22
|
-
getUser: () => ({ email: 'someone@
|
|
22
|
+
getUser: () => ({ email: 'someone@example.com', roles }),
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -36,7 +36,7 @@ const defaultFormButtons = (): FormButtons<any> => ({
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
const defaultFieldLayout = ['email', 'token', 'tokenExpiresAt', 'invitedBy'];
|
|
39
|
-
const existingInvite = { id: 'invite-1', email: 'invitee@
|
|
39
|
+
const existingInvite = { id: 'invite-1', email: 'invitee@example.com' } as Invite;
|
|
40
40
|
|
|
41
41
|
const visibleButtons = (record: Invite | undefined) => {
|
|
42
42
|
const buttons = new InviteRecordFormCustomization().getFormButtons(record, defaultFormButtons());
|
|
@@ -49,11 +49,13 @@ describe('Invite record form customization', () => {
|
|
|
49
49
|
(UserAuth as unknown as UserAuthInternals).permissionRolesMapping = undefined;
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
it('replaces raw record create/delete with send/revoke', () => {
|
|
52
|
+
it('replaces raw record create/save/delete with send/resend/revoke (the db doors refuse generic writes)', () => {
|
|
53
53
|
setRoles(['admin']);
|
|
54
54
|
const buttons = new InviteRecordFormCustomization().getFormButtons(existingInvite, defaultFormButtons());
|
|
55
55
|
expect(Object.keys(buttons)).not.toContain('create');
|
|
56
|
+
expect(Object.keys(buttons)).not.toContain('save');
|
|
56
57
|
expect(Object.keys(buttons)).not.toContain('delete');
|
|
58
|
+
expect(Object.keys(buttons)).toEqual(expect.arrayContaining(['send', 'resend', 'revoke']));
|
|
57
59
|
});
|
|
58
60
|
|
|
59
61
|
it('offers an admin Send invite on the new-record form and Revoke on an existing invite', () => {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The invite record form's Resend act: offered on an EXISTING invite row (beside Revoke) to a
|
|
3
|
+
* caller with the 'users' permission — never on the new-record form, never to a caller who can't
|
|
4
|
+
* perform it. Its outcome rides `SignupService.resendInvite` (the door's own refusal reads back
|
|
5
|
+
* verbatim), and the form re-lands on the invite's own record so the fresh token and expiry show.
|
|
6
|
+
*
|
|
7
|
+
* Node environment like its sibling suite (InviteRecordFormCustomization.test.ts): the form's
|
|
8
|
+
* db-ui import reaches uuid, whose browser build is ESM jest cannot parse under jsdom.
|
|
9
|
+
*/
|
|
10
|
+
import { FormButtons } from '@proteinjs/ui';
|
|
11
|
+
import { recordFormLink } from '@proteinjs/db-ui';
|
|
12
|
+
import { Invite, UserAuth } from '@proteinjs/user';
|
|
13
|
+
import { InviteRecordFormCustomization } from '../src/form/InviteRecordFormCustomization';
|
|
14
|
+
|
|
15
|
+
const signupService = {
|
|
16
|
+
resendInvite: jest.fn(),
|
|
17
|
+
};
|
|
18
|
+
jest.mock('@proteinjs/user', () => ({
|
|
19
|
+
...jest.requireActual('@proteinjs/user'),
|
|
20
|
+
getSignupService: () => signupService,
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
type UserAuthInternals = {
|
|
24
|
+
userRepo?: { getUser: () => { email: string; roles: string[] } };
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const setRoles = (roles: string[]) => {
|
|
28
|
+
(UserAuth as unknown as UserAuthInternals).userRepo = {
|
|
29
|
+
getUser: () => ({ email: 'someone@example.com', roles }),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const defaultFormButtons = (): FormButtons<any> => ({
|
|
34
|
+
delete: { name: 'Delete', style: {} },
|
|
35
|
+
save: { name: 'Save', style: {} },
|
|
36
|
+
create: { name: 'Create', style: {} },
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const existingInvite = { id: 'invite-1', email: 'invitee@example.com' } as Invite;
|
|
40
|
+
|
|
41
|
+
const buttons = (record: Invite | undefined) =>
|
|
42
|
+
new InviteRecordFormCustomization().getFormButtons(record, defaultFormButtons());
|
|
43
|
+
const visible = (record: Invite | undefined) =>
|
|
44
|
+
Object.keys(buttons(record)).filter((name) => !buttons(record)[name].accessibility?.hidden);
|
|
45
|
+
|
|
46
|
+
describe('Resend on the invite record form', () => {
|
|
47
|
+
afterEach(() => {
|
|
48
|
+
(UserAuth as unknown as UserAuthInternals).userRepo = undefined;
|
|
49
|
+
signupService.resendInvite.mockReset();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('is offered on an existing invite beside Revoke, and not on the new-record form', () => {
|
|
53
|
+
setRoles(['admin']);
|
|
54
|
+
expect(visible(existingInvite)).toEqual(expect.arrayContaining(['resend', 'revoke']));
|
|
55
|
+
expect(visible(existingInvite)).not.toContain('send');
|
|
56
|
+
expect(visible(undefined)).not.toContain('resend');
|
|
57
|
+
expect(buttons(existingInvite).resend.name).toBe('Resend');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('is never offered to a caller without the users permission', () => {
|
|
61
|
+
setRoles([]);
|
|
62
|
+
expect(visible(existingInvite)).not.toContain('resend');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('re-sends through the service door and names the address on success', async () => {
|
|
66
|
+
setRoles(['admin']);
|
|
67
|
+
signupService.resendInvite.mockResolvedValue({ sent: true });
|
|
68
|
+
const message = await buttons(existingInvite).resend.onClick!({} as any, {} as any);
|
|
69
|
+
expect(signupService.resendInvite).toHaveBeenCalledWith('invitee@example.com');
|
|
70
|
+
expect(message).toBe('Resent invite to invitee@example.com');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("surfaces the door's own refusal verbatim", async () => {
|
|
74
|
+
setRoles(['admin']);
|
|
75
|
+
signupService.resendInvite.mockResolvedValue({ sent: false, error: 'No invite exists for that email.' });
|
|
76
|
+
const message = await buttons(existingInvite).resend.onClick!({} as any, {} as any);
|
|
77
|
+
expect(message).toBe('No invite exists for that email.');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("re-lands on the invite's own record (the fresh token and expiry show on reload)", async () => {
|
|
81
|
+
jest.useFakeTimers();
|
|
82
|
+
try {
|
|
83
|
+
setRoles(['admin']);
|
|
84
|
+
const redirect = buttons(existingInvite).resend.redirect!({} as any, {} as any);
|
|
85
|
+
jest.advanceTimersByTime(1400);
|
|
86
|
+
await expect(redirect).resolves.toEqual({ path: recordFormLink('invite', 'invite-1') });
|
|
87
|
+
} finally {
|
|
88
|
+
jest.useRealTimers();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -52,7 +52,7 @@ type UserAuthInternals = {
|
|
|
52
52
|
|
|
53
53
|
const setCallerRoles = (roles: string[]) => {
|
|
54
54
|
(UserAuth as unknown as UserAuthInternals).userRepo = {
|
|
55
|
-
getUser: () => ({ email: 'caller@
|
|
55
|
+
getUser: () => ({ email: 'caller@example.com', roles }),
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -72,7 +72,7 @@ const userRecord = (overrides: Partial<User> = {}): User =>
|
|
|
72
72
|
({
|
|
73
73
|
id: 'user-1',
|
|
74
74
|
name: 'Ada',
|
|
75
|
-
email: 'ada@
|
|
75
|
+
email: 'ada@example.com',
|
|
76
76
|
roles: ['ops'],
|
|
77
77
|
status: 'active',
|
|
78
78
|
...overrides,
|