@abtnode/ux 1.16.28-beta-23b06b63 → 1.16.28-beta-bfbab430

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.
@@ -234,13 +234,13 @@ export default function ComponentCell({
234
234
  disabled: !['starting', 'stopping'].includes(app.status) && isInProgress(app.status)
235
235
  }), /*#__PURE__*/_jsx(Actions, {
236
236
  "data-cy": "component-actions",
237
- actions: [hasStartEngine(blocklet.meta) ? {
237
+ actions: [hasStartEngine(blocklet.meta) || isResource(blocklet) ? {
238
238
  icon: /*#__PURE__*/_jsx(InfoOutlinedIcon, {}),
239
239
  text: t('common.detail'),
240
240
  onClick: () => {
241
241
  setComponentInfo(blocklet);
242
242
  }
243
- } : null, !isResource(blocklet) && {
243
+ } : null, {
244
244
  icon: /*#__PURE__*/_jsx(RestartIcon, {}),
245
245
  text: t('common.restart'),
246
246
  onClick: () => {
@@ -2,12 +2,9 @@ import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
2
2
  import { useContext } from 'react';
3
3
  import styled from '@emotion/styled';
4
4
  import PropTypes from 'prop-types';
5
- import Badge from '@mui/material/Badge';
6
- import Dialog from '@mui/material/Dialog';
7
- import DialogContent from '@mui/material/DialogContent';
8
- import DialogTitle from '@mui/material/DialogTitle';
5
+ import { Badge, Box } from '@mui/material';
9
6
  import InfoRow from '@arcblock/ux/lib/InfoRow';
10
- import Box from '@mui/material/Box';
7
+ import Dialog from '@arcblock/ux/lib/Dialog';
11
8
  import { getDisplayName, hasStartEngine } from '@blocklet/meta/lib/util';
12
9
  import { useDeletingBlockletContext } from '../../contexts/deleting-blocklets';
13
10
  import Tag from '../../tag';
@@ -16,7 +13,7 @@ import DidAddress from '../../did-address';
16
13
  import BlockletSource from '../blocklet-source';
17
14
  import BlockletStatus from '../status';
18
15
  import BlockletVersion from '../version';
19
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
20
17
  const isResource = component => !component?.meta?.group;
21
18
  const getEngineRows = (engine, t) => {
22
19
  if (!engine) {
@@ -204,18 +201,16 @@ export default function ComponentInfoDialog({
204
201
  }
205
202
  return /*#__PURE__*/_jsx(Dialog, {
206
203
  open: true,
204
+ title: t('common.componentBasicInfo'),
205
+ showCloseButton: true,
207
206
  fullWidth: true,
208
207
  maxWidth: "md",
209
208
  onClose: () => {
210
209
  onClose(null);
211
210
  },
212
- children: /*#__PURE__*/_jsxs(Box, {
213
- paddingY: 1.5,
214
- children: [/*#__PURE__*/_jsx(DialogTitle, {
215
- children: t('common.componentBasicInfo')
216
- }), /*#__PURE__*/_jsx(DialogContent, {
217
- children: renderRows(componentRows)
218
- })]
211
+ children: /*#__PURE__*/_jsx(Box, {
212
+ paddingBottom: 1.5,
213
+ children: renderRows(componentRows)
219
214
  }, "dialog-wrapper")
220
215
  }, "base-info-dialog");
221
216
  }
@@ -4,7 +4,8 @@ import PropTypes from 'prop-types';
4
4
  import IconButton from '@mui/material/IconButton';
5
5
  import Box from '@mui/material/Box';
6
6
  import EditIcon from '@mui/icons-material/Edit';
7
- import { getDisplayName, hasStartEngine } from '@blocklet/meta/lib/util';
7
+ import { getDisplayName } from '@blocklet/meta/lib/util';
8
+ import { hasMountPoint } from '@blocklet/meta/lib/engine';
8
9
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
9
10
  import Dialog from '@arcblock/ux/lib/Dialog';
10
11
  import Tabs from '@arcblock/ux/lib/Tabs';
@@ -22,7 +23,7 @@ export default function ComponentConfiguration({
22
23
  t
23
24
  } = useLocaleContext();
24
25
  const isComponent = !!ancestors.length;
25
- const [tab, setTab] = useState(hasStartEngine(blocklet?.meta) ? 'settings' : 'environments');
26
+ const [tab, setTab] = useState(hasMountPoint(blocklet?.meta) ? 'settings' : 'environments');
26
27
  const name = isComponent ? getDisplayName(blocklet, true) : t('blocklet.component.container');
27
28
  if (isInstalling(blocklet.status)) {
28
29
  return null;
@@ -39,7 +40,7 @@ export default function ComponentConfiguration({
39
40
  setShowDialog(true);
40
41
  };
41
42
  const tabConfigs = {
42
- settings: hasStartEngine(blocklet.meta) && {
43
+ settings: hasMountPoint(blocklet.meta) && {
43
44
  label: t('blocklet.component.setting'),
44
45
  value: 'settings',
45
46
  component: /*#__PURE__*/_jsx(ComponentSetting, {
@@ -222,6 +222,7 @@ function NotificationEmail() {
222
222
  fullWidth: true,
223
223
  children: /*#__PURE__*/_jsx(TextField, {
224
224
  ...field,
225
+ required: true,
225
226
  label: t('notification.email.from'),
226
227
  error: !!formState.errors[field.name],
227
228
  helperText: formState.errors[field.name]?.message || ' ',
@@ -240,6 +241,7 @@ function NotificationEmail() {
240
241
  fullWidth: true,
241
242
  children: /*#__PURE__*/_jsx(TextField, {
242
243
  ...field,
244
+ required: true,
243
245
  error: !!formState.errors[field.name],
244
246
  label: t('notification.email.host'),
245
247
  helperText: formState.errors[field.name]?.message || ' ',
@@ -258,6 +260,7 @@ function NotificationEmail() {
258
260
  fullWidth: true,
259
261
  children: /*#__PURE__*/_jsx(TextField, {
260
262
  ...field,
263
+ required: true,
261
264
  type: "number",
262
265
  error: !!formState.errors[field.name],
263
266
  label: t('notification.email.port'),
@@ -277,6 +280,7 @@ function NotificationEmail() {
277
280
  fullWidth: true,
278
281
  children: /*#__PURE__*/_jsx(TextField, {
279
282
  ...field,
283
+ required: true,
280
284
  error: !!formState.errors[field.name],
281
285
  label: t('notification.email.user'),
282
286
  helperText: formState.errors[field.name]?.message || ' ',
@@ -295,6 +299,7 @@ function NotificationEmail() {
295
299
  fullWidth: true,
296
300
  children: /*#__PURE__*/_jsx(TextField, {
297
301
  ...field,
302
+ required: true,
298
303
  type: "password",
299
304
  error: !!formState.errors[field.name],
300
305
  label: t('notification.email.password'),
@@ -12,7 +12,9 @@ import useConfirm from '../../hooks/confirm';
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const defaultFormValues = {
14
14
  enabled: false,
15
- endpoint: ''
15
+ endpoint: '',
16
+ did: undefined,
17
+ pushPath: undefined
16
18
  };
17
19
  function NotificationPushKit() {
18
20
  const {
@@ -178,12 +180,56 @@ function NotificationPushKit() {
178
180
  fullWidth: true,
179
181
  children: /*#__PURE__*/_jsx(TextField, {
180
182
  ...field,
183
+ required: true,
181
184
  label: t('notification.pushKit.endpoint'),
182
185
  error: !!formState.errors[field.name],
183
186
  helperText: formState.errors[field.name]?.message || ' ',
184
187
  disabled: !enabled
185
188
  })
186
189
  })
190
+ }), /*#__PURE__*/_jsxs(Box, {
191
+ component: "details",
192
+ sx: {
193
+ pl: '1em'
194
+ },
195
+ children: [/*#__PURE__*/_jsx(Box, {
196
+ component: "summary",
197
+ sx: {
198
+ mb: 1,
199
+ ml: '-1em'
200
+ },
201
+ children: t('notification.pushKit.customOptions')
202
+ }), /*#__PURE__*/_jsx(Controller, {
203
+ name: "did",
204
+ control: control,
205
+ render: ({
206
+ field
207
+ }) => /*#__PURE__*/_jsx(FormControl, {
208
+ fullWidth: true,
209
+ children: /*#__PURE__*/_jsx(TextField, {
210
+ ...field,
211
+ label: t('notification.pushKit.did'),
212
+ error: !!formState.errors[field.name],
213
+ helperText: formState.errors[field.name]?.message || ' ',
214
+ disabled: !enabled
215
+ })
216
+ })
217
+ }), /*#__PURE__*/_jsx(Controller, {
218
+ name: "pushPath",
219
+ control: control,
220
+ render: ({
221
+ field
222
+ }) => /*#__PURE__*/_jsx(FormControl, {
223
+ fullWidth: true,
224
+ children: /*#__PURE__*/_jsx(TextField, {
225
+ ...field,
226
+ label: t('notification.pushKit.pushPath'),
227
+ error: !!formState.errors[field.name],
228
+ helperText: formState.errors[field.name]?.message || ' ',
229
+ disabled: !enabled
230
+ })
231
+ })
232
+ })]
187
233
  }), /*#__PURE__*/_jsx(Button, {
188
234
  variant: "outlined",
189
235
  color: "warning",
package/lib/locales/en.js CHANGED
@@ -931,7 +931,10 @@ export default {
931
931
  testReceiver: 'PushKit receiver',
932
932
  testSend: 'Test push-kit send',
933
933
  inputTestReceiver: 'Please input test receiver did',
934
- receiverRequired: 'PushKit receiver is required'
934
+ receiverRequired: 'PushKit receiver is required',
935
+ pushPath: 'Api path for push-kit (default /api/push)',
936
+ did: 'PushKit Blocklet DID',
937
+ customOptions: 'Custom Options'
935
938
  },
936
939
  email: {
937
940
  enable: 'Enable email notification',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.28-beta-23b06b63",
3
+ "version": "1.16.28-beta-bfbab430",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,9 +25,9 @@
25
25
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/auth": "1.16.28-beta-23b06b63",
29
- "@abtnode/constant": "1.16.28-beta-23b06b63",
30
- "@abtnode/util": "1.16.28-beta-23b06b63",
28
+ "@abtnode/auth": "1.16.28-beta-bfbab430",
29
+ "@abtnode/constant": "1.16.28-beta-bfbab430",
30
+ "@abtnode/util": "1.16.28-beta-bfbab430",
31
31
  "@ahooksjs/use-url-state": "^3.5.1",
32
32
  "@arcblock/did": "^1.18.123",
33
33
  "@arcblock/did-connect": "^2.9.90",
@@ -37,10 +37,10 @@
37
37
  "@arcblock/react-hooks": "^2.9.90",
38
38
  "@arcblock/terminal": "^2.9.90",
39
39
  "@arcblock/ux": "^2.9.90",
40
- "@blocklet/constant": "1.16.28-beta-23b06b63",
40
+ "@blocklet/constant": "1.16.28-beta-bfbab430",
41
41
  "@blocklet/launcher-layout": "2.3.21",
42
42
  "@blocklet/list": "^0.12.111",
43
- "@blocklet/meta": "1.16.28-beta-23b06b63",
43
+ "@blocklet/meta": "1.16.28-beta-bfbab430",
44
44
  "@blocklet/ui-react": "^2.9.90",
45
45
  "@blocklet/uploader": "^0.1.6",
46
46
  "@emotion/react": "^11.10.4",
@@ -108,5 +108,5 @@
108
108
  "jest": "^29.7.0",
109
109
  "jest-environment-jsdom": "^29.7.0"
110
110
  },
111
- "gitHead": "4e16d8cb992139e25f6702268895917561a1d2f1"
111
+ "gitHead": "f1fbf0752de46be00d1faa0d54eb7d28016e0bb9"
112
112
  }