@abtnode/ux 1.16.17-beta-3232a7af → 1.16.17-beta-703fb879
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/es/blocklet/oauth/federated-site-list.js +3 -42
- package/es/blocklet/router/add-domain.js +1 -1
- package/es/invitation/invitation-receive.js +42 -40
- package/es/locales/en.js +4 -0
- package/es/locales/zh.js +4 -0
- package/lib/blocklet/oauth/federated-site-list.js +2 -41
- package/lib/blocklet/router/add-domain.js +1 -1
- package/lib/invitation/invitation-receive.js +41 -38
- package/lib/locales/en.js +4 -0
- package/lib/locales/zh.js +4 -0
- package/package.json +14 -14
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/* eslint-disable react/no-unstable-nested-components */
|
|
2
2
|
import SvgIcon from '@mui/material/SvgIcon';
|
|
3
|
-
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
4
3
|
import StarsIcon from '@mui/icons-material/Stars';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import Box from '@mui/material/Box';
|
|
7
6
|
import Datatable from '@arcblock/ux/lib/Datatable';
|
|
8
7
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
8
|
import Address from '@arcblock/did-connect/lib/Address';
|
|
10
|
-
import { useContext, useRef
|
|
9
|
+
import { useContext, useRef } from 'react';
|
|
11
10
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
12
11
|
import Button from '@arcblock/ux/lib/Button';
|
|
13
12
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
@@ -17,7 +16,6 @@ import { useNodeContext } from '../../contexts/node';
|
|
|
17
16
|
import useConfirm from '../../hooks/confirm';
|
|
18
17
|
import FederatedDetailDialog from './federated-detail-dialog';
|
|
19
18
|
import FederatedInviteDialog from './federated-invite-dialog';
|
|
20
|
-
import SwitchControl from '../component/switch-control';
|
|
21
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
21
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -44,9 +42,7 @@ function FederatedSiteList({
|
|
|
44
42
|
api
|
|
45
43
|
} = useNodeContext();
|
|
46
44
|
const federatedSites = blocklet.settings.federated?.sites || [];
|
|
47
|
-
const federatedConfig = blocklet.settings.federated?.config || {
|
|
48
|
-
autoLogin: false
|
|
49
|
-
};
|
|
45
|
+
const federatedConfig = blocklet.settings.federated?.config || {};
|
|
50
46
|
const isMaster = federatedConfig.isMaster !== false;
|
|
51
47
|
const viewDetail = useMemoizedFn(row => {
|
|
52
48
|
federatedDetailDialogRef.current?.open(row);
|
|
@@ -236,23 +232,6 @@ function FederatedSiteList({
|
|
|
236
232
|
Toast.error(t('federated.failedToGetFederatedLoginLink'));
|
|
237
233
|
}
|
|
238
234
|
}, [blocklet.site?.domainAliases?.[0]?.href]);
|
|
239
|
-
const [checked, setChecked] = useState(federatedConfig.autoLogin || false);
|
|
240
|
-
const changeAutoLogin = useMemoizedFn(() => {
|
|
241
|
-
confirmApi.open({
|
|
242
|
-
title: checked ? t('federated.disableFederatedAutoLogin') : t('federated.enableFederatedAutoLogin'),
|
|
243
|
-
content: checked ? t('federated.disableFederatedAutoLoginDescription') : t('federated.enableFederatedAutoLoginDescription'),
|
|
244
|
-
async onConfirm(close) {
|
|
245
|
-
await api.configFederated({
|
|
246
|
-
input: {
|
|
247
|
-
did: blocklet.appPid,
|
|
248
|
-
autoLogin: !checked
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
setChecked(prevValue => !prevValue);
|
|
252
|
-
close();
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}, [setChecked, checked]);
|
|
256
235
|
const quitFederatedLogin = useMemoizedFn(() => {
|
|
257
236
|
confirmApi.open({
|
|
258
237
|
title: t('federated.quitFederatedLogin'),
|
|
@@ -323,25 +302,7 @@ function FederatedSiteList({
|
|
|
323
302
|
customButtons: customButtons,
|
|
324
303
|
title: /*#__PURE__*/_jsx(Box, {
|
|
325
304
|
className: "table-toolbar-left",
|
|
326
|
-
children:
|
|
327
|
-
sx: {
|
|
328
|
-
ml: 0,
|
|
329
|
-
'& span.MuiSwitch-switchBase': {
|
|
330
|
-
display: 'flex'
|
|
331
|
-
},
|
|
332
|
-
'& span.MuiSwitch-track': {
|
|
333
|
-
display: 'block'
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
control: /*#__PURE__*/_jsx(SwitchControl, {
|
|
337
|
-
checked: checked,
|
|
338
|
-
style: {
|
|
339
|
-
marginRight: '6px'
|
|
340
|
-
},
|
|
341
|
-
onChange: changeAutoLogin
|
|
342
|
-
}),
|
|
343
|
-
label: t('federated.enableFederatedAutoLogin')
|
|
344
|
-
})
|
|
305
|
+
children: t('oauth.federated')
|
|
345
306
|
}),
|
|
346
307
|
options: tableOptions
|
|
347
308
|
}), confirmHolder, /*#__PURE__*/_jsx(FederatedInviteDialog, {
|
|
@@ -4,7 +4,7 @@ import DiamondIcon from '@mui/icons-material/Diamond';
|
|
|
4
4
|
import EditIcon from '@mui/icons-material/Edit';
|
|
5
5
|
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
|
6
6
|
import Box from '@mui/material/Box';
|
|
7
|
-
import Button from '@
|
|
7
|
+
import Button from '@arcblock/ux/lib/Button';
|
|
8
8
|
import Link from '@mui/material/Link';
|
|
9
9
|
import TextField from '@mui/material/TextField';
|
|
10
10
|
import useTheme from '@mui/material/styles/useTheme';
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
|
-
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
6
5
|
import DidButton from '@arcblock/did-connect/lib/Button';
|
|
7
|
-
import {
|
|
6
|
+
import { getFederatedEnabled, getMaster } from '@arcblock/ux/lib/Util/federated';
|
|
7
|
+
import { AUTH_SERVICE_PREFIX, API_DID_PREFIX } from '@arcblock/did-connect/lib/constant';
|
|
8
|
+
import joinURL from 'url-join';
|
|
8
9
|
import { formatDateTime } from '../util';
|
|
9
10
|
import usePassportId from '../hooks/use-passport-id';
|
|
11
|
+
import { useSessionContext } from '../contexts/session';
|
|
10
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
14
|
function InvitationReceive({
|
|
14
15
|
invitation,
|
|
15
|
-
checkFn,
|
|
16
16
|
onLogin,
|
|
17
17
|
onReceive
|
|
18
18
|
}) {
|
|
19
|
-
const [open, setOpen] = useState(false);
|
|
20
19
|
const {
|
|
21
20
|
t,
|
|
22
21
|
locale
|
|
23
22
|
} = useLocaleContext();
|
|
23
|
+
const {
|
|
24
|
+
connectApi
|
|
25
|
+
} = useSessionContext();
|
|
24
26
|
const {
|
|
25
27
|
getPassportId
|
|
26
28
|
} = usePassportId();
|
|
@@ -36,60 +38,60 @@ function InvitationReceive({
|
|
|
36
38
|
componentId
|
|
37
39
|
};
|
|
38
40
|
const onClose = useCallback(() => {
|
|
39
|
-
|
|
40
|
-
}, []);
|
|
41
|
+
connectApi.close();
|
|
42
|
+
}, [connectApi]);
|
|
41
43
|
const onSuccess = useCallback((...args) => {
|
|
42
|
-
|
|
44
|
+
connectApi.close();
|
|
43
45
|
onLogin(...args);
|
|
44
|
-
}, [onLogin]);
|
|
46
|
+
}, [onLogin, connectApi]);
|
|
45
47
|
const onClickReceive = useCallback(() => {
|
|
46
48
|
if (typeof onReceive === 'function') {
|
|
47
49
|
onReceive();
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
size: "large",
|
|
57
|
-
variant: "contained",
|
|
58
|
-
className: "invite-receive__button",
|
|
59
|
-
"data-cy": "invite-receive-passport",
|
|
60
|
-
color: "primary",
|
|
61
|
-
onClick: onClickReceive,
|
|
62
|
-
children: t('invite.receive')
|
|
63
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
64
|
-
className: "invite-receive__until",
|
|
65
|
-
children: [t('invite.validUntil'), formatDateTime(invitation.expireDate, locale)]
|
|
66
|
-
})]
|
|
67
|
-
}), /*#__PURE__*/_jsx(DidConnect, {
|
|
68
|
-
popup: true,
|
|
69
|
-
open: open,
|
|
70
|
-
className: "connect",
|
|
71
|
-
action: "invite",
|
|
72
|
-
checkFn: checkFn,
|
|
52
|
+
const masterSite = getMaster();
|
|
53
|
+
const federatedEnabled = getFederatedEnabled();
|
|
54
|
+
const baseUrl = federatedEnabled ? masterSite.appUrl : window.location.origin;
|
|
55
|
+
connectApi.openPopup({
|
|
56
|
+
action: 'invite',
|
|
57
|
+
className: 'connect',
|
|
73
58
|
forceConnected: false,
|
|
74
59
|
autoConnect: false,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
webWalletUrl: getWebWalletUrl(),
|
|
60
|
+
locale,
|
|
61
|
+
extraParams,
|
|
62
|
+
baseUrl: window.location.origin,
|
|
63
|
+
prefix: joinURL(window.location.origin, AUTH_SERVICE_PREFIX, API_DID_PREFIX),
|
|
80
64
|
messages: {
|
|
81
65
|
title: t('receive.dialog.title'),
|
|
82
66
|
scan: t('receive.dialog.scan'),
|
|
83
67
|
confirm: t('receive.dialog.confirm'),
|
|
84
68
|
success: t('receive.dialog.success')
|
|
85
69
|
},
|
|
86
|
-
|
|
70
|
+
onSuccess,
|
|
71
|
+
onClose
|
|
72
|
+
}, {
|
|
73
|
+
baseUrl,
|
|
74
|
+
locale
|
|
75
|
+
});
|
|
76
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
|
+
}, [connectApi.openPopup]);
|
|
78
|
+
return /*#__PURE__*/_jsxs(Root, {
|
|
79
|
+
children: [/*#__PURE__*/_jsx(DidButton, {
|
|
80
|
+
size: "large",
|
|
81
|
+
variant: "contained",
|
|
82
|
+
className: "invite-receive__button",
|
|
83
|
+
"data-cy": "invite-receive-passport",
|
|
84
|
+
color: "primary",
|
|
85
|
+
onClick: onClickReceive,
|
|
86
|
+
children: t('invite.receive')
|
|
87
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
88
|
+
className: "invite-receive__until",
|
|
89
|
+
children: [t('invite.validUntil'), formatDateTime(invitation.expireDate, locale)]
|
|
87
90
|
})]
|
|
88
91
|
});
|
|
89
92
|
}
|
|
90
93
|
InvitationReceive.propTypes = {
|
|
91
94
|
invitation: PropTypes.object.isRequired,
|
|
92
|
-
checkFn: PropTypes.func.isRequired,
|
|
93
95
|
onLogin: PropTypes.func,
|
|
94
96
|
onReceive: PropTypes.func
|
|
95
97
|
};
|
package/es/locales/en.js
CHANGED
|
@@ -63,6 +63,10 @@ module.exports = {
|
|
|
63
63
|
success: 'Passport has been successfully exchanged'
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
+
payablePassport: {
|
|
67
|
+
title: 'Purchase passport with payment',
|
|
68
|
+
tooltip: 'If you do not have a passport, you can purchase a passport with this link.'
|
|
69
|
+
},
|
|
66
70
|
sidebar: {
|
|
67
71
|
dashboard: 'Dashboard',
|
|
68
72
|
blocklets: 'Blocklets',
|
package/es/locales/zh.js
CHANGED
|
@@ -66,6 +66,10 @@ module.exports = {
|
|
|
66
66
|
success: '通行证换取成功'
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
+
payablePassport: {
|
|
70
|
+
title: 'Purchase passport with payment',
|
|
71
|
+
tooltip: 'If you do not have a passport, you can purchase a passport with this link.'
|
|
72
|
+
},
|
|
69
73
|
sidebar: {
|
|
70
74
|
dashboard: '仪表盘',
|
|
71
75
|
blocklets: '基石程序',
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _SvgIcon = _interopRequireDefault(require("@mui/material/SvgIcon"));
|
|
8
|
-
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
9
8
|
var _Stars = _interopRequireDefault(require("@mui/icons-material/Stars"));
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
@@ -22,7 +21,6 @@ var _node = require("../../contexts/node");
|
|
|
22
21
|
var _confirm = _interopRequireDefault(require("../../hooks/confirm"));
|
|
23
22
|
var _federatedDetailDialog = _interopRequireDefault(require("./federated-detail-dialog"));
|
|
24
23
|
var _federatedInviteDialog = _interopRequireDefault(require("./federated-invite-dialog"));
|
|
25
|
-
var _switchControl = _interopRequireDefault(require("../component/switch-control"));
|
|
26
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
26
|
/* eslint-disable react/no-unstable-nested-components */
|
|
@@ -52,9 +50,7 @@ function FederatedSiteList(_ref) {
|
|
|
52
50
|
api
|
|
53
51
|
} = (0, _node.useNodeContext)();
|
|
54
52
|
const federatedSites = ((_blocklet$settings$fe = blocklet.settings.federated) === null || _blocklet$settings$fe === void 0 ? void 0 : _blocklet$settings$fe.sites) || [];
|
|
55
|
-
const federatedConfig = ((_blocklet$settings$fe2 = blocklet.settings.federated) === null || _blocklet$settings$fe2 === void 0 ? void 0 : _blocklet$settings$fe2.config) || {
|
|
56
|
-
autoLogin: false
|
|
57
|
-
};
|
|
53
|
+
const federatedConfig = ((_blocklet$settings$fe2 = blocklet.settings.federated) === null || _blocklet$settings$fe2 === void 0 ? void 0 : _blocklet$settings$fe2.config) || {};
|
|
58
54
|
const isMaster = federatedConfig.isMaster !== false;
|
|
59
55
|
const viewDetail = (0, _ahooks.useMemoizedFn)(row => {
|
|
60
56
|
var _federatedDetailDialo;
|
|
@@ -248,23 +244,6 @@ function FederatedSiteList(_ref) {
|
|
|
248
244
|
_Toast.default.error(t('federated.failedToGetFederatedLoginLink'));
|
|
249
245
|
}
|
|
250
246
|
}, [(_blocklet$site = blocklet.site) === null || _blocklet$site === void 0 ? void 0 : (_blocklet$site$domain = _blocklet$site.domainAliases) === null || _blocklet$site$domain === void 0 ? void 0 : (_blocklet$site$domain2 = _blocklet$site$domain[0]) === null || _blocklet$site$domain2 === void 0 ? void 0 : _blocklet$site$domain2.href]);
|
|
251
|
-
const [checked, setChecked] = (0, _react.useState)(federatedConfig.autoLogin || false);
|
|
252
|
-
const changeAutoLogin = (0, _ahooks.useMemoizedFn)(() => {
|
|
253
|
-
confirmApi.open({
|
|
254
|
-
title: checked ? t('federated.disableFederatedAutoLogin') : t('federated.enableFederatedAutoLogin'),
|
|
255
|
-
content: checked ? t('federated.disableFederatedAutoLoginDescription') : t('federated.enableFederatedAutoLoginDescription'),
|
|
256
|
-
async onConfirm(close) {
|
|
257
|
-
await api.configFederated({
|
|
258
|
-
input: {
|
|
259
|
-
did: blocklet.appPid,
|
|
260
|
-
autoLogin: !checked
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
setChecked(prevValue => !prevValue);
|
|
264
|
-
close();
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}, [setChecked, checked]);
|
|
268
247
|
const quitFederatedLogin = (0, _ahooks.useMemoizedFn)(() => {
|
|
269
248
|
confirmApi.open({
|
|
270
249
|
title: t('federated.quitFederatedLogin'),
|
|
@@ -335,25 +314,7 @@ function FederatedSiteList(_ref) {
|
|
|
335
314
|
customButtons: customButtons,
|
|
336
315
|
title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
337
316
|
className: "table-toolbar-left",
|
|
338
|
-
children:
|
|
339
|
-
sx: {
|
|
340
|
-
ml: 0,
|
|
341
|
-
'& span.MuiSwitch-switchBase': {
|
|
342
|
-
display: 'flex'
|
|
343
|
-
},
|
|
344
|
-
'& span.MuiSwitch-track': {
|
|
345
|
-
display: 'block'
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_switchControl.default, {
|
|
349
|
-
checked: checked,
|
|
350
|
-
style: {
|
|
351
|
-
marginRight: '6px'
|
|
352
|
-
},
|
|
353
|
-
onChange: changeAutoLogin
|
|
354
|
-
}),
|
|
355
|
-
label: t('federated.enableFederatedAutoLogin')
|
|
356
|
-
})
|
|
317
|
+
children: t('oauth.federated')
|
|
357
318
|
}),
|
|
358
319
|
options: tableOptions
|
|
359
320
|
}), confirmHolder, /*#__PURE__*/(0, _jsxRuntime.jsx)(_federatedInviteDialog.default, {
|
|
@@ -10,7 +10,7 @@ var _Diamond = _interopRequireDefault(require("@mui/icons-material/Diamond"));
|
|
|
10
10
|
var _Edit = _interopRequireDefault(require("@mui/icons-material/Edit"));
|
|
11
11
|
var _OpenInNew = _interopRequireDefault(require("@mui/icons-material/OpenInNew"));
|
|
12
12
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
-
var _Button = _interopRequireDefault(require("@
|
|
13
|
+
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
14
14
|
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
|
15
15
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
16
16
|
var _useTheme = _interopRequireDefault(require("@mui/material/styles/useTheme"));
|
|
@@ -8,11 +8,13 @@ var _react = require("react");
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
10
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
11
|
-
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
12
11
|
var _Button = _interopRequireDefault(require("@arcblock/did-connect/lib/Button"));
|
|
13
|
-
var
|
|
12
|
+
var _federated = require("@arcblock/ux/lib/Util/federated");
|
|
13
|
+
var _constant = require("@arcblock/did-connect/lib/constant");
|
|
14
|
+
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
14
15
|
var _util = require("../util");
|
|
15
16
|
var _usePassportId = _interopRequireDefault(require("../hooks/use-passport-id"));
|
|
17
|
+
var _session = require("../contexts/session");
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
19
|
var _templateObject;
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -20,15 +22,16 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
20
22
|
function InvitationReceive(_ref) {
|
|
21
23
|
let {
|
|
22
24
|
invitation,
|
|
23
|
-
checkFn,
|
|
24
25
|
onLogin,
|
|
25
26
|
onReceive
|
|
26
27
|
} = _ref;
|
|
27
|
-
const [open, setOpen] = (0, _react.useState)(false);
|
|
28
28
|
const {
|
|
29
29
|
t,
|
|
30
30
|
locale
|
|
31
31
|
} = (0, _context.useLocaleContext)();
|
|
32
|
+
const {
|
|
33
|
+
connectApi
|
|
34
|
+
} = (0, _session.useSessionContext)();
|
|
32
35
|
const {
|
|
33
36
|
getPassportId
|
|
34
37
|
} = (0, _usePassportId.default)();
|
|
@@ -45,60 +48,60 @@ function InvitationReceive(_ref) {
|
|
|
45
48
|
componentId
|
|
46
49
|
};
|
|
47
50
|
const onClose = (0, _react.useCallback)(() => {
|
|
48
|
-
|
|
49
|
-
}, []);
|
|
51
|
+
connectApi.close();
|
|
52
|
+
}, [connectApi]);
|
|
50
53
|
const onSuccess = (0, _react.useCallback)(function () {
|
|
51
|
-
|
|
54
|
+
connectApi.close();
|
|
52
55
|
onLogin(...arguments);
|
|
53
|
-
}, [onLogin]);
|
|
56
|
+
}, [onLogin, connectApi]);
|
|
54
57
|
const onClickReceive = (0, _react.useCallback)(() => {
|
|
55
58
|
if (typeof onReceive === 'function') {
|
|
56
59
|
onReceive();
|
|
57
60
|
return;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
size: "large",
|
|
66
|
-
variant: "contained",
|
|
67
|
-
className: "invite-receive__button",
|
|
68
|
-
"data-cy": "invite-receive-passport",
|
|
69
|
-
color: "primary",
|
|
70
|
-
onClick: onClickReceive,
|
|
71
|
-
children: t('invite.receive')
|
|
72
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
73
|
-
className: "invite-receive__until",
|
|
74
|
-
children: [t('invite.validUntil'), (0, _util.formatDateTime)(invitation.expireDate, locale)]
|
|
75
|
-
})]
|
|
76
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
|
|
77
|
-
popup: true,
|
|
78
|
-
open: open,
|
|
79
|
-
className: "connect",
|
|
80
|
-
action: "invite",
|
|
81
|
-
checkFn: checkFn,
|
|
62
|
+
const masterSite = (0, _federated.getMaster)();
|
|
63
|
+
const federatedEnabled = (0, _federated.getFederatedEnabled)();
|
|
64
|
+
const baseUrl = federatedEnabled ? masterSite.appUrl : window.location.origin;
|
|
65
|
+
connectApi.openPopup({
|
|
66
|
+
action: 'invite',
|
|
67
|
+
className: 'connect',
|
|
82
68
|
forceConnected: false,
|
|
83
69
|
autoConnect: false,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
webWalletUrl: (0, _utils.getWebWalletUrl)(),
|
|
70
|
+
locale,
|
|
71
|
+
extraParams,
|
|
72
|
+
baseUrl: window.location.origin,
|
|
73
|
+
prefix: (0, _urlJoin.default)(window.location.origin, _constant.AUTH_SERVICE_PREFIX, _constant.API_DID_PREFIX),
|
|
89
74
|
messages: {
|
|
90
75
|
title: t('receive.dialog.title'),
|
|
91
76
|
scan: t('receive.dialog.scan'),
|
|
92
77
|
confirm: t('receive.dialog.confirm'),
|
|
93
78
|
success: t('receive.dialog.success')
|
|
94
79
|
},
|
|
95
|
-
|
|
80
|
+
onSuccess,
|
|
81
|
+
onClose
|
|
82
|
+
}, {
|
|
83
|
+
baseUrl,
|
|
84
|
+
locale
|
|
85
|
+
});
|
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
+
}, [connectApi.openPopup]);
|
|
88
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
|
|
89
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
90
|
+
size: "large",
|
|
91
|
+
variant: "contained",
|
|
92
|
+
className: "invite-receive__button",
|
|
93
|
+
"data-cy": "invite-receive-passport",
|
|
94
|
+
color: "primary",
|
|
95
|
+
onClick: onClickReceive,
|
|
96
|
+
children: t('invite.receive')
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
98
|
+
className: "invite-receive__until",
|
|
99
|
+
children: [t('invite.validUntil'), (0, _util.formatDateTime)(invitation.expireDate, locale)]
|
|
96
100
|
})]
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
InvitationReceive.propTypes = {
|
|
100
104
|
invitation: _propTypes.default.object.isRequired,
|
|
101
|
-
checkFn: _propTypes.default.func.isRequired,
|
|
102
105
|
onLogin: _propTypes.default.func,
|
|
103
106
|
onReceive: _propTypes.default.func
|
|
104
107
|
};
|
package/lib/locales/en.js
CHANGED
|
@@ -65,6 +65,10 @@ module.exports = {
|
|
|
65
65
|
success: 'Passport has been successfully exchanged'
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
+
payablePassport: {
|
|
69
|
+
title: 'Purchase passport with payment',
|
|
70
|
+
tooltip: 'If you do not have a passport, you can purchase a passport with this link.'
|
|
71
|
+
},
|
|
68
72
|
sidebar: {
|
|
69
73
|
dashboard: 'Dashboard',
|
|
70
74
|
blocklets: 'Blocklets',
|
package/lib/locales/zh.js
CHANGED
|
@@ -68,6 +68,10 @@ module.exports = {
|
|
|
68
68
|
success: '通行证换取成功'
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
+
payablePassport: {
|
|
72
|
+
title: 'Purchase passport with payment',
|
|
73
|
+
tooltip: 'If you do not have a passport, you can purchase a passport with this link.'
|
|
74
|
+
},
|
|
71
75
|
sidebar: {
|
|
72
76
|
dashboard: '仪表盘',
|
|
73
77
|
blocklets: '基石程序',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.17-beta-
|
|
3
|
+
"version": "1.16.17-beta-703fb879",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.17-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.17-beta-
|
|
32
|
-
"@abtnode/util": "1.16.17-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.17-beta-703fb879",
|
|
31
|
+
"@abtnode/constant": "1.16.17-beta-703fb879",
|
|
32
|
+
"@abtnode/util": "1.16.17-beta-703fb879",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.92",
|
|
35
|
-
"@arcblock/did-connect": "^2.
|
|
35
|
+
"@arcblock/did-connect": "^2.8.2",
|
|
36
36
|
"@arcblock/did-motif": "^1.1.13",
|
|
37
|
-
"@arcblock/icons": "^2.
|
|
38
|
-
"@arcblock/nft-display": "2.
|
|
39
|
-
"@arcblock/react-hooks": "^2.
|
|
40
|
-
"@arcblock/terminal": "^2.
|
|
41
|
-
"@arcblock/ux": "^2.
|
|
42
|
-
"@blocklet/constant": "1.16.17-beta-
|
|
37
|
+
"@arcblock/icons": "^2.8.2",
|
|
38
|
+
"@arcblock/nft-display": "2.8.2",
|
|
39
|
+
"@arcblock/react-hooks": "^2.8.2",
|
|
40
|
+
"@arcblock/terminal": "^2.8.2",
|
|
41
|
+
"@arcblock/ux": "^2.8.2",
|
|
42
|
+
"@blocklet/constant": "1.16.17-beta-703fb879",
|
|
43
43
|
"@blocklet/launcher-layout": "2.2.22",
|
|
44
44
|
"@blocklet/list": "^0.12.45",
|
|
45
|
-
"@blocklet/meta": "1.16.17-beta-
|
|
46
|
-
"@blocklet/ui-react": "^2.
|
|
45
|
+
"@blocklet/meta": "1.16.17-beta-703fb879",
|
|
46
|
+
"@blocklet/ui-react": "^2.8.2",
|
|
47
47
|
"@blocklet/uploader": "^0.0.32",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
101
101
|
"glob": "^10.3.3"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "97d63c671d823076e58b994107e10866367edd5d",
|
|
104
104
|
"exports": {
|
|
105
105
|
".": {
|
|
106
106
|
"import": "./es/index.js",
|