@proteinjs/user-ui 1.12.8 → 1.13.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 +11 -0
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/src/auth/AuthPageProduct.d.ts +32 -0
- package/dist/src/auth/AuthPageProduct.d.ts.map +1 -0
- package/dist/src/auth/AuthPageProduct.js +26 -0
- package/dist/src/auth/AuthPageProduct.js.map +1 -0
- package/dist/src/pages/Login.d.ts.map +1 -1
- package/dist/src/pages/Login.js +17 -10
- package/dist/src/pages/Login.js.map +1 -1
- package/dist/test/authPages.test.js +27 -0
- package/dist/test/authPages.test.js.map +1 -1
- package/generated/index.ts +1 -1
- package/index.ts +2 -0
- package/package.json +4 -4
- package/src/auth/AuthPageProduct.ts +39 -0
- package/src/pages/Login.tsx +19 -11
- package/test/authPages.test.tsx +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.13.0](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.12.8...@proteinjs/user-ui@1.13.0) (2026-11-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **user-ui:** the log-in page shows a product's own line under Forgot password ([4f345d6](https://github.com/proteinjs/user/commit/4f345d62cb7090f7085cb30a79258493a5514639))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.12.8](https://github.com/proteinjs/user/compare/@proteinjs/user-ui@1.12.7...@proteinjs/user-ui@1.12.8) (2026-10-29)
|
|
7
18
|
|
|
8
19
|
**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/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/ui/Page\"},{\"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\":{\"packageName\":\"\",\"name\":\"Table<Invite>\",\"filePath\":null,\"qualifiedName\":\"/Table<Invite>\",\"typeParameters\":null,\"directParents\":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/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\":{\"packageName\":\"\",\"name\":\"Table<User>\",\"filePath\":null,\"qualifiedName\":\"/Table<User>\",\"typeParameters\":null,\"directParents\":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/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/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/AuthPageProduct\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"AuthPageProduct\",\"filePath\":\"src/auth/AuthPageProduct.ts\",\"qualifiedName\":\"@proteinjs/user-ui/AuthPageProduct\",\"properties\":[{\"name\":\"signupClosedLine\",\"type\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"{ words: string; href: string }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user-ui/{ words: string; href: string }\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"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\":{\"packageName\":\"\",\"name\":\"Table<Invite>\",\"filePath\":null,\"qualifiedName\":\"/Table<Invite>\",\"typeParameters\":null,\"directParents\":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/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\":{\"packageName\":\"\",\"name\":\"Table<User>\",\"filePath\":null,\"qualifiedName\":\"/Table<User>\",\"typeParameters\":null,\"directParents\":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/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/AuthPageProduct\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"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,m+WAAm+W,CAAC;AAGx/W,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.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './src/auth/AuthButton';
|
|
|
8
8
|
export * from './src/auth/AuthFormError';
|
|
9
9
|
export * from './src/auth/AuthMessagePanel';
|
|
10
10
|
export * from './src/auth/AuthFormFields';
|
|
11
|
+
export * from './src/auth/AuthPageProduct';
|
|
11
12
|
export type { AuthFieldErrors } from './src/auth/AuthValidation';
|
|
12
13
|
export type { LoginLocationState } from './src/pages/Login';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAI3D,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAI3D,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,2BAA2B,CAAC;AAE1C,cAAc,4BAA4B,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,4 +28,6 @@ __exportStar(require("./src/auth/AuthMessagePanel"), exports);
|
|
|
28
28
|
// The form reader the pages above use at submit (uncontrolled fields; the values read from the
|
|
29
29
|
// form itself) — exported so a consumer page fixes the same class the same way, not by hand.
|
|
30
30
|
__exportStar(require("./src/auth/AuthFormFields"), exports);
|
|
31
|
+
// The product's part in the sign-in pages (the log-in page's line while sign-up is closed), registered by the product.
|
|
32
|
+
__exportStar(require("./src/auth/AuthPageProduct"), exports);
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,iDAA+B;AAC/B,sEAAoD;AACpD,6EAA2D;AAE3D,0FAA0F;AAC1F,+FAA+F;AAC/F,wDAAsC;AACtC,2DAAyC;AACzC,wDAAsC;AACtC,2DAAyC;AACzC,8DAA4C;AAC5C,+FAA+F;AAC/F,6FAA6F;AAC7F,4DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,iDAA+B;AAC/B,sEAAoD;AACpD,6EAA2D;AAE3D,0FAA0F;AAC1F,+FAA+F;AAC/F,wDAAsC;AACtC,2DAAyC;AACzC,wDAAsC;AACtC,2DAAyC;AACzC,8DAA4C;AAC5C,+FAA+F;AAC/F,6FAA6F;AAC7F,4DAA0C;AAC1C,uHAAuH;AACvH,6DAA2C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Loadable } from '@proteinjs/reflection';
|
|
2
|
+
/**
|
|
3
|
+
* THE PRODUCT'S PART IN THE SIGN-IN PAGES: the one hand-in between a product and this library's sign-in pages.
|
|
4
|
+
* The library is open source and carries no product's name or words, so whatever on those pages is the
|
|
5
|
+
* product's own comes through here.
|
|
6
|
+
*
|
|
7
|
+
* Where it lives and why: a registration in user-ui (the `RoleCatalogEntry` pattern: an interface that
|
|
8
|
+
* extends Loadable, found through the reflection graph), registered by a class in the product's own ui
|
|
9
|
+
* package. A ui registration because the pages read it while they render in the browser.
|
|
10
|
+
*
|
|
11
|
+
* Its shape: one object, members added as the pages need them, each read by the one page that shows it.
|
|
12
|
+
* Today the log-in page's line. With no registration the pages show only the library's own words.
|
|
13
|
+
*/
|
|
14
|
+
export interface AuthPageProduct extends Loadable {
|
|
15
|
+
/**
|
|
16
|
+
* The line under "Forgot password?" on the log-in page of a product whose sign-up is closed (an account is
|
|
17
|
+
* made only from an invite): its words and the address it opens. The page shows it whenever one is
|
|
18
|
+
* registered; a product anyone can sign up to registers none.
|
|
19
|
+
*/
|
|
20
|
+
signupClosedLine: {
|
|
21
|
+
words: string;
|
|
22
|
+
href: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare class AuthPageProducts {
|
|
26
|
+
/**
|
|
27
|
+
* The product's registration, if one was made (the first found). None where the graph holds no such type:
|
|
28
|
+
* a page mounted straight from its source file, with no package index loaded (a bare suite).
|
|
29
|
+
*/
|
|
30
|
+
static registered(): AuthPageProduct | undefined;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=AuthPageProduct.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthPageProduct.d.ts","sourceRoot":"","sources":["../../../src/auth/AuthPageProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C;;;;OAIG;IACH,gBAAgB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED,qBAAa,gBAAgB;IAC3B;;;OAGG;IACH,MAAM,CAAC,UAAU,IAAI,eAAe,GAAG,SAAS;CAUjD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthPageProducts = void 0;
|
|
4
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
5
|
+
var AuthPageProducts = /** @class */ (function () {
|
|
6
|
+
function AuthPageProducts() {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The product's registration, if one was made (the first found). None where the graph holds no such type:
|
|
10
|
+
* a page mounted straight from its source file, with no package index loaded (a bare suite).
|
|
11
|
+
*/
|
|
12
|
+
AuthPageProducts.registered = function () {
|
|
13
|
+
try {
|
|
14
|
+
return reflection_1.SourceRepository.get().object('@proteinjs/user-ui/AuthPageProduct');
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (error instanceof Error && error.message.startsWith('Unable to find type')) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return AuthPageProducts;
|
|
24
|
+
}());
|
|
25
|
+
exports.AuthPageProducts = AuthPageProducts;
|
|
26
|
+
//# sourceMappingURL=AuthPageProduct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthPageProduct.js","sourceRoot":"","sources":["../../../src/auth/AuthPageProduct.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AAuBnE;IAAA;IAeA,CAAC;IAdC;;;OAGG;IACI,2BAAU,GAAjB;QACE,IAAI;YACF,OAAO,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAkB,oCAAoC,CAAC,CAAC;SAC7F;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE;gBAC7E,OAAO,SAAS,CAAC;aAClB;YACD,MAAM,KAAK,CAAC;SACb;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,4CAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../../src/pages/Login.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../../src/pages/Login.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAerC;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAwHtD,eAAO,MAAM,SAAS,EAAE,IAOvB,CAAC"}
|
package/dist/src/pages/Login.js
CHANGED
|
@@ -83,15 +83,26 @@ var AuthFormError_1 = require("../auth/AuthFormError");
|
|
|
83
83
|
var AuthApi_1 = require("../auth/AuthApi");
|
|
84
84
|
var AuthFormFields_1 = require("../auth/AuthFormFields");
|
|
85
85
|
var AuthValidation_1 = require("../auth/AuthValidation");
|
|
86
|
+
var AuthPageProduct_1 = require("../auth/AuthPageProduct");
|
|
86
87
|
function arrivalMessage(state) {
|
|
87
88
|
var message = state === null || state === void 0 ? void 0 : state.message;
|
|
88
89
|
return typeof message === 'string' && message.length > 0 ? message : undefined;
|
|
89
90
|
}
|
|
91
|
+
/** The quiet links under the form: 0.875rem in the secondary text color, a 44px tap target without visual bulk. */
|
|
92
|
+
var quietLinkSx = {
|
|
93
|
+
fontSize: '0.875rem',
|
|
94
|
+
color: 'text.secondary',
|
|
95
|
+
py: '13px',
|
|
96
|
+
px: 2,
|
|
97
|
+
};
|
|
90
98
|
var LoginComponent = function () {
|
|
91
|
-
var _a
|
|
92
|
-
var _b = (0, react_1.useState)(),
|
|
93
|
-
var _c = (0, react_1.useState)(
|
|
99
|
+
var _a;
|
|
100
|
+
var _b = (0, react_1.useState)({}), fieldErrors = _b[0], setFieldErrors = _b[1];
|
|
101
|
+
var _c = (0, react_1.useState)(), error = _c[0], setError = _c[1];
|
|
102
|
+
var _d = (0, react_1.useState)(false), busy = _d[0], setBusy = _d[1];
|
|
94
103
|
var message = arrivalMessage((0, react_router_dom_1.useLocation)().state);
|
|
104
|
+
// The product's own line under "Forgot password?" (AuthPageProduct), read at render; none registered, no line.
|
|
105
|
+
var productLine = (_a = AuthPageProduct_1.AuthPageProducts.registered()) === null || _a === void 0 ? void 0 : _a.signupClosedLine;
|
|
95
106
|
var clearFieldError = function (name) {
|
|
96
107
|
return setFieldErrors(function (errors) {
|
|
97
108
|
var _a;
|
|
@@ -158,13 +169,9 @@ var LoginComponent = function () {
|
|
|
158
169
|
react_1.default.createElement(AuthFormError_1.AuthFormError, { message: error }),
|
|
159
170
|
react_1.default.createElement(AuthButton_1.AuthButton, { busy: busy }, "Log in")),
|
|
160
171
|
react_1.default.createElement(material_1.Box, { sx: { display: 'flex', justifyContent: 'center', mt: 3 } },
|
|
161
|
-
react_1.default.createElement(material_1.Link, { href: "/".concat(user_1.uiRoutes.auth.forgotPassword), underline: 'hover', sx:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// 44px touch target without visual bulk.
|
|
165
|
-
py: '13px',
|
|
166
|
-
px: 2,
|
|
167
|
-
} }, "Forgot password?")))));
|
|
172
|
+
react_1.default.createElement(material_1.Link, { href: "/".concat(user_1.uiRoutes.auth.forgotPassword), underline: 'hover', sx: quietLinkSx }, "Forgot password?")),
|
|
173
|
+
productLine && (react_1.default.createElement(material_1.Box, { sx: { display: 'flex', justifyContent: 'center' } },
|
|
174
|
+
react_1.default.createElement(material_1.Link, { href: productLine.href, underline: 'hover', sx: quietLinkSx }, productLine.words))))));
|
|
168
175
|
};
|
|
169
176
|
exports.loginPage = {
|
|
170
177
|
name: 'Login',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Login.js","sourceRoot":"","sources":["../../../src/pages/Login.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AACxC,0CAAsD;AAEtD,wCAA2C;AAC3C,6CAAsC;AACtC,qDAA+C;AAC/C,iDAAgD;AAChD,uDAAsD;AACtD,iDAAgD;AAChD,uDAAsD;AACtD,2CAA0C;AAC1C,yDAAwD;AACxD,yDAAyE;
|
|
1
|
+
{"version":3,"file":"Login.js","sourceRoot":"","sources":["../../../src/pages/Login.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AACxC,0CAAsD;AAEtD,wCAA2C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AE,QAAQ,EAAE;gBACpD,8BAAC,eAAI,IAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,SAAS,EAAC,OAAO,EAAC,EAAE,EAAE,WAAW,IAC5D,WAAW,CAAC,KAAK,CACb,CACH,CACP,CACU,CACZ,CACJ,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,SAAS,GAAS;IAC7B,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,eAAQ,CAAC,IAAI,CAAC,KAAK;IACzB,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;KACb;IACD,SAAS,EAAE,cAAc;CAC1B,CAAC"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var server_1 = require("react-dom/server");
|
|
8
8
|
var react_router_dom_1 = require("react-router-dom");
|
|
9
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
9
10
|
var Login_1 = require("../src/pages/Login");
|
|
10
11
|
var ForgotPassword_1 = require("../src/pages/ForgotPassword");
|
|
11
12
|
var PasswordReset_1 = require("../src/pages/PasswordReset");
|
|
@@ -13,7 +14,19 @@ var Signup_1 = require("../src/pages/Signup");
|
|
|
13
14
|
function render(node) {
|
|
14
15
|
return (0, server_1.renderToStaticMarkup)(react_1.default.createElement(react_router_dom_1.MemoryRouter, null, node));
|
|
15
16
|
}
|
|
17
|
+
/** The links a page renders, in the order it renders them: each one's address and words. */
|
|
18
|
+
function links(html) {
|
|
19
|
+
var found = [];
|
|
20
|
+
var anchor = /<a [^>]*href="([^"]*)"[^>]*>([^<]*)<\/a>/g;
|
|
21
|
+
for (var match = anchor.exec(html); match; match = anchor.exec(html)) {
|
|
22
|
+
found.push({ href: match[1], words: match[2] });
|
|
23
|
+
}
|
|
24
|
+
return found;
|
|
25
|
+
}
|
|
16
26
|
describe('auth pages', function () {
|
|
27
|
+
afterEach(function () {
|
|
28
|
+
jest.restoreAllMocks();
|
|
29
|
+
});
|
|
17
30
|
it('login renders email + password fields, the submit action, and the forgot-password link', function () {
|
|
18
31
|
var Login = Login_1.loginPage.component;
|
|
19
32
|
var html = render(react_1.default.createElement(Login, { urlParams: {} }));
|
|
@@ -31,6 +44,20 @@ describe('auth pages', function () {
|
|
|
31
44
|
expect(html.toLowerCase()).toContain('type="email"');
|
|
32
45
|
expect(html.toLowerCase()).toContain('autocomplete="current-password"');
|
|
33
46
|
});
|
|
47
|
+
it("login shows the line a product registers under the forgot-password link, opening the product's address, and no line when none is registered", function () {
|
|
48
|
+
var Login = Login_1.loginPage.component;
|
|
49
|
+
// A product's registration, in words that are the test's own (the library carries no product's words).
|
|
50
|
+
var product = { signupClosedLine: { words: 'Ask the product for an invite', href: '/ask-the-product' } };
|
|
51
|
+
var registered = product;
|
|
52
|
+
jest.spyOn(reflection_1.SourceRepository, 'get').mockReturnValue({
|
|
53
|
+
object: function (type) { return (type === '@proteinjs/user-ui/AuthPageProduct' ? registered : undefined); },
|
|
54
|
+
});
|
|
55
|
+
var offered = links(render(react_1.default.createElement(Login, { urlParams: {} })));
|
|
56
|
+
expect(offered.map(function (link) { return link.href; })).toEqual(['/login/forgot-password', product.signupClosedLine.href]);
|
|
57
|
+
expect(offered[1].words).toBe(product.signupClosedLine.words);
|
|
58
|
+
registered = undefined;
|
|
59
|
+
expect(links(render(react_1.default.createElement(Login, { urlParams: {} }))).map(function (link) { return link.href; })).toEqual(['/login/forgot-password']);
|
|
60
|
+
});
|
|
34
61
|
it('forgot password renders the email field, the send action, and a way back to login', function () {
|
|
35
62
|
var ForgotPassword = ForgotPassword_1.forgotPasswordPage.component;
|
|
36
63
|
var html = render(react_1.default.createElement(ForgotPassword, { urlParams: {} }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authPages.test.js","sourceRoot":"","sources":["../../test/authPages.test.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,2CAAwD;AACxD,qDAAgD;AAChD,4CAA+C;AAC/C,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c,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iFAAiF,EAAE;QACpF,IAAM,MAAM,GAAG,mBAAU,CAAC,SAAS,CAAC;QACpC,IAAM,IAAI,GAAG,MAAM,CAAC,8BAAC,MAAM,IAAC,SAAS,EAAE,EAAE,GAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAC9C,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/db-ui/RecordFormCustomization"},{"v":"@proteinjs/ui/Page"},{"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":{"packageName":"","name":"Table<Invite>","filePath":null,"qualifiedName":"/Table<Invite>","typeParameters":null,"directParents":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/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":{"packageName":"","name":"Table<User>","filePath":null,"qualifiedName":"/Table<User>","typeParameters":null,"directParents":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/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/db-ui/RecordFormCustomization"},{"v":"@proteinjs/reflection/Loadable"},{"v":"@proteinjs/ui/Page"},{"v":"@proteinjs/user-ui/AuthPageProduct","value":{"packageName":"@proteinjs/user-ui","name":"AuthPageProduct","filePath":"src/auth/AuthPageProduct.ts","qualifiedName":"@proteinjs/user-ui/AuthPageProduct","properties":[{"name":"signupClosedLine","type":{"packageName":"@proteinjs/user-ui","name":"{ words: string; href: string }","filePath":null,"qualifiedName":"@proteinjs/user-ui/{ words: string; href: string }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"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":{"packageName":"","name":"Table<Invite>","filePath":null,"qualifiedName":"/Table<Invite>","typeParameters":null,"directParents":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/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":{"packageName":"","name":"Table<User>","filePath":null,"qualifiedName":"/Table<User>","typeParameters":null,"directParents":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/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/AuthPageProduct","w":"@proteinjs/reflection/Loadable","value":"extends interface"},{"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
|
@@ -13,6 +13,8 @@ export * from './src/auth/AuthMessagePanel';
|
|
|
13
13
|
// The form reader the pages above use at submit (uncontrolled fields; the values read from the
|
|
14
14
|
// form itself) — exported so a consumer page fixes the same class the same way, not by hand.
|
|
15
15
|
export * from './src/auth/AuthFormFields';
|
|
16
|
+
// The product's part in the sign-in pages (the log-in page's line while sign-up is closed), registered by the product.
|
|
17
|
+
export * from './src/auth/AuthPageProduct';
|
|
16
18
|
export type { AuthFieldErrors } from './src/auth/AuthValidation';
|
|
17
19
|
// What a navigation to the login page may carry (`{ message }`, the page's message seat).
|
|
18
20
|
export type { LoginLocationState } from './src/pages/Login';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/user-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.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.
|
|
27
|
+
"@proteinjs/db": "^1.63.1",
|
|
28
28
|
"@proteinjs/db-ui": "^1.21.19",
|
|
29
29
|
"@proteinjs/reflection": "^1.2.2",
|
|
30
30
|
"@proteinjs/server-api": "^3.6.0",
|
|
31
31
|
"@proteinjs/ui": "^4.22.1",
|
|
32
|
-
"@proteinjs/user": "^1.25.
|
|
32
|
+
"@proteinjs/user": "^1.25.2",
|
|
33
33
|
"@proteinjs/util": "^1.6.2",
|
|
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": "057cc732e91e09044f19abc02189aa65e60369b9"
|
|
60
60
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Loadable, SourceRepository } from '@proteinjs/reflection';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* THE PRODUCT'S PART IN THE SIGN-IN PAGES: the one hand-in between a product and this library's sign-in pages.
|
|
5
|
+
* The library is open source and carries no product's name or words, so whatever on those pages is the
|
|
6
|
+
* product's own comes through here.
|
|
7
|
+
*
|
|
8
|
+
* Where it lives and why: a registration in user-ui (the `RoleCatalogEntry` pattern: an interface that
|
|
9
|
+
* extends Loadable, found through the reflection graph), registered by a class in the product's own ui
|
|
10
|
+
* package. A ui registration because the pages read it while they render in the browser.
|
|
11
|
+
*
|
|
12
|
+
* Its shape: one object, members added as the pages need them, each read by the one page that shows it.
|
|
13
|
+
* Today the log-in page's line. With no registration the pages show only the library's own words.
|
|
14
|
+
*/
|
|
15
|
+
export interface AuthPageProduct extends Loadable {
|
|
16
|
+
/**
|
|
17
|
+
* The line under "Forgot password?" on the log-in page of a product whose sign-up is closed (an account is
|
|
18
|
+
* made only from an invite): its words and the address it opens. The page shows it whenever one is
|
|
19
|
+
* registered; a product anyone can sign up to registers none.
|
|
20
|
+
*/
|
|
21
|
+
signupClosedLine: { words: string; href: string };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class AuthPageProducts {
|
|
25
|
+
/**
|
|
26
|
+
* The product's registration, if one was made (the first found). None where the graph holds no such type:
|
|
27
|
+
* a page mounted straight from its source file, with no package index loaded (a bare suite).
|
|
28
|
+
*/
|
|
29
|
+
static registered(): AuthPageProduct | undefined {
|
|
30
|
+
try {
|
|
31
|
+
return SourceRepository.get().object<AuthPageProduct>('@proteinjs/user-ui/AuthPageProduct');
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error instanceof Error && error.message.startsWith('Unable to find type')) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/pages/Login.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import { AuthFormError } from '../auth/AuthFormError';
|
|
|
11
11
|
import { AuthApi } from '../auth/AuthApi';
|
|
12
12
|
import { AuthFormFields } from '../auth/AuthFormFields';
|
|
13
13
|
import { AuthFieldErrors, AuthValidation } from '../auth/AuthValidation';
|
|
14
|
+
import { AuthPageProducts } from '../auth/AuthPageProduct';
|
|
14
15
|
|
|
15
16
|
type LoginField = 'email' | 'password';
|
|
16
17
|
|
|
@@ -27,11 +28,21 @@ function arrivalMessage(state: unknown): string | undefined {
|
|
|
27
28
|
return typeof message === 'string' && message.length > 0 ? message : undefined;
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
/** The quiet links under the form: 0.875rem in the secondary text color, a 44px tap target without visual bulk. */
|
|
32
|
+
const quietLinkSx = {
|
|
33
|
+
fontSize: '0.875rem',
|
|
34
|
+
color: 'text.secondary',
|
|
35
|
+
py: '13px',
|
|
36
|
+
px: 2,
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
30
39
|
const LoginComponent: React.FC = () => {
|
|
31
40
|
const [fieldErrors, setFieldErrors] = useState<AuthFieldErrors<LoginField>>({});
|
|
32
41
|
const [error, setError] = useState<string | undefined>();
|
|
33
42
|
const [busy, setBusy] = useState(false);
|
|
34
43
|
const message = arrivalMessage(useLocation().state);
|
|
44
|
+
// The product's own line under "Forgot password?" (AuthPageProduct), read at render; none registered, no line.
|
|
45
|
+
const productLine = AuthPageProducts.registered()?.signupClosedLine;
|
|
35
46
|
|
|
36
47
|
const clearFieldError = (name: LoginField) =>
|
|
37
48
|
setFieldErrors((errors) => (errors[name] ? { ...errors, [name]: undefined } : errors));
|
|
@@ -114,20 +125,17 @@ const LoginComponent: React.FC = () => {
|
|
|
114
125
|
<AuthButton busy={busy}>Log in</AuthButton>
|
|
115
126
|
</form>
|
|
116
127
|
<Box sx={{ display: 'flex', justifyContent: 'center', mt: 3 }}>
|
|
117
|
-
<Link
|
|
118
|
-
href={`/${uiRoutes.auth.forgotPassword}`}
|
|
119
|
-
underline='hover'
|
|
120
|
-
sx={{
|
|
121
|
-
fontSize: '0.875rem',
|
|
122
|
-
color: 'text.secondary',
|
|
123
|
-
// 44px touch target without visual bulk.
|
|
124
|
-
py: '13px',
|
|
125
|
-
px: 2,
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
+
<Link href={`/${uiRoutes.auth.forgotPassword}`} underline='hover' sx={quietLinkSx}>
|
|
128
129
|
Forgot password?
|
|
129
130
|
</Link>
|
|
130
131
|
</Box>
|
|
132
|
+
{productLine && (
|
|
133
|
+
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
|
|
134
|
+
<Link href={productLine.href} underline='hover' sx={quietLinkSx}>
|
|
135
|
+
{productLine.words}
|
|
136
|
+
</Link>
|
|
137
|
+
</Box>
|
|
138
|
+
)}
|
|
131
139
|
</AuthLayout>
|
|
132
140
|
</>
|
|
133
141
|
);
|
package/test/authPages.test.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
import { SourceRepository } from '@proteinjs/reflection';
|
|
4
5
|
import { loginPage } from '../src/pages/Login';
|
|
5
6
|
import { forgotPasswordPage } from '../src/pages/ForgotPassword';
|
|
6
7
|
import { passwordResetPage } from '../src/pages/PasswordReset';
|
|
@@ -10,7 +11,21 @@ function render(node: React.ReactElement) {
|
|
|
10
11
|
return renderToStaticMarkup(<MemoryRouter>{node}</MemoryRouter>);
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
/** The links a page renders, in the order it renders them: each one's address and words. */
|
|
15
|
+
function links(html: string): { href: string; words: string }[] {
|
|
16
|
+
const found: { href: string; words: string }[] = [];
|
|
17
|
+
const anchor = /<a [^>]*href="([^"]*)"[^>]*>([^<]*)<\/a>/g;
|
|
18
|
+
for (let match = anchor.exec(html); match; match = anchor.exec(html)) {
|
|
19
|
+
found.push({ href: match[1], words: match[2] });
|
|
20
|
+
}
|
|
21
|
+
return found;
|
|
22
|
+
}
|
|
23
|
+
|
|
13
24
|
describe('auth pages', () => {
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
jest.restoreAllMocks();
|
|
27
|
+
});
|
|
28
|
+
|
|
14
29
|
it('login renders email + password fields, the submit action, and the forgot-password link', () => {
|
|
15
30
|
const Login = loginPage.component;
|
|
16
31
|
const html = render(<Login urlParams={{}} />);
|
|
@@ -29,6 +44,23 @@ describe('auth pages', () => {
|
|
|
29
44
|
expect(html.toLowerCase()).toContain('autocomplete="current-password"');
|
|
30
45
|
});
|
|
31
46
|
|
|
47
|
+
it("login shows the line a product registers under the forgot-password link, opening the product's address, and no line when none is registered", () => {
|
|
48
|
+
const Login = loginPage.component;
|
|
49
|
+
// A product's registration, in words that are the test's own (the library carries no product's words).
|
|
50
|
+
const product = { signupClosedLine: { words: 'Ask the product for an invite', href: '/ask-the-product' } };
|
|
51
|
+
let registered: typeof product | undefined = product;
|
|
52
|
+
jest.spyOn(SourceRepository, 'get').mockReturnValue({
|
|
53
|
+
object: (type: string) => (type === '@proteinjs/user-ui/AuthPageProduct' ? registered : undefined),
|
|
54
|
+
} as unknown as SourceRepository);
|
|
55
|
+
|
|
56
|
+
const offered = links(render(<Login urlParams={{}} />));
|
|
57
|
+
expect(offered.map((link) => link.href)).toEqual(['/login/forgot-password', product.signupClosedLine.href]);
|
|
58
|
+
expect(offered[1].words).toBe(product.signupClosedLine.words);
|
|
59
|
+
|
|
60
|
+
registered = undefined;
|
|
61
|
+
expect(links(render(<Login urlParams={{}} />)).map((link) => link.href)).toEqual(['/login/forgot-password']);
|
|
62
|
+
});
|
|
63
|
+
|
|
32
64
|
it('forgot password renders the email field, the send action, and a way back to login', () => {
|
|
33
65
|
const ForgotPassword = forgotPasswordPage.component;
|
|
34
66
|
const html = render(<ForgotPassword urlParams={{}} />);
|