@abtnode/ux 1.16.14-beta-dd4f6a50 → 1.16.14-beta-3127f514

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.
@@ -118,8 +118,19 @@ function BlockletActions(_ref) {
118
118
  });
119
119
  return;
120
120
  }
121
+ const componentDids = blocklet.children.filter(x => !(0, _util.isInProgress)(x.status) && x.status !== 'running').map(x => x.meta.did);
121
122
  const input = {
122
- did: blocklet.meta.did
123
+ did: blocklet.meta.did,
124
+ componentDids
125
+ };
126
+ await fn({
127
+ input
128
+ });
129
+ } else if (['stop', 'restart', 'reload'].includes(action)) {
130
+ const componentDids = blocklet.children.filter(x => x.status === 'running').map(x => x.meta.did);
131
+ const input = {
132
+ did: blocklet.meta.did,
133
+ componentDids
123
134
  };
124
135
  await fn({
125
136
  input
@@ -163,7 +174,18 @@ function BlockletActions(_ref) {
163
174
  setConfirmSetting(null);
164
175
  };
165
176
  const name = (0, _util.getDisplayName)(blocklet, true);
166
- const removeSetting = {
177
+ const removeSetting = blocklet.mode === _constant.BLOCKLET_MODES.DEVELOPMENT ? {
178
+ description: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
179
+ component: "div",
180
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
181
+ gutterBottom: true,
182
+ children: t('blocklet.action.removeApplicationDescription')
183
+ })
184
+ }),
185
+ params: {
186
+ removeType: 'complete'
187
+ }
188
+ } : {
167
189
  description: (params, setParams) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
168
190
  component: "div",
169
191
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
@@ -306,25 +328,25 @@ function BlockletActions(_ref) {
306
328
  icon: _icons.default.Start,
307
329
  name: t('common.start'),
308
330
  handler: createHandler('start', node.api.startBlocklet),
309
- disabled: disableStart || blocklet.status === 'running' || blocklet.status === 'corrupted' || missingRequiredConfigs.length > 0 || (0, _util2.isDownloading)(blocklet.status) || blocklet.mode === _constant.BLOCKLET_MODES.DEVELOPMENT || recommendedUrlLoading || inProgress
331
+ disabled: disableStart || blocklet.children.every(x => x.status === 'running') || (0, _util2.isDownloading)(blocklet.status) || recommendedUrlLoading || inProgress
310
332
  }, {
311
333
  action: 'stop',
312
334
  icon: _icons.default.Stop,
313
335
  name: t('common.stop'),
314
336
  handler: createHandler('stop', node.api.stopBlocklet, true),
315
- disabled: !['running', 'starting'].includes(blocklet.status) || blocklet.mode === _constant.BLOCKLET_MODES.DEVELOPMENT
337
+ disabled: !['running', 'starting'].includes(blocklet.status)
316
338
  }, {
317
339
  action: 'restart',
318
340
  icon: _icons.default.Restart,
319
341
  name: t('common.restart'),
320
342
  handler: createHandler('restart', node.api.restartBlocklet, true),
321
- disabled: disableStart || blocklet.status !== 'running' || blocklet.mode === _constant.BLOCKLET_MODES.DEVELOPMENT
343
+ disabled: disableStart || blocklet.status !== 'running'
322
344
  }, {
323
345
  action: 'reload',
324
346
  icon: _icons.default.Reload,
325
347
  name: t('common.reload'),
326
348
  handler: createHandler('reload', node.api.reloadBlocklet),
327
- disabled: disableStart || blocklet.status !== 'running' || blocklet.mode === _constant.BLOCKLET_MODES.DEVELOPMENT
349
+ disabled: disableStart || blocklet.status !== 'running'
328
350
  }, (0, _util2.isDownloading)(blocklet.status) ? cancelDownloadAction : removeAction, {
329
351
  separator: true
330
352
  }, {
@@ -1110,7 +1110,9 @@ AddComponent.propTypes = {
1110
1110
  AddComponent.defaultProps = {
1111
1111
  children: null
1112
1112
  };
1113
- const DialogWrapper = (0, _styled.default)(_Dialog.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .MuiDialogContent-root {\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 0;\n }\n .MuiDialogActions-root {\n padding: 16px 24px;\n }\n"])));
1113
+
1114
+ // FIXME: @zhanghan 下面代码中的 header:empty 用于修复 e2e-test 中的问题 core/webapp/cypress/e2e/3-blocklet-lifecycle.cy.js L70
1115
+ const DialogWrapper = (0, _styled.default)(_Dialog.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .MuiDialogContent-root {\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 0;\n }\n .MuiDialogActions-root {\n padding: 16px 24px;\n }\n header:empty {\n display: none;\n }\n"])));
1114
1116
  const TypographyWrapper = (0, _styled.default)(_Typography.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n"])));
1115
1117
  const RightContent = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 34px 24px 24px;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n\n // blocklet-select-side\n aside {\n width: 140px;\n }\n"])));
1116
1118
  const isMobileDialogContent = props => {
@@ -69,7 +69,6 @@ const FederatedDetailDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
69
69
  }), [open, close, approve]);
70
70
  const infoList = (0, _ahooks.useCreation)(() => {
71
71
  state.data.migratedFrom = [state.data.appId, state.data.appPid];
72
- // const keys = Object.keys(omit(state.data, ['isMaster', 'did', 'pk']));
73
72
  const keys = ['appName', 'appLogo', 'appId', 'appPid', 'migratedFrom', 'appDescription', 'appUrl', 'version', 'appliedAt', 'status', 'serverId', 'serverVersion'];
74
73
  if (state.data.isMaster !== false) {
75
74
  (0, _pull.default)(keys, 'appliedAt', 'status');
@@ -130,17 +129,18 @@ const FederatedDetailDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
130
129
  const onReject = (0, _ahooks.useMemoizedFn)(async () => {
131
130
  await api.auditFederatedLogin({
132
131
  input: {
133
- appId: state.data.appId,
132
+ memberPid: state.data.appPid,
134
133
  did: blocklet.appPid,
135
134
  status: 'rejected'
136
135
  }
137
136
  });
137
+ close();
138
138
  state === null || state === void 0 ? void 0 : state.callback(false);
139
139
  });
140
140
  const onApprove = (0, _ahooks.useMemoizedFn)(async () => {
141
141
  await api.auditFederatedLogin({
142
142
  input: {
143
- memberPid: state.data.appId,
143
+ memberPid: state.data.appPid,
144
144
  did: blocklet.appPid,
145
145
  status: 'approved'
146
146
  }
@@ -175,7 +175,17 @@ function SpacesBackupRecords(_ref2) {
175
175
  message
176
176
  } = (_backups$index = backups === null || backups === void 0 ? void 0 : backups[index]) !== null && _backups$index !== void 0 ? _backups$index : {};
177
177
  if ((0, _lodash.isNull)(status)) {
178
- return t('common.progress');
178
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
179
+ display: "inline-flex",
180
+ alignItems: "center",
181
+ fontSize: "14px",
182
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
183
+ sx: {
184
+ marginRight: '4px'
185
+ },
186
+ size: "12px"
187
+ }), t('common.progress')]
188
+ });
179
189
  }
180
190
  const node = !status ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, {
181
191
  type: "success",
@@ -266,6 +266,7 @@ function SpaceItem(_ref) {
266
266
  await onBackupNow();
267
267
  } catch (error) {
268
268
  console.error(error);
269
+ _Toast.default.error(error.message);
269
270
  } finally {
270
271
  setLoading(true);
271
272
  }
@@ -23,7 +23,7 @@ function RelativeTime(_ref) {
23
23
  return '-';
24
24
  }
25
25
  const prettyOption = {
26
- locale: locale === 'zh' ? 'zh_CN' : 'zh_US',
26
+ locale: (0, _util.formatPrettyMsLocale)(locale),
27
27
  compact: true
28
28
  };
29
29
  const valTime = new Date(value).getTime();
@@ -102,7 +102,7 @@ function Subscription(_ref) {
102
102
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, _objectSpread(_objectSpread({
103
103
  label: t("expiration.tips.".concat(status), {
104
104
  validity: (0, _prettyMsI18n.default)(validityMs, {
105
- locale: (0, _util.formatLocale)(locale),
105
+ locale: (0, _util.formatPrettyMsLocale)(locale),
106
106
  compact: true,
107
107
  verbose: true
108
108
  })
package/lib/util/index.js CHANGED
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "formatError", {
15
15
  }
16
16
  });
17
17
  exports.formatFactoryPrice = formatFactoryPrice;
18
- exports.formatRegistryScreenshotPath = exports.formatRegistryLogoPath = exports.formatPerson = exports.formatMountPoint = exports.formatLocale = void 0;
18
+ exports.formatRegistryScreenshotPath = exports.formatRegistryLogoPath = exports.formatPrettyMsLocale = exports.formatPerson = exports.formatMountPoint = exports.formatLocale = void 0;
19
19
  exports.formatTime = formatTime;
20
20
  exports.formatToDate = formatToDate;
21
21
  exports.formatToDatetime = formatToDatetime;
@@ -257,6 +257,8 @@ const formatLocale = function formatLocale() {
257
257
  return locale;
258
258
  };
259
259
  exports.formatLocale = formatLocale;
260
+ const formatPrettyMsLocale = locale => locale === 'zh' ? 'zh_CN' : 'en_US';
261
+ exports.formatPrettyMsLocale = formatPrettyMsLocale;
260
262
  const parseQuery = str => str.replace(/^\?/, '').split('&').map(x => x.split('=')).filter(_ref => {
261
263
  let [key] = _ref;
262
264
  return !!key;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.14-beta-dd4f6a50",
3
+ "version": "1.16.14-beta-3127f514",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,23 +23,23 @@
23
23
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@abtnode/auth": "1.16.14-beta-dd4f6a50",
27
- "@abtnode/constant": "1.16.14-beta-dd4f6a50",
28
- "@abtnode/util": "1.16.14-beta-dd4f6a50",
26
+ "@abtnode/auth": "1.16.14-beta-3127f514",
27
+ "@abtnode/constant": "1.16.14-beta-3127f514",
28
+ "@abtnode/util": "1.16.14-beta-3127f514",
29
29
  "@ahooksjs/use-url-state": "^3.5.1",
30
30
  "@arcblock/did": "^1.18.87",
31
- "@arcblock/did-connect": "^2.5.65",
31
+ "@arcblock/did-connect": "^2.6.2",
32
32
  "@arcblock/did-motif": "^1.1.13",
33
- "@arcblock/icons": "^2.5.65",
34
- "@arcblock/nft-display": "2.5.65",
35
- "@arcblock/react-hooks": "^2.5.65",
36
- "@arcblock/terminal": "^2.5.65",
37
- "@arcblock/ux": "^2.5.65",
38
- "@blocklet/constant": "1.16.14-beta-dd4f6a50",
39
- "@blocklet/launcher-layout": "2.1.55",
40
- "@blocklet/list": "^0.12.10",
41
- "@blocklet/meta": "1.16.14-beta-dd4f6a50",
42
- "@blocklet/ui-react": "^2.5.65",
33
+ "@arcblock/icons": "^2.6.2",
34
+ "@arcblock/nft-display": "2.6.2",
35
+ "@arcblock/react-hooks": "^2.6.2",
36
+ "@arcblock/terminal": "^2.6.2",
37
+ "@arcblock/ux": "^2.6.2",
38
+ "@blocklet/constant": "1.16.14-beta-3127f514",
39
+ "@blocklet/launcher-layout": "2.1.72",
40
+ "@blocklet/list": "^0.12.15",
41
+ "@blocklet/meta": "1.16.14-beta-3127f514",
42
+ "@blocklet/ui-react": "^2.6.2",
43
43
  "@emotion/react": "^11.10.4",
44
44
  "@emotion/styled": "^11.10.4",
45
45
  "@iconify/react": "^4.0.0",
@@ -97,5 +97,5 @@
97
97
  "@babel/preset-react": "^7.18.6",
98
98
  "babel-plugin-inline-react-svg": "^1.1.2"
99
99
  },
100
- "gitHead": "fb3858f842b221f0a8c298307b393d55c555af45"
100
+ "gitHead": "cb397b94b752e71dfc0ba2c4ad08628cf03ce396"
101
101
  }