datastake-daf 0.6.809 → 0.6.810
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/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/dist/components/index.js +215 -527
- package/dist/hooks/index.js +4 -11
- package/dist/pages/index.js +228 -224
- package/dist/services/index.js +5 -19
- package/dist/utils/index.js +5 -24
- package/package.json +1 -1
- package/src/@daf/core/components/AuthForm/index.jsx +3 -12
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +3 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +51 -51
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +1 -6
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +12 -47
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewUser/index.jsx +10 -36
- package/src/@daf/core/components/Screens/Admin/AdminModals/TransferRights/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Accounts.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/helper.js +30 -22
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +3 -4
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +2 -6
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +12 -14
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/hook.js +0 -3
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +9 -12
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +4 -16
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/View/helpers.js +17 -9
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +8 -9
- package/src/@daf/core/components/Screens/Admin/AppInvitation/index.jsx +99 -124
- package/src/@daf/hooks/useAdminDashboard.js +4 -7
- package/src/@daf/pages/Locations/MineSite/columns.js +18 -1
- package/src/@daf/pages/Locations/MineSite/config.js +2 -2
- package/src/@daf/services/AdminService.js +4 -15
- package/src/@daf/services/DashboardService.js +3 -3
- package/src/@daf/utils/filters.js +15 -13
- package/src/constants/locales/en/translation.js +0 -9
package/dist/components/index.js
CHANGED
|
@@ -42089,10 +42089,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
|
|
|
42089
42089
|
}
|
|
42090
42090
|
});
|
|
42091
42091
|
if (hasChanges) {
|
|
42092
|
-
setValues(prevValues => ({
|
|
42093
|
-
...prevValues,
|
|
42094
|
-
...resolvedValues
|
|
42095
|
-
}));
|
|
42092
|
+
setValues(prevValues => _objectSpread2(_objectSpread2({}, prevValues), resolvedValues));
|
|
42096
42093
|
MainForm.setFieldsValue(resolvedValues);
|
|
42097
42094
|
}
|
|
42098
42095
|
}, [values, parentValues, combinedPrefilledValues, setValues, MainForm]);
|
|
@@ -42954,17 +42951,12 @@ function AuthForm(_ref) {
|
|
|
42954
42951
|
errors,
|
|
42955
42952
|
t = key => key,
|
|
42956
42953
|
executeRecaptcha = () => {},
|
|
42957
|
-
getCurrentStep = () => {}
|
|
42958
|
-
theme
|
|
42954
|
+
getCurrentStep = () => {}
|
|
42959
42955
|
} = _ref;
|
|
42960
42956
|
const [formInstance] = antd.Form.useForm(form);
|
|
42961
42957
|
const [currentStep, setCurrentStep] = React.useState(0);
|
|
42962
42958
|
const [allFormValues, setAllFormValues] = React.useState(initialValues);
|
|
42963
42959
|
const [formErrors, setFormErrors] = React.useState(null);
|
|
42964
|
-
const buttonStyle = theme !== null && theme !== void 0 && theme.colorPrimary ? {
|
|
42965
|
-
backgroundColor: theme.colorPrimary,
|
|
42966
|
-
borderColor: theme.colorPrimary
|
|
42967
|
-
} : {};
|
|
42968
42960
|
const isMultiStep = !!steps;
|
|
42969
42961
|
const currentFields = isMultiStep ? steps === null || steps === void 0 || (_steps$currentStep = steps[currentStep]) === null || _steps$currentStep === void 0 ? void 0 : _steps$currentStep.fields : fields || [];
|
|
42970
42962
|
React.useEffect(() => {
|
|
@@ -43105,7 +43097,6 @@ function AuthForm(_ref) {
|
|
|
43105
43097
|
name: field.name,
|
|
43106
43098
|
label: field.label,
|
|
43107
43099
|
rules: field.rules,
|
|
43108
|
-
dependencies: field.dependencies,
|
|
43109
43100
|
style: {
|
|
43110
43101
|
marginBottom: 0
|
|
43111
43102
|
}
|
|
@@ -43152,7 +43143,6 @@ function AuthForm(_ref) {
|
|
|
43152
43143
|
disabled: isLastStep && !allFieldsFilled,
|
|
43153
43144
|
block: true,
|
|
43154
43145
|
className: "normal-br",
|
|
43155
|
-
style: buttonStyle,
|
|
43156
43146
|
children: isLastStep ? submitText : t("Next")
|
|
43157
43147
|
})
|
|
43158
43148
|
});
|
|
@@ -43166,7 +43156,6 @@ function AuthForm(_ref) {
|
|
|
43166
43156
|
onClick: prev,
|
|
43167
43157
|
block: true,
|
|
43168
43158
|
className: "normal-br",
|
|
43169
|
-
style: buttonStyle,
|
|
43170
43159
|
children: t("Back")
|
|
43171
43160
|
})
|
|
43172
43161
|
})]
|
|
@@ -43180,7 +43169,6 @@ function AuthForm(_ref) {
|
|
|
43180
43169
|
htmlType: "submit",
|
|
43181
43170
|
block: true,
|
|
43182
43171
|
className: "normal-br",
|
|
43183
|
-
style: buttonStyle,
|
|
43184
43172
|
children: isMultiStep ? t("Next") : submitText
|
|
43185
43173
|
})
|
|
43186
43174
|
})]
|
|
@@ -45572,15 +45560,14 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
45572
45560
|
});
|
|
45573
45561
|
return o;
|
|
45574
45562
|
};
|
|
45575
|
-
const NEW_PAGINATION_APPS = ["nashiriki"];
|
|
45576
45563
|
const filterParams = (value, module) => {
|
|
45577
45564
|
const {
|
|
45578
45565
|
activeFilters,
|
|
45579
45566
|
...rest
|
|
45580
45567
|
} = value;
|
|
45581
45568
|
const {
|
|
45582
|
-
page,
|
|
45583
|
-
pageSize,
|
|
45569
|
+
page = 1,
|
|
45570
|
+
pageSize = 20,
|
|
45584
45571
|
sortDir,
|
|
45585
45572
|
sortBy,
|
|
45586
45573
|
search,
|
|
@@ -45589,9 +45576,10 @@ const filterParams = (value, module) => {
|
|
|
45589
45576
|
} = activeFilters || {};
|
|
45590
45577
|
const params = {};
|
|
45591
45578
|
params.pagination = JSON.stringify({
|
|
45592
|
-
|
|
45593
|
-
|
|
45579
|
+
page,
|
|
45580
|
+
pageSize
|
|
45594
45581
|
});
|
|
45582
|
+
params.filters = JSON.stringify(filters);
|
|
45595
45583
|
if (search && searchParams) {
|
|
45596
45584
|
params.search = JSON.stringify({
|
|
45597
45585
|
qs: search,
|
|
@@ -45604,16 +45592,6 @@ const filterParams = (value, module) => {
|
|
|
45604
45592
|
by: sortBy
|
|
45605
45593
|
});
|
|
45606
45594
|
}
|
|
45607
|
-
if (Object.keys(filters).length) {
|
|
45608
|
-
if (value.sourceId && value.sourceId === "overview") {
|
|
45609
|
-
params.filters = JSON.stringify(filters);
|
|
45610
|
-
} else {
|
|
45611
|
-
params.filters = JSON.stringify({
|
|
45612
|
-
...filters,
|
|
45613
|
-
authorId: undefined
|
|
45614
|
-
});
|
|
45615
|
-
}
|
|
45616
|
-
}
|
|
45617
45595
|
return {
|
|
45618
45596
|
...rest,
|
|
45619
45597
|
...params
|
|
@@ -51971,27 +51949,33 @@ const BaseScreen = _ref => {
|
|
|
51971
51949
|
|
|
51972
51950
|
function AppInvitation(_ref) {
|
|
51973
51951
|
let {
|
|
51952
|
+
// Redux State
|
|
51974
51953
|
errors,
|
|
51975
51954
|
user,
|
|
51976
51955
|
invitationSuccess,
|
|
51956
|
+
// Actions
|
|
51977
51957
|
confirmInvitation,
|
|
51978
51958
|
getUserFromInvitation,
|
|
51979
|
-
|
|
51959
|
+
// Configuration
|
|
51980
51960
|
Layout,
|
|
51981
51961
|
redirectPath = "/",
|
|
51982
51962
|
loginPath = "/login",
|
|
51983
51963
|
appRedirectPath = "/app",
|
|
51984
|
-
params: propParams = {}
|
|
51985
|
-
goTo,
|
|
51986
|
-
isMobile = false,
|
|
51987
|
-
t
|
|
51964
|
+
params: propParams = {}
|
|
51988
51965
|
} = _ref;
|
|
51966
|
+
const {
|
|
51967
|
+
t
|
|
51968
|
+
} = useTranslation();
|
|
51969
|
+
const routeParams = useParams();
|
|
51989
51970
|
const {
|
|
51990
51971
|
app,
|
|
51991
51972
|
companyCode,
|
|
51992
51973
|
userCode
|
|
51993
|
-
} = propParams;
|
|
51974
|
+
} = _objectSpread2(_objectSpread2({}, routeParams), propParams);
|
|
51975
|
+
const [passwords] = antd.Form.useForm();
|
|
51994
51976
|
const [checking, setChecking] = React.useState(true);
|
|
51977
|
+
const goTo = useNavigate();
|
|
51978
|
+
const [termsAgreed, setTermsAgreed] = React.useState(false);
|
|
51995
51979
|
const [passwordReseted, setPasswordReseted] = React.useState(false);
|
|
51996
51980
|
React.useEffect(() => {
|
|
51997
51981
|
if (companyCode && userCode) {
|
|
@@ -52012,114 +51996,32 @@ function AppInvitation(_ref) {
|
|
|
52012
51996
|
localStorage.setItem('token', data.token);
|
|
52013
51997
|
}
|
|
52014
51998
|
antd.message.success(t('Invitation accepted'));
|
|
52015
|
-
|
|
52016
|
-
|
|
52017
|
-
|
|
52018
|
-
window.location.href = redirectPath;
|
|
52019
|
-
}
|
|
51999
|
+
// Fix: ensure we don't rely on a variable from useParams that might not exist
|
|
52000
|
+
// Just use the configured redirectPath
|
|
52001
|
+
goTo(redirectPath);
|
|
52020
52002
|
}, {
|
|
52021
52003
|
companyCode,
|
|
52022
52004
|
userCode
|
|
52023
52005
|
});
|
|
52024
52006
|
}
|
|
52025
52007
|
}, [invitationSuccess, user, confirmInvitation, goTo, redirectPath, companyCode, userCode, t]);
|
|
52026
|
-
|
|
52027
|
-
|
|
52028
|
-
|
|
52029
|
-
|
|
52030
|
-
|
|
52031
|
-
|
|
52032
|
-
} else {
|
|
52033
|
-
window.location.href = appRedirectPath;
|
|
52034
|
-
}
|
|
52035
|
-
} else {
|
|
52036
|
-
if (goTo && typeof goTo === 'function') {
|
|
52037
|
-
goTo(redirectPath);
|
|
52038
|
-
} else {
|
|
52039
|
-
window.location.href = redirectPath;
|
|
52040
|
-
}
|
|
52041
|
-
}
|
|
52042
|
-
}
|
|
52043
|
-
}, [user, goTo, appRedirectPath, redirectPath, checking, invitationSuccess]);
|
|
52008
|
+
const displayError = name => {
|
|
52009
|
+
return errors && errors[name] && errors[name].length > 0 && {
|
|
52010
|
+
help: errors[name][0],
|
|
52011
|
+
validateStatus: 'error'
|
|
52012
|
+
};
|
|
52013
|
+
};
|
|
52044
52014
|
const subTitle = !passwordReseted ? 'Set up your password and agree with out terms and conditions.' : isMobile ? 'Your account has been successfully set up. To log in use a desktop device.' : 'Your account has been successfully set up. Please click the button below to log in.';
|
|
52045
52015
|
const title = passwordReseted ? 'Thank You!' : undefined;
|
|
52046
|
-
const fields = [{
|
|
52047
|
-
name: 'email',
|
|
52048
|
-
label: t("Email"),
|
|
52049
|
-
type: 'input',
|
|
52050
|
-
disabled: true
|
|
52051
|
-
}, {
|
|
52052
|
-
name: 'password',
|
|
52053
|
-
label: t("Password"),
|
|
52054
|
-
type: 'password',
|
|
52055
|
-
required: true,
|
|
52056
|
-
rules: [{
|
|
52057
|
-
required: true,
|
|
52058
|
-
message: t("errors::password should not be empty")
|
|
52059
|
-
}],
|
|
52060
|
-
placeholder: t("Password")
|
|
52061
|
-
}, {
|
|
52062
|
-
name: 'confirmPassword',
|
|
52063
|
-
label: t("Confirm Password"),
|
|
52064
|
-
type: 'password',
|
|
52065
|
-
required: true,
|
|
52066
|
-
dependencies: ['password'],
|
|
52067
|
-
rules: [{
|
|
52068
|
-
required: true,
|
|
52069
|
-
message: t("errors::password should not be empty")
|
|
52070
|
-
}, _ref2 => {
|
|
52071
|
-
let {
|
|
52072
|
-
getFieldValue
|
|
52073
|
-
} = _ref2;
|
|
52074
|
-
return {
|
|
52075
|
-
validator(rule, value) {
|
|
52076
|
-
if (!value || getFieldValue('password') === value) {
|
|
52077
|
-
return Promise.resolve();
|
|
52078
|
-
}
|
|
52079
|
-
return Promise.reject(t('errors::passwordNotMatch'));
|
|
52080
|
-
}
|
|
52081
|
-
};
|
|
52082
|
-
}],
|
|
52083
|
-
placeholder: t("Confirm Password")
|
|
52084
|
-
}, {
|
|
52085
|
-
name: 'mailUpdates',
|
|
52086
|
-
type: 'custom',
|
|
52087
|
-
valuePropName: 'checked',
|
|
52088
|
-
component: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
52089
|
-
children: t("Sign up to receive updates")
|
|
52090
|
-
})
|
|
52091
|
-
}, {
|
|
52092
|
-
name: 'agreeTerms',
|
|
52093
|
-
type: 'custom',
|
|
52094
|
-
valuePropName: 'checked',
|
|
52095
|
-
rules: [{
|
|
52096
|
-
validator: (_, value) => value ? Promise.resolve() : Promise.reject(new Error(t('You must agree to the terms and conditions')))
|
|
52097
|
-
}],
|
|
52098
|
-
component: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
52099
|
-
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
52100
|
-
className: "mb-0",
|
|
52101
|
-
children: t('Agree to the Terms of Use of this application and the Privacy Policy')
|
|
52102
|
-
})
|
|
52103
|
-
})
|
|
52104
|
-
}];
|
|
52105
|
-
const handleSubmit = values => {
|
|
52106
|
-
const {
|
|
52107
|
-
password,
|
|
52108
|
-
mailUpdates
|
|
52109
|
-
} = values;
|
|
52110
|
-
confirmInvitation({
|
|
52111
|
-
password,
|
|
52112
|
-
mailUpdates
|
|
52113
|
-
}, () => {}, {
|
|
52114
|
-
companyCode,
|
|
52115
|
-
userCode
|
|
52116
|
-
});
|
|
52117
|
-
setPasswordReseted(true);
|
|
52118
|
-
};
|
|
52119
52016
|
if (checking && !invitationSuccess) {
|
|
52120
52017
|
return /*#__PURE__*/jsxRuntime.jsx(Loading, {});
|
|
52121
52018
|
}
|
|
52019
|
+
|
|
52020
|
+
// If auto-confirming (inviteToken present), we might want to show loading or nothing until redirect
|
|
52122
52021
|
if (invitationSuccess && user && user.inviteToken) {
|
|
52022
|
+
// The useEffect will handle the redirect/confirm.
|
|
52023
|
+
// We can show loading here too or just return null.
|
|
52024
|
+
// Original code: checks invitationSuccess && !user.inviteToken for form, else redirect.
|
|
52123
52025
|
return /*#__PURE__*/jsxRuntime.jsx(Loading, {});
|
|
52124
52026
|
}
|
|
52125
52027
|
if (invitationSuccess && !user.inviteToken) {
|
|
@@ -52128,29 +52030,106 @@ function AppInvitation(_ref) {
|
|
|
52128
52030
|
children: isMobile ? null : /*#__PURE__*/jsxRuntime.jsx(DafButton, {
|
|
52129
52031
|
type: "primary",
|
|
52130
52032
|
className: "normal-br",
|
|
52131
|
-
style: theme || window.theme ? {
|
|
52132
|
-
backgroundColor: (theme || window.theme).colorPrimary,
|
|
52133
|
-
borderColor: (theme || window.theme).colorPrimary
|
|
52134
|
-
} : {},
|
|
52135
52033
|
onClick: () => {
|
|
52136
52034
|
window.location.href = loginPath;
|
|
52137
52035
|
},
|
|
52138
52036
|
children: t('Log In')
|
|
52139
52037
|
})
|
|
52140
|
-
}) : /*#__PURE__*/jsxRuntime.
|
|
52141
|
-
|
|
52142
|
-
|
|
52143
|
-
|
|
52144
|
-
|
|
52145
|
-
|
|
52146
|
-
|
|
52147
|
-
|
|
52148
|
-
|
|
52149
|
-
|
|
52150
|
-
|
|
52038
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
52039
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(antd.Form, {
|
|
52040
|
+
name: "password",
|
|
52041
|
+
layout: "vertical",
|
|
52042
|
+
form: passwords,
|
|
52043
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
52044
|
+
required: true,
|
|
52045
|
+
name: "password"
|
|
52046
|
+
}, displayError('password')), {}, {
|
|
52047
|
+
label: t("Password"),
|
|
52048
|
+
rules: [{
|
|
52049
|
+
required: true,
|
|
52050
|
+
message: t("errors::password should not be empty")
|
|
52051
|
+
}],
|
|
52052
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input.Password, {
|
|
52053
|
+
size: "large",
|
|
52054
|
+
placeholder: t("Password")
|
|
52055
|
+
})
|
|
52056
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
52057
|
+
required: true,
|
|
52058
|
+
name: "confirmPassword"
|
|
52059
|
+
}, displayError('confirmPassword')), {}, {
|
|
52060
|
+
label: t("Confirm Password"),
|
|
52061
|
+
dependencies: ['password'],
|
|
52062
|
+
rules: [{
|
|
52063
|
+
required: true,
|
|
52064
|
+
message: t("errors::password should not be empty")
|
|
52065
|
+
}, _ref2 => {
|
|
52066
|
+
let {
|
|
52067
|
+
getFieldValue
|
|
52068
|
+
} = _ref2;
|
|
52069
|
+
return {
|
|
52070
|
+
validator(rule, value) {
|
|
52071
|
+
if (!value || getFieldValue('password') === value) {
|
|
52072
|
+
return Promise.resolve();
|
|
52073
|
+
}
|
|
52074
|
+
return Promise.reject(t('errors::passwordNotMatch'));
|
|
52075
|
+
}
|
|
52076
|
+
};
|
|
52077
|
+
}],
|
|
52078
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input.Password, {
|
|
52079
|
+
size: "large",
|
|
52080
|
+
placeholder: t("Confirm Password")
|
|
52081
|
+
})
|
|
52082
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
52083
|
+
name: "mailUpdates",
|
|
52084
|
+
valuePropName: "checked",
|
|
52085
|
+
noStyle: true,
|
|
52086
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
52087
|
+
children: t("Sign up to receive updates")
|
|
52088
|
+
})
|
|
52089
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
52090
|
+
name: "agreeTerms",
|
|
52091
|
+
valuePropName: "checked",
|
|
52092
|
+
noStyle: true,
|
|
52093
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
52094
|
+
checked: termsAgreed,
|
|
52095
|
+
onChange: e => setTermsAgreed(e.target.checked),
|
|
52096
|
+
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
52097
|
+
className: "mb-0",
|
|
52098
|
+
children: t('Agree to the Terms of Use of this application and the Privacy Policy')
|
|
52099
|
+
})
|
|
52100
|
+
})
|
|
52101
|
+
})]
|
|
52102
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
52103
|
+
className: "buttons",
|
|
52104
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DafButton, {
|
|
52105
|
+
className: "normal-br",
|
|
52106
|
+
type: "primary",
|
|
52107
|
+
block: true,
|
|
52108
|
+
size: "large",
|
|
52109
|
+
disabled: !termsAgreed,
|
|
52110
|
+
onClick: () => {
|
|
52111
|
+
passwords.validateFields().then(data => {
|
|
52112
|
+
const {
|
|
52113
|
+
password,
|
|
52114
|
+
mailUpdates
|
|
52115
|
+
} = data;
|
|
52116
|
+
confirmInvitation({
|
|
52117
|
+
password,
|
|
52118
|
+
mailUpdates
|
|
52119
|
+
}, () => {}, {
|
|
52120
|
+
companyCode,
|
|
52121
|
+
userCode
|
|
52122
|
+
});
|
|
52123
|
+
setPasswordReseted(true);
|
|
52124
|
+
});
|
|
52125
|
+
},
|
|
52126
|
+
children: t("Confirm")
|
|
52127
|
+
})
|
|
52128
|
+
})]
|
|
52151
52129
|
})
|
|
52152
52130
|
});
|
|
52153
52131
|
if (Layout) {
|
|
52132
|
+
// Assuming Layout accepts these props as per Nashiriki AuthLayout
|
|
52154
52133
|
return /*#__PURE__*/jsxRuntime.jsx(Layout, {
|
|
52155
52134
|
app: app,
|
|
52156
52135
|
step: 1,
|
|
@@ -52172,7 +52151,11 @@ function AppInvitation(_ref) {
|
|
|
52172
52151
|
}), Content]
|
|
52173
52152
|
});
|
|
52174
52153
|
}
|
|
52175
|
-
return
|
|
52154
|
+
return user ? /*#__PURE__*/jsxRuntime.jsx(Navigate, {
|
|
52155
|
+
to: appRedirectPath
|
|
52156
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Navigate, {
|
|
52157
|
+
to: redirectPath
|
|
52158
|
+
});
|
|
52176
52159
|
}
|
|
52177
52160
|
|
|
52178
52161
|
/**
|
|
@@ -52498,6 +52481,7 @@ function useUserGrowth({
|
|
|
52498
52481
|
const {
|
|
52499
52482
|
token
|
|
52500
52483
|
} = useToken$6();
|
|
52484
|
+
console.log("mainData", mainData);
|
|
52501
52485
|
const fetchData = () => {
|
|
52502
52486
|
const {
|
|
52503
52487
|
dates = []
|
|
@@ -52633,11 +52617,12 @@ function UserGrowth({
|
|
|
52633
52617
|
t,
|
|
52634
52618
|
translationKeys
|
|
52635
52619
|
});
|
|
52620
|
+
console.log("usergrowthhhhh", data);
|
|
52636
52621
|
React.useEffect(() => {
|
|
52637
52622
|
if (typeof fetchUserGrowth === "function") {
|
|
52638
52623
|
fetchUserGrowth(selectValue);
|
|
52639
52624
|
}
|
|
52640
|
-
}, [selectValue
|
|
52625
|
+
}, [selectValue]);
|
|
52641
52626
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
52642
52627
|
title: t(`admin::user-growth`),
|
|
52643
52628
|
loading: loading,
|
|
@@ -52760,6 +52745,7 @@ function TopContributors({
|
|
|
52760
52745
|
data,
|
|
52761
52746
|
t
|
|
52762
52747
|
});
|
|
52748
|
+
console.log("topcontributorshhhh", data);
|
|
52763
52749
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
52764
52750
|
title: t(`admin::top-contributors`),
|
|
52765
52751
|
className: "with-border-header overflow-hidden h-w-btn-header",
|
|
@@ -53526,7 +53512,6 @@ function useAdminTable({
|
|
|
53526
53512
|
defaultPageSize: defaultPageSize || 20,
|
|
53527
53513
|
getRedirectLink
|
|
53528
53514
|
});
|
|
53529
|
-
console.log(filter, "filter.activeFilters");
|
|
53530
53515
|
const activeTab = React.useMemo(() => filter.activeFilters.activeTab, [filter.activeFilters]);
|
|
53531
53516
|
const canClearSearch = React.useMemo(() => {
|
|
53532
53517
|
return !!filter.activeFilters.search;
|
|
@@ -53558,7 +53543,6 @@ function useAdminTable({
|
|
|
53558
53543
|
const params = filterParams({
|
|
53559
53544
|
activeFilters: filter.activeFilters
|
|
53560
53545
|
});
|
|
53561
|
-
console.log(params, "params");
|
|
53562
53546
|
const {
|
|
53563
53547
|
data
|
|
53564
53548
|
} = await getData({
|
|
@@ -54004,7 +53988,11 @@ const getColumns$6 = ({
|
|
|
54004
53988
|
})
|
|
54005
53989
|
});
|
|
54006
53990
|
}
|
|
54007
|
-
const moreMenuItems = [{
|
|
53991
|
+
const moreMenuItems = !val.emailVerified ? [{
|
|
53992
|
+
label: t("admin::cancel-invitation"),
|
|
53993
|
+
value: "cancel",
|
|
53994
|
+
onClick: () => onCanelVerification(val)
|
|
53995
|
+
}] : [{
|
|
54008
53996
|
label: t("Edit"),
|
|
54009
53997
|
value: "edit",
|
|
54010
53998
|
onClick: () => setAddAccountVisible(val)
|
|
@@ -54341,246 +54329,23 @@ function CombineAccountModal({
|
|
|
54341
54329
|
});
|
|
54342
54330
|
}
|
|
54343
54331
|
|
|
54344
|
-
class AuthenticationService extends BaseService {
|
|
54345
|
-
register(form) {
|
|
54346
|
-
return this.apiPost({
|
|
54347
|
-
url: '/register',
|
|
54348
|
-
data: form
|
|
54349
|
-
});
|
|
54350
|
-
}
|
|
54351
|
-
login(username, password, firebaseToken, rest) {
|
|
54352
|
-
const headers = {
|
|
54353
|
-
CheckApplicationAccess: rest?.invited ? false : undefined
|
|
54354
|
-
};
|
|
54355
|
-
if (firebaseToken) {
|
|
54356
|
-
headers.FbToken = firebaseToken;
|
|
54357
|
-
headers.Platform = 'web';
|
|
54358
|
-
}
|
|
54359
|
-
return this.apiPost({
|
|
54360
|
-
url: rest?.invited ? '/auth/app-invitation' : '/login',
|
|
54361
|
-
data: rest?.invited ? {
|
|
54362
|
-
email: username,
|
|
54363
|
-
password,
|
|
54364
|
-
...rest,
|
|
54365
|
-
invited: undefined
|
|
54366
|
-
} : {
|
|
54367
|
-
email: username,
|
|
54368
|
-
password
|
|
54369
|
-
},
|
|
54370
|
-
headers
|
|
54371
|
-
});
|
|
54372
|
-
}
|
|
54373
|
-
updateCompany(id, data) {
|
|
54374
|
-
return this.apiPut({
|
|
54375
|
-
url: `/companies/${id}`,
|
|
54376
|
-
data,
|
|
54377
|
-
isDaf: true
|
|
54378
|
-
});
|
|
54379
|
-
}
|
|
54380
|
-
getApplications() {
|
|
54381
|
-
return this.apiGet({
|
|
54382
|
-
url: '/applications',
|
|
54383
|
-
isDaf: true
|
|
54384
|
-
});
|
|
54385
|
-
}
|
|
54386
|
-
getRegistrationData(code) {
|
|
54387
|
-
return this.apiGet({
|
|
54388
|
-
url: `requests/registration-data/${code}`,
|
|
54389
|
-
isUserManager: true
|
|
54390
|
-
});
|
|
54391
|
-
}
|
|
54392
|
-
getRegistrationOptions(data) {
|
|
54393
|
-
return this.apiPost({
|
|
54394
|
-
url: '/auth/registration-options',
|
|
54395
|
-
isDaf: true,
|
|
54396
|
-
data
|
|
54397
|
-
});
|
|
54398
|
-
}
|
|
54399
|
-
verify(code) {
|
|
54400
|
-
return this.apiGet({
|
|
54401
|
-
url: '/register/confirm',
|
|
54402
|
-
params: {
|
|
54403
|
-
token: code
|
|
54404
|
-
},
|
|
54405
|
-
isDaf: true
|
|
54406
|
-
});
|
|
54407
|
-
}
|
|
54408
|
-
exitImpersonation() {
|
|
54409
|
-
return this.apiGet({
|
|
54410
|
-
url: '/users/impersonate/exit'
|
|
54411
|
-
});
|
|
54412
|
-
}
|
|
54413
|
-
resetPasswordRequest(payload) {
|
|
54414
|
-
const lang = StorageManager.get('datastakeLng') || 'en';
|
|
54415
|
-
const req = {
|
|
54416
|
-
...payload,
|
|
54417
|
-
language: lang
|
|
54418
|
-
};
|
|
54419
|
-
return this.apiPut({
|
|
54420
|
-
url: '/profile/reset-password',
|
|
54421
|
-
data: req,
|
|
54422
|
-
headers: {
|
|
54423
|
-
Language: lang
|
|
54424
|
-
}
|
|
54425
|
-
});
|
|
54426
|
-
}
|
|
54427
|
-
changePassword(payload) {
|
|
54428
|
-
return this.apiPut({
|
|
54429
|
-
url: '/profile/change-password',
|
|
54430
|
-
data: payload
|
|
54431
|
-
});
|
|
54432
|
-
}
|
|
54433
|
-
resetPassword(payload) {
|
|
54434
|
-
return this.apiPut({
|
|
54435
|
-
url: '/forgot-password/reset',
|
|
54436
|
-
data: payload
|
|
54437
|
-
});
|
|
54438
|
-
}
|
|
54439
|
-
updateLanguage(language) {
|
|
54440
|
-
return this.apiPut({
|
|
54441
|
-
url: '/profile',
|
|
54442
|
-
data: {
|
|
54443
|
-
language
|
|
54444
|
-
}
|
|
54445
|
-
});
|
|
54446
|
-
}
|
|
54447
|
-
resendVerification() {
|
|
54448
|
-
return this.apiGet({
|
|
54449
|
-
url: '/auth/rverification'
|
|
54450
|
-
});
|
|
54451
|
-
}
|
|
54452
|
-
getInvitedUsers(id) {
|
|
54453
|
-
return this.apiGet({
|
|
54454
|
-
url: `/companies/${id}`
|
|
54455
|
-
});
|
|
54456
|
-
}
|
|
54457
|
-
inviteUser(payload, id) {
|
|
54458
|
-
if (id) {
|
|
54459
|
-
return this.apiPost({
|
|
54460
|
-
url: `/companies/${id}/invite`,
|
|
54461
|
-
data: payload
|
|
54462
|
-
});
|
|
54463
|
-
}
|
|
54464
|
-
return this.apiPost({
|
|
54465
|
-
url: '/companies/invite',
|
|
54466
|
-
data: payload
|
|
54467
|
-
});
|
|
54468
|
-
}
|
|
54469
|
-
confirmInvitation({
|
|
54470
|
-
password,
|
|
54471
|
-
mailUpdates
|
|
54472
|
-
}, token, code = {}) {
|
|
54473
|
-
return this.apiPost({
|
|
54474
|
-
url: `/register/${code.companyCode}/sub-user/${code.userCode}`,
|
|
54475
|
-
data: {
|
|
54476
|
-
password: password || '',
|
|
54477
|
-
mailUpdates
|
|
54478
|
-
},
|
|
54479
|
-
headers: token ? {
|
|
54480
|
-
Authorization: `Bearer ${token}`
|
|
54481
|
-
} : undefined
|
|
54482
|
-
});
|
|
54483
|
-
}
|
|
54484
|
-
getUserFromInvitation(code = {}) {
|
|
54485
|
-
return this.apiGet({
|
|
54486
|
-
url: `/companies/${code.companyCode}/sub-user/${code.userCode}`
|
|
54487
|
-
});
|
|
54488
|
-
}
|
|
54489
|
-
demoLogin(token) {
|
|
54490
|
-
return this.apiGet({
|
|
54491
|
-
url: `/demo/${token}`
|
|
54492
|
-
});
|
|
54493
|
-
}
|
|
54494
|
-
demoSignup(payload) {
|
|
54495
|
-
return this.apiPost({
|
|
54496
|
-
url: '/demo-signup',
|
|
54497
|
-
data: payload
|
|
54498
|
-
});
|
|
54499
|
-
}
|
|
54500
|
-
resendEmail(email) {
|
|
54501
|
-
return this.apiPost({
|
|
54502
|
-
url: `/register/resendConfirmation`,
|
|
54503
|
-
data: {
|
|
54504
|
-
email
|
|
54505
|
-
}
|
|
54506
|
-
});
|
|
54507
|
-
}
|
|
54508
|
-
editUserSettings(data = {}) {
|
|
54509
|
-
return this.apiPut({
|
|
54510
|
-
url: `/profile`,
|
|
54511
|
-
data
|
|
54512
|
-
});
|
|
54513
|
-
}
|
|
54514
|
-
editSubUser(data = {}) {
|
|
54515
|
-
return this.apiPut({
|
|
54516
|
-
url: `/users/updateRole/${data.id}`,
|
|
54517
|
-
data
|
|
54518
|
-
});
|
|
54519
|
-
}
|
|
54520
|
-
removeSubUser(companyId, userId) {
|
|
54521
|
-
return this.apiPut({
|
|
54522
|
-
url: `/companies/${companyId}/remove-user/${userId}`
|
|
54523
|
-
});
|
|
54524
|
-
}
|
|
54525
|
-
resendSubUserInvite(id) {
|
|
54526
|
-
return this.apiPost({
|
|
54527
|
-
url: `/companies/resendInvitation/${id}`
|
|
54528
|
-
});
|
|
54529
|
-
}
|
|
54530
|
-
getFormOptions({
|
|
54531
|
-
references = ['countries', 'categoriesOptions', 'subCategoriesOptions', 'locationCategoriesOptions', 'documentationTypesOptions'],
|
|
54532
|
-
language,
|
|
54533
|
-
...params
|
|
54534
|
-
}) {
|
|
54535
|
-
return this.apiPost({
|
|
54536
|
-
url: '/query/form-options',
|
|
54537
|
-
isDaf: true,
|
|
54538
|
-
data: {
|
|
54539
|
-
references,
|
|
54540
|
-
language
|
|
54541
|
-
}
|
|
54542
|
-
});
|
|
54543
|
-
}
|
|
54544
|
-
}
|
|
54545
|
-
var AuthenticationService$1 = createLazyService(AuthenticationService);
|
|
54546
|
-
|
|
54547
54332
|
function NewAccount({
|
|
54548
54333
|
t,
|
|
54549
54334
|
isOpen,
|
|
54550
54335
|
onClose,
|
|
54551
54336
|
accountTypes = [],
|
|
54552
54337
|
fetchData,
|
|
54553
|
-
inviteAccount
|
|
54554
|
-
selectOptions
|
|
54338
|
+
inviteAccount
|
|
54555
54339
|
}) {
|
|
54556
54340
|
const [MainForm] = antd.Form.useForm();
|
|
54557
54341
|
const [loading, setLoading] = React.useState(false);
|
|
54558
54342
|
const [accountUsed, setAccountUsed] = React.useState(false);
|
|
54559
|
-
const [countries, setCountries] = React.useState([]);
|
|
54560
|
-
React.useEffect(() => {
|
|
54561
|
-
const getCountries = async () => {
|
|
54562
|
-
try {
|
|
54563
|
-
const language = StorageManager.get("datastakeLng") || "en";
|
|
54564
|
-
const {
|
|
54565
|
-
data
|
|
54566
|
-
} = await AuthenticationService$1.getFormOptions({
|
|
54567
|
-
references: ["countries"],
|
|
54568
|
-
language
|
|
54569
|
-
});
|
|
54570
|
-
setCountries(data?.countries || []);
|
|
54571
|
-
} catch (e) {
|
|
54572
|
-
console.error(e);
|
|
54573
|
-
}
|
|
54574
|
-
};
|
|
54575
|
-
getCountries();
|
|
54576
|
-
}, []);
|
|
54577
54343
|
const isEdit = React.useMemo(() => isOpen && typeof isOpen === "object", [isOpen]);
|
|
54578
54344
|
React.useEffect(() => {
|
|
54579
54345
|
if (isOpen && typeof isOpen === "object") {
|
|
54580
54346
|
MainForm.setFieldsValue({
|
|
54581
54347
|
name: isOpen.name,
|
|
54582
|
-
|
|
54583
|
-
type: isOpen?.type
|
|
54348
|
+
email: isOpen?.admin?.email
|
|
54584
54349
|
});
|
|
54585
54350
|
} else {
|
|
54586
54351
|
MainForm.resetFields();
|
|
@@ -54620,21 +54385,17 @@ function NewAccount({
|
|
|
54620
54385
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
54621
54386
|
placeholder: t("Type")
|
|
54622
54387
|
})
|
|
54623
|
-
}),
|
|
54624
|
-
name: "
|
|
54625
|
-
label: t("
|
|
54388
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
54389
|
+
name: "type",
|
|
54390
|
+
label: t("Type"),
|
|
54626
54391
|
rules: [{
|
|
54627
|
-
required: true
|
|
54628
|
-
type: "country"
|
|
54392
|
+
required: true
|
|
54629
54393
|
}],
|
|
54630
54394
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
54631
54395
|
placeholder: t("Select"),
|
|
54632
|
-
options:
|
|
54633
|
-
label: c?.label,
|
|
54634
|
-
value: c?.value
|
|
54635
|
-
}))
|
|
54396
|
+
options: accountTypes
|
|
54636
54397
|
})
|
|
54637
|
-
})
|
|
54398
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
54638
54399
|
name: "email",
|
|
54639
54400
|
label: t("Email"),
|
|
54640
54401
|
rules: [{
|
|
@@ -54642,17 +54403,12 @@ function NewAccount({
|
|
|
54642
54403
|
type: "email"
|
|
54643
54404
|
}],
|
|
54644
54405
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
54645
|
-
placeholder: t("Type")
|
|
54646
|
-
|
|
54647
|
-
|
|
54648
|
-
|
|
54649
|
-
|
|
54650
|
-
|
|
54651
|
-
required: true
|
|
54652
|
-
}],
|
|
54653
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
54654
|
-
placeholder: t("Select"),
|
|
54655
|
-
options: accountTypes || []
|
|
54406
|
+
placeholder: t("Type"),
|
|
54407
|
+
onChange: () => {
|
|
54408
|
+
if (accountUsed) {
|
|
54409
|
+
setAccountUsed(false);
|
|
54410
|
+
}
|
|
54411
|
+
}
|
|
54656
54412
|
})
|
|
54657
54413
|
}), accountUsed && /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
|
|
54658
54414
|
message: t("FB00001"),
|
|
@@ -54681,7 +54437,6 @@ function AccountTable(_ref) {
|
|
|
54681
54437
|
actionButton,
|
|
54682
54438
|
inviteAccount
|
|
54683
54439
|
} = _ref;
|
|
54684
|
-
const accountTypes = config === null || config === void 0 ? void 0 : config.accountTypes;
|
|
54685
54440
|
const [showFilters, setShowFilters] = React.useState(false);
|
|
54686
54441
|
const [hasError, setHasError] = React.useState(false);
|
|
54687
54442
|
const [selectedAccounts, setSelectedAccounts] = React.useState([]);
|
|
@@ -54713,9 +54468,9 @@ function AccountTable(_ref) {
|
|
|
54713
54468
|
var _config$options;
|
|
54714
54469
|
return {
|
|
54715
54470
|
country: (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.countries,
|
|
54716
|
-
type: accountTypes
|
|
54471
|
+
type: config.accountTypes
|
|
54717
54472
|
};
|
|
54718
|
-
}, [config.options, accountTypes]);
|
|
54473
|
+
}, [config.options, config.accountTypes]);
|
|
54719
54474
|
React.useEffect(() => {
|
|
54720
54475
|
if (initFetchDone) {
|
|
54721
54476
|
filter.setActiveFilters(_objectSpread2(_objectSpread2({}, filter.activeFilters), {}, {
|
|
@@ -54832,7 +54587,7 @@ function AccountTable(_ref) {
|
|
|
54832
54587
|
fetchData();
|
|
54833
54588
|
fetchPendingAccounts();
|
|
54834
54589
|
},
|
|
54835
|
-
accountTypes: accountTypes,
|
|
54590
|
+
accountTypes: config.accountTypes,
|
|
54836
54591
|
inviteAccount: inviteAccount
|
|
54837
54592
|
}), /*#__PURE__*/jsxRuntime.jsx(CombineAccountModal, {
|
|
54838
54593
|
isOpen: combineAccountVisible,
|
|
@@ -55469,13 +55224,10 @@ function LocationTable(_ref) {
|
|
|
55469
55224
|
activeTab = "active";
|
|
55470
55225
|
}
|
|
55471
55226
|
}
|
|
55472
|
-
const page = Number(paginationObj.page) || 1;
|
|
55473
|
-
const pageSize = Number(paginationObj.pageSize) || 20;
|
|
55474
|
-
const skip = (page - 1) * pageSize;
|
|
55475
55227
|
const transformedParams = {
|
|
55476
55228
|
pagination: {
|
|
55477
|
-
skip,
|
|
55478
|
-
take: pageSize
|
|
55229
|
+
skip: String(paginationObj.page || 1),
|
|
55230
|
+
take: String(paginationObj.pageSize || 20)
|
|
55479
55231
|
},
|
|
55480
55232
|
tab: activeTab
|
|
55481
55233
|
};
|
|
@@ -56042,8 +55794,6 @@ function CombineSubjectsModal({
|
|
|
56042
55794
|
const onSubmit = () => {
|
|
56043
55795
|
MainForm.validateFields().then(data => {
|
|
56044
55796
|
const ids = selectedSubjects.map(subject => subject.id);
|
|
56045
|
-
console.log(ids, "ids");
|
|
56046
|
-
console.log(data, "data");
|
|
56047
55797
|
onSuccess({
|
|
56048
55798
|
ids,
|
|
56049
55799
|
data
|
|
@@ -56106,10 +55856,7 @@ function CombineSubjectsModal({
|
|
|
56106
55856
|
className: "flex-1",
|
|
56107
55857
|
name: "id",
|
|
56108
55858
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
56109
|
-
options: selectedSubjects
|
|
56110
|
-
label: s?.datastakeId || "-",
|
|
56111
|
-
value: s?.id || "-"
|
|
56112
|
-
})),
|
|
55859
|
+
options: mapToSelectOptions(selectedSubjects, "datastakeId", selectOptions, null),
|
|
56113
55860
|
placeholder: t("ID")
|
|
56114
55861
|
})
|
|
56115
55862
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
@@ -56232,13 +55979,10 @@ function SubjectsTable(_ref) {
|
|
|
56232
55979
|
activeTab = "active";
|
|
56233
55980
|
}
|
|
56234
55981
|
}
|
|
56235
|
-
const page = Number(paginationObj.page) || 1;
|
|
56236
|
-
const pageSize = Number(paginationObj.pageSize) || 20;
|
|
56237
|
-
const skip = (page - 1) * pageSize;
|
|
56238
55982
|
const transformedParams = {
|
|
56239
55983
|
pagination: {
|
|
56240
|
-
skip,
|
|
56241
|
-
take: pageSize
|
|
55984
|
+
skip: String(paginationObj.page || 1),
|
|
55985
|
+
take: String(paginationObj.pageSize || 20)
|
|
56242
55986
|
},
|
|
56243
55987
|
tab: activeTab
|
|
56244
55988
|
};
|
|
@@ -56300,7 +56044,7 @@ function SubjectsTable(_ref) {
|
|
|
56300
56044
|
actionButton: [{
|
|
56301
56045
|
icon: "Merge",
|
|
56302
56046
|
onClick: () => setIsModalOpen(true),
|
|
56303
|
-
tooltip: t("merge-subjects"),
|
|
56047
|
+
tooltip: t("admin::merge-subjects"),
|
|
56304
56048
|
disabled: selectedSubjects.length < 2
|
|
56305
56049
|
}],
|
|
56306
56050
|
tabs: getTabs({
|
|
@@ -56359,13 +56103,11 @@ function SubjectsTable(_ref) {
|
|
|
56359
56103
|
onSuccess: data => {
|
|
56360
56104
|
setIsModalOpen(false);
|
|
56361
56105
|
setLoading(true);
|
|
56106
|
+
antd.message.success(t("Subjects successfully merged."));
|
|
56362
56107
|
if (typeof mergeSubjectsFunction === 'function') {
|
|
56363
|
-
mergeSubjectsFunction(data).
|
|
56364
|
-
setTimeout(() => {
|
|
56365
|
-
fetchData();
|
|
56366
|
-
}, 500);
|
|
56367
|
-
}).finally(() => {
|
|
56108
|
+
mergeSubjectsFunction(data).finally(() => {
|
|
56368
56109
|
setSelectedSubjects([]);
|
|
56110
|
+
fetchData();
|
|
56369
56111
|
});
|
|
56370
56112
|
}
|
|
56371
56113
|
},
|
|
@@ -56482,7 +56224,7 @@ function TransferRights({
|
|
|
56482
56224
|
};
|
|
56483
56225
|
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
56484
56226
|
t: t,
|
|
56485
|
-
title: t("admin::transfer-
|
|
56227
|
+
title: t("admin::transfer-admin-rights"),
|
|
56486
56228
|
open: isOpen,
|
|
56487
56229
|
onClose: onClose,
|
|
56488
56230
|
loading: loading,
|
|
@@ -56532,16 +56274,11 @@ function NewUser({
|
|
|
56532
56274
|
module = "straatos",
|
|
56533
56275
|
inviteCompanyAccount = () => {},
|
|
56534
56276
|
companyId,
|
|
56535
|
-
handleError = () => {}
|
|
56536
|
-
existingEmails = []
|
|
56277
|
+
handleError = () => {}
|
|
56537
56278
|
}) {
|
|
56538
56279
|
const [MainForm] = antd.Form.useForm();
|
|
56539
56280
|
const [accountUsed, setAccountUsed] = React.useState(false);
|
|
56540
56281
|
const [loading, setLoading] = React.useState(false);
|
|
56541
|
-
const checkEmailExists = email => {
|
|
56542
|
-
if (!email) return false;
|
|
56543
|
-
return existingEmails.includes(email.toLowerCase());
|
|
56544
|
-
};
|
|
56545
56282
|
React.useEffect(() => {
|
|
56546
56283
|
if (defaultData) {
|
|
56547
56284
|
MainForm.setFieldsValue({
|
|
@@ -56553,10 +56290,6 @@ function NewUser({
|
|
|
56553
56290
|
const onSubmit = async () => {
|
|
56554
56291
|
try {
|
|
56555
56292
|
const val = await MainForm.validateFields();
|
|
56556
|
-
if (checkEmailExists(val.email)) {
|
|
56557
|
-
setAccountUsed(true);
|
|
56558
|
-
return;
|
|
56559
|
-
}
|
|
56560
56293
|
setLoading(true);
|
|
56561
56294
|
const apiPayload = {
|
|
56562
56295
|
firstName: val.firstName,
|
|
@@ -56573,8 +56306,7 @@ function NewUser({
|
|
|
56573
56306
|
});
|
|
56574
56307
|
const localUserData = {
|
|
56575
56308
|
...apiPayload,
|
|
56576
|
-
status: 'pending'
|
|
56577
|
-
id: apiPayload.email // Add a unique ID for the table key
|
|
56309
|
+
status: 'pending'
|
|
56578
56310
|
// apps: {
|
|
56579
56311
|
// [module]: {
|
|
56580
56312
|
// role: val.role,
|
|
@@ -56632,22 +56364,12 @@ function NewUser({
|
|
|
56632
56364
|
}],
|
|
56633
56365
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
56634
56366
|
placeholder: t("Type"),
|
|
56635
|
-
onChange:
|
|
56636
|
-
|
|
56637
|
-
|
|
56638
|
-
|
|
56639
|
-
onBlur: e => {
|
|
56640
|
-
const emailExists = checkEmailExists(e.target.value);
|
|
56641
|
-
setAccountUsed(emailExists);
|
|
56367
|
+
onChange: () => {
|
|
56368
|
+
if (accountUsed) {
|
|
56369
|
+
setAccountUsed(false);
|
|
56370
|
+
}
|
|
56642
56371
|
}
|
|
56643
56372
|
})
|
|
56644
|
-
}), accountUsed && /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
|
|
56645
|
-
message: t("This email corresponds to another account."),
|
|
56646
|
-
type: "error",
|
|
56647
|
-
className: "mb-2",
|
|
56648
|
-
showIcon: true,
|
|
56649
|
-
closable: true,
|
|
56650
|
-
onClose: () => setAccountUsed(false)
|
|
56651
56373
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
56652
56374
|
name: "role",
|
|
56653
56375
|
label: t("Role"),
|
|
@@ -56667,28 +56389,31 @@ const renderStatus = ({
|
|
|
56667
56389
|
val,
|
|
56668
56390
|
t = s => s
|
|
56669
56391
|
}) => {
|
|
56670
|
-
|
|
56392
|
+
// switch (val) {
|
|
56393
|
+
// case "active":
|
|
56394
|
+
// return <Tag color="green">{t("Active")}</Tag>;
|
|
56395
|
+
// case "unsaved":
|
|
56396
|
+
// return <Tag color="red">{t("Unsaved")}</Tag>;
|
|
56397
|
+
// case "inactive":
|
|
56398
|
+
// case "suspended":
|
|
56399
|
+
// return <Tag color="red">{t("Suspended")}</Tag>;
|
|
56400
|
+
// case "pending":
|
|
56401
|
+
// return <Tag color="orange">{t("Pending")}</Tag>;
|
|
56402
|
+
// default:
|
|
56403
|
+
// return <Tag color="default">{t("Unknown")}</Tag>;
|
|
56404
|
+
// }
|
|
56405
|
+
|
|
56406
|
+
if (val) {
|
|
56671
56407
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
|
|
56672
|
-
color: "
|
|
56673
|
-
children: t("
|
|
56408
|
+
color: "green",
|
|
56409
|
+
children: t("Active")
|
|
56674
56410
|
});
|
|
56675
|
-
}
|
|
56676
|
-
if (val === 'unsaved') {
|
|
56411
|
+
} else {
|
|
56677
56412
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
|
|
56678
56413
|
color: "red",
|
|
56679
|
-
children: t("
|
|
56414
|
+
children: t("Suspended")
|
|
56680
56415
|
});
|
|
56681
56416
|
}
|
|
56682
|
-
if (val === 'active' || val === true) {
|
|
56683
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
|
|
56684
|
-
color: "green",
|
|
56685
|
-
children: t("Active")
|
|
56686
|
-
});
|
|
56687
|
-
}
|
|
56688
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
|
|
56689
|
-
color: "red",
|
|
56690
|
-
children: t("Suspended")
|
|
56691
|
-
});
|
|
56692
56417
|
};
|
|
56693
56418
|
|
|
56694
56419
|
const getColumns = ({
|
|
@@ -56957,14 +56682,9 @@ function Users({
|
|
|
56957
56682
|
}, [activeFilters]);
|
|
56958
56683
|
const onDeleteUserClick = React.useCallback(id => {
|
|
56959
56684
|
antd.Modal.confirm({
|
|
56960
|
-
title: t("
|
|
56685
|
+
title: t("sbg-admin::remove-user-title"),
|
|
56961
56686
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.ExclamationCircleOutlined, {}),
|
|
56962
|
-
content:
|
|
56963
|
-
style: {
|
|
56964
|
-
color: "#888"
|
|
56965
|
-
},
|
|
56966
|
-
children: t("The-user-will-lose-access-to-the-application-and-to-all-data-created-for-this-account.")
|
|
56967
|
-
}),
|
|
56687
|
+
content: t("sbg-admin::remove-user-body"),
|
|
56968
56688
|
okText: t("Yes"),
|
|
56969
56689
|
cancelText: t("No"),
|
|
56970
56690
|
onOk: () => {
|
|
@@ -56975,14 +56695,9 @@ function Users({
|
|
|
56975
56695
|
}, [deleteUser]);
|
|
56976
56696
|
const data = React.useMemo(() => {
|
|
56977
56697
|
const {
|
|
56978
|
-
users = []
|
|
56979
|
-
pendingUsers = []
|
|
56698
|
+
users = []
|
|
56980
56699
|
} = accountData;
|
|
56981
|
-
let filtered = [...users
|
|
56982
|
-
...u,
|
|
56983
|
-
status: 'pending',
|
|
56984
|
-
id: u.invitationToken || u.email // ensure pending users have an ID
|
|
56985
|
-
}))];
|
|
56700
|
+
let filtered = [...users];
|
|
56986
56701
|
if (!isEmptyOrSpaces(activeFilters.search)) {
|
|
56987
56702
|
const search = activeFilters.search.toLowerCase();
|
|
56988
56703
|
filtered = filtered.filter(u => `${u.firstName} ${u.lastName}`.toLowerCase().indexOf(search) !== -1 || u.email.toLowerCase().indexOf(search) !== -1);
|
|
@@ -57060,8 +56775,7 @@ function Users({
|
|
|
57060
56775
|
module: module,
|
|
57061
56776
|
inviteCompanyAccount: inviteCompanyAccount,
|
|
57062
56777
|
companyId: companyId,
|
|
57063
|
-
handleError: handleError
|
|
57064
|
-
existingEmails: [...(accountData?.users || []).map(u => u.email?.toLowerCase()), ...(accountData?.pendingUsers || []).map(u => u.email?.toLowerCase())].filter(Boolean)
|
|
56778
|
+
handleError: handleError
|
|
57065
56779
|
})]
|
|
57066
56780
|
});
|
|
57067
56781
|
}
|
|
@@ -57243,7 +56957,7 @@ class AdminService extends BaseService {
|
|
|
57243
56957
|
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
57244
56958
|
return this.apiPut({
|
|
57245
56959
|
url: `/management/subject/${type}/${id}`,
|
|
57246
|
-
data: data
|
|
56960
|
+
data: filterCreateData(data)
|
|
57247
56961
|
});
|
|
57248
56962
|
}
|
|
57249
56963
|
deleteSubject({
|
|
@@ -57255,25 +56969,14 @@ class AdminService extends BaseService {
|
|
|
57255
56969
|
url: `/management/subject/${type}/${id}`
|
|
57256
56970
|
});
|
|
57257
56971
|
}
|
|
57258
|
-
|
|
57259
|
-
|
|
57260
|
-
data
|
|
57261
|
-
} = await this.apiGet({
|
|
56972
|
+
getUserGrowth(activeFilter) {
|
|
56973
|
+
return this.apiGet({
|
|
57262
56974
|
url: `/accounts/dashboard/user-growth`,
|
|
57263
56975
|
isUserManager: true,
|
|
57264
56976
|
params: {
|
|
57265
56977
|
activeFilter
|
|
57266
56978
|
}
|
|
57267
56979
|
});
|
|
57268
|
-
return data;
|
|
57269
|
-
}
|
|
57270
|
-
removeUserFromAccount({
|
|
57271
|
-
accountId,
|
|
57272
|
-
userId
|
|
57273
|
-
}) {
|
|
57274
|
-
return this.apiDelete({
|
|
57275
|
-
url: `/accounts/${accountId}/users/${userId}`
|
|
57276
|
-
});
|
|
57277
56980
|
}
|
|
57278
56981
|
}
|
|
57279
56982
|
var AdminService$1 = createLazyService(AdminService);
|
|
@@ -57490,18 +57193,11 @@ function Edit({
|
|
|
57490
57193
|
removeCheck();
|
|
57491
57194
|
}
|
|
57492
57195
|
}, [isChanged, addCheck, removeCheck]);
|
|
57493
|
-
const deleteUser = React.useCallback(
|
|
57494
|
-
|
|
57495
|
-
|
|
57496
|
-
|
|
57497
|
-
|
|
57498
|
-
});
|
|
57499
|
-
antd.message.success(t("User removed successfully"));
|
|
57500
|
-
fetchData();
|
|
57501
|
-
} catch (err) {
|
|
57502
|
-
handleError(err);
|
|
57503
|
-
}
|
|
57504
|
-
}, [fetchData, data.id, t, handleError]);
|
|
57196
|
+
const deleteUser = React.useCallback(id => {
|
|
57197
|
+
// TODO: add call
|
|
57198
|
+
console.log("DELETE", id);
|
|
57199
|
+
fetchData();
|
|
57200
|
+
}, [fetchData]);
|
|
57505
57201
|
const updateUser = React.useCallback((id, val) => {
|
|
57506
57202
|
setIsChanged(true);
|
|
57507
57203
|
setData(prev => ({
|
|
@@ -57529,14 +57225,9 @@ function Edit({
|
|
|
57529
57225
|
}, []);
|
|
57530
57226
|
const onSuspend = () => {
|
|
57531
57227
|
antd.Modal.confirm({
|
|
57532
|
-
title: t("
|
|
57228
|
+
title: t("sbg-admin::suspend-title"),
|
|
57533
57229
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.ExclamationCircleOutlined, {}),
|
|
57534
|
-
content:
|
|
57535
|
-
style: {
|
|
57536
|
-
color: "#888"
|
|
57537
|
-
},
|
|
57538
|
-
children: t("Associated-users-will-lose-access-to-the-application-and-to-all-data-created-for-this-account.")
|
|
57539
|
-
}),
|
|
57230
|
+
content: t("sbg-admin::suspend-content"),
|
|
57540
57231
|
okText: t("Yes"),
|
|
57541
57232
|
cancelText: t("No"),
|
|
57542
57233
|
onOk: async () => {
|
|
@@ -57852,15 +57543,13 @@ function AdminView(_ref) {
|
|
|
57852
57543
|
} = user,
|
|
57853
57544
|
userDataToInvite = _objectWithoutProperties(user, _excluded2);
|
|
57854
57545
|
console.log('Sending invitation for:', user.email, userDataToInvite);
|
|
57855
|
-
|
|
57856
|
-
|
|
57857
|
-
|
|
57858
|
-
|
|
57859
|
-
|
|
57860
|
-
|
|
57861
|
-
|
|
57862
|
-
// });
|
|
57863
|
-
// console.log('Invitation sent successfully for:', user.email);
|
|
57546
|
+
await inviteCompanyAccount({
|
|
57547
|
+
companyId: editData.id,
|
|
57548
|
+
data: _objectSpread2(_objectSpread2({}, userDataToInvite), {}, {
|
|
57549
|
+
pendingCompanyId
|
|
57550
|
+
})
|
|
57551
|
+
});
|
|
57552
|
+
console.log('Invitation sent successfully for:', user.email);
|
|
57864
57553
|
} catch (inviteError) {
|
|
57865
57554
|
console.error('Failed to invite user:', user.email, inviteError);
|
|
57866
57555
|
handleError(inviteError);
|
|
@@ -57969,7 +57658,8 @@ function AdminDashboardScreen({
|
|
|
57969
57658
|
}), [data?.keyIndicators, data?.keyInformation, getRedirectLink, getKeyIndicatorsConfig]);
|
|
57970
57659
|
const safeUserActivity = Array.isArray(data?.data?.userActivity) ? data.data.userActivity : [];
|
|
57971
57660
|
const safeTopContributors = Array.isArray(data?.topContributors) ? data.topContributors : [];
|
|
57972
|
-
const safeUserGrowth = userGrowthData
|
|
57661
|
+
const safeUserGrowth = Array.isArray(data?.userGrowthData) ? data.userGrowthData : [];
|
|
57662
|
+
console.log("safeUserGrowth", safeUserGrowth);
|
|
57973
57663
|
return /*#__PURE__*/jsxRuntime.jsx(AdminDashboard, {
|
|
57974
57664
|
t: t,
|
|
57975
57665
|
goTo: goTo,
|
|
@@ -57978,7 +57668,6 @@ function AdminDashboardScreen({
|
|
|
57978
57668
|
loadingUserGrowth: userGrowthDataLoading,
|
|
57979
57669
|
fetchUserGrowth: fetchUserGrowth,
|
|
57980
57670
|
adminTranslationIdentifier: appName,
|
|
57981
|
-
userGrowthData: safeUserGrowth,
|
|
57982
57671
|
data: {
|
|
57983
57672
|
keyIndicatorsData: keyIndicatorsConfig,
|
|
57984
57673
|
userActivityData: safeUserActivity,
|
|
@@ -58146,7 +57835,6 @@ function AdminAccountsScreen({
|
|
|
58146
57835
|
isOpen: addAccountVisible,
|
|
58147
57836
|
onClose: () => setAddAccountVisible(false),
|
|
58148
57837
|
accountTypes: accountTypes,
|
|
58149
|
-
countriesOptions: options?.countries,
|
|
58150
57838
|
fetchData: () => {},
|
|
58151
57839
|
inviteAccount: data => AdminService.inviteAccount(data)
|
|
58152
57840
|
})]
|