@abtnode/ux 1.16.28 → 1.16.29-beta-e04c6f40
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/add-cert.js +2 -2
- package/lib/blocklet/component/add-component/add-component-core.js +2 -2
- package/lib/blocklet/component/did-space/connect-to.js +2 -2
- package/lib/blocklet/install-from-url.js +2 -2
- package/lib/blocklet/migration.js +2 -2
- package/lib/blocklet/notification/push-kit.js +17 -3
- package/lib/blocklet/publish/create-release/blocklets.js +1 -1
- package/lib/blocklet/publish/create-release/branding.js +2 -1
- package/lib/blocklet/publish/create-release/connect-store-button.js +99 -23
- package/lib/blocklet/publish/create-release/connect-store-list.js +37 -29
- package/lib/blocklet/publish/create-release/index.js +5 -2
- package/lib/blocklet/publish/release-list.js +2 -1
- package/lib/blocklet/storage/connect-to.js +2 -2
- package/lib/blocklet/transfer-owner.js +2 -2
- package/lib/hooks/use-navigation.js +31 -2
- package/lib/invitation/invitation-receive.js +46 -25
- package/lib/invitation/invitation.js +4 -4
- package/lib/locales/ar.js +15 -4
- package/lib/locales/de.js +15 -4
- package/lib/locales/en.js +14 -3
- package/lib/locales/es.js +15 -4
- package/lib/locales/fr.js +15 -4
- package/lib/locales/hi.js +15 -4
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +15 -4
- package/lib/locales/ja.js +15 -4
- package/lib/locales/ko.js +15 -4
- package/lib/locales/pt.js +15 -4
- package/lib/locales/ru.js +15 -4
- package/lib/locales/th.js +15 -4
- package/lib/locales/vi.js +15 -4
- package/lib/locales/zh-tw.js +15 -4
- package/lib/locales/zh.js +15 -4
- package/lib/store/add.js +31 -13
- package/lib/store/connect-actions.js +18 -18
- package/lib/store/item.js +30 -5
- package/lib/team/members/index.js +33 -1
- package/lib/team/members/invite-member.js +99 -67
- package/lib/team/members/issue-passport.js +2 -2
- package/lib/team/members/transfer-node.js +5 -5
- package/lib/team/passports/mutate-role.js +2 -2
- package/lib/util/index.js +1 -1
- package/lib/util/sdk.js +3 -0
- package/package.json +8 -7
package/lib/locales/ru.js
CHANGED
|
@@ -356,7 +356,9 @@ export default {
|
|
|
356
356
|
blockletStudio: 'Студия',
|
|
357
357
|
visitStore: 'Посетите магазин',
|
|
358
358
|
reconnect: 'Восстановить соединение',
|
|
359
|
-
change: 'Изменение'
|
|
359
|
+
change: 'Изменение',
|
|
360
|
+
disconnect: 'Отсоединить',
|
|
361
|
+
sourceApp: 'Принадлежит приложению'
|
|
360
362
|
},
|
|
361
363
|
blocklet: {
|
|
362
364
|
external: 'Внешний',
|
|
@@ -727,7 +729,7 @@ export default {
|
|
|
727
729
|
},
|
|
728
730
|
resourceTip: 'В настоящее время, как ресурсный блоклет, его нельзя установить напрямую из Магазина.',
|
|
729
731
|
whyCantSeeInStore: 'Почему я не вижу этот блоклет в магазине?',
|
|
730
|
-
whyCantSeeResourceBlockletInStore: '
|
|
732
|
+
whyCantSeeResourceBlockletInStore: 'Реурсные блоклеты по умолчанию скрыты со страницы списка магазина',
|
|
731
733
|
tenantScope: 'Арендатор',
|
|
732
734
|
blockletStudio: 'Студия Блоклет',
|
|
733
735
|
allComponentsNotRunning: 'Blocklets не запускается, пожалуйста, сначала запустите его',
|
|
@@ -744,7 +746,9 @@ export default {
|
|
|
744
746
|
branding: 'Брендинг',
|
|
745
747
|
brandingHelp: 'Больше информации о блоклете будет отображаться в магазине',
|
|
746
748
|
resourceSelect: 'Выберите ресурс из блоклетов',
|
|
747
|
-
resourceUpload: '
|
|
749
|
+
resourceUpload: 'Загрузите ресурс с вашего диска (в архиве требуется index.html)',
|
|
750
|
+
deleteStoreTip: 'Вы уверены, что хотите удалить {name} из списка магазина Connect?',
|
|
751
|
+
disconnectStoreTip: 'Блоклет будет удален из магазина после отключения. Уверены, что хотите отключить?'
|
|
748
752
|
},
|
|
749
753
|
titleValidationError: 'Длина заголовка должна быть не менее 3 символов',
|
|
750
754
|
descriptionValidationError: 'Длина описания должна быть от 3 до 160 символов'
|
|
@@ -1612,7 +1616,14 @@ export default {
|
|
|
1612
1616
|
restConfirmTitle: 'Вы хотите очистить все настраиваемые навигационные параметры?',
|
|
1613
1617
|
restConfirmDesc: 'После очистки навигация будет восстановлена в исходную конфигурацию Blocklet.',
|
|
1614
1618
|
resetSuccessful: 'Сброс успешен'
|
|
1615
|
-
}
|
|
1619
|
+
},
|
|
1620
|
+
access: 'Доступ',
|
|
1621
|
+
members: 'Участники',
|
|
1622
|
+
passport: 'Паспорт',
|
|
1623
|
+
analytics: 'аналитика',
|
|
1624
|
+
dashboard: 'Панель управления',
|
|
1625
|
+
studio: 'Студия',
|
|
1626
|
+
blockletService: 'Сервис Blocklet'
|
|
1616
1627
|
},
|
|
1617
1628
|
storage: {
|
|
1618
1629
|
spaces: {
|
package/lib/locales/th.js
CHANGED
|
@@ -356,7 +356,9 @@ export default {
|
|
|
356
356
|
blockletStudio: 'สตูดิโอ',
|
|
357
357
|
visitStore: 'เยี่ยมชมร้านค้า',
|
|
358
358
|
reconnect: 'เชื่อมต่อใหม่',
|
|
359
|
-
change: 'เปลี่ยนแปลง'
|
|
359
|
+
change: 'เปลี่ยนแปลง',
|
|
360
|
+
disconnect: 'ตัดการเชื่อมต่อ',
|
|
361
|
+
sourceApp: 'เป็นของแอป'
|
|
360
362
|
},
|
|
361
363
|
blocklet: {
|
|
362
364
|
external: 'ภายนอก',
|
|
@@ -727,7 +729,7 @@ export default {
|
|
|
727
729
|
},
|
|
728
730
|
resourceTip: 'ปัจจุบันเป็นบล็อกทรัพยากร ไม่สามารถติดตั้งโดยตรงจากร้านค้าได้',
|
|
729
731
|
whyCantSeeInStore: 'ทำไมฉันไม่สามารถเห็นบล็อกเล็ตนี้ในร้านค้าได้หรือ?',
|
|
730
|
-
whyCantSeeResourceBlockletInStore: '
|
|
732
|
+
whyCantSeeResourceBlockletInStore: 'Resource Blocklet ถูกซ่อนจากหน้ารายการร้านค้าโดยค่าตั้งต้น',
|
|
731
733
|
tenantScope: 'ผู้เช่า',
|
|
732
734
|
blockletStudio: 'Blocklet Studio',
|
|
733
735
|
allComponentsNotRunning: 'Blocklets ไม่ได้ทำงาน โปรดเริ่มต้นใช้งานก่อน',
|
|
@@ -744,7 +746,9 @@ export default {
|
|
|
744
746
|
branding: 'การติดตามแบรนด์',
|
|
745
747
|
brandingHelp: 'ข้อมูลเพิ่มเติมเกี่ยวกับ blocklet จะแสดงในร้านค้า',
|
|
746
748
|
resourceSelect: 'เลือกทรัพยากรจากบล็อกเล็ต',
|
|
747
|
-
resourceUpload: 'อัปโหลดทรัพยากรจากดิสก์ของคุณ'
|
|
749
|
+
resourceUpload: 'อัปโหลดทรัพยากรจากดิสก์ของคุณ (index.html จำเป็นในไฟล์เข้าเก็บ)',
|
|
750
|
+
deleteStoreTip: 'คุณแน่ใจหรือว่าต้องการลบ {name} ออกจากรายการร้านค้าเชื่อมต่อหรือไม่?',
|
|
751
|
+
disconnectStoreTip: 'เมื่อยกเลิกการเชื่อมต่อแล้ว Blocklet จะถูกลบออกจากร้าน คุณแน่ใจไหมว่าต้องการยกเลิกการเชื่อมต่อหรือไม่'
|
|
748
752
|
},
|
|
749
753
|
titleValidationError: 'ความยาวของชื่อต้องมีอย่างน้อย 3 ตัวอักษร',
|
|
750
754
|
descriptionValidationError: 'ความยาวคำอธิบายต้องอยู่ระหว่าง 3 ถึง 160 ตัวอักษร.'
|
|
@@ -1612,7 +1616,14 @@ export default {
|
|
|
1612
1616
|
restConfirmTitle: 'คุณต้องการล้างการนำทางทั้งหมดหรือไม่?',
|
|
1613
1617
|
restConfirmDesc: 'หลังจากล้างสะอาดแล้ว การนำทางจะถูกกู้คืนไปยังการกำหนดค่าเริ่มต้นเดิมของ Blocklet',
|
|
1614
1618
|
resetSuccessful: 'การรีเซ็ตสำเร็จ'
|
|
1615
|
-
}
|
|
1619
|
+
},
|
|
1620
|
+
access: 'เข้าถึง',
|
|
1621
|
+
members: 'สมาชิก',
|
|
1622
|
+
passport: 'หนังสือเดินทาง',
|
|
1623
|
+
analytics: 'การวิเคราะห์',
|
|
1624
|
+
dashboard: 'แดชบอร์ด',
|
|
1625
|
+
studio: 'สตูดิโอ',
|
|
1626
|
+
blockletService: 'บริการ Blocklet'
|
|
1616
1627
|
},
|
|
1617
1628
|
storage: {
|
|
1618
1629
|
spaces: {
|
package/lib/locales/vi.js
CHANGED
|
@@ -356,7 +356,9 @@ export default {
|
|
|
356
356
|
blockletStudio: 'Studio',
|
|
357
357
|
visitStore: 'Ghé cửa hàng',
|
|
358
358
|
reconnect: 'Kết nối lại',
|
|
359
|
-
change: 'Thay đổi'
|
|
359
|
+
change: 'Thay đổi',
|
|
360
|
+
disconnect: 'Ngắt kết nối',
|
|
361
|
+
sourceApp: 'Thuộc về ứng dụng'
|
|
360
362
|
},
|
|
361
363
|
blocklet: {
|
|
362
364
|
external: 'Bên ngoài',
|
|
@@ -727,7 +729,7 @@ export default {
|
|
|
727
729
|
},
|
|
728
730
|
resourceTip: 'Hiện tại, là một khối tài nguyên, nó không thể được cài đặt trực tiếp từ Cửa hàng.',
|
|
729
731
|
whyCantSeeInStore: 'Tại sao tôi không thể thấy khối này trong Cửa hàng?',
|
|
730
|
-
whyCantSeeResourceBlockletInStore: '
|
|
732
|
+
whyCantSeeResourceBlockletInStore: 'Resource Blocklet được ẩn khỏi trang danh sách cửa hàng mặc định',
|
|
731
733
|
tenantScope: 'Người thuê',
|
|
732
734
|
blockletStudio: 'Blocklet Studio',
|
|
733
735
|
allComponentsNotRunning: 'Blocklets không đang chạy, vui lòng khởi động nó trước',
|
|
@@ -744,7 +746,9 @@ export default {
|
|
|
744
746
|
branding: 'Thương hiệu',
|
|
745
747
|
brandingHelp: 'Thông tin chi tiết về blocklet sẽ được hiển thị trên Cửa hàng',
|
|
746
748
|
resourceSelect: 'Chọn tài nguyên từ blocklets',
|
|
747
|
-
resourceUpload: 'Tải tài nguyên từ ổ đĩa của bạn'
|
|
749
|
+
resourceUpload: 'Tải tài nguyên từ ổ đĩa của bạn (index.html cần thiết trong tệp nén)',
|
|
750
|
+
deleteStoreTip: 'Bạn có chắc chắn muốn xóa {name} khỏi danh sách Cửa hàng Kết nối không?',
|
|
751
|
+
disconnectStoreTip: 'Sau khi ngắt kết nối, Blocklet sẽ bị xóa khỏi cửa hàng. Bạn có chắc chắn muốn ngắt kết nối không?'
|
|
748
752
|
},
|
|
749
753
|
titleValidationError: 'Độ dài tiêu đề phải ít nhất 3 ký tự',
|
|
750
754
|
descriptionValidationError: 'Chiều dài mô tả phải từ 3 đến 160 ký tự.'
|
|
@@ -1612,7 +1616,14 @@ export default {
|
|
|
1612
1616
|
restConfirmTitle: 'Bạn có muốn xóa tất cả các điều hướng tùy chỉnh?',
|
|
1613
1617
|
restConfirmDesc: 'Sau khi làm sạch, điều hướng sẽ được khôi phục về cấu hình mặc định ban đầu của Blocklet',
|
|
1614
1618
|
resetSuccessful: 'Khôi phục thành công'
|
|
1615
|
-
}
|
|
1619
|
+
},
|
|
1620
|
+
access: 'Truy cập',
|
|
1621
|
+
members: 'Thành viên',
|
|
1622
|
+
passport: 'Hộ chiếu',
|
|
1623
|
+
analytics: 'Phân tích',
|
|
1624
|
+
dashboard: 'Bảng điều khiển',
|
|
1625
|
+
studio: 'Studio',
|
|
1626
|
+
blockletService: 'Dịch vụ Blocklet'
|
|
1616
1627
|
},
|
|
1617
1628
|
storage: {
|
|
1618
1629
|
spaces: {
|
package/lib/locales/zh-tw.js
CHANGED
|
@@ -356,7 +356,9 @@ export default {
|
|
|
356
356
|
blockletStudio: 'Studio',
|
|
357
357
|
visitStore: '訪問 Store',
|
|
358
358
|
reconnect: '重新連接',
|
|
359
|
-
change: '更改'
|
|
359
|
+
change: '更改',
|
|
360
|
+
disconnect: '斷開連線',
|
|
361
|
+
sourceApp: '屬於此 App'
|
|
360
362
|
},
|
|
361
363
|
blocklet: {
|
|
362
364
|
external: '外部的',
|
|
@@ -727,7 +729,7 @@ export default {
|
|
|
727
729
|
},
|
|
728
730
|
resourceTip: '目前,作為資源型 Blocklet,無法直接從商店安裝。',
|
|
729
731
|
whyCantSeeInStore: '為什麼我無法在商店中看到這個 Blocklet?',
|
|
730
|
-
whyCantSeeResourceBlockletInStore: '
|
|
732
|
+
whyCantSeeResourceBlockletInStore: '資源Blocklet預設情況下在商店列表頁面上被隱藏',
|
|
731
733
|
tenantScope: '租戶',
|
|
732
734
|
blockletStudio: 'Blocklet Studio',
|
|
733
735
|
allComponentsNotRunning: 'Blocklets未執行,請先啟動',
|
|
@@ -744,7 +746,9 @@ export default {
|
|
|
744
746
|
branding: '品牌',
|
|
745
747
|
brandingHelp: '將在商店中顯示有關區塊的更多信息',
|
|
746
748
|
resourceSelect: '從 blocklets 選擇資源',
|
|
747
|
-
resourceUpload: '
|
|
749
|
+
resourceUpload: '從您的磁盤上傳資源(存檔中需要index.html)',
|
|
750
|
+
deleteStoreTip: '您確定要將{name}從連接商店列表中移除嗎?',
|
|
751
|
+
disconnectStoreTip: '斷開連線後,blocklet 將從商店中移除。您確定要斷開連線嗎?'
|
|
748
752
|
},
|
|
749
753
|
titleValidationError: '標題長度必須至少為3到40個字符',
|
|
750
754
|
descriptionValidationError: '描述長度必須介於3到160個字符之間'
|
|
@@ -1612,7 +1616,14 @@ export default {
|
|
|
1612
1616
|
restConfirmTitle: '您要清除所有自訂導航嗎?',
|
|
1613
1617
|
restConfirmDesc: '清除後,導航將恢復到Blocklet的原始默認配置',
|
|
1614
1618
|
resetSuccessful: '重設成功'
|
|
1615
|
-
}
|
|
1619
|
+
},
|
|
1620
|
+
access: '訪問',
|
|
1621
|
+
members: '成員',
|
|
1622
|
+
passport: '護照',
|
|
1623
|
+
analytics: '分析',
|
|
1624
|
+
dashboard: '儀表板',
|
|
1625
|
+
studio: '工作室',
|
|
1626
|
+
blockletService: 'Blocklet服務'
|
|
1616
1627
|
},
|
|
1617
1628
|
storage: {
|
|
1618
1629
|
spaces: {
|
package/lib/locales/zh.js
CHANGED
|
@@ -356,7 +356,9 @@ export default {
|
|
|
356
356
|
blockletStudio: 'Studio',
|
|
357
357
|
visitStore: '访问 Store',
|
|
358
358
|
reconnect: '重新连接',
|
|
359
|
-
change: '更改'
|
|
359
|
+
change: '更改',
|
|
360
|
+
sourceApp: '所属应用',
|
|
361
|
+
disconnect: '断开连接'
|
|
360
362
|
},
|
|
361
363
|
blocklet: {
|
|
362
364
|
external: '外部',
|
|
@@ -732,7 +734,7 @@ export default {
|
|
|
732
734
|
},
|
|
733
735
|
resourceTip: '目前,作为资源型 Blocklet,它无法直接从 Store 安装。',
|
|
734
736
|
whyCantSeeInStore: '为什么我不能在 Store 中看到这个 Blocklet?',
|
|
735
|
-
whyCantSeeResourceBlockletInStore: '
|
|
737
|
+
whyCantSeeResourceBlockletInStore: '资源Blocklet默认情况下在商店列表页面上被隐藏',
|
|
736
738
|
tenantScope: '租户',
|
|
737
739
|
blockletStudio: 'Blocklet Studio',
|
|
738
740
|
allComponentsNotRunning: 'Blocklets未运行,请先启动',
|
|
@@ -747,7 +749,9 @@ export default {
|
|
|
747
749
|
branding: '品牌',
|
|
748
750
|
brandingHelp: '将在商店中显示有关区块链的更多信息',
|
|
749
751
|
resourceSelect: '从 blocklets 选择资源',
|
|
750
|
-
resourceUpload: '
|
|
752
|
+
resourceUpload: '从您的磁盘上传资源(存档中需要index.html)',
|
|
753
|
+
deleteStoreTip: '您确定要将{name}从连接商店列表中移除吗?',
|
|
754
|
+
disconnectStoreTip: '断开连接后,blocklet 将从商店中移除。您确定要断开连接吗?'
|
|
751
755
|
},
|
|
752
756
|
titleValidationError: '标题长度必须至少为3到40个字符',
|
|
753
757
|
descriptionValidationError: '描述长度必须在3到160个字符之间'
|
|
@@ -1619,7 +1623,14 @@ export default {
|
|
|
1619
1623
|
restConfirmTitle: '是否清空所有自定义导航?',
|
|
1620
1624
|
restConfirmDesc: '清空后,导航会恢复到 Blocklet 原有默认的配置.',
|
|
1621
1625
|
resetSuccessful: '重置成功'
|
|
1622
|
-
}
|
|
1626
|
+
},
|
|
1627
|
+
access: '访问',
|
|
1628
|
+
members: '成员',
|
|
1629
|
+
passport: '护照',
|
|
1630
|
+
analytics: '分析',
|
|
1631
|
+
dashboard: '仪表板',
|
|
1632
|
+
studio: '工作室',
|
|
1633
|
+
blockletService: 'Blocklet服务'
|
|
1623
1634
|
},
|
|
1624
1635
|
storage: {
|
|
1625
1636
|
spaces: {
|
package/lib/store/add.js
CHANGED
|
@@ -10,7 +10,7 @@ import ListItem from '@mui/material/ListItem';
|
|
|
10
10
|
import AddIcon from '@mui/icons-material/Add';
|
|
11
11
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
12
12
|
import Button from '@arcblock/ux/lib/Button';
|
|
13
|
-
import Alert from '@
|
|
13
|
+
import Alert from '@mui/material/Alert';
|
|
14
14
|
import { useNodeContext } from '../contexts/node';
|
|
15
15
|
import { formatError, isNewStoreUrl } from '../util';
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -26,14 +26,18 @@ export default function AddStore({
|
|
|
26
26
|
disabled,
|
|
27
27
|
storeList,
|
|
28
28
|
teamDid,
|
|
29
|
-
onAdd
|
|
29
|
+
onAdd,
|
|
30
|
+
scope,
|
|
31
|
+
hiddenChildren,
|
|
32
|
+
open,
|
|
33
|
+
onClose
|
|
30
34
|
}) {
|
|
31
35
|
const {
|
|
32
36
|
api
|
|
33
37
|
} = useNodeContext();
|
|
34
38
|
const [loading, setLoading] = useState(false);
|
|
35
39
|
const [disable, setDisable] = useState(true);
|
|
36
|
-
const [
|
|
40
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
37
41
|
const [url, setUrl] = useState('');
|
|
38
42
|
const [error, setError] = useState('');
|
|
39
43
|
const {
|
|
@@ -53,11 +57,13 @@ export default function AddStore({
|
|
|
53
57
|
await api.addBlockletStore({
|
|
54
58
|
input: {
|
|
55
59
|
teamDid,
|
|
56
|
-
url: decoded
|
|
60
|
+
url: decoded,
|
|
61
|
+
scope
|
|
57
62
|
}
|
|
58
63
|
});
|
|
59
64
|
onAdd(decoded);
|
|
60
|
-
|
|
65
|
+
setIsOpen(false);
|
|
66
|
+
onClose();
|
|
61
67
|
} catch (err) {
|
|
62
68
|
const errMsg = `${t('store.blockletRegistry.addFailed')} ${formatError(err)}`;
|
|
63
69
|
setError(errMsg);
|
|
@@ -65,13 +71,17 @@ export default function AddStore({
|
|
|
65
71
|
setLoading(false);
|
|
66
72
|
}
|
|
67
73
|
};
|
|
74
|
+
const handleClose = () => {
|
|
75
|
+
setIsOpen(false);
|
|
76
|
+
onClose();
|
|
77
|
+
};
|
|
68
78
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
69
|
-
children: [/*#__PURE__*/_jsxs(ListItem, {
|
|
79
|
+
children: [!hiddenChildren && /*#__PURE__*/_jsxs(ListItem, {
|
|
70
80
|
button: true,
|
|
71
81
|
disabled: disabled,
|
|
72
82
|
className: classes.addMenuItemRoot,
|
|
73
83
|
onClick: () => {
|
|
74
|
-
|
|
84
|
+
setIsOpen(true);
|
|
75
85
|
},
|
|
76
86
|
children: [/*#__PURE__*/_jsx(AddIcon, {
|
|
77
87
|
font: true
|
|
@@ -83,8 +93,8 @@ export default function AddStore({
|
|
|
83
93
|
title: t('store.blockletRegistry.addRegistry'),
|
|
84
94
|
fullWidth: true,
|
|
85
95
|
maxWidth: "md",
|
|
86
|
-
open: open,
|
|
87
|
-
onClose:
|
|
96
|
+
open: open || isOpen,
|
|
97
|
+
onClose: handleClose,
|
|
88
98
|
PaperProps: {
|
|
89
99
|
style: {
|
|
90
100
|
minHeight: 'auto'
|
|
@@ -94,7 +104,7 @@ export default function AddStore({
|
|
|
94
104
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
95
105
|
onClick: e => {
|
|
96
106
|
e.stopPropagation();
|
|
97
|
-
|
|
107
|
+
handleClose();
|
|
98
108
|
},
|
|
99
109
|
color: "inherit",
|
|
100
110
|
children: t('common.cancel')
|
|
@@ -156,7 +166,7 @@ export default function AddStore({
|
|
|
156
166
|
})
|
|
157
167
|
})
|
|
158
168
|
}), !!error && /*#__PURE__*/_jsx(Alert, {
|
|
159
|
-
|
|
169
|
+
severity: "error",
|
|
160
170
|
style: {
|
|
161
171
|
width: '100%'
|
|
162
172
|
},
|
|
@@ -169,10 +179,18 @@ AddStore.propTypes = {
|
|
|
169
179
|
teamDid: PropTypes.string.isRequired,
|
|
170
180
|
disabled: PropTypes.bool,
|
|
171
181
|
storeList: PropTypes.array,
|
|
172
|
-
onAdd: PropTypes.func
|
|
182
|
+
onAdd: PropTypes.func,
|
|
183
|
+
scope: PropTypes.string,
|
|
184
|
+
hiddenChildren: PropTypes.bool,
|
|
185
|
+
open: PropTypes.bool,
|
|
186
|
+
onClose: PropTypes.func
|
|
173
187
|
};
|
|
174
188
|
AddStore.defaultProps = {
|
|
175
189
|
disabled: false,
|
|
176
190
|
storeList: [],
|
|
177
|
-
onAdd: () => {}
|
|
191
|
+
onAdd: () => {},
|
|
192
|
+
scope: '',
|
|
193
|
+
hiddenChildren: false,
|
|
194
|
+
open: false,
|
|
195
|
+
onClose: () => {}
|
|
178
196
|
};
|
|
@@ -4,7 +4,7 @@ import { Box, Button, Menu, MenuItem } from '@mui/material';
|
|
|
4
4
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
5
5
|
import { joinURL } from 'ufo';
|
|
6
6
|
import LaunchIcon from '@mui/icons-material/Launch';
|
|
7
|
-
import
|
|
7
|
+
import LinkOffIcon from '@mui/icons-material/LinkOff';
|
|
8
8
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
9
9
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
10
10
|
import ConfirmDialog from '../confirm';
|
|
@@ -12,7 +12,7 @@ import DeleteStore from './delete';
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
function ConnectActions({
|
|
14
14
|
connected,
|
|
15
|
-
|
|
15
|
+
onDisconnect,
|
|
16
16
|
onDelete,
|
|
17
17
|
store,
|
|
18
18
|
teamDid,
|
|
@@ -23,7 +23,7 @@ function ConnectActions({
|
|
|
23
23
|
const {
|
|
24
24
|
t
|
|
25
25
|
} = useLocaleContext();
|
|
26
|
-
const [
|
|
26
|
+
const [showDisconnectConfirm, setShowDisconnectConfirm] = useState(false);
|
|
27
27
|
const handleOpenUrl = e => {
|
|
28
28
|
e.stopPropagation();
|
|
29
29
|
window.open(joinURL(store.url, 'developer/blocklets'));
|
|
@@ -35,21 +35,21 @@ function ConnectActions({
|
|
|
35
35
|
const handleClose = () => {
|
|
36
36
|
setAnchorEl(null);
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const handleDisconnect = () => {
|
|
39
|
+
setShowDisconnectConfirm(false);
|
|
40
|
+
onDisconnect();
|
|
41
41
|
};
|
|
42
42
|
const actions = [{
|
|
43
43
|
label: t('common.visitStore'),
|
|
44
44
|
action: handleOpenUrl,
|
|
45
45
|
icon: LaunchIcon
|
|
46
46
|
}, {
|
|
47
|
-
label: t('common.
|
|
47
|
+
label: t('common.disconnect'),
|
|
48
48
|
action: () => {
|
|
49
49
|
handleClose();
|
|
50
|
-
|
|
50
|
+
setShowDisconnectConfirm(true);
|
|
51
51
|
},
|
|
52
|
-
icon:
|
|
52
|
+
icon: LinkOffIcon,
|
|
53
53
|
hidden: !connected
|
|
54
54
|
}];
|
|
55
55
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -93,7 +93,7 @@ function ConnectActions({
|
|
|
93
93
|
children: x.label
|
|
94
94
|
})]
|
|
95
95
|
}, x.label);
|
|
96
|
-
}), /*#__PURE__*/_jsx(DeleteStore, {
|
|
96
|
+
}), !store.protected && /*#__PURE__*/_jsx(DeleteStore, {
|
|
97
97
|
store: store,
|
|
98
98
|
onDelete: onDelete,
|
|
99
99
|
teamDid: teamDid,
|
|
@@ -112,19 +112,19 @@ function ConnectActions({
|
|
|
112
112
|
})]
|
|
113
113
|
})
|
|
114
114
|
})]
|
|
115
|
-
}),
|
|
115
|
+
}), showDisconnectConfirm && /*#__PURE__*/_jsx(ConfirmDialog, {
|
|
116
116
|
displayError: true,
|
|
117
|
-
title: `${t('common.
|
|
118
|
-
description: t('blocklet.publish.
|
|
117
|
+
title: `${t('common.disconnect')} ${store.name}`,
|
|
118
|
+
description: t('blocklet.publish.disconnectStoreTip'),
|
|
119
119
|
confirm: t('common.confirm'),
|
|
120
|
-
onConfirm:
|
|
121
|
-
onCancel: () =>
|
|
120
|
+
onConfirm: handleDisconnect,
|
|
121
|
+
onCancel: () => setShowDisconnectConfirm(false)
|
|
122
122
|
})]
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
ConnectActions.propTypes = {
|
|
126
126
|
connected: PropTypes.bool,
|
|
127
|
-
|
|
127
|
+
onDisconnect: PropTypes.func,
|
|
128
128
|
onDelete: PropTypes.func,
|
|
129
129
|
store: PropTypes.object.isRequired,
|
|
130
130
|
teamDid: PropTypes.string.isRequired,
|
|
@@ -133,7 +133,7 @@ ConnectActions.propTypes = {
|
|
|
133
133
|
ConnectActions.defaultProps = {
|
|
134
134
|
projectId: '',
|
|
135
135
|
connected: false,
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
onDelete: () => {},
|
|
137
|
+
onDisconnect: () => {}
|
|
138
138
|
};
|
|
139
139
|
export default ConnectActions;
|
package/lib/store/item.js
CHANGED
|
@@ -17,6 +17,10 @@ import ConnectActions from './connect-actions';
|
|
|
17
17
|
import DidAddress from '../did-address';
|
|
18
18
|
import usePromiseWindowOpen from '../hooks/use-promise-window-open';
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
export const BEHAVIOR = {
|
|
21
|
+
CONNECT: 'connect',
|
|
22
|
+
SELECT: 'select'
|
|
23
|
+
};
|
|
20
24
|
const useStyles = makeStyles(() => ({
|
|
21
25
|
buttonText: {
|
|
22
26
|
textTransform: 'none !important'
|
|
@@ -79,7 +83,7 @@ const WhiteTooltip = styled(({
|
|
|
79
83
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
80
84
|
backgroundColor: '#fff',
|
|
81
85
|
color: 'rgba(0, 0, 0, 0.87)',
|
|
82
|
-
maxWidth:
|
|
86
|
+
maxWidth: 250,
|
|
83
87
|
borderRadius: 8,
|
|
84
88
|
padding: theme.spacing(2),
|
|
85
89
|
fontSize: theme.typography.pxToRem(12),
|
|
@@ -98,7 +102,9 @@ export default function StoreItem({
|
|
|
98
102
|
connectedStore,
|
|
99
103
|
releaseType,
|
|
100
104
|
onPublish,
|
|
101
|
-
onOpenConnectStore
|
|
105
|
+
onOpenConnectStore,
|
|
106
|
+
onSelectConnectStore,
|
|
107
|
+
behavior
|
|
102
108
|
}) {
|
|
103
109
|
const classes = useStyles();
|
|
104
110
|
const {
|
|
@@ -123,6 +129,10 @@ export default function StoreItem({
|
|
|
123
129
|
window.open(store.url);
|
|
124
130
|
};
|
|
125
131
|
const handleConnectToStore = () => {
|
|
132
|
+
if (behavior === BEHAVIOR.SELECT) {
|
|
133
|
+
onSelectConnectStore(store);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
126
136
|
openWindow(async (newWindow, open) => {
|
|
127
137
|
try {
|
|
128
138
|
const res = await api.connectToStore({
|
|
@@ -153,6 +163,16 @@ export default function StoreItem({
|
|
|
153
163
|
}
|
|
154
164
|
});
|
|
155
165
|
};
|
|
166
|
+
const handleDisconnectStore = async () => {
|
|
167
|
+
await api.disconnectFromStore({
|
|
168
|
+
input: {
|
|
169
|
+
did: teamDid,
|
|
170
|
+
storeId: store.id,
|
|
171
|
+
projectId
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
onDelete();
|
|
175
|
+
};
|
|
156
176
|
const handleUploadToStore = () => {
|
|
157
177
|
setLoading(true);
|
|
158
178
|
api.publishToStore({
|
|
@@ -221,6 +241,7 @@ export default function StoreItem({
|
|
|
221
241
|
children: connectedStore.developerName
|
|
222
242
|
}), /*#__PURE__*/_jsx(DidAddress, {
|
|
223
243
|
size: 14,
|
|
244
|
+
copyable: true,
|
|
224
245
|
responsive: true,
|
|
225
246
|
did: connectedStore.developerDid
|
|
226
247
|
})]
|
|
@@ -301,7 +322,7 @@ export default function StoreItem({
|
|
|
301
322
|
store: store,
|
|
302
323
|
onDelete: onDelete,
|
|
303
324
|
teamDid: teamDid,
|
|
304
|
-
|
|
325
|
+
onDisconnect: handleDisconnectStore
|
|
305
326
|
})]
|
|
306
327
|
}), !isPublish && /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
307
328
|
disabled: loading,
|
|
@@ -348,7 +369,9 @@ StoreItem.propTypes = {
|
|
|
348
369
|
}).isRequired,
|
|
349
370
|
onDelete: PropTypes.func,
|
|
350
371
|
onPublish: PropTypes.func,
|
|
351
|
-
onOpenConnectStore: PropTypes.func
|
|
372
|
+
onOpenConnectStore: PropTypes.func,
|
|
373
|
+
behavior: PropTypes.string,
|
|
374
|
+
onSelectConnectStore: PropTypes.func
|
|
352
375
|
};
|
|
353
376
|
StoreItem.defaultProps = {
|
|
354
377
|
kind: 'store',
|
|
@@ -357,7 +380,9 @@ StoreItem.defaultProps = {
|
|
|
357
380
|
releaseId: '',
|
|
358
381
|
projectId: '',
|
|
359
382
|
releaseType: '',
|
|
383
|
+
behavior: BEHAVIOR.CONNECT,
|
|
360
384
|
onPublish: () => {},
|
|
361
385
|
onDelete: () => {},
|
|
362
|
-
onOpenConnectStore: () => {}
|
|
386
|
+
onOpenConnectStore: () => {},
|
|
387
|
+
onSelectConnectStore: () => {}
|
|
363
388
|
};
|
|
@@ -151,7 +151,8 @@ export default function MemberList({
|
|
|
151
151
|
refresh,
|
|
152
152
|
enablePassportIssuance,
|
|
153
153
|
endpoint,
|
|
154
|
-
api
|
|
154
|
+
api,
|
|
155
|
+
blocklet
|
|
155
156
|
} = useTeamContext();
|
|
156
157
|
const {
|
|
157
158
|
inService,
|
|
@@ -159,6 +160,36 @@ export default function MemberList({
|
|
|
159
160
|
useSubscription
|
|
160
161
|
}
|
|
161
162
|
} = useNodeContext();
|
|
163
|
+
const appInfoList = [];
|
|
164
|
+
if (inService && blocklet) {
|
|
165
|
+
const federatedMaster = (blocklet.settings?.federated?.sites || []).find(item => item.isMaster !== false);
|
|
166
|
+
const federatedCurrent = (blocklet.settings?.federated?.sites || []).find(item => item.appId === blocklet.appDid);
|
|
167
|
+
if (federatedCurrent?.status === 'approved') {
|
|
168
|
+
appInfoList.push({
|
|
169
|
+
appId: federatedMaster.appId,
|
|
170
|
+
appName: federatedMaster.appName,
|
|
171
|
+
appDescription: federatedMaster.appDescription,
|
|
172
|
+
appLogo: federatedMaster.appLogo,
|
|
173
|
+
appPid: federatedMaster.appPid,
|
|
174
|
+
appUrl: federatedMaster.appUrl,
|
|
175
|
+
version: federatedMaster.version,
|
|
176
|
+
sourceAppPid: federatedMaster.appPid,
|
|
177
|
+
provider: 'wallet'
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
appInfoList.push({
|
|
181
|
+
appId: federatedCurrent.appId,
|
|
182
|
+
appName: federatedCurrent.appName,
|
|
183
|
+
appDescription: federatedCurrent.appDescription,
|
|
184
|
+
appLogo: federatedCurrent.appLogo,
|
|
185
|
+
appPid: federatedCurrent.appPid,
|
|
186
|
+
appUrl: federatedCurrent.appUrl,
|
|
187
|
+
version: federatedCurrent.version,
|
|
188
|
+
// NOTICE: null 代表该值置空
|
|
189
|
+
sourceAppPid: null,
|
|
190
|
+
provider: 'wallet'
|
|
191
|
+
});
|
|
192
|
+
}
|
|
162
193
|
const {
|
|
163
194
|
t,
|
|
164
195
|
locale
|
|
@@ -604,6 +635,7 @@ export default function MemberList({
|
|
|
604
635
|
teamDid: teamDid,
|
|
605
636
|
endpoint: endpoint,
|
|
606
637
|
roles: roles,
|
|
638
|
+
apps: appInfoList,
|
|
607
639
|
onCancel: () => setShowInviteMember(false),
|
|
608
640
|
onSuccess: () => {
|
|
609
641
|
refresh();
|