{t('explore.sidebar.workspace')}
- {installedApps.map(({id, app : { name }}) => {
+ {installedApps.map(({id, is_pinned, uninstallable, app : { name }}) => {
return (
- handleUpdatePinStatus(id, !is_pinned)}
+ uninstallable={uninstallable}
onDelete={handleDelete}
/>
)
diff --git a/web/i18n/lang/explore.en.ts b/web/i18n/lang/explore.en.ts
index 06058dd7ff..699e1725cb 100644
--- a/web/i18n/lang/explore.en.ts
+++ b/web/i18n/lang/explore.en.ts
@@ -16,6 +16,13 @@ const translation = {
title: 'Create app from {{name}}',
subTitle: 'App icon & name',
nameRequired: 'App name is required',
+ },
+ sideBar: {
+ action: {
+ pin: 'Pin',
+ unpin: 'Unpin',
+ delete: 'Delete',
+ }
}
}
diff --git a/web/i18n/lang/explore.zh.ts b/web/i18n/lang/explore.zh.ts
index 66b65bdfff..f8fcee793f 100644
--- a/web/i18n/lang/explore.zh.ts
+++ b/web/i18n/lang/explore.zh.ts
@@ -16,6 +16,13 @@ const translation = {
title: '从 {{name}} 创建应用程序',
subTitle: '应用程序图标和名称',
nameRequired: '应用程序名称不能为空',
+ },
+ sideBar: {
+ action: {
+ pin: '置顶',
+ unpin: '取消置顶',
+ delete: '删除',
+ }
}
}
diff --git a/web/models/explore.ts b/web/models/explore.ts
index 65f2e175fb..c950df3e31 100644
--- a/web/models/explore.ts
+++ b/web/models/explore.ts
@@ -26,4 +26,5 @@ export type InstalledApp = {
app: AppBasicInfo;
id: string;
uninstallable: boolean
+ is_pinned: boolean
}
\ No newline at end of file
diff --git a/web/service/explore.ts b/web/service/explore.ts
index 64a46381ca..2d6e69c264 100644
--- a/web/service/explore.ts
+++ b/web/service/explore.ts
@@ -1,4 +1,4 @@
-import { get, post, del } from './base'
+import { get, post, del, patch } from './base'
export const fetchAppList = () => {
return get('/explore/apps')
@@ -23,3 +23,11 @@ export const installApp = (id: string) => {
export const uninstallApp = (id: string) => {
return del(`/installed-apps/${id}`)
}
+
+export const updatePinStatus = (id: string, isPinned: boolean) => {
+ return patch(`/installed-apps/${id}`, {
+ body: {
+ is_pinned: isPinned
+ }
+ })
+}