datastake-daf 0.6.843 → 0.6.845
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/dist/components/index.js +1140 -1152
- package/dist/pages/index.js +21 -12
- package/package.json +1 -1
- package/src/@daf/core/components/EditForm/helper.js +14 -6
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +19 -6
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Accounts.jsx +4 -1
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +2 -0
- package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/config.js +10 -1
- package/src/@daf/pages/ResetPassword/index.jsx +228 -228
- package/src/@daf/pages/Template/components/LinkingTemplate/config.js +1 -0
- package/src/@daf/pages/Template/components/LinkingTemplate/index.jsx +3 -1
- package/src/@daf/services/LinkedSubjects.js +1 -0
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DafButton from "../../../Button/index.jsx";
|
|
3
|
+
import Loading from "../../../Loading/index.jsx";
|
|
4
|
+
import AuthForm from "../../../AuthForm/index.jsx";
|
|
5
|
+
|
|
6
|
+
const step = 1;
|
|
7
|
+
|
|
8
|
+
export default function ResetPassword({
|
|
9
|
+
resetRequestSuccedded,
|
|
10
|
+
resetRequestError,
|
|
11
|
+
submitting,
|
|
12
|
+
requestResetPassword,
|
|
13
|
+
resetPassword,
|
|
14
|
+
params: propParams = {},
|
|
15
|
+
Layout,
|
|
16
|
+
goTo,
|
|
17
|
+
t,
|
|
18
|
+
theme,
|
|
19
|
+
errors,
|
|
20
|
+
|
|
21
|
+
loginPath: loginPathProp,
|
|
22
|
+
}) {
|
|
23
|
+
const { app, confirmationToken } = propParams;
|
|
24
|
+
|
|
25
|
+
const getLogInLink = () => {
|
|
26
|
+
if (loginPathProp) return loginPathProp;
|
|
27
|
+
if (app) return `/${app}/login`;
|
|
28
|
+
return "/login";
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const handleGoToLogin = () => {
|
|
32
|
+
const link = getLogInLink();
|
|
33
|
+
if (goTo && typeof goTo === "function") {
|
|
34
|
+
goTo(link);
|
|
35
|
+
} else {
|
|
36
|
+
window.location.href = link;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const title = !confirmationToken
|
|
41
|
+
? resetRequestSuccedded
|
|
42
|
+
? "Thank you"
|
|
43
|
+
: "Reset Password"
|
|
44
|
+
: resetRequestSuccedded
|
|
45
|
+
? "Password updated"
|
|
46
|
+
: "Create Password";
|
|
47
|
+
|
|
48
|
+
const subTitle = !confirmationToken
|
|
49
|
+
? resetRequestSuccedded
|
|
50
|
+
? "A password reset link has been sent to your email address. If you can’t find the message in your inbox, please check your spam folder!"
|
|
51
|
+
: "Please enter your email, to get a link and request a new password."
|
|
52
|
+
: resetRequestSuccedded
|
|
53
|
+
? "Your password has been updated, click in the button below to log in."
|
|
54
|
+
: "Please set up your new password.";
|
|
55
|
+
|
|
56
|
+
const requestResetFields = [
|
|
57
|
+
{
|
|
58
|
+
name: "email",
|
|
59
|
+
label: t("Email"),
|
|
60
|
+
type: "input",
|
|
61
|
+
required: true,
|
|
62
|
+
rules: [
|
|
63
|
+
{
|
|
64
|
+
required: true,
|
|
65
|
+
message: t("errors::email should not be empty"),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
pattern:
|
|
69
|
+
/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
|
|
70
|
+
message: t("errors::email is not valid"),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
placeholder: t("Email"),
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const resetPasswordFields = [
|
|
78
|
+
{
|
|
79
|
+
name: "password",
|
|
80
|
+
label: t("Enter password"),
|
|
81
|
+
type: "password",
|
|
82
|
+
required: true,
|
|
83
|
+
rules: [
|
|
84
|
+
{
|
|
85
|
+
required: true,
|
|
86
|
+
message: t("errors::password should not be empty"),
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
placeholder: t("••••••••"),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "confirmPassword",
|
|
93
|
+
label: t("Confirm password"),
|
|
94
|
+
type: "password",
|
|
95
|
+
required: true,
|
|
96
|
+
dependencies: ["password"],
|
|
97
|
+
rules: [
|
|
98
|
+
{
|
|
99
|
+
required: true,
|
|
100
|
+
message: t("errors::password should not be empty"),
|
|
101
|
+
},
|
|
102
|
+
({ getFieldValue }) => ({
|
|
103
|
+
validator(rule, value) {
|
|
104
|
+
if (!value || getFieldValue("password") === value) {
|
|
105
|
+
return Promise.resolve();
|
|
106
|
+
}
|
|
107
|
+
return Promise.reject(t("errors::passwordNotMatch"));
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
],
|
|
111
|
+
placeholder: t("••••••••"),
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
const handleRequestResetSubmit = (values) => {
|
|
116
|
+
requestResetPassword(values);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const handleResetPasswordSubmit = (values) => {
|
|
120
|
+
|
|
121
|
+
resetPassword({
|
|
122
|
+
...values,
|
|
123
|
+
passConfirmationToken: confirmationToken,
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const currentTheme = theme || window.theme;
|
|
128
|
+
|
|
129
|
+
const Content = (
|
|
130
|
+
<>
|
|
131
|
+
{!resetRequestSuccedded && !confirmationToken && (
|
|
132
|
+
<>
|
|
133
|
+
<AuthForm
|
|
134
|
+
fields={requestResetFields}
|
|
135
|
+
onSubmit={handleRequestResetSubmit}
|
|
136
|
+
submitText={t("Get Link")}
|
|
137
|
+
errors={errors}
|
|
138
|
+
t={t}
|
|
139
|
+
executeRecaptcha={() => Promise.resolve(true)}
|
|
140
|
+
theme={currentTheme}
|
|
141
|
+
submitButtonProps={{
|
|
142
|
+
loading: submitting,
|
|
143
|
+
}}
|
|
144
|
+
/>
|
|
145
|
+
<div className="mt-4">
|
|
146
|
+
<DafButton
|
|
147
|
+
type="default"
|
|
148
|
+
className="normal-br"
|
|
149
|
+
style={
|
|
150
|
+
currentTheme
|
|
151
|
+
? {
|
|
152
|
+
borderColor: currentTheme.colorPrimary,
|
|
153
|
+
color: currentTheme.colorPrimary,
|
|
154
|
+
}
|
|
155
|
+
: {}
|
|
156
|
+
}
|
|
157
|
+
onClick={handleGoToLogin}
|
|
158
|
+
>
|
|
159
|
+
{t("Back")}
|
|
160
|
+
</DafButton>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
{resetRequestError ? (
|
|
164
|
+
<div
|
|
165
|
+
className="ant-form-item-explain errors-cont no-pt mt-3"
|
|
166
|
+
style={{ color: "#ff4d4f" }}
|
|
167
|
+
>
|
|
168
|
+
{t(resetRequestError)}
|
|
169
|
+
</div>
|
|
170
|
+
) : null}
|
|
171
|
+
</>
|
|
172
|
+
)}
|
|
173
|
+
|
|
174
|
+
{!resetRequestSuccedded && confirmationToken && (
|
|
175
|
+
<AuthForm
|
|
176
|
+
fields={resetPasswordFields}
|
|
177
|
+
onSubmit={handleResetPasswordSubmit}
|
|
178
|
+
submitText={t("Reset Password")}
|
|
179
|
+
errors={errors}
|
|
180
|
+
t={t}
|
|
181
|
+
executeRecaptcha={() => Promise.resolve(true)}
|
|
182
|
+
theme={currentTheme}
|
|
183
|
+
submitButtonProps={{
|
|
184
|
+
loading: submitting,
|
|
185
|
+
}}
|
|
186
|
+
/>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{resetRequestSuccedded && confirmationToken && (
|
|
190
|
+
<div className="buttons">
|
|
191
|
+
<DafButton
|
|
192
|
+
type="primary"
|
|
193
|
+
className="normal-br"
|
|
194
|
+
style={
|
|
195
|
+
currentTheme
|
|
196
|
+
? {
|
|
197
|
+
backgroundColor: currentTheme.colorPrimary,
|
|
198
|
+
borderColor: currentTheme.colorPrimary,
|
|
199
|
+
}
|
|
200
|
+
: {}
|
|
201
|
+
}
|
|
202
|
+
onClick={handleGoToLogin}
|
|
203
|
+
>
|
|
204
|
+
{t("Log In")}
|
|
205
|
+
</DafButton>
|
|
206
|
+
</div>
|
|
207
|
+
)}
|
|
208
|
+
|
|
209
|
+
{resetRequestSuccedded && !confirmationToken && null}
|
|
210
|
+
</>
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
if (Layout) {
|
|
214
|
+
return (
|
|
215
|
+
<Layout app={app} step={step} title={title} subTitle={subTitle}>
|
|
216
|
+
{Content}
|
|
217
|
+
</Layout>
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<div style={{ padding: 20, maxWidth: 400, margin: "0 auto" }}>
|
|
223
|
+
<h2>{title}</h2>
|
|
224
|
+
<p>{subTitle}</p>
|
|
225
|
+
{Content}
|
|
226
|
+
</div>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
@@ -44,7 +44,9 @@ const LinkingTemplate = ({
|
|
|
44
44
|
|
|
45
45
|
const dataSource = conf?.linkingTemplateContextData?.[id];
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
// Derive namespace from conf.allData.form if not provided
|
|
48
|
+
const derivedNamespace = namespace || conf.allData?.form;
|
|
49
|
+
const _namespace = namespaceMap[derivedNamespace] || derivedNamespace;
|
|
48
50
|
|
|
49
51
|
const changeData = async () => {
|
|
50
52
|
try {
|