@proteinjs/user-ui 1.10.1 → 1.11.0

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 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.0](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.10.2...@proteinjs/user-ui@1.11.0) (2026-09-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **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))
12
+
13
+
14
+ ### Features
15
+
16
+ * **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))
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.10.2](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.10.1...@proteinjs/user-ui@1.10.2) (2026-09-13)
23
+
24
+ **Note:** Version bump only for package @proteinjs/user-ui
25
+
26
+
27
+
28
+
29
+
6
30
  ## [1.10.1](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.10.0...@proteinjs/user-ui@1.10.1) (2026-09-12)
7
31
 
8
32
  **Note:** Version bump only for package @proteinjs/user-ui
@@ -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,sqTAAsqT,CAAC;AAG3rT,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"}
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"}
@@ -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
- * Both actions go through `SignupService` rather than raw record writes, because an invite is more
9
- * than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the signup
10
- * link; revoking is the invite domain's own delete. Inserting or deleting the row directly would
11
- * produce invites that can never be redeemed.
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,EAAmB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAoB,MAAM,EAAsC,MAAM,iBAAiB,CAAC;AAG/F;;;;;;;;GAQG;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;IASlG,OAAO,CAAC,UAAU;IA+BlB,OAAO,CAAC,YAAY;IAsBpB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAGvB"}
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
- * Both actions go through `SignupService` rather than raw record writes, because an invite is more
74
- * than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the signup
75
- * link; revoking is the invite domain's own delete. Inserting or deleting the row directly would
76
- * produce invites that can never be redeemed.
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,0CAA4E;AAC5E,wCAA+F;AAC/F,wCAA6C;AAE7C;;;;;;;;GAQG;AACH;IAAmD,iDAAuB;IAA1E;QAAA,qEA8EC;QA7EQ,WAAK,GAAG,aAAM,CAAC,MAAM,CAAC;;IA6E/B,CAAC;IA3EC,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,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9C,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,WAAW,C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ChB,OAAO,EAAE,MAAM;aAChB;YACD,8FAA8F;YAC9F,QAAQ,EAAE;;oBACR,sBAAO,EAAE,IAAI,EAAE,IAAA,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"}
@@ -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":[],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C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=InviteResend.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InviteResend.test.d.ts","sourceRoot":"","sources":["../../test/InviteResend.test.ts"],"names":[],"mappings":""}
@@ -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,I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,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;;;;SAC1D,CAAC,CAAC;IAEH,EAAE,CAAC,iFAAiF,EAAE;;;;;oBACpF,IAAI,CAAC,aAAa,EAAE,CAAC;;;;oBAEnB,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACd,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,QAAS,CAAC,EAAS,EAAE,EAAS,CAAC,CAAC;oBAChF,IAAI,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"}
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/user-ui",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "User ui components",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,12 +24,12 @@
24
24
  "dependencies": {
25
25
  "@mui/icons-material": "5.14.11",
26
26
  "@mui/material": "5.14.11",
27
- "@proteinjs/db": "^1.43.0",
28
- "@proteinjs/db-ui": "^1.16.0",
27
+ "@proteinjs/db": "^1.47.0",
28
+ "@proteinjs/db-ui": "^1.20.0",
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.19.1",
32
+ "@proteinjs/user": "^1.20.0",
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": "868016bac4feaec93b7d2a7fa68724d87619cf2e"
59
+ "gitHead": "b41385de00be0c41a62e4aa1d37b0cf56907d192"
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
- * Both actions go through `SignupService` rather than raw record writes, because an invite is more
11
- * than its row — sending mints a token, sets its expiry, stamps the inviter, and emails the signup
12
- * link; revoking is the invite domain's own delete. Inserting or deleting the row directly would
13
- * produce invites that can never be redeemed.
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',
@@ -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
+ });