@abtnode/ux 1.8.69-beta-54faead3 → 1.8.69-beta-76f8a46f
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/lib/blocklet/actions.js +2 -1
- package/lib/blocklet/component/add.js +22 -50
- package/lib/blocklet/component/configuration.js +3 -3
- package/lib/blocklet/component/index.js +70 -79
- package/lib/blocklet/component/setting.js +1 -2
- package/lib/blocklet/install-from-url.js +6 -66
- package/lib/blocklet/migration.js +127 -0
- package/lib/blocklet/overview.js +2 -68
- package/lib/blocklet/status.js +1 -1
- package/lib/blocklet/storage.js +17 -6
- package/lib/blocklet/version.js +2 -26
- package/lib/hooks/use-app-logo.js +2 -1
- package/lib/locales/en.js +20 -3
- package/lib/locales/zh.js +20 -3
- package/lib/team/members/index.js +4 -2
- package/lib/util/index.js +2 -2
- package/package.json +9 -9
package/lib/blocklet/actions.js
CHANGED
|
@@ -27,6 +27,7 @@ var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
|
27
27
|
var _util = require("@blocklet/meta/lib/util");
|
|
28
28
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
29
29
|
var _constant = require("@blocklet/constant");
|
|
30
|
+
var _constant2 = require("@abtnode/constant");
|
|
30
31
|
var _toast = _interopRequireDefault(require("../toast"));
|
|
31
32
|
var _util2 = require("../util");
|
|
32
33
|
var _util3 = require("./util");
|
|
@@ -258,7 +259,7 @@ function BlockletActions(_ref) {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
};
|
|
261
|
-
const removeAction = !inService && (0, _util.isDeletableBlocklet)(blocklet) ? {
|
|
262
|
+
const removeAction = !inService && (0, _util.isDeletableBlocklet)(blocklet) && blocklet.structVersion === _constant2.APP_STRUCT_VERSION ? {
|
|
262
263
|
action: 'remove',
|
|
263
264
|
icon: _icons.default.Remove,
|
|
264
265
|
name: t('common.remove'),
|
|
@@ -28,7 +28,6 @@ var _step = require("@blocklet/launcher-layout/lib/context/step");
|
|
|
28
28
|
var _constant2 = require("@abtnode/constant");
|
|
29
29
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
30
30
|
var _Alert = _interopRequireDefault(require("@arcblock/ux/lib/Alert"));
|
|
31
|
-
var _Tag = _interopRequireDefault(require("@arcblock/ux/lib/Tag"));
|
|
32
31
|
var _AnimationWaiter = _interopRequireDefault(require("@arcblock/ux/lib/AnimationWaiter"));
|
|
33
32
|
var _launchResultMessage = _interopRequireDefault(require("@blocklet/launcher-layout/lib/launch-result-message"));
|
|
34
33
|
var _util = require("@blocklet/meta/lib/util");
|
|
@@ -138,7 +137,6 @@ function AddComponent(_ref2) {
|
|
|
138
137
|
const [editingItem, setEditingItem] = (0, _react.useState)(null);
|
|
139
138
|
const [error, setError] = (0, _react.useState)('');
|
|
140
139
|
const [showDialog, setShowDialog] = (0, _react.useState)('');
|
|
141
|
-
const [configs, setConfigs] = (0, _react.useState)([]);
|
|
142
140
|
const [mountPointHelperText, setMountPointHelperText] = (0, _react.useState)('');
|
|
143
141
|
const {
|
|
144
142
|
api,
|
|
@@ -324,9 +322,10 @@ function AddComponent(_ref2) {
|
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
} catch (err) {
|
|
327
|
-
|
|
325
|
+
const errMsg = (0, _util2.formatError)(err);
|
|
326
|
+
_toast.default.error(errMsg);
|
|
328
327
|
console.error('installComponent error: ', err);
|
|
329
|
-
setInstallErrorResult(
|
|
328
|
+
setInstallErrorResult(errMsg);
|
|
330
329
|
} finally {
|
|
331
330
|
setLoading(false);
|
|
332
331
|
component.current.installInput = installInput;
|
|
@@ -431,7 +430,7 @@ function AddComponent(_ref2) {
|
|
|
431
430
|
onNext();
|
|
432
431
|
};
|
|
433
432
|
const setConfigValue = _ref4 => {
|
|
434
|
-
var _blocklet$settings,
|
|
433
|
+
var _blocklet$settings, _meta$environments;
|
|
435
434
|
let {
|
|
436
435
|
chooseParams = component.current,
|
|
437
436
|
componentDid: componentDidValue,
|
|
@@ -451,9 +450,8 @@ function AddComponent(_ref2) {
|
|
|
451
450
|
} = meta;
|
|
452
451
|
|
|
453
452
|
// deleted history list
|
|
454
|
-
const list = (((_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.children) || []).filter(x => x.status === 'deleted' && x.meta.bundleDid === bundleDid)
|
|
455
|
-
|
|
456
|
-
const componentDid = componentDidValue || ((_list$ = list[0]) === null || _list$ === void 0 ? void 0 : (_list$$meta = _list$.meta) === null || _list$$meta === void 0 ? void 0 : _list$$meta.did) || '';
|
|
453
|
+
const list = (((_blocklet$settings = blocklet.settings) === null || _blocklet$settings === void 0 ? void 0 : _blocklet$settings.children) || []).filter(x => x.status === 'deleted' && x.meta.bundleDid === bundleDid);
|
|
454
|
+
const componentDid = componentDidValue || '';
|
|
457
455
|
const newConfigs = (_meta$environments = meta.environments) === null || _meta$environments === void 0 ? void 0 : _meta$environments.map(item => {
|
|
458
456
|
const {
|
|
459
457
|
name: key,
|
|
@@ -534,21 +532,22 @@ function AddComponent(_ref2) {
|
|
|
534
532
|
hasMissRequiredConfigs: hasMissRequiredConfigs(configsList, configsValue)
|
|
535
533
|
});
|
|
536
534
|
}
|
|
535
|
+
const hasRootPath = blocklet.children.some(x => x.mountPoint === '/');
|
|
537
536
|
|
|
538
537
|
// use deleted history
|
|
539
|
-
|
|
540
|
-
|
|
538
|
+
const config = list.find(x => x.meta.bundleDid === bundleDid);
|
|
539
|
+
if (config) {
|
|
541
540
|
doc = _objectSpread(_objectSpread({}, doc), {}, {
|
|
542
|
-
pathPrefix: config
|
|
543
|
-
title: config
|
|
544
|
-
componentName: config
|
|
541
|
+
pathPrefix: config.mountPoint,
|
|
542
|
+
title: config.meta.title,
|
|
543
|
+
componentName: config.meta.name,
|
|
545
544
|
// use history's environments
|
|
546
545
|
hasEnvironmentsStep: false
|
|
547
546
|
});
|
|
548
547
|
} else {
|
|
549
548
|
var _component$current$me, _component$current$me2;
|
|
550
549
|
doc = _objectSpread(_objectSpread({}, doc), {}, {
|
|
551
|
-
pathPrefix: "/".concat((0, _urlFriendly.default)(name)),
|
|
550
|
+
pathPrefix: hasRootPath ? "/".concat((0, _urlFriendly.default)(name)) : '/',
|
|
552
551
|
title: title || '',
|
|
553
552
|
componentName: '',
|
|
554
553
|
hasEnvironmentsStep: ((_component$current$me = component.current.meta) === null || _component$current$me === void 0 ? void 0 : (_component$current$me2 = _component$current$me.environments) === null || _component$current$me2 === void 0 ? void 0 : _component$current$me2.length) > 0
|
|
@@ -679,7 +678,15 @@ function AddComponent(_ref2) {
|
|
|
679
678
|
},
|
|
680
679
|
extraFilter: allBlocklets => {
|
|
681
680
|
// only use blocklets that are component
|
|
682
|
-
return allBlocklets === null || allBlocklets === void 0 ? void 0 : allBlocklets.filter(x =>
|
|
681
|
+
return allBlocklets === null || allBlocklets === void 0 ? void 0 : allBlocklets.filter(x => {
|
|
682
|
+
if (!(0, _util.isComponentBlocklet)(x)) {
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
if ((blocklet.children || []).some(y => y.meta.did === x.did)) {
|
|
686
|
+
return false;
|
|
687
|
+
}
|
|
688
|
+
return true;
|
|
689
|
+
});
|
|
683
690
|
}
|
|
684
691
|
});
|
|
685
692
|
}
|
|
@@ -777,40 +784,6 @@ function AddComponent(_ref2) {
|
|
|
777
784
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PageHeaderWrapper, {
|
|
778
785
|
title: t('common.config'),
|
|
779
786
|
subTitle: t('blocklet.component.addComponentTip.config')
|
|
780
|
-
}), !!params.bundleDid && !!configs.length && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TextField.default, {
|
|
781
|
-
select: true,
|
|
782
|
-
label: t('blocklet.component.selectInstance'),
|
|
783
|
-
autoComplete: "off",
|
|
784
|
-
variant: "outlined",
|
|
785
|
-
name: "did",
|
|
786
|
-
helperText: t('blocklet.component.selectInstanceTip'),
|
|
787
|
-
"data-cy": "component-instance-select",
|
|
788
|
-
fullWidth: true,
|
|
789
|
-
value: params.componentDid || '_empty_',
|
|
790
|
-
onChange: e => {
|
|
791
|
-
setConfigValue({
|
|
792
|
-
componentDid: e.target.value
|
|
793
|
-
});
|
|
794
|
-
},
|
|
795
|
-
style: {
|
|
796
|
-
marginBottom: 32
|
|
797
|
-
},
|
|
798
|
-
margin: "normal",
|
|
799
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
800
|
-
value: "_empty_",
|
|
801
|
-
children: t('blocklet.component.newInstance')
|
|
802
|
-
}, "_empty_"), configs.map(x => {
|
|
803
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MenuItem.default, {
|
|
804
|
-
value: x.meta.did,
|
|
805
|
-
"data-cy": x.meta.did,
|
|
806
|
-
children: [x.meta.title, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, {
|
|
807
|
-
style: {
|
|
808
|
-
marginLeft: 8
|
|
809
|
-
},
|
|
810
|
-
children: (0, _util2.formatToDatetime)(x.deletedAt)
|
|
811
|
-
})]
|
|
812
|
-
}, x.meta.did);
|
|
813
|
-
})]
|
|
814
787
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
|
|
815
788
|
label: t('blocklet.component.mountPoint'),
|
|
816
789
|
autoComplete: "off",
|
|
@@ -845,7 +818,6 @@ function AddComponent(_ref2) {
|
|
|
845
818
|
},
|
|
846
819
|
margin: "normal",
|
|
847
820
|
value: params.title,
|
|
848
|
-
helperText: t('blocklet.component.titleTip'),
|
|
849
821
|
onChange: e => {
|
|
850
822
|
const title = e.target.value;
|
|
851
823
|
setParams(_objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -32,9 +32,9 @@ function ComponentConfiguration(_ref) {
|
|
|
32
32
|
t
|
|
33
33
|
} = (0, _context.useLocaleContext)();
|
|
34
34
|
const isRoot = !ancestors.map(x => x.meta.did)[0];
|
|
35
|
-
const
|
|
35
|
+
const isLevel1 = ancestors.length === 1;
|
|
36
36
|
const [tab, setTab] = (0, _react.useState)('settings');
|
|
37
|
-
const name = ancestors.concat(blocklet).map(x => (0, _util.getDisplayName)(x, true)).join(' / ');
|
|
37
|
+
const name = ancestors.concat(blocklet).slice(1).map(x => (0, _util.getDisplayName)(x, true)).join(' / ');
|
|
38
38
|
if ((0, _util2.isInstalling)(blocklet.status)) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
@@ -98,7 +98,7 @@ function ComponentConfiguration(_ref) {
|
|
|
98
98
|
minHeight: 'auto'
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
-
children: isRoot ||
|
|
101
|
+
children: isRoot || isLevel1 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
102
102
|
mt: 1,
|
|
103
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tabs.default, {
|
|
104
104
|
tabs: tabs,
|
|
@@ -7,7 +7,6 @@ exports.default = BlockletComponent;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _semver = _interopRequireDefault(require("semver"));
|
|
11
10
|
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
12
11
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
12
|
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
@@ -27,6 +26,8 @@ var _ArrowForward = _interopRequireDefault(require("@mui/icons-material/ArrowFor
|
|
|
27
26
|
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
28
27
|
var _ChevronRight = _interopRequireDefault(require("@mui/icons-material/ChevronRight"));
|
|
29
28
|
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
29
|
+
var _react2 = require("@iconify/react");
|
|
30
|
+
var _constant = require("@abtnode/constant");
|
|
30
31
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
31
32
|
var _InfoRow = _interopRequireDefault(require("@arcblock/ux/lib/InfoRow"));
|
|
32
33
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
@@ -113,14 +114,31 @@ const getSourceInfo = blocklet => {
|
|
|
113
114
|
}
|
|
114
115
|
return {};
|
|
115
116
|
};
|
|
117
|
+
const getComponentName = (componentId, app) => {
|
|
118
|
+
const ids = componentId.split('/').slice(1);
|
|
119
|
+
let parent = app;
|
|
120
|
+
let index = 0;
|
|
121
|
+
const names = [];
|
|
122
|
+
while (parent && index < ids.length) {
|
|
123
|
+
// eslint-disable-next-line no-loop-func
|
|
124
|
+
const component = parent.children.find(x => x.meta.did === ids[index]);
|
|
125
|
+
parent = component;
|
|
126
|
+
index++;
|
|
127
|
+
if (component) {
|
|
128
|
+
names.push(component.meta.title);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return names.join(' / ');
|
|
132
|
+
};
|
|
116
133
|
function ComponentItem(_ref) {
|
|
117
|
-
var _blocklet$children;
|
|
134
|
+
var _blocklet$dependents, _blocklet$dependents2, _blocklet$dependents3, _blocklet$children;
|
|
118
135
|
let {
|
|
119
136
|
blocklet,
|
|
120
137
|
ancestors,
|
|
121
138
|
depth,
|
|
122
139
|
onRemove,
|
|
123
|
-
getComponentUrl
|
|
140
|
+
getComponentUrl,
|
|
141
|
+
app
|
|
124
142
|
} = _ref;
|
|
125
143
|
const {
|
|
126
144
|
t
|
|
@@ -227,12 +245,27 @@ function ComponentItem(_ref) {
|
|
|
227
245
|
children: value
|
|
228
246
|
}, name);
|
|
229
247
|
})
|
|
230
|
-
}
|
|
248
|
+
}, (_blocklet$dependents = blocklet.dependents) !== null && _blocklet$dependents !== void 0 && _blocklet$dependents.length ? {
|
|
249
|
+
name: t('common.dependents'),
|
|
250
|
+
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
251
|
+
children: blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
252
|
+
children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
|
|
253
|
+
}))
|
|
254
|
+
})
|
|
255
|
+
} : null].filter(Boolean) : [];
|
|
231
256
|
let deleteDisabledTip = '';
|
|
232
|
-
if (depth !== 1
|
|
257
|
+
if (depth !== 1) {
|
|
233
258
|
deleteDisabledTip = t('blocklet.component.tip.notDynamic');
|
|
234
259
|
} else if ((0, _util2.isInProgress)(root.status) || depth === 1 && deletingComponents.includes(blocklet.meta.did)) {
|
|
235
260
|
deleteDisabledTip = t('blocklet.component.tip.stopBlocklet');
|
|
261
|
+
} else if ((_blocklet$dependents2 = blocklet.dependents) !== null && _blocklet$dependents2 !== void 0 && _blocklet$dependents2.length) {
|
|
262
|
+
const requires = blocklet.dependents.filter(x => x.required);
|
|
263
|
+
if (requires.length) {
|
|
264
|
+
const names = requires.map(x => getComponentName(x.id, app));
|
|
265
|
+
deleteDisabledTip = t('blocklet.component.tip.requiredBy', {
|
|
266
|
+
name: names.join(', ')
|
|
267
|
+
});
|
|
268
|
+
}
|
|
236
269
|
}
|
|
237
270
|
return [(depth > 0 || blocklet.meta.group !== 'gateway') && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
238
271
|
display: "flex",
|
|
@@ -282,6 +315,19 @@ function ComponentItem(_ref) {
|
|
|
282
315
|
},
|
|
283
316
|
status: status,
|
|
284
317
|
source: blocklet.source
|
|
318
|
+
}), !!((_blocklet$dependents3 = blocklet.dependents) !== null && _blocklet$dependents3 !== void 0 && _blocklet$dependents3.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
319
|
+
title: ["".concat(t('common.dependents'), ": "), blocklet.dependents.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
320
|
+
pl: 1,
|
|
321
|
+
children: "".concat(getComponentName(x.id, app), " ").concat(x.required ? "(".concat(t('common.required'), ")") : '')
|
|
322
|
+
}))],
|
|
323
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
324
|
+
display: "flex",
|
|
325
|
+
color: "primary.main",
|
|
326
|
+
ml: 1,
|
|
327
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
328
|
+
icon: "octicon:package-dependents-16"
|
|
329
|
+
})
|
|
330
|
+
})
|
|
285
331
|
})]
|
|
286
332
|
})]
|
|
287
333
|
})]
|
|
@@ -367,7 +413,8 @@ function ComponentItem(_ref) {
|
|
|
367
413
|
ancestors: [...ancestors, blocklet],
|
|
368
414
|
depth: depth + 1,
|
|
369
415
|
onRemove: onRemove,
|
|
370
|
-
getComponentUrl: getComponentUrl
|
|
416
|
+
getComponentUrl: getComponentUrl,
|
|
417
|
+
app: app
|
|
371
418
|
}, "".concat(depth + 1, "-").concat(x.meta.did)))
|
|
372
419
|
}, "blocklet-collapse") : null, !!componentInfo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
373
420
|
open: true,
|
|
@@ -391,17 +438,18 @@ ComponentItem.propTypes = {
|
|
|
391
438
|
ancestors: _propTypes.default.array,
|
|
392
439
|
depth: _propTypes.default.number,
|
|
393
440
|
onRemove: _propTypes.default.func,
|
|
394
|
-
getComponentUrl: _propTypes.default.func
|
|
441
|
+
getComponentUrl: _propTypes.default.func,
|
|
442
|
+
app: _propTypes.default.object
|
|
395
443
|
};
|
|
396
444
|
ComponentItem.defaultProps = {
|
|
397
445
|
ancestors: [],
|
|
398
446
|
depth: 0,
|
|
399
447
|
onRemove: () => {},
|
|
400
|
-
getComponentUrl: () => window.location.origin
|
|
448
|
+
getComponentUrl: () => window.location.origin,
|
|
449
|
+
app: null
|
|
401
450
|
};
|
|
402
451
|
const StyledBadge = (0, _styled.default)(_Badge.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .BaseBadge-badge {\n top: ", "px;\n right: ", "px;\n }\n"])), props => props.top * 8 || 6, props => props.right * 8 || 6);
|
|
403
452
|
function BlockletComponent(_ref4) {
|
|
404
|
-
var _blocklet$meta;
|
|
405
453
|
let {
|
|
406
454
|
blocklet,
|
|
407
455
|
onUpdate,
|
|
@@ -422,6 +470,9 @@ function BlockletComponent(_ref4) {
|
|
|
422
470
|
} = (0, _deletingBlocklets.useDeletingBlockletContext)();
|
|
423
471
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
424
472
|
const [updateConfirm, setUpdateConfirm] = (0, _react.useState)(null);
|
|
473
|
+
const needMigration = blocklet && blocklet.structVersion !== _constant.APP_STRUCT_VERSION;
|
|
474
|
+
|
|
475
|
+
// update dot is not used but maybe useful in the further
|
|
425
476
|
const [showUpdateDot, setShowUpdateDot] = (0, _react.useState)(false);
|
|
426
477
|
const components = [...blocklet.children] || [];
|
|
427
478
|
if (blocklet.meta.group !== 'gateway') {
|
|
@@ -429,59 +480,12 @@ function BlockletComponent(_ref4) {
|
|
|
429
480
|
components.unshift(blocklet);
|
|
430
481
|
}
|
|
431
482
|
matchDeletingDid(components.map(e => e.meta.did));
|
|
432
|
-
(0, _react.useEffect)(() => {
|
|
433
|
-
if (blocklet && !(0, _util2.isInProgress)(blocklet.status)) {
|
|
434
|
-
api.getLatestBlockletVersion({
|
|
435
|
-
input: {
|
|
436
|
-
did: blocklet.meta.did,
|
|
437
|
-
version: blocklet.meta.version
|
|
438
|
-
}
|
|
439
|
-
}).then(res => {
|
|
440
|
-
const {
|
|
441
|
-
version
|
|
442
|
-
} = res.data || {};
|
|
443
|
-
if (version && _semver.default.gt(version, blocklet.meta.version)) {
|
|
444
|
-
setShowUpdateDot(true);
|
|
445
|
-
}
|
|
446
|
-
}).catch(err => {
|
|
447
|
-
console.error(err.message);
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
}, [blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.did]); // eslint-disable-line
|
|
451
|
-
|
|
452
483
|
const checkForUpdates = async () => {
|
|
453
484
|
if (loading) {
|
|
454
485
|
return;
|
|
455
486
|
}
|
|
456
487
|
setLoading(true);
|
|
457
488
|
try {
|
|
458
|
-
// check app version
|
|
459
|
-
const {
|
|
460
|
-
version,
|
|
461
|
-
registryUrl
|
|
462
|
-
} = (await api.getLatestBlockletVersion({
|
|
463
|
-
input: {
|
|
464
|
-
did: blocklet.meta.did,
|
|
465
|
-
version: blocklet.meta.version
|
|
466
|
-
}
|
|
467
|
-
})).data || {};
|
|
468
|
-
if (version && _semver.default.gt(version, blocklet.meta.version)) {
|
|
469
|
-
setUpdateConfirm({
|
|
470
|
-
type: 'app',
|
|
471
|
-
params: {
|
|
472
|
-
version,
|
|
473
|
-
registryUrl
|
|
474
|
-
},
|
|
475
|
-
list: [{
|
|
476
|
-
name: (0, _util.getDisplayName)(blocklet),
|
|
477
|
-
version: blocklet.meta.version,
|
|
478
|
-
newVersion: version
|
|
479
|
-
}]
|
|
480
|
-
});
|
|
481
|
-
setLoading(false);
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
489
|
// check child component version
|
|
486
490
|
const {
|
|
487
491
|
updateId,
|
|
@@ -525,7 +529,6 @@ function BlockletComponent(_ref4) {
|
|
|
525
529
|
}
|
|
526
530
|
});
|
|
527
531
|
setUpdateConfirm({
|
|
528
|
-
type: 'component',
|
|
529
532
|
params: {
|
|
530
533
|
updateId
|
|
531
534
|
},
|
|
@@ -542,27 +545,15 @@ function BlockletComponent(_ref4) {
|
|
|
542
545
|
if (loading) {
|
|
543
546
|
return;
|
|
544
547
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
if (updateConfirm.type === 'app') {
|
|
548
|
-
fn = api.upgradeBlocklet.bind(api);
|
|
549
|
-
input = {
|
|
550
|
-
did: blocklet.meta.did,
|
|
551
|
-
version: updateConfirm.params.version,
|
|
552
|
-
storeUrl: updateConfirm.params.registryUrl || ''
|
|
553
|
-
};
|
|
554
|
-
} else {
|
|
555
|
-
fn = api.upgradeComponents.bind(api);
|
|
548
|
+
try {
|
|
549
|
+
setLoading(true);
|
|
556
550
|
const selectedComponents = Object.keys(updateConfirm.checks).filter(x => updateConfirm.checks[x]);
|
|
557
|
-
input = {
|
|
551
|
+
const input = {
|
|
558
552
|
updateId: updateConfirm.params.updateId,
|
|
559
553
|
rootDid: blocklet.meta.did,
|
|
560
554
|
selectedComponents
|
|
561
555
|
};
|
|
562
|
-
|
|
563
|
-
try {
|
|
564
|
-
setLoading(true);
|
|
565
|
-
await fn({
|
|
556
|
+
await api.upgradeComponents({
|
|
566
557
|
input
|
|
567
558
|
});
|
|
568
559
|
setLoading(false);
|
|
@@ -615,7 +606,7 @@ function BlockletComponent(_ref4) {
|
|
|
615
606
|
alignItems: "center",
|
|
616
607
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
617
608
|
className: "title",
|
|
618
|
-
children: [t('common.components'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_permission.default, {
|
|
609
|
+
children: [t('common.components'), !needMigration && /*#__PURE__*/(0, _jsxRuntime.jsx)(_permission.default, {
|
|
619
610
|
permission: inService ? '' : 'mutate_blocklets',
|
|
620
611
|
role: inService ? _util2.BlockletAdminRoles : [],
|
|
621
612
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledBadge, {
|
|
@@ -671,7 +662,7 @@ function BlockletComponent(_ref4) {
|
|
|
671
662
|
}), t('router.rule.add.title')]
|
|
672
663
|
});
|
|
673
664
|
}
|
|
674
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_add.default, {
|
|
665
|
+
}), !needMigration && /*#__PURE__*/(0, _jsxRuntime.jsx)(_add.default, {
|
|
675
666
|
blocklet: blocklet,
|
|
676
667
|
children: _ref8 => {
|
|
677
668
|
let {
|
|
@@ -702,6 +693,7 @@ function BlockletComponent(_ref4) {
|
|
|
702
693
|
},
|
|
703
694
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ComponentItem, {
|
|
704
695
|
blocklet: blocklet,
|
|
696
|
+
app: blocklet,
|
|
705
697
|
onRemove: removeComponent,
|
|
706
698
|
getComponentUrl: getComponentUrl
|
|
707
699
|
}, "0-".concat(blocklet.meta.did))
|
|
@@ -723,15 +715,14 @@ function BlockletComponent(_ref4) {
|
|
|
723
715
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
724
716
|
paddingY: 1.5,
|
|
725
717
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DialogTitle.default, {
|
|
726
|
-
children:
|
|
718
|
+
children: t('blocklet.component.updateTitle')
|
|
727
719
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
728
720
|
component: _DialogContent.default,
|
|
729
721
|
py: 4,
|
|
730
|
-
ml: updateConfirm.type === 'component' ? 0 : 4,
|
|
731
722
|
children: updateConfirm.list.map(x => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
732
723
|
display: "flex",
|
|
733
724
|
alignItems: "center",
|
|
734
|
-
children: [
|
|
725
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
|
|
735
726
|
checked: updateConfirm.checks[x.groupId],
|
|
736
727
|
onChange: e => onUpdateChecksChange(e, x.groupId),
|
|
737
728
|
style: {
|
|
@@ -789,7 +780,7 @@ function BlockletComponent(_ref4) {
|
|
|
789
780
|
onConfirmUpdate();
|
|
790
781
|
},
|
|
791
782
|
color: "primary",
|
|
792
|
-
disabled: loading ||
|
|
783
|
+
disabled: loading || !updateConfirm.hasChecks,
|
|
793
784
|
variant: "contained",
|
|
794
785
|
autoFocus: true,
|
|
795
786
|
children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {
|
|
@@ -41,7 +41,6 @@ function ComponentSetting(_ref) {
|
|
|
41
41
|
api
|
|
42
42
|
} = (0, _node.useNodeContext)();
|
|
43
43
|
const isRoot = !ancestors.length;
|
|
44
|
-
const isDynamic = blocklet.dynamic;
|
|
45
44
|
const rootDid = isRoot ? blocklet.meta.did : ancestors.map(x => x.meta.did)[0];
|
|
46
45
|
const [loading, setLoading] = (0, _react.useState)('');
|
|
47
46
|
const [mountPointHelperText, setMountPointHelperText] = (0, _react.useState)('');
|
|
@@ -103,7 +102,7 @@ function ComponentSetting(_ref) {
|
|
|
103
102
|
}, rest), {}, {
|
|
104
103
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
105
104
|
mt: 3,
|
|
106
|
-
children: [
|
|
105
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_formTextInput.default, {
|
|
107
106
|
label: t('common.title'),
|
|
108
107
|
style: {
|
|
109
108
|
marginTop: -24
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = InstallFromUrl;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _semver = _interopRequireDefault(require("semver"));
|
|
10
9
|
var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
11
10
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
12
11
|
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
@@ -20,7 +19,6 @@ var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect
|
|
|
20
19
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
21
20
|
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
22
21
|
var _Alert = _interopRequireDefault(require("@arcblock/ux/lib/Alert"));
|
|
23
|
-
var _Tag = _interopRequireDefault(require("@arcblock/ux/lib/Tag"));
|
|
24
22
|
var _util = require("@blocklet/meta/lib/util");
|
|
25
23
|
var _node = require("../contexts/node");
|
|
26
24
|
var _session = require("../contexts/session");
|
|
@@ -59,9 +57,7 @@ function InstallFromUrl(_ref) {
|
|
|
59
57
|
const [url, setUrl] = (0, _react.useState)(defaultUrl);
|
|
60
58
|
const [activeStep, setActiveStep] = (0, _react.useState)(defaultUrl ? 1 : 0);
|
|
61
59
|
const [meta, setMeta] = (0, _react.useState)(initMeta);
|
|
62
|
-
const [existingMeta, setExistingMeta] = (0, _react.useState)(null);
|
|
63
60
|
const [isConnectOpen, setConnectOpen] = (0, _react.useState)(false);
|
|
64
|
-
const [canUpgrade, setCanUpgrade] = (0, _react.useState)(false);
|
|
65
61
|
const [params, setParams] = (0, _react.useState)({});
|
|
66
62
|
const isComponentMode = mode === 'component';
|
|
67
63
|
// if mode is component , we need to always show the step, that means the user can return to the previous step
|
|
@@ -89,25 +85,7 @@ function InstallFromUrl(_ref) {
|
|
|
89
85
|
url: decoded
|
|
90
86
|
}
|
|
91
87
|
});
|
|
92
|
-
|
|
93
|
-
// if mode is component, never check existing blocklet
|
|
94
|
-
if (isComponentMode) {
|
|
95
|
-
setMeta(newer);
|
|
96
|
-
} else {
|
|
97
|
-
const {
|
|
98
|
-
blocklet: existedBlocklet
|
|
99
|
-
} = await api.getBlocklet({
|
|
100
|
-
input: {
|
|
101
|
-
did: newer.did,
|
|
102
|
-
attachRuntimeInfo: false
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
if (existedBlocklet) {
|
|
106
|
-
setExistingMeta(existedBlocklet.meta);
|
|
107
|
-
setCanUpgrade(_semver.default.lt(existedBlocklet.meta.version, newer.version));
|
|
108
|
-
}
|
|
109
|
-
setMeta(newer);
|
|
110
|
-
}
|
|
88
|
+
setMeta(newer);
|
|
111
89
|
setParams({
|
|
112
90
|
inStore,
|
|
113
91
|
registryUrl,
|
|
@@ -130,26 +108,6 @@ function InstallFromUrl(_ref) {
|
|
|
130
108
|
_onCancel();
|
|
131
109
|
return;
|
|
132
110
|
}
|
|
133
|
-
if (canUpgrade) {
|
|
134
|
-
try {
|
|
135
|
-
setLoading(true);
|
|
136
|
-
await api.installBlocklet({
|
|
137
|
-
input: {
|
|
138
|
-
url: decodeURIComponent(url.trim())
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
onSuccess(_objectSpread({
|
|
142
|
-
meta
|
|
143
|
-
}, params));
|
|
144
|
-
_onCancel();
|
|
145
|
-
} catch (err) {
|
|
146
|
-
const errMsg = "Blocklet Install failed: ".concat((0, _util2.formatError)(err));
|
|
147
|
-
setError(errMsg);
|
|
148
|
-
} finally {
|
|
149
|
-
setLoading(false);
|
|
150
|
-
}
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
111
|
setLoading(true);
|
|
154
112
|
setConnectOpen(true);
|
|
155
113
|
};
|
|
@@ -206,11 +164,11 @@ function InstallFromUrl(_ref) {
|
|
|
206
164
|
});
|
|
207
165
|
}
|
|
208
166
|
if (meta.did) {
|
|
209
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
167
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
210
168
|
style: {
|
|
211
169
|
paddingLeft: '10%'
|
|
212
170
|
},
|
|
213
|
-
children:
|
|
171
|
+
children: rows.map(row => {
|
|
214
172
|
if (row.name === t('common.did')) {
|
|
215
173
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
216
174
|
valueComponent: "div",
|
|
@@ -226,21 +184,7 @@ function InstallFromUrl(_ref) {
|
|
|
226
184
|
name: row.name,
|
|
227
185
|
children: row.value
|
|
228
186
|
}, row.name);
|
|
229
|
-
})
|
|
230
|
-
type: "error",
|
|
231
|
-
variant: "icon",
|
|
232
|
-
style: {
|
|
233
|
-
margin: '15px 0 0 -16px'
|
|
234
|
-
},
|
|
235
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
236
|
-
children: [t('blocklet.fromUrl.existTipPrefix'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, {
|
|
237
|
-
content: existingMeta.version,
|
|
238
|
-
style: {
|
|
239
|
-
margin: '0 5px'
|
|
240
|
-
}
|
|
241
|
-
}), t('blocklet.fromUrl.existTipSuffix')]
|
|
242
|
-
})
|
|
243
|
-
})]
|
|
187
|
+
})
|
|
244
188
|
});
|
|
245
189
|
}
|
|
246
190
|
return null;
|
|
@@ -288,7 +232,7 @@ function InstallFromUrl(_ref) {
|
|
|
288
232
|
label: t('blocklet.fromUrl.step1'),
|
|
289
233
|
body: getStep1Body(),
|
|
290
234
|
cancel: alwayShowSteps ? t('common.pre') : t('common.cancel'),
|
|
291
|
-
confirm: (handleText === null || handleText === void 0 ? void 0 : handleText.confirm) ||
|
|
235
|
+
confirm: (handleText === null || handleText === void 0 ? void 0 : handleText.confirm) || t('blocklet.fromUrl.confirm'),
|
|
292
236
|
onCancel: () => {
|
|
293
237
|
if (alwayShowSteps) {
|
|
294
238
|
setActiveStep(s => s - 1);
|
|
@@ -297,11 +241,7 @@ function InstallFromUrl(_ref) {
|
|
|
297
241
|
}
|
|
298
242
|
},
|
|
299
243
|
onConfirm: () => {
|
|
300
|
-
|
|
301
|
-
_onCancel();
|
|
302
|
-
} else {
|
|
303
|
-
_onConfirm();
|
|
304
|
-
}
|
|
244
|
+
_onConfirm();
|
|
305
245
|
}
|
|
306
246
|
}];
|
|
307
247
|
const step = steps[activeStep];
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BlockletMigration;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
+
var _Alert = _interopRequireDefault(require("@arcblock/ux/lib/Alert"));
|
|
10
|
+
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
11
|
+
var _constant = require("@abtnode/constant");
|
|
12
|
+
var _Connect = _interopRequireDefault(require("@arcblock/did-connect/lib/Connect"));
|
|
13
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
14
|
+
var _util = require("@blocklet/meta/lib/util");
|
|
15
|
+
var _blocklet = require("../contexts/blocklet");
|
|
16
|
+
var _session = require("../contexts/session");
|
|
17
|
+
var _toast = _interopRequireDefault(require("../toast"));
|
|
18
|
+
var _util2 = require("../util");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
const findDuplicate = blocklet => {
|
|
22
|
+
const map = {};
|
|
23
|
+
let duplicate = null;
|
|
24
|
+
(0, _util.forEachBlockletSync)(blocklet, component => {
|
|
25
|
+
if (map[component.meta.bundleDid]) {
|
|
26
|
+
duplicate = (0, _util.getDisplayName)(component, true);
|
|
27
|
+
} else if (component.meta.bundleDid) {
|
|
28
|
+
map[component.meta.bundleDid] = true;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return duplicate;
|
|
32
|
+
};
|
|
33
|
+
function BlockletMigration() {
|
|
34
|
+
const {
|
|
35
|
+
t
|
|
36
|
+
} = (0, _context.useLocaleContext)();
|
|
37
|
+
const {
|
|
38
|
+
api
|
|
39
|
+
} = (0, _session.useSessionContext)();
|
|
40
|
+
const {
|
|
41
|
+
blocklet
|
|
42
|
+
} = (0, _blocklet.useBlockletContext)();
|
|
43
|
+
const [openConnect, setOpenConnect] = (0, _react.useState)(false);
|
|
44
|
+
const [leftSec, setLeftSec] = (0, _react.useState)(5);
|
|
45
|
+
const needMigration = blocklet && blocklet.structVersion !== _constant.APP_STRUCT_VERSION;
|
|
46
|
+
const onMigrate = async () => {
|
|
47
|
+
try {
|
|
48
|
+
if (blocklet.status === 'running') {
|
|
49
|
+
_toast.default.error(t('blocklet.migrate.tip.running'));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const duplicate = findDuplicate(blocklet);
|
|
53
|
+
if (duplicate) {
|
|
54
|
+
_toast.default.error(t('blocklet.migrate.tip.duplicate', {
|
|
55
|
+
name: duplicate
|
|
56
|
+
}));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
setOpenConnect(true);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
_toast.default.error((0, _util2.formatError)(error));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const onSuccess = () => {
|
|
65
|
+
const {
|
|
66
|
+
href
|
|
67
|
+
} = window.location;
|
|
68
|
+
const newHref = href.replace(blocklet.meta.bundleDid, blocklet.appDid);
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
window.location.href = newHref;
|
|
71
|
+
}, 5000);
|
|
72
|
+
setLeftSec(5);
|
|
73
|
+
setInterval(() => {
|
|
74
|
+
setLeftSec(sec => sec - 1);
|
|
75
|
+
}, 1000);
|
|
76
|
+
};
|
|
77
|
+
const onClose = () => setOpenConnect(false);
|
|
78
|
+
return [needMigration && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Alert.default, {
|
|
79
|
+
type: "warning",
|
|
80
|
+
style: {
|
|
81
|
+
margin: '12px 0'
|
|
82
|
+
},
|
|
83
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
84
|
+
display: "flex",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
87
|
+
onClick: () => onMigrate(),
|
|
88
|
+
children: t('blocklet.migrate.intro.l1')
|
|
89
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
90
|
+
children: t('blocklet.migrate.intro.l2')
|
|
91
|
+
})]
|
|
92
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
93
|
+
ml: 3,
|
|
94
|
+
display: "flex",
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
children: t('blocklet.migrate.intro.l3')
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
98
|
+
ml: 3,
|
|
99
|
+
display: "flex",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
children: t('blocklet.migrate.intro.l4')
|
|
102
|
+
})]
|
|
103
|
+
}), blocklet && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
|
|
104
|
+
popup: true,
|
|
105
|
+
open: openConnect,
|
|
106
|
+
saveConnect: false,
|
|
107
|
+
forceConnected: false,
|
|
108
|
+
action: "migrate-app-to-struct-v2",
|
|
109
|
+
checkFn: api.get,
|
|
110
|
+
checkTimeout: 5 * 60 * 1000,
|
|
111
|
+
onSuccess: onSuccess,
|
|
112
|
+
extraParams: {
|
|
113
|
+
did: blocklet.meta.did,
|
|
114
|
+
title: (0, _util.getDisplayName)(blocklet)
|
|
115
|
+
},
|
|
116
|
+
messages: {
|
|
117
|
+
title: t('blocklet.migrate.title'),
|
|
118
|
+
scan: t('blocklet.migrate.scan'),
|
|
119
|
+
confirm: t('blocklet.migrate.confirm'),
|
|
120
|
+
success: t('blocklet.migrate.success', {
|
|
121
|
+
sec: leftSec
|
|
122
|
+
})
|
|
123
|
+
},
|
|
124
|
+
onClose: onClose
|
|
125
|
+
})];
|
|
126
|
+
}
|
|
127
|
+
BlockletMigration.propTypes = {};
|
package/lib/blocklet/overview.js
CHANGED
|
@@ -21,9 +21,7 @@ var _blocklet = require("../contexts/blocklet");
|
|
|
21
21
|
var _node = require("../contexts/node");
|
|
22
22
|
var _util2 = require("../util");
|
|
23
23
|
var _didAddress = _interopRequireDefault(require("../did-address"));
|
|
24
|
-
var _blockletSource = _interopRequireDefault(require("./blocklet-source"));
|
|
25
24
|
var _status = _interopRequireDefault(require("./status"));
|
|
26
|
-
var _version = _interopRequireDefault(require("./version"));
|
|
27
25
|
var _domainStatus = _interopRequireDefault(require("./router/domain-status"));
|
|
28
26
|
var _types = require("./types");
|
|
29
27
|
var _expiration = _interopRequireDefault(require("./component/expiration"));
|
|
@@ -82,23 +80,6 @@ DomainLink.propTypes = {
|
|
|
82
80
|
children: _propTypes.default.any.isRequired
|
|
83
81
|
};
|
|
84
82
|
const LinkDiv = _styled.default.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &,\n & > * {\n color: #222;\n font-size: 18px;\n }\n\n .status {\n margin-left: 8px;\n }\n"])));
|
|
85
|
-
const getEngineRows = (engine, t) => {
|
|
86
|
-
if (!engine) {
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
return [{
|
|
90
|
-
name: t('common.name'),
|
|
91
|
-
value: engine.displayName
|
|
92
|
-
}, {
|
|
93
|
-
name: t('common.description'),
|
|
94
|
-
value: engine.description
|
|
95
|
-
}, {
|
|
96
|
-
name: t('common.version'),
|
|
97
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, {
|
|
98
|
-
children: engine.version
|
|
99
|
-
})
|
|
100
|
-
}];
|
|
101
|
-
};
|
|
102
83
|
function BlockletOverview() {
|
|
103
84
|
var _blocklet$settings, _blocklet$site;
|
|
104
85
|
const {
|
|
@@ -128,9 +109,9 @@ function BlockletOverview() {
|
|
|
128
109
|
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
129
110
|
did: appPid
|
|
130
111
|
})
|
|
131
|
-
} : null, migratedFrom
|
|
112
|
+
} : null, (migratedFrom === null || migratedFrom === void 0 ? void 0 : migratedFrom.length) > 1 ? {
|
|
132
113
|
name: t('blocklet.alsoKnownAs'),
|
|
133
|
-
value: migratedFrom.map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
114
|
+
value: migratedFrom.slice(1).map(x => /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
134
115
|
did: x.appDid
|
|
135
116
|
}))
|
|
136
117
|
} : null, {
|
|
@@ -142,20 +123,6 @@ function BlockletOverview() {
|
|
|
142
123
|
status: blocklet.status,
|
|
143
124
|
source: blocklet.source
|
|
144
125
|
})
|
|
145
|
-
}, {
|
|
146
|
-
name: t('common.version'),
|
|
147
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_version.default, {
|
|
148
|
-
blocklet: blocklet
|
|
149
|
-
})
|
|
150
|
-
}, {
|
|
151
|
-
name: t('common.group'),
|
|
152
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, {
|
|
153
|
-
type: "success",
|
|
154
|
-
children: blocklet.meta.group
|
|
155
|
-
})
|
|
156
|
-
}, {
|
|
157
|
-
name: t('common.author'),
|
|
158
|
-
value: (0, _util2.formatPerson)(blocklet.meta.author)
|
|
159
126
|
}, blocklet.controller ? {
|
|
160
127
|
name: t('common.expires'),
|
|
161
128
|
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_expiration.default, {
|
|
@@ -172,25 +139,8 @@ function BlockletOverview() {
|
|
|
172
139
|
name: t('blocklet.stoppedAt'),
|
|
173
140
|
value: (0, _util2.formatToDatetime)(blocklet.stoppedAt)
|
|
174
141
|
} : null, {
|
|
175
|
-
name: t('blocklet.overview.source'),
|
|
176
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockletSource.default, {
|
|
177
|
-
sourceInfo: {
|
|
178
|
-
source: blocklet.source,
|
|
179
|
-
deployedFrom: blocklet.deployedFrom
|
|
180
|
-
},
|
|
181
|
-
blocklet: blocklet
|
|
182
|
-
})
|
|
183
|
-
}, {
|
|
184
|
-
name: t('blocklet.overview.deployedFrom'),
|
|
185
|
-
value: blocklet.deployedFrom || '-'
|
|
186
|
-
}, {
|
|
187
142
|
name: t('blocklet.overview.accessControl'),
|
|
188
143
|
value: t("team.whoCanAccess.".concat((0, _util.getWhoCanAccess)(blocklet), ".title"))
|
|
189
|
-
}, {
|
|
190
|
-
name: t('common.did'),
|
|
191
|
-
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
192
|
-
did: blocklet.meta.did
|
|
193
|
-
})
|
|
194
144
|
}, {
|
|
195
145
|
name: t('common.owner'),
|
|
196
146
|
value: (_blocklet$settings = blocklet.settings) !== null && _blocklet$settings !== void 0 && _blocklet$settings.owner ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_didAddress.default, {
|
|
@@ -210,7 +160,6 @@ function BlockletOverview() {
|
|
|
210
160
|
})
|
|
211
161
|
});
|
|
212
162
|
}
|
|
213
|
-
const engineRows = getEngineRows(blocklet.engine, t);
|
|
214
163
|
const renderRows = rows => rows.map(row => {
|
|
215
164
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
216
165
|
valueComponent: "div",
|
|
@@ -280,21 +229,6 @@ function BlockletOverview() {
|
|
|
280
229
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
281
230
|
className: "basicInfo",
|
|
282
231
|
children: renderRows(infoRows)
|
|
283
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
284
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
285
|
-
className: "title",
|
|
286
|
-
children: t('common.engine')
|
|
287
|
-
}), engineRows.map(_ref2 => {
|
|
288
|
-
let {
|
|
289
|
-
name,
|
|
290
|
-
value
|
|
291
|
-
} = _ref2;
|
|
292
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InfoRow.default, {
|
|
293
|
-
nameWidth: 120,
|
|
294
|
-
name: name,
|
|
295
|
-
children: value
|
|
296
|
-
}, name);
|
|
297
|
-
})]
|
|
298
232
|
})]
|
|
299
233
|
});
|
|
300
234
|
}
|
package/lib/blocklet/status.js
CHANGED
|
@@ -71,7 +71,7 @@ function BlockletStatus(_ref) {
|
|
|
71
71
|
deleting: colors.yellow
|
|
72
72
|
};
|
|
73
73
|
const inProgress = (0, _util.isInProgress)(status);
|
|
74
|
-
const statusTxt = t("blocklet.status.".concat(
|
|
74
|
+
const statusTxt = t("blocklet.status.".concat(status));
|
|
75
75
|
if (variant === 'dot') {
|
|
76
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
77
77
|
title: t('blocklet.statusTip', {
|
package/lib/blocklet/storage.js
CHANGED
|
@@ -76,7 +76,12 @@ function useAppUrl(blocklet) {
|
|
|
76
76
|
return +a.isProtected - +b.isProtected;
|
|
77
77
|
}
|
|
78
78
|
return +b.accessibility.accessible - +a.accessibility.accessible;
|
|
79
|
-
})) === null || _blocklet$site$domain2 === void 0 ? void 0 : _blocklet$site$domain2.map(domainAlias =>
|
|
79
|
+
})) === null || _blocklet$site$domain2 === void 0 ? void 0 : _blocklet$site$domain2.map(domainAlias => {
|
|
80
|
+
var _domainAlias$domainSt;
|
|
81
|
+
const protocol = domainAlias !== null && domainAlias !== void 0 && (_domainAlias$domainSt = domainAlias.domainStatus) !== null && _domainAlias$domainSt !== void 0 && _domainAlias$domainSt.isHttps ? 'https://' : 'http://';
|
|
82
|
+
const value = domainAlias === null || domainAlias === void 0 ? void 0 : domainAlias.value;
|
|
83
|
+
return "".concat(protocol).concat(value);
|
|
84
|
+
}).filter(Boolean);
|
|
80
85
|
const appUrl = appUrls === null || appUrls === void 0 ? void 0 : appUrls[0];
|
|
81
86
|
|
|
82
87
|
// 授权的时候提供 appUrl, 因为 appUrl 可能很久都拿不到值,所以加一个 loading 效果过渡一下
|
|
@@ -87,10 +92,12 @@ function useAppUrl(blocklet) {
|
|
|
87
92
|
}
|
|
88
93
|
function Storage() {
|
|
89
94
|
var _blocklet$environment;
|
|
90
|
-
/** @type {{ api: import('@abtnode/client').ABTNodeClient }} */
|
|
95
|
+
/** @type {{ api: import('@abtnode/client').ABTNodeClient, info: import('@abtnode/client').NodeState }} */
|
|
91
96
|
const {
|
|
92
|
-
api
|
|
97
|
+
api,
|
|
98
|
+
info
|
|
93
99
|
} = (0, _node.useNodeContext)();
|
|
100
|
+
const nodeDid = info.did;
|
|
94
101
|
const {
|
|
95
102
|
t,
|
|
96
103
|
locale
|
|
@@ -164,7 +171,8 @@ function Storage() {
|
|
|
164
171
|
appDescription,
|
|
165
172
|
scopes: 'list:object read:object write:object',
|
|
166
173
|
appUrl,
|
|
167
|
-
referrer: window.location.href
|
|
174
|
+
referrer: window.location.href,
|
|
175
|
+
nodeDid
|
|
168
176
|
},
|
|
169
177
|
onClose: () => {
|
|
170
178
|
// eslint-disable-next-line no-shadow
|
|
@@ -214,10 +222,13 @@ function Storage() {
|
|
|
214
222
|
(0, _react.useEffect)(() => {
|
|
215
223
|
if (progress !== null && progress !== void 0 && progress.completed) {
|
|
216
224
|
setIsLoading(false);
|
|
225
|
+
if (progress !== null && progress !== void 0 && progress.progress) {
|
|
226
|
+
progress.progress = 0;
|
|
227
|
+
}
|
|
217
228
|
} else if (progress !== null && progress !== void 0 && progress.message) {
|
|
218
229
|
setIsLoading(true);
|
|
219
230
|
}
|
|
220
|
-
}, [progress
|
|
231
|
+
}, [progress]);
|
|
221
232
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
222
233
|
style: {
|
|
223
234
|
maxWidth: '720px'
|
|
@@ -276,7 +287,7 @@ function Storage() {
|
|
|
276
287
|
},
|
|
277
288
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.LinearProgress, {
|
|
278
289
|
color: "primary",
|
|
279
|
-
variant: "
|
|
290
|
+
variant: "indeterminate",
|
|
280
291
|
value: progress === null || progress === void 0 ? void 0 : progress.progress
|
|
281
292
|
})
|
|
282
293
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
package/lib/blocklet/version.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = BlockletVersion;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _semver = _interopRequireDefault(require("semver"));
|
|
10
9
|
var _notistack = require("notistack");
|
|
11
10
|
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
12
11
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
@@ -54,30 +53,7 @@ function Version(_ref) {
|
|
|
54
53
|
(0, _react.useEffect)(() => {
|
|
55
54
|
setNewVersionBlocklet(null);
|
|
56
55
|
if (checkUpgrade && blocklet.mode !== _constant.BLOCKLET_MODES.DEVELOPMENT) {
|
|
57
|
-
|
|
58
|
-
input: {
|
|
59
|
-
did: blocklet.meta.did,
|
|
60
|
-
version: blocklet.meta.version
|
|
61
|
-
}
|
|
62
|
-
}).then(_ref2 => {
|
|
63
|
-
let {
|
|
64
|
-
data
|
|
65
|
-
} = _ref2;
|
|
66
|
-
if (data) {
|
|
67
|
-
const {
|
|
68
|
-
version,
|
|
69
|
-
registryUrl
|
|
70
|
-
} = data;
|
|
71
|
-
if (version && _semver.default.gt(version, blocklet.meta.version)) {
|
|
72
|
-
setNewVersionBlocklet({
|
|
73
|
-
version,
|
|
74
|
-
registryUrl
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
// eslint-disable-next-line max-len
|
|
80
|
-
.catch(err => console.error("Failed to fetch latest version: ".concat(blocklet.meta.name, ", error: ").concat((0, _util2.formatError)(err)))); // prettier-ignore
|
|
56
|
+
// The implementation was removed and will be restore in the further
|
|
81
57
|
}
|
|
82
58
|
}, [blocklet, checkUpgrade]); // eslint-disable-line
|
|
83
59
|
|
|
@@ -164,7 +140,7 @@ Version.propTypes = {
|
|
|
164
140
|
hasPermission: _propTypes.default.bool
|
|
165
141
|
};
|
|
166
142
|
Version.defaultProps = {
|
|
167
|
-
checkUpgrade:
|
|
143
|
+
checkUpgrade: false,
|
|
168
144
|
hasPermission: false
|
|
169
145
|
};
|
|
170
146
|
const BlockletVersionInDaemon = (0, _permission.withPermission)(Version, 'mutate_blocklets');
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = useAppLogo;
|
|
7
7
|
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
8
8
|
var _node = require("../contexts/node");
|
|
9
|
+
var _util = require("../util");
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
function useAppLogo(_ref) {
|
|
11
12
|
var _window$env, _blocklet$meta;
|
|
@@ -16,7 +17,7 @@ function useAppLogo(_ref) {
|
|
|
16
17
|
inService
|
|
17
18
|
} = (0, _node.useNodeContext)();
|
|
18
19
|
const prefix = ((_window$env = window.env) === null || _window$env === void 0 ? void 0 : _window$env.apiPrefix) || '/';
|
|
19
|
-
const search = "?v=".concat(blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version);
|
|
20
|
+
const search = "?v=".concat(blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.version).concat((0, _util.isInstalling)(blocklet === null || blocklet === void 0 ? void 0 : blocklet.status) ? '~' : '');
|
|
20
21
|
const logoUrl = (0, _urlJoin.default)(prefix, "/blocklet/logo/".concat(inService ? '' : blocklet.meta.did), search);
|
|
21
22
|
return {
|
|
22
23
|
logoUrl
|
package/lib/locales/en.js
CHANGED
|
@@ -121,6 +121,7 @@ module.exports = {
|
|
|
121
121
|
delConfirm: 'Delete',
|
|
122
122
|
delConfirmDescription: 'Confirm delete?',
|
|
123
123
|
delete: 'Delete',
|
|
124
|
+
dependents: 'Dependents',
|
|
124
125
|
description: 'Description',
|
|
125
126
|
detail: 'Detail',
|
|
126
127
|
did: 'DID',
|
|
@@ -222,6 +223,7 @@ module.exports = {
|
|
|
222
223
|
remove: 'Remove',
|
|
223
224
|
renew: 'Renew',
|
|
224
225
|
reportIssue: 'Report an issue',
|
|
226
|
+
required: 'Required',
|
|
225
227
|
requiredErrorText: '{name} is required',
|
|
226
228
|
resource: 'Resource',
|
|
227
229
|
restart: 'Restart',
|
|
@@ -458,7 +460,6 @@ module.exports = {
|
|
|
458
460
|
component: {
|
|
459
461
|
checkUpdateTitle: 'Check for Updates',
|
|
460
462
|
updateTitle: 'Update Components',
|
|
461
|
-
updateAppTitle: 'Update Blocklet',
|
|
462
463
|
noUpdate: 'No components to update',
|
|
463
464
|
add: 'Add Component',
|
|
464
465
|
selectComponent: 'Select Component',
|
|
@@ -470,13 +471,13 @@ module.exports = {
|
|
|
470
471
|
noComponent: 'No components',
|
|
471
472
|
mountPoint: "What's the mount point?",
|
|
472
473
|
mountPointTip: "If you set mount point to '/my-prefix', then all requests that begins with that mount point will be routed to the selected component",
|
|
473
|
-
titleTip: 'You can customize different titles for identical components',
|
|
474
474
|
delete: 'Delete Component',
|
|
475
475
|
deleteDescription: 'This component will not be accessible after deletion. Confirm delete?',
|
|
476
476
|
purchase: 'Payment Required',
|
|
477
477
|
tip: {
|
|
478
478
|
stopBlocklet: 'Please stop running Blocklet first',
|
|
479
|
-
notDynamic: 'Only dynamically added component can be removed'
|
|
479
|
+
notDynamic: 'Only dynamically added component can be removed',
|
|
480
|
+
requiredBy: 'The component is required by {name}'
|
|
480
481
|
},
|
|
481
482
|
choose: 'Choose',
|
|
482
483
|
addWithName: 'Add Component To {name}',
|
|
@@ -519,6 +520,22 @@ module.exports = {
|
|
|
519
520
|
resultTipStart: 'With',
|
|
520
521
|
resultTipEnd: 'you can build and publish this blocklet within minutes',
|
|
521
522
|
uploadedComponentTip: 'Directly uploaded components cannot be exported:'
|
|
523
|
+
},
|
|
524
|
+
migrate: {
|
|
525
|
+
title: 'Migrate Application',
|
|
526
|
+
scan: 'Connect your DID Wallet to generate a key-pair for this application',
|
|
527
|
+
confirm: 'Review this operation on your DID Wallet',
|
|
528
|
+
success: 'Your application is successfully migrated, the page will be refreshed in {sec} seconds',
|
|
529
|
+
intro: {
|
|
530
|
+
l1: 'Click here',
|
|
531
|
+
l2: 'to migrate your application',
|
|
532
|
+
l3: '1. Your Application DID will be fully controlled in your DID Wallet.',
|
|
533
|
+
l4: '2. The component structure will be updated and you can manage your components more flexibly.'
|
|
534
|
+
},
|
|
535
|
+
tip: {
|
|
536
|
+
duplicate: 'Find duplicate component {name}, please delete useless components and migrate again',
|
|
537
|
+
running: 'Please stop blocklet before migration'
|
|
538
|
+
}
|
|
522
539
|
}
|
|
523
540
|
},
|
|
524
541
|
dashboard: {
|
package/lib/locales/zh.js
CHANGED
|
@@ -125,6 +125,7 @@ module.exports = {
|
|
|
125
125
|
delConfirm: '删除',
|
|
126
126
|
delConfirmDescription: '确认删除?',
|
|
127
127
|
delete: '删除',
|
|
128
|
+
dependents: '被依赖',
|
|
128
129
|
description: '描述',
|
|
129
130
|
detail: '详情',
|
|
130
131
|
did: 'DID',
|
|
@@ -228,6 +229,7 @@ module.exports = {
|
|
|
228
229
|
remove: '删除',
|
|
229
230
|
renew: '续期',
|
|
230
231
|
reportIssue: '问题反馈',
|
|
232
|
+
required: '必需的',
|
|
231
233
|
requiredErrorText: '{name}是必填的',
|
|
232
234
|
resource: '资源',
|
|
233
235
|
restart: '重启',
|
|
@@ -466,7 +468,6 @@ module.exports = {
|
|
|
466
468
|
component: {
|
|
467
469
|
checkUpdateTitle: '检查更新',
|
|
468
470
|
updateTitle: '更新组件',
|
|
469
|
-
updateAppTitle: '更新 Blocklet',
|
|
470
471
|
noUpdate: '没有需要更新的组件',
|
|
471
472
|
add: '添加组件',
|
|
472
473
|
selectComponent: '选择组件',
|
|
@@ -478,13 +479,13 @@ module.exports = {
|
|
|
478
479
|
noComponent: '暂无组件',
|
|
479
480
|
mountPoint: '组件的挂载点是什么?',
|
|
480
481
|
mountPointTip: "如果你填写了 '/my-prefix',那么所有以其为前缀的请求都会被转发到配置的组件",
|
|
481
|
-
titleTip: '你可以为相同的组件自定义不同的名称',
|
|
482
482
|
delete: '删除组件',
|
|
483
483
|
deleteDescription: '删除后此组件将无法访问。确认删除?',
|
|
484
484
|
purchase: '需要支付',
|
|
485
485
|
tip: {
|
|
486
486
|
stopBlocklet: '请先停止运行 Blocklet',
|
|
487
|
-
notDynamic: '只有动态添加的组件才能被删除'
|
|
487
|
+
notDynamic: '只有动态添加的组件才能被删除',
|
|
488
|
+
requiredBy: '{name} 需要该组件'
|
|
488
489
|
},
|
|
489
490
|
choose: '选择',
|
|
490
491
|
addWithName: '添加组件到 {name}',
|
|
@@ -527,6 +528,22 @@ module.exports = {
|
|
|
527
528
|
resultTipStart: '使用',
|
|
528
529
|
resultTipEnd: '你可以在几分钟内构建并发布这个 Blocklet',
|
|
529
530
|
uploadedComponentTip: '无法导出直接上传的组件:'
|
|
531
|
+
},
|
|
532
|
+
migrate: {
|
|
533
|
+
title: '迁移应用',
|
|
534
|
+
scan: '用你的 DID 钱包扫码为这个应用生成钥匙对',
|
|
535
|
+
confirm: '请在 DID 钱包上确认',
|
|
536
|
+
success: '你的应用已迁移成功,页面将在 {sec} 秒后刷新',
|
|
537
|
+
intro: {
|
|
538
|
+
l1: '点击这里',
|
|
539
|
+
l2: '迁移你的应用',
|
|
540
|
+
l3: '1. 应用程序的 DID 将在你的钱包中完全控制。',
|
|
541
|
+
l4: '2. 组件结构将更新,你可以更灵活地管理您的组件。'
|
|
542
|
+
},
|
|
543
|
+
tip: {
|
|
544
|
+
duplicate: '发现重复的组件 {name},请删除无用组件并重新迁移',
|
|
545
|
+
running: '迁移前请先停止应用'
|
|
546
|
+
}
|
|
530
547
|
}
|
|
531
548
|
},
|
|
532
549
|
dashboard: {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = MemberList;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
12
|
var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
|
|
@@ -115,11 +116,12 @@ function MemberList(_ref2) {
|
|
|
115
116
|
type
|
|
116
117
|
} = _ref2;
|
|
117
118
|
const {
|
|
118
|
-
appIdList
|
|
119
|
+
appIdList = []
|
|
119
120
|
} = (0, _blocklet.useBlockletContext)();
|
|
120
121
|
const {
|
|
121
122
|
teamDid,
|
|
122
123
|
invitations,
|
|
124
|
+
teamIssuerDid,
|
|
123
125
|
roles,
|
|
124
126
|
refresh,
|
|
125
127
|
enablePassportIssuance,
|
|
@@ -187,7 +189,7 @@ function MemberList(_ref2) {
|
|
|
187
189
|
}).then(res => {
|
|
188
190
|
setLoading(false);
|
|
189
191
|
(res.users || []).forEach(x => {
|
|
190
|
-
x.isFromExternal = isFromExternal(x, appIdList);
|
|
192
|
+
x.isFromExternal = isFromExternal(x, (0, _isEmpty.default)(appIdList) ? [teamIssuerDid] : appIdList);
|
|
191
193
|
x.avatar = (0, _util2.parseAvatar)(x.avatar, teamDid, inService);
|
|
192
194
|
|
|
193
195
|
// for backwards compatibility
|
package/lib/util/index.js
CHANGED
|
@@ -576,8 +576,8 @@ function extractStatusUrlFromNextWorkflow(nextWorkflow) {
|
|
|
576
576
|
token: new URL(nextWorkflowURL).searchParams.get('_t_')
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
|
-
function getBlockletMetaUrl(
|
|
580
|
-
return (0, _urlJoin.default)(
|
|
579
|
+
function getBlockletMetaUrl(storeUrl, did) {
|
|
580
|
+
return (0, _urlJoin.default)(storeUrl, _constant.BLOCKLET_STORE_API_PREFIX, "/blocklets/".concat(did, "/blocklet.json"));
|
|
581
581
|
}
|
|
582
582
|
async function getAsset(chainHost, address) {
|
|
583
583
|
const result = await _axios.default.post((0, _urlJoin.default)(chainHost, '/api/gql/'), JSON.stringify({
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.69-beta-
|
|
6
|
+
"version": "1.8.69-beta-76f8a46f",
|
|
7
7
|
"description": "UX components shared across abtnode packages",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@abtnode/auth": "1.8.69-beta-
|
|
25
|
-
"@abtnode/constant": "1.8.69-beta-
|
|
26
|
-
"@abtnode/util": "1.8.69-beta-
|
|
24
|
+
"@abtnode/auth": "1.8.69-beta-76f8a46f",
|
|
25
|
+
"@abtnode/constant": "1.8.69-beta-76f8a46f",
|
|
26
|
+
"@abtnode/util": "1.8.69-beta-76f8a46f",
|
|
27
27
|
"@arcblock/did-connect": "^2.5.5",
|
|
28
28
|
"@arcblock/did-motif": "^1.1.10",
|
|
29
29
|
"@arcblock/icons": "^2.5.5",
|
|
30
30
|
"@arcblock/terminal": "^2.5.5",
|
|
31
31
|
"@arcblock/ux": "^2.5.5",
|
|
32
|
-
"@blocklet/constant": "1.8.69-beta-
|
|
33
|
-
"@blocklet/launcher-layout": "^1.9.
|
|
34
|
-
"@blocklet/list": "^0.11.
|
|
35
|
-
"@blocklet/meta": "1.8.69-beta-
|
|
32
|
+
"@blocklet/constant": "1.8.69-beta-76f8a46f",
|
|
33
|
+
"@blocklet/launcher-layout": "^1.9.65",
|
|
34
|
+
"@blocklet/list": "^0.11.6",
|
|
35
|
+
"@blocklet/meta": "1.8.69-beta-76f8a46f",
|
|
36
36
|
"@blocklet/ui-react": "^2.5.5",
|
|
37
37
|
"@emotion/react": "^11.10.4",
|
|
38
38
|
"@emotion/styled": "^11.10.4",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"@babel/preset-react": "^7.18.6",
|
|
87
87
|
"babel-plugin-inline-react-svg": "^1.1.2"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "07415e674443b85648ea80b734f7a3690abfc15e"
|
|
90
90
|
}
|