@velocitycareerlabs/sample-registrar-app 1.25.0-dev-build.15a031a73
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/.env.dev.local +9 -0
- package/.eslintrc.js +30 -0
- package/.prettierrc.js +24 -0
- package/LICENSE +201 -0
- package/README.md +37 -0
- package/index.html +29 -0
- package/package.json +64 -0
- package/public/assets/images/logo.svg +12 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.png +0 -0
- package/public/index.html +40 -0
- package/public/manifest.json +15 -0
- package/src/App.jsx +124 -0
- package/src/AuthProviderBridge.jsx +85 -0
- package/src/ConfigLoader.jsx +23 -0
- package/src/config.js +28 -0
- package/src/fonts/Inter-Regular.ttf +0 -0
- package/src/fonts/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/src/fonts/inter-v12-latin-300.eot +0 -0
- package/src/fonts/inter-v12-latin-300.svg +350 -0
- package/src/fonts/inter-v12-latin-300.ttf +0 -0
- package/src/fonts/inter-v12-latin-300.woff +0 -0
- package/src/fonts/inter-v12-latin-300.woff2 +0 -0
- package/src/fonts/inter-v12-latin-500.eot +0 -0
- package/src/fonts/inter-v12-latin-500.svg +351 -0
- package/src/fonts/inter-v12-latin-500.ttf +0 -0
- package/src/fonts/inter-v12-latin-500.woff +0 -0
- package/src/fonts/inter-v12-latin-500.woff2 +0 -0
- package/src/fonts/inter-v12-latin-600.eot +0 -0
- package/src/fonts/inter-v12-latin-600.svg +351 -0
- package/src/fonts/inter-v12-latin-600.ttf +0 -0
- package/src/fonts/inter-v12-latin-600.woff +0 -0
- package/src/fonts/inter-v12-latin-600.woff2 +0 -0
- package/src/fonts/inter-v12-latin-regular.eot +0 -0
- package/src/fonts/inter-v12-latin-regular.svg +351 -0
- package/src/fonts/inter-v12-latin-regular.ttf +0 -0
- package/src/fonts/inter-v12-latin-regular.woff +0 -0
- package/src/fonts/inter-v12-latin-regular.woff2 +0 -0
- package/src/index.css +60 -0
- package/src/main.jsx +35 -0
- package/template.env.remoteauth +7 -0
- package/template.env.remotedev +7 -0
- package/vite.config.js +31 -0
package/.env.dev.local
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
VITE_REGISTRAR_AUTH0_DOMAIN=localhost:13001
|
2
|
+
VITE_REGISTRAR_AUTH0_CLIENT_ID=GKZ5MeATHcBFADukezS4Pa3hCB1XbkX6
|
3
|
+
VITE_REGISTRAR_AUTH0_REDIRECT_URI=http://localhost:5173
|
4
|
+
VITE_REGISTRAR_AUDIENCE=testAudience
|
5
|
+
VITE_REGISTRAR_CONNECTION=vnf-localdev-users-connection
|
6
|
+
VITE_REGISTRAR_API=http://localhost:13999/api/v0.6
|
7
|
+
VITE_X_AUTO_ACTIVATE=true
|
8
|
+
VITE_CHAIN_NAME=Devnet
|
9
|
+
|
package/.eslintrc.js
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
const eslintConfig = require('../../.eslintrc');
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
...eslintConfig,
|
5
|
+
root: true,
|
6
|
+
extends: eslintConfig.extends.concat([
|
7
|
+
'plugin:react/recommended',
|
8
|
+
'plugin:react/jsx-runtime',
|
9
|
+
'plugin:react-hooks/recommended',
|
10
|
+
]),
|
11
|
+
env: {
|
12
|
+
es6: true,
|
13
|
+
browser: true,
|
14
|
+
jest: true,
|
15
|
+
},
|
16
|
+
rules: {
|
17
|
+
...eslintConfig.rules,
|
18
|
+
'import/prefer-default-export': 0,
|
19
|
+
'no-unused-vars': ['warn', { varsIgnorePattern: '^React$' }],
|
20
|
+
'import/no-unresolved': [
|
21
|
+
'error',
|
22
|
+
{ ignore: ['@velocitycareerlabs/components-organizations-registrar.*'] },
|
23
|
+
],
|
24
|
+
},
|
25
|
+
overrides: [
|
26
|
+
{
|
27
|
+
files: ['**/*.{js,jsx}'],
|
28
|
+
},
|
29
|
+
],
|
30
|
+
};
|
package/.prettierrc.js
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2023 Velocity Team
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
module.exports = {
|
18
|
+
printWidth: 100,
|
19
|
+
trailingComma: 'all',
|
20
|
+
tabWidth: 2,
|
21
|
+
semi: true,
|
22
|
+
singleQuote: true,
|
23
|
+
'prettier.eslintIntegration': true,
|
24
|
+
};
|
package/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Sample Registrar App
|
2
|
+
|
3
|
+
The sample registrar app shows how to use the components-registrar-app components & pages
|
4
|
+
|
5
|
+
## Builds
|
6
|
+
Vite is used for building the project - primarily involving transpilation of JSX files using SWC
|
7
|
+
|
8
|
+
## Tests
|
9
|
+
Tests are written in Jest
|
10
|
+
|
11
|
+
## Style
|
12
|
+
Style is maintained in eslint based on the monorepo root styles
|
13
|
+
|
14
|
+
## How to develop
|
15
|
+
There are two types of server that this application requires: a registrar server and an authorization server.
|
16
|
+
|
17
|
+
It ships with an example of how to run using completely local development but your mileage may vary as to how well it works.
|
18
|
+
Certain flows cannot be tested locally yet including signup.
|
19
|
+
|
20
|
+
### Local Registrar and Auth Servers
|
21
|
+
1. Start the sample-registrar-server docker compose (it will automatically start a fake auth0 server): `docker compose up`
|
22
|
+
2. Start the sample-regsitrar-app: `> vite start`
|
23
|
+
|
24
|
+
### Remote Registrar and avoid Auth Server
|
25
|
+
1. Create an remote env file (eg. `env.remotedev`) based on `template.env.remotedev`
|
26
|
+
2. Login into the auth server for the remote environment and get an access token
|
27
|
+
3. Open `AuthBridgeProvider.js` file
|
28
|
+
4. Hardcode the access token as the return value from `getAccessToken` and `getAccessTokenWithPopup`
|
29
|
+
5. `> vite start:remote`
|
30
|
+
|
31
|
+
### Remote Auth only
|
32
|
+
1. Start the sample-registrar-server docker compose (it will automatically start a fake auth0 server): `docker compose up`
|
33
|
+
2. Create an remote env file (eg. `env.remoteauth`) based on `template.env.remoteauth`
|
34
|
+
3. `> vite start:remoteauth`
|
35
|
+
|
36
|
+
|
37
|
+
Using a
|
package/index.html
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
<!--
|
2
|
+
~ Copyright 2025 Velocity Team
|
3
|
+
~
|
4
|
+
~ Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
~ you may not use this file except in compliance with the License.
|
6
|
+
~ You may obtain a copy of the License at
|
7
|
+
~
|
8
|
+
~ http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
~
|
10
|
+
~ Unless required by applicable law or agreed to in writing, software
|
11
|
+
~ distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
~ See the License for the specific language governing permissions and
|
14
|
+
~ limitations under the License.
|
15
|
+
~
|
16
|
+
-->
|
17
|
+
|
18
|
+
<html lang="en">
|
19
|
+
<head>
|
20
|
+
<meta charset="UTF-8" />
|
21
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
22
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
23
|
+
<title>Sample Velocity Core Registrar</title>
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<div id="root"></div>
|
27
|
+
<script type="module" src="/src/main.jsx"></script>
|
28
|
+
</body>
|
29
|
+
</html>
|
package/package.json
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
{
|
2
|
+
"name": "@velocitycareerlabs/sample-registrar-app",
|
3
|
+
"version": "1.25.0-dev-build.15a031a73",
|
4
|
+
"description": "Velocity Registrar",
|
5
|
+
"license": "Apache-2.0",
|
6
|
+
"publishConfig": {
|
7
|
+
"access": "public"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"@auth0/auth0-react": "^2.2.1",
|
11
|
+
"@csstools/normalize.css": "^12.0.0",
|
12
|
+
"@emotion/react": "^11.11.4",
|
13
|
+
"@emotion/styled": "^11.11.5",
|
14
|
+
"@mui/icons-material": "^6.0.0",
|
15
|
+
"@mui/material": "^6.0.0",
|
16
|
+
"@react-pdf/renderer": "^3.0.0",
|
17
|
+
"@velocitycareerlabs/components-organizations-registrar": "1.25.0-dev-build.15a031a73",
|
18
|
+
"autosuggest-highlight": "^3.3.4",
|
19
|
+
"classnames": "~2.5.0",
|
20
|
+
"env-cmd": "^10.1.0",
|
21
|
+
"lodash": "^4.17.21",
|
22
|
+
"prop-types": "^15.8.1",
|
23
|
+
"query-string": "^9.0.0",
|
24
|
+
"ra-core": "^5.5.2",
|
25
|
+
"ra-data-local-storage": "^5.5.2",
|
26
|
+
"react": "^18.3.1",
|
27
|
+
"react-admin": "^5.5.2",
|
28
|
+
"react-dom": "^18.3.1",
|
29
|
+
"react-hook-form": "^7.53.0",
|
30
|
+
"react-router": "6.29",
|
31
|
+
"react-router-dom": "6.29"
|
32
|
+
},
|
33
|
+
"devDependencies": {
|
34
|
+
"@vitejs/plugin-react-swc": "^3.8.0",
|
35
|
+
"eslint": "8.57.1",
|
36
|
+
"eslint-config-airbnb-base": "14.2.1",
|
37
|
+
"eslint-config-prettier": "8.10.0",
|
38
|
+
"eslint-plugin-autofix": "1.1.0",
|
39
|
+
"eslint-plugin-better-mutation": "1.7.0",
|
40
|
+
"eslint-plugin-import": "2.31.0",
|
41
|
+
"eslint-plugin-prefer-arrow-functions": "3.6.2",
|
42
|
+
"eslint-plugin-prettier": "4.2.1",
|
43
|
+
"eslint-plugin-react": "7.37.4",
|
44
|
+
"eslint-plugin-react-hooks": "4.6.2",
|
45
|
+
"postcss-normalize": "10.0.1",
|
46
|
+
"vite": "^6.2.0"
|
47
|
+
},
|
48
|
+
"scripts": {
|
49
|
+
"start": "vite dev --mode dev.local",
|
50
|
+
"start:remote": "vite dev --mode dev.remote",
|
51
|
+
"start:remoteauth": "vite dev --mode dev.remoteauth",
|
52
|
+
"build": "vite build",
|
53
|
+
"preview": "vite preview",
|
54
|
+
"lint": "eslint src --format json >> eslint.json",
|
55
|
+
"lint:fix": "eslint src --fix"
|
56
|
+
},
|
57
|
+
"browserslist": [
|
58
|
+
">0.2%",
|
59
|
+
"not dead",
|
60
|
+
"not ie <= 11",
|
61
|
+
"not op_mini all"
|
62
|
+
],
|
63
|
+
"gitHead": "5f48f9740617912fb6606a02cc7e611c4bb81a95"
|
64
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<svg width="135" height="30" viewBox="0 0 135 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M23.3596 20.0003C22.1952 20.0003 21.1415 20.4766 20.3791 21.2455L19.928 21.7968L8.28179 15.7608L8.29358 15.7288C8.38344 15.3841 8.43063 15.023 8.43063 14.6509C8.43063 14.2788 8.38344 13.9167 8.29358 13.5729L8.28269 13.5409L19.9226 7.50856L19.2981 6.18839L7.66735 12.2152L7.0284 11.4838C6.28236 10.8091 5.29671 10.3995 4.21577 10.3995C1.88689 10.3995 0 12.3021 0 14.6499C0 16.9969 1.88689 18.9004 4.21577 18.9004C5.29671 18.9004 6.28236 18.4908 7.0284 17.8161L7.66644 17.0856L19.3145 23.1225L19.231 23.394C19.1747 23.6711 19.1457 23.9572 19.1457 24.2507C19.1457 26.5977 21.0335 28.5012 23.3614 28.5012C25.6903 28.5012 27.5772 26.5977 27.5772 24.2507C27.5772 21.9038 25.6885 20.0003 23.3596 20.0003ZM4.21486 17.3471C2.74093 17.3471 1.54109 16.1375 1.54109 14.6509C1.54109 13.1643 2.74093 11.9547 4.21486 11.9547C5.6897 11.9547 6.88863 13.1643 6.88863 14.6509C6.88863 16.1375 5.68879 17.3471 4.21486 17.3471ZM23.3596 26.9478C21.8848 26.9478 20.6859 25.7382 20.6859 24.2516C20.6859 22.765 21.8857 21.5554 23.3596 21.5554C24.8336 21.5554 26.0334 22.765 26.0334 24.2516C26.0334 25.7382 24.8345 26.9478 23.3596 26.9478Z" fill="black"/>
|
3
|
+
<path d="M19.9207 7.50952C20.684 8.59384 21.9411 9.30055 23.3605 9.30055C25.6894 9.30055 27.5772 7.39703 27.5772 5.0501C27.5772 2.70225 25.6894 0.799641 23.3605 0.799641C21.0326 0.799641 19.1448 2.70225 19.1448 5.0501C19.1448 5.44415 19.1983 5.82539 19.2982 6.18745L19.9207 7.50952ZM23.3596 2.3539C24.8354 2.3539 26.0343 3.56349 26.0343 5.0501C26.0343 6.5367 24.8345 7.74628 23.3596 7.74628C21.8848 7.74628 20.6859 6.5367 20.6859 5.0501C20.6859 3.56349 21.8857 2.3539 23.3596 2.3539Z" fill="black"/>
|
4
|
+
<path d="M35.2217 7.94007H38.7686L42.2737 16.1868L45.7706 7.94007H49.2994L43.3955 21.9156H41.1383L35.2217 7.94007Z" fill="#1B1B1B"/>
|
5
|
+
<path d="M65.2318 15.9428H54.0493C54.2109 16.9366 54.642 17.7265 55.3435 18.3125C56.0451 18.8995 56.9391 19.1921 58.0273 19.1921C59.3279 19.1921 60.446 18.734 61.3808 17.8179L64.3133 19.2049C63.5818 20.2499 62.7068 21.0224 61.6867 21.5235C60.6666 22.0245 59.4549 22.275 58.0527 22.275C55.8763 22.275 54.1038 21.5838 52.7351 20.2005C51.3665 18.8181 50.6821 17.0856 50.6821 15.0047C50.6821 12.8726 51.3646 11.1017 52.7288 9.6937C54.0929 8.28481 55.8037 7.58082 57.8612 7.58082C60.0458 7.58082 61.8228 8.28572 63.1915 9.6937C64.5601 11.1026 65.2445 12.9622 65.2445 15.2744L65.2318 15.9428ZM61.7511 13.1816C61.5215 12.4027 61.0677 11.7691 60.3907 11.2809C59.7136 10.7927 58.9285 10.5485 58.0345 10.5485C57.0643 10.5485 56.2121 10.8228 55.4806 11.3705C55.0204 11.7133 54.5948 12.3167 54.2036 13.1816H61.7511Z" fill="#1B1B1B"/>
|
6
|
+
<path d="M67.6675 2.5459H71.1481V21.9157H67.6675V2.5459Z" fill="#1B1B1B"/>
|
7
|
+
<path d="M80.8265 7.58082C82.1353 7.58082 83.366 7.91087 84.5177 8.57006C85.6694 9.22925 86.5689 10.1243 87.2142 11.2544C87.8604 12.3844 88.1835 13.605 88.1835 14.9151C88.1835 16.2335 87.8586 17.4668 87.2078 18.6143C86.5571 19.7617 85.6713 20.6586 84.5495 21.305C83.4277 21.9513 82.1906 22.275 80.8392 22.275C78.8498 22.275 77.1517 21.5619 75.7449 20.1365C74.3381 18.7112 73.6348 16.9786 73.6348 14.9407C73.6348 12.7574 74.4298 10.9371 76.019 9.48159C77.4131 8.21441 79.0159 7.58082 80.8265 7.58082ZM80.8837 10.8823C79.8019 10.8823 78.9015 11.2608 78.1827 12.0187C77.463 12.7766 77.1036 13.7467 77.1036 14.9279C77.1036 16.1439 77.4594 17.1286 78.17 17.8819C78.8807 18.6353 79.781 19.012 80.871 19.012C81.961 19.012 82.8677 18.6307 83.592 17.8691C84.3153 17.1075 84.6774 16.1265 84.6774 14.9279C84.6774 13.7293 84.3217 12.7547 83.611 12.0059C82.8995 11.2571 81.991 10.8823 80.8837 10.8823Z" fill="#1B1B1B"/>
|
8
|
+
<path d="M104.607 10.7661L101.709 12.3715C101.165 11.7983 100.626 11.3997 100.095 11.1766C99.5628 10.9544 98.9393 10.8429 98.2241 10.8429C96.9217 10.8429 95.8689 11.2342 95.0648 12.0159C94.2606 12.7985 93.8586 13.8005 93.8586 15.0229C93.8586 16.2115 94.2461 17.1824 95.0203 17.934C95.7945 18.6864 96.8119 19.0622 98.0716 19.0622C99.629 19.0622 100.842 18.5273 101.71 17.4567L104.455 19.3502C102.967 21.2994 100.867 22.274 98.156 22.274C95.7164 22.274 93.8059 21.5463 92.4246 20.0907C91.0432 18.6352 90.3525 16.931 90.3525 14.9781C90.3525 13.625 90.6883 12.3789 91.36 11.2406C92.0316 10.1014 92.9682 9.20725 94.1717 8.55628C95.3742 7.90532 96.7193 7.57984 98.2077 7.57984C99.5846 7.57984 100.822 7.85595 101.918 8.40817C103.013 8.96131 103.91 9.74758 104.607 10.7661Z" fill="#1B1B1B"/>
|
9
|
+
<path d="M109.101 2.18567C109.711 2.18567 110.235 2.40875 110.672 2.854C111.108 3.29925 111.326 3.83867 111.326 4.47226C111.326 5.09762 111.11 5.63064 110.678 6.07132C110.246 6.51292 109.729 6.73325 109.127 6.73325C108.508 6.73325 107.981 6.50834 107.544 6.05852C107.107 5.6087 106.89 5.06288 106.89 4.42106C106.89 3.80484 107.106 3.27822 107.538 2.8412C107.97 2.40417 108.491 2.18567 109.101 2.18567ZM107.361 7.94009H110.842V21.9157H107.361V7.94009Z" fill="#1B1B1B"/>
|
10
|
+
<path d="M114.426 2.79H117.906V7.94101H119.972V10.9599H117.906V21.9166H114.426V10.959H112.641V7.9401H114.426V2.79Z" fill="#1B1B1B"/>
|
11
|
+
<path d="M120.294 7.94007H123.852L127.456 16.7089L131.432 7.94007H135L126.311 27.0273H122.716L125.569 20.8725L120.294 7.94007Z" fill="#1B1B1B"/>
|
12
|
+
</svg>
|
Binary file
|
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
6
|
+
<meta name="theme-color" content="#000000">
|
7
|
+
<!--
|
8
|
+
manifest.json provides metadata used when your web app is added to the
|
9
|
+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
10
|
+
-->
|
11
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
12
|
+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
13
|
+
<!--
|
14
|
+
Notice the use of %PUBLIC_URL% in the tags above.
|
15
|
+
It will be replaced with the URL of the `public` folder during the build.
|
16
|
+
Only files inside the `public` folder can be referenced from the HTML.
|
17
|
+
|
18
|
+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
19
|
+
work correctly both with client-side routing and a non-root public URL.
|
20
|
+
Learn how to configure a non-root public URL by running `npm run build`.
|
21
|
+
-->
|
22
|
+
<title>Velocity Network Registrar</title>
|
23
|
+
</head>
|
24
|
+
<body>
|
25
|
+
<noscript>
|
26
|
+
You need to enable JavaScript to run this app.
|
27
|
+
</noscript>
|
28
|
+
<div id="root"></div>
|
29
|
+
<!--
|
30
|
+
This HTML file is a template.
|
31
|
+
If you open it directly in the browser, you will see an empty page.
|
32
|
+
|
33
|
+
You can add webfonts, meta tags, or analytics to this file.
|
34
|
+
The build step will place the bundled scripts into the <body> tag.
|
35
|
+
|
36
|
+
To begin the development, run `npm start` or `yarn start`.
|
37
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
38
|
+
-->
|
39
|
+
</body>
|
40
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"short_name": "Registrar",
|
3
|
+
"name": "Velocity Network Registrar",
|
4
|
+
"icons": [
|
5
|
+
{
|
6
|
+
"src": "favicon.png",
|
7
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
8
|
+
"type": "image/x-icon"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"start_url": "./index.html",
|
12
|
+
"display": "standalone",
|
13
|
+
"theme_color": "#000000",
|
14
|
+
"background_color": "#ffffff"
|
15
|
+
}
|
package/src/App.jsx
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2025 Velocity Team
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*
|
16
|
+
*/
|
17
|
+
|
18
|
+
import { Route, useLocation, useNavigate } from 'react-router-dom';
|
19
|
+
import { CustomRoutes, Resource } from 'react-admin';
|
20
|
+
import React from 'react';
|
21
|
+
import { Auth0Provider } from '@auth0/auth0-react';
|
22
|
+
import OrganizationIcon from '@mui/icons-material/Business';
|
23
|
+
import {
|
24
|
+
OrganizationShow,
|
25
|
+
OrganizationEdit,
|
26
|
+
OrganizationCreate,
|
27
|
+
} from '@velocitycareerlabs/components-organizations-registrar/pages/organizations';
|
28
|
+
import {
|
29
|
+
IndividualsDashboard,
|
30
|
+
IndividualsShow,
|
31
|
+
IndividualsEdit,
|
32
|
+
} from '@velocitycareerlabs/components-organizations-registrar/pages/individuals';
|
33
|
+
import { ServicesList } from '@velocitycareerlabs/components-organizations-registrar/pages/services';
|
34
|
+
import {
|
35
|
+
CreateOrganisationFromInvitation,
|
36
|
+
InvitationsList,
|
37
|
+
} from '@velocitycareerlabs/components-organizations-registrar/pages/invitations';
|
38
|
+
import {
|
39
|
+
PrivacyPolicy,
|
40
|
+
TermsAndConditions,
|
41
|
+
SignatoryLanding,
|
42
|
+
} from '@velocitycareerlabs/components-organizations-registrar/pages';
|
43
|
+
import { Dashboard } from '@velocitycareerlabs/components-organizations-registrar/components';
|
44
|
+
import {
|
45
|
+
defaultOAuthScopes,
|
46
|
+
registrarApiScopes,
|
47
|
+
PublicAppRoot,
|
48
|
+
PrivateAppRoot,
|
49
|
+
useConfig,
|
50
|
+
} from '@velocitycareerlabs/components-organizations-registrar';
|
51
|
+
import { AuthProviderBridge } from './AuthProviderBridge.jsx';
|
52
|
+
|
53
|
+
const PublicRoutes = ['/privacy-policy', '/terms-and-conditions', /^\/signatories\/[^/]+$/];
|
54
|
+
|
55
|
+
const isPublicRoute = (pathname) =>
|
56
|
+
PublicRoutes.some((route) =>
|
57
|
+
typeof route === 'string' ? route === pathname : route.test(pathname),
|
58
|
+
);
|
59
|
+
|
60
|
+
const App = () => {
|
61
|
+
const location = useLocation();
|
62
|
+
if (isPublicRoute(location.pathname)) {
|
63
|
+
return (
|
64
|
+
<PublicAppRoot>
|
65
|
+
<Route path="/privacy-policy" element={<PrivacyPolicy />} />
|
66
|
+
<Route path="/terms-and-conditions" element={<TermsAndConditions />} />
|
67
|
+
<Route path="/signatories/:response" element={<SignatoryLanding />} />
|
68
|
+
</PublicAppRoot>
|
69
|
+
);
|
70
|
+
}
|
71
|
+
|
72
|
+
return <PrivateRegistrarApp />;
|
73
|
+
};
|
74
|
+
|
75
|
+
const PrivateRegistrarApp = () => {
|
76
|
+
const config = useConfig();
|
77
|
+
const navigate = useNavigate();
|
78
|
+
const onRedirectCallback = (appState) => {
|
79
|
+
navigate(appState?.returnTo || window.location.pathname);
|
80
|
+
};
|
81
|
+
|
82
|
+
return (
|
83
|
+
<Auth0Provider
|
84
|
+
domain={config.authConfig.domain}
|
85
|
+
clientId={config.authConfig.clientId}
|
86
|
+
useRefreshTokens
|
87
|
+
cacheLocation="localstorage"
|
88
|
+
onRedirectCallback={onRedirectCallback}
|
89
|
+
authorizationParams={{
|
90
|
+
audience: config.authConfig.audience,
|
91
|
+
scope: `${registrarApiScopes} ${defaultOAuthScopes}`,
|
92
|
+
redirect_uri: config.authConfig.redirectUri,
|
93
|
+
connection: config.authConfig.connection,
|
94
|
+
}}
|
95
|
+
>
|
96
|
+
<AuthProviderBridge config={config}>
|
97
|
+
<PrivateAppRoot>
|
98
|
+
<Resource
|
99
|
+
name="organizations"
|
100
|
+
icon={OrganizationIcon}
|
101
|
+
show={OrganizationShow}
|
102
|
+
list={Dashboard}
|
103
|
+
edit={OrganizationEdit}
|
104
|
+
create={OrganizationCreate}
|
105
|
+
/>
|
106
|
+
<Resource
|
107
|
+
name="individuals"
|
108
|
+
list={IndividualsDashboard}
|
109
|
+
show={IndividualsShow}
|
110
|
+
edit={IndividualsEdit}
|
111
|
+
/>
|
112
|
+
<Resource name="services" list={ServicesList} create={ServicesList} />
|
113
|
+
<Resource name="users" />
|
114
|
+
<Resource name="invitations" list={InvitationsList} create={InvitationsList} />
|
115
|
+
<CustomRoutes noLayout>
|
116
|
+
<Route exact path="/invitations/:code" element={<CreateOrganisationFromInvitation />} />
|
117
|
+
</CustomRoutes>
|
118
|
+
</PrivateAppRoot>
|
119
|
+
</AuthProviderBridge>
|
120
|
+
</Auth0Provider>
|
121
|
+
);
|
122
|
+
};
|
123
|
+
|
124
|
+
export default App;
|