@abtnode/ux 1.16.14-beta-dc99d0a2 → 1.16.14-beta-dd4f6a50

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.
@@ -131,7 +131,7 @@ const FederatedDetailDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
131
131
  await api.auditFederatedLogin({
132
132
  input: {
133
133
  appId: state.data.appId,
134
- did: blocklet.meta.did,
134
+ did: blocklet.appPid,
135
135
  status: 'rejected'
136
136
  }
137
137
  });
@@ -140,8 +140,8 @@ const FederatedDetailDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
140
140
  const onApprove = (0, _ahooks.useMemoizedFn)(async () => {
141
141
  await api.auditFederatedLogin({
142
142
  input: {
143
- appId: state.data.appId,
144
- did: blocklet.meta.did,
143
+ memberPid: state.data.appId,
144
+ did: blocklet.appPid,
145
145
  status: 'approved'
146
146
  }
147
147
  });
@@ -19,7 +19,7 @@ var _node = require("../../contexts/node");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
  const FederatedJoinDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
22
- var _blocklet$meta, _theme$transitions, _theme$transitions$du;
22
+ var _theme$transitions, _theme$transitions$du;
23
23
  const {
24
24
  t
25
25
  } = (0, _react.useContext)(_context.LocaleContext);
@@ -29,7 +29,7 @@ const FederatedJoinDialog = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
29
29
  const {
30
30
  blocklet
31
31
  } = (0, _blocklet.useBlockletContext)();
32
- const did = blocklet === null || blocklet === void 0 ? void 0 : (_blocklet$meta = blocklet.meta) === null || _blocklet$meta === void 0 ? void 0 : _blocklet$meta.did;
32
+ const did = blocklet === null || blocklet === void 0 ? void 0 : blocklet.appPid;
33
33
  const theme = (0, _Theme.useTheme)();
34
34
  const leavingScreen = (theme === null || theme === void 0 ? void 0 : (_theme$transitions = theme.transitions) === null || _theme$transitions === void 0 ? void 0 : (_theme$transitions$du = _theme$transitions.duration) === null || _theme$transitions$du === void 0 ? void 0 : _theme$transitions$du.leavingScreen) || 300;
35
35
  const state = (0, _ahooks.useReactive)({
@@ -70,8 +70,8 @@ function FederatedSiteList(_ref) {
70
70
  async onConfirm(close) {
71
71
  await api.auditFederatedLogin({
72
72
  input: {
73
- appId: row.appId,
74
- did: blocklet.meta.did,
73
+ memberPid: row.appPid,
74
+ did: blocklet.appPid,
75
75
  status: 'revoked'
76
76
  }
77
77
  });
@@ -86,8 +86,8 @@ function FederatedSiteList(_ref) {
86
86
  async onConfirm(close) {
87
87
  await api.auditFederatedLogin({
88
88
  input: {
89
- appId: row.appId,
90
- did: blocklet.meta.did,
89
+ memberPid: row.appPid,
90
+ did: blocklet.appPid,
91
91
  status: 'approved'
92
92
  }
93
93
  });
@@ -259,7 +259,7 @@ function FederatedSiteList(_ref) {
259
259
  async onConfirm(close) {
260
260
  await api.configFederated({
261
261
  input: {
262
- did: blocklet.meta.did,
262
+ did: blocklet.appPid,
263
263
  autoLogin: !checked
264
264
  }
265
265
  });
@@ -268,19 +268,53 @@ function FederatedSiteList(_ref) {
268
268
  }
269
269
  });
270
270
  }, [setChecked, checked]);
271
+ const quitFederatedLogin = (0, _ahooks.useMemoizedFn)(() => {
272
+ confirmApi.open({
273
+ title: t('federated.quitFederatedLogin'),
274
+ content: t('federated.quitFederatedLoginDescription'),
275
+ async onConfirm(close) {
276
+ await api.quitFederatedLogin({
277
+ input: {
278
+ did: blocklet.appPid
279
+ }
280
+ });
281
+ close();
282
+ }
283
+ });
284
+ });
285
+ const customButtons = [];
286
+ if (mode !== 'master') {
287
+ customButtons.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
288
+ size: "small",
289
+ variant: "contained",
290
+ color: "error",
291
+ onClick: quitFederatedLogin,
292
+ sx: {
293
+ ml: 1
294
+ },
295
+ children: t('federated.quitFederatedLogin')
296
+ }));
297
+ } else {
298
+ customButtons.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
299
+ size: "small",
300
+ variant: "contained",
301
+ onClick: showInvite,
302
+ sx: {
303
+ ml: 1
304
+ },
305
+ children: t('federated.inviteJoinFederatedLogin')
306
+ }));
307
+ }
271
308
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
272
309
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Datatable.default, {
273
310
  className: "main-table",
274
311
  locale: locale,
275
312
  data: federatedSites,
276
313
  columns: columns,
314
+ customButtons: customButtons,
277
315
  title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
278
316
  className: "table-toolbar-left",
279
- children: mode === 'master' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
280
- variant: "contained",
281
- onClick: showInvite,
282
- children: t('federated.inviteJoinFederatedLogin')
283
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
317
+ children: mode === 'master' ? t('oauth.federated') : /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
284
318
  sx: {
285
319
  ml: 0,
286
320
  '& span.MuiSwitch-switchBase': {
package/lib/locales/en.js CHANGED
@@ -1491,6 +1491,8 @@ module.exports = {
1491
1491
  federatedLogin: 'Federated login',
1492
1492
  joinFederatedLogin: 'Join federated login',
1493
1493
  joinFederatedLoginDescription: 'Please enter the federated login address provided by Master Blocklet to join the federated login',
1494
+ quitFederatedLogin: 'Quit federated login',
1495
+ quitFederatedLoginDescription: 'After quit federated login, normal login is always available',
1494
1496
  federatedJoinAppUrl: 'Federated login join appUrl',
1495
1497
  federatedJoinAppUrlRequired: 'Please input federated login join appUrl',
1496
1498
  failedToGetFederatedLoginAppUrl: 'Failed to get federated login join appUrl',
package/lib/locales/zh.js CHANGED
@@ -1494,6 +1494,8 @@ module.exports = {
1494
1494
  federatedLogin: '统一登录',
1495
1495
  joinFederatedLogin: '加入统一登录',
1496
1496
  joinFederatedLoginDescription: '请输入 Master Blocklet 提供的统一登录地址以加入统一登录',
1497
+ quitFederatedLogin: '退出统一登录',
1498
+ quitFederatedLoginDescription: '退出统一登录后,你仍可以使用普通的登录方式来登录',
1497
1499
  federatedJoinAppUrl: '统一登录地址',
1498
1500
  federatedJoinAppUrlRequired: '请输入统一登录地址',
1499
1501
  failedToGetFederatedLoginAppUrl: '获取统一登录地址失败',
@@ -299,7 +299,8 @@ function MemberList(_ref2) {
299
299
  const source = e || _constant.USER_TYPE.WALLET;
300
300
  const providerNameMap = {
301
301
  auth0: 'Auth0',
302
- wallet: 'DID wallet'
302
+ wallet: 'DID wallet',
303
+ federated: 'Federated'
303
304
  };
304
305
  return providerNameMap[source] || source;
305
306
  }
@@ -169,7 +169,8 @@ function Member(_ref3) {
169
169
  };
170
170
  const providerNameMap = {
171
171
  auth0: 'Auth0',
172
- wallet: 'DID wallet'
172
+ wallet: 'DID wallet',
173
+ federated: 'Federated'
173
174
  };
174
175
 
175
176
  // tab
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/ux",
3
- "version": "1.16.14-beta-dc99d0a2",
3
+ "version": "1.16.14-beta-dd4f6a50",
4
4
  "description": "UX components shared across abtnode packages",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,9 +23,9 @@
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-dc99d0a2",
27
- "@abtnode/constant": "1.16.14-beta-dc99d0a2",
28
- "@abtnode/util": "1.16.14-beta-dc99d0a2",
26
+ "@abtnode/auth": "1.16.14-beta-dd4f6a50",
27
+ "@abtnode/constant": "1.16.14-beta-dd4f6a50",
28
+ "@abtnode/util": "1.16.14-beta-dd4f6a50",
29
29
  "@ahooksjs/use-url-state": "^3.5.1",
30
30
  "@arcblock/did": "^1.18.87",
31
31
  "@arcblock/did-connect": "^2.5.65",
@@ -35,10 +35,10 @@
35
35
  "@arcblock/react-hooks": "^2.5.65",
36
36
  "@arcblock/terminal": "^2.5.65",
37
37
  "@arcblock/ux": "^2.5.65",
38
- "@blocklet/constant": "1.16.14-beta-dc99d0a2",
38
+ "@blocklet/constant": "1.16.14-beta-dd4f6a50",
39
39
  "@blocklet/launcher-layout": "2.1.55",
40
40
  "@blocklet/list": "^0.12.10",
41
- "@blocklet/meta": "1.16.14-beta-dc99d0a2",
41
+ "@blocklet/meta": "1.16.14-beta-dd4f6a50",
42
42
  "@blocklet/ui-react": "^2.5.65",
43
43
  "@emotion/react": "^11.10.4",
44
44
  "@emotion/styled": "^11.10.4",
@@ -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": "a00766d660ede97e2036f3a785f4f5cfb2e6d870"
100
+ "gitHead": "fb3858f842b221f0a8c298307b393d55c555af45"
101
101
  }