@nocobase/client-v2 2.1.31 → 2.2.0-alpha.10
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/es/APIClient.d.ts +1 -3
- package/es/BaseApplication.d.ts +2 -0
- package/es/PluginSettingsManager.d.ts +33 -0
- package/es/RouteRepository.d.ts +29 -6
- package/es/RouterManager.d.ts +15 -0
- package/es/authRedirect.d.ts +1 -0
- package/es/components/category-tabs/SortableCategoryTabs.d.ts +55 -0
- package/es/components/category-tabs/index.d.ts +9 -0
- package/es/components/form/TypedVariableInput.d.ts +31 -5
- package/es/components/form/filter/CollectionFilter.d.ts +2 -0
- package/es/components/form/filter/CollectionFilterItem.d.ts +11 -1
- package/es/components/form/filter/CollectionFilterPanel.d.ts +2 -0
- package/es/components/form/filter/index.d.ts +2 -0
- package/es/components/form/filter/useFilterActionProps.d.ts +2 -0
- package/es/components/index.d.ts +2 -0
- package/es/entry-actions/EntryActionManager.d.ts +24 -0
- package/es/entry-actions/index.d.ts +9 -0
- package/es/flow/actions/index.d.ts +1 -1
- package/es/flow/actions/linkageRules.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.d.ts +2 -1
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +3 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.d.ts +3 -2
- package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +5 -0
- package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +2 -1
- package/es/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.d.ts +24 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.d.ts +6 -0
- package/es/flow/admin-shell/admin-layout/useApplications.d.ts +7 -2
- package/es/flow/components/FieldAssignExactDatePicker.d.ts +1 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +9 -0
- package/es/flow/components/RunJSValueEditor.d.ts +1 -0
- package/es/flow/components/filter/FilterGroup.d.ts +1 -0
- package/es/flow/components/filter/VariableFilterItem.d.ts +6 -1
- package/es/flow/index.d.ts +1 -0
- package/es/flow/models/base/ActionModelCore.d.ts +2 -0
- package/es/flow/models/base/GridModel.d.ts +1 -1
- package/es/flow/models/base/PageModel/PageModel.d.ts +12 -0
- package/es/flow/models/base/PageModel/PageModelTabBar.d.ts +22 -0
- package/es/flow/models/base/PageModel/PageTabModel.d.ts +12 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +9 -0
- package/es/flow-compat/routeTypes.d.ts +1 -0
- package/es/index.d.ts +7 -1
- package/es/index.mjs +223 -135
- package/es/utils/getRouteRuntimeVersion.d.ts +23 -0
- package/es/utils/index.d.ts +1 -0
- package/lib/index.js +220 -132
- package/package.json +7 -7
- package/src/APIClient.ts +1 -10
- package/src/Application.tsx +4 -0
- package/src/BaseApplication.tsx +2 -0
- package/src/PluginSettingsManager.ts +53 -0
- package/src/RouteRepository.ts +151 -24
- package/src/RouterManager.tsx +142 -1
- package/src/__tests__/PluginSettingsManager.test.ts +13 -0
- package/src/__tests__/RouteRepository.test.ts +239 -0
- package/src/__tests__/RouterManager.test.ts +125 -0
- package/src/__tests__/app.test.tsx +18 -0
- package/src/__tests__/authRedirect.test.ts +17 -0
- package/src/__tests__/browserChecker.test.ts +61 -0
- package/src/__tests__/exports.test.ts +16 -0
- package/src/__tests__/getRouteRuntimeVersion.test.ts +68 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +28 -0
- package/src/__tests__/plugin-manager.test.tsx +44 -2
- package/src/__tests__/settings-center.test.tsx +40 -1
- package/src/authRedirect.ts +38 -0
- package/src/components/README.md +7 -1
- package/src/components/README.zh-CN.md +6 -1
- package/src/components/category-tabs/SortableCategoryTabs.tsx +210 -0
- package/src/components/category-tabs/index.ts +10 -0
- package/src/components/form/JsonTextArea.tsx +4 -0
- package/src/components/form/TypedVariableInput.tsx +452 -101
- package/src/components/form/__tests__/TypedVariableInput.test.tsx +364 -12
- package/src/components/form/filter/CollectionFilter.tsx +4 -0
- package/src/components/form/filter/CollectionFilterItem.tsx +32 -7
- package/src/components/form/filter/CollectionFilterPanel.tsx +4 -0
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +38 -0
- package/src/components/form/filter/__tests__/useFilterActionProps.test.tsx +95 -0
- package/src/components/form/filter/index.ts +2 -0
- package/src/components/form/filter/useFilterActionProps.ts +37 -6
- package/src/components/index.ts +2 -0
- package/src/entry-actions/EntryActionManager.ts +76 -0
- package/src/entry-actions/index.ts +10 -0
- package/src/flow/__tests__/FlowRoute.test.tsx +1084 -145
- package/src/flow/actions/__tests__/linkageRules.tab.test.ts +171 -0
- package/src/flow/actions/customVariable.tsx +1 -2
- package/src/flow/actions/index.ts +2 -0
- package/src/flow/actions/linkageRules.tsx +65 -8
- package/src/flow/actions/runjs.tsx +2 -14
- package/src/flow/admin-shell/BaseLayoutModel.tsx +13 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +46 -13
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +486 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +64 -8
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.ts +5 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +61 -9
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +71 -8
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +1 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +23 -9
- package/src/flow/admin-shell/admin-layout/AppListRender.tsx +13 -2
- package/src/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.tsx +289 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutComponent.test.tsx +435 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +99 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +77 -0
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +214 -2
- package/src/flow/admin-shell/admin-layout/index.ts +1 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +20 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +33 -5
- package/src/flow/admin-shell/admin-layout/useApplications.tsx +81 -12
- package/src/flow/components/DefaultValue.tsx +1 -2
- package/src/flow/components/FieldAssignExactDatePicker.tsx +25 -11
- package/src/flow/components/FieldAssignValueInput.tsx +76 -9
- package/src/flow/components/FlowRoute.tsx +185 -28
- package/src/flow/components/RunJSValueEditor.tsx +9 -1
- package/src/flow/components/__tests__/FieldAssignValueInput.context.test.tsx +84 -2
- package/src/flow/components/code-editor/__tests__/useCodeRunner.test.tsx +2 -17
- package/src/flow/components/code-editor/hooks/useCodeRunner.ts +2 -14
- package/src/flow/components/code-editor/runjsDiagnostics.ts +8 -45
- package/src/flow/components/filter/FilterGroup.tsx +33 -5
- package/src/flow/components/filter/VariableFilterItem.tsx +158 -10
- package/src/flow/components/filter/__tests__/FilterGroup.test.tsx +45 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.leftMetaTree.test.tsx +9 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +70 -1
- package/src/flow/index.ts +1 -0
- package/src/flow/models/actions/JSActionModel.tsx +2 -7
- package/src/flow/models/actions/JSCollectionActionModel.tsx +2 -7
- package/src/flow/models/actions/JSItemActionModel.tsx +2 -7
- package/src/flow/models/actions/JSRecordActionModel.tsx +2 -7
- package/src/flow/models/base/ActionModel.tsx +21 -8
- package/src/flow/models/base/ActionModelCore.tsx +5 -0
- package/src/flow/models/base/GridModel.tsx +38 -7
- package/src/flow/models/base/PageModel/PageModel.tsx +387 -53
- package/src/flow/models/base/PageModel/PageModelTabBar.tsx +114 -0
- package/src/flow/models/base/PageModel/PageTabModel.tsx +186 -3
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +790 -14
- package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.module-isolation.test.tsx +130 -0
- package/src/flow/models/base/PageModel/__tests__/PageModelTabBar.test.tsx +118 -0
- package/src/flow/models/base/PageModel/__tests__/PageTabModel.test.ts +586 -1
- package/src/flow/models/base/__tests__/ActionModel.test.ts +83 -0
- package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +239 -1
- package/src/flow/models/base/__tests__/transformRowsToSingleColumn.test.ts +48 -0
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +1 -2
- package/src/flow/models/blocks/filter-form/FilterFormJSActionModel.tsx +2 -7
- package/src/flow/models/blocks/form/JSFormActionModel.tsx +2 -7
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +87 -0
- package/src/flow/models/blocks/form/value-runtime/rules.ts +2 -2
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +91 -0
- package/src/flow/models/blocks/js-block/JSBlock.tsx +2 -7
- package/src/flow/models/blocks/table/JSColumnModel.tsx +1 -9
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +1 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +13 -3
- package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +54 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.mobileSettingsButtons.test.tsx +78 -0
- package/src/flow/models/fields/JSEditableFieldModel.tsx +2 -11
- package/src/flow/models/fields/JSFieldModel.tsx +2 -7
- package/src/flow/models/fields/JSItemModel.tsx +2 -14
- package/src/flow/models/fields/VariableFieldFormModel.tsx +3 -3
- package/src/flow/models/fields/__tests__/VariableFieldFormModel.test.tsx +51 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +168 -10
- package/src/flow-compat/Popover.tsx +43 -4
- package/src/flow-compat/__tests__/Popover.test.tsx +34 -0
- package/src/flow-compat/routeTypes.ts +1 -0
- package/src/index.ts +13 -1
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +41 -1
- package/src/nocobase-buildin-plugin/index.tsx +19 -3
- package/src/settings-center/AdminSettingsLayout.tsx +10 -2
- package/src/settings-center/SystemSettingsPage.tsx +0 -1
- package/src/settings-center/plugin-manager/PluginCard.tsx +2 -2
- package/src/settings-center/utils.tsx +0 -6
- package/src/utils/getRouteRuntimeVersion.ts +185 -0
- package/src/utils/index.tsx +1 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { SettingOutlined } from '@ant-design/icons';
|
|
11
|
+
import { css } from '@emotion/css';
|
|
12
|
+
import { Icon } from '../../../components';
|
|
13
|
+
import { ActionModel } from '../../models/base';
|
|
14
|
+
import {
|
|
15
|
+
AddSubModelButton,
|
|
16
|
+
DndProvider,
|
|
17
|
+
DragHandler,
|
|
18
|
+
Droppable,
|
|
19
|
+
FlowModel,
|
|
20
|
+
FlowModelRenderer,
|
|
21
|
+
FlowSettingsButton,
|
|
22
|
+
mergeSubModelItems,
|
|
23
|
+
observer,
|
|
24
|
+
type SubModelItem,
|
|
25
|
+
type SubModelItemsType,
|
|
26
|
+
} from '@nocobase/flow-engine';
|
|
27
|
+
import { Avatar, Button, Card, Tooltip, Typography } from 'antd';
|
|
28
|
+
import React from 'react';
|
|
29
|
+
|
|
30
|
+
const defaultIconColors = ['#3d8bff', '#00a8b5', '#35b26b', '#f5a623', '#ff7a45', '#e85d75', '#9254de', '#597ef7'];
|
|
31
|
+
|
|
32
|
+
function getDefaultIconColor(title?: React.ReactNode) {
|
|
33
|
+
const source = typeof title === 'string' ? title : '';
|
|
34
|
+
const hash = Array.from(source).reduce((sum, char) => sum + char.charCodeAt(0), 0);
|
|
35
|
+
return defaultIconColors[hash % defaultIconColors.length];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type AppSwitcherActionPanelStructure = {
|
|
39
|
+
subModels: {
|
|
40
|
+
actions?: ActionModel[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function isRenderableActionModel(action: unknown): action is ActionModel {
|
|
45
|
+
if (!action || typeof action !== 'object') {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const candidate = action as Partial<ActionModel>;
|
|
50
|
+
return typeof candidate.getTitle === 'function' && typeof candidate.onClick === 'function';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type EntryActionAvailability = {
|
|
54
|
+
isEntryActionAvailable?: () => boolean;
|
|
55
|
+
getEntryActionUnavailableMessage?: () => string | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
function isEntryActionUnavailable(action: ActionModel) {
|
|
59
|
+
const candidate = action as ActionModel & EntryActionAvailability;
|
|
60
|
+
return typeof candidate.isEntryActionAvailable === 'function' && !candidate.isEntryActionAvailable();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getEntryActionUnavailableMessage(action: ActionModel) {
|
|
64
|
+
const candidate = action as ActionModel & EntryActionAvailability;
|
|
65
|
+
return candidate.getEntryActionUnavailableMessage?.();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class AppSwitcherActionPanelModel extends FlowModel<AppSwitcherActionPanelStructure> {
|
|
69
|
+
getConfigureActionsItems(): SubModelItemsType {
|
|
70
|
+
const linkAction: SubModelItem = {
|
|
71
|
+
key: 'app-switcher:link',
|
|
72
|
+
label: this.context.t('Link'),
|
|
73
|
+
createModelOptions: {
|
|
74
|
+
use: 'LinkActionModel',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
const jsAction: SubModelItem = {
|
|
78
|
+
key: 'app-switcher:js-action',
|
|
79
|
+
label: this.context.t('JS action'),
|
|
80
|
+
createModelOptions: {
|
|
81
|
+
use: 'JSActionModel',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return mergeSubModelItems([[linkAction], this.context.app.entryActionManager.getItems('app-switcher'), [jsAction]]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
renderConfigureActions() {
|
|
89
|
+
return <AppSwitcherConfigureActionsButton model={this} />;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private getRenderableActions(options: { includeHidden?: boolean; includeUnavailable?: boolean } = {}) {
|
|
93
|
+
return this.mapSubModels('actions', (action) => action)
|
|
94
|
+
.filter(isRenderableActionModel)
|
|
95
|
+
.filter((action) => options.includeUnavailable || !isEntryActionUnavailable(action))
|
|
96
|
+
.filter((action) => options.includeHidden || !action.hidden);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
hasActions() {
|
|
100
|
+
return this.getRenderableActions().length > 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
renderContent() {
|
|
104
|
+
const token = this.context.themeToken;
|
|
105
|
+
const designable = !!this.context.flowSettingsEnabled;
|
|
106
|
+
const actions = this.getRenderableActions({ includeHidden: designable, includeUnavailable: designable });
|
|
107
|
+
const columnCount = Math.min(Math.max(actions.length || 1, 1), 2);
|
|
108
|
+
const buttonResetClass = css`
|
|
109
|
+
&.ant-btn {
|
|
110
|
+
display: block;
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
padding: 0;
|
|
114
|
+
border: none;
|
|
115
|
+
box-shadow: none;
|
|
116
|
+
background: none;
|
|
117
|
+
color: ${token.colorText};
|
|
118
|
+
text-align: left;
|
|
119
|
+
}
|
|
120
|
+
&.ant-btn > span {
|
|
121
|
+
display: block;
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
.ant-btn-icon {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
const contentClass = css`
|
|
130
|
+
max-width: calc(100vw - 48px);
|
|
131
|
+
max-height: calc(100vh - 48px);
|
|
132
|
+
overflow: auto;
|
|
133
|
+
padding: ${token.paddingXS}px;
|
|
134
|
+
`;
|
|
135
|
+
const listClass = css`
|
|
136
|
+
display: grid;
|
|
137
|
+
grid-template-columns: repeat(${columnCount}, 260px);
|
|
138
|
+
gap: ${token.marginXXS}px;
|
|
139
|
+
margin: 0;
|
|
140
|
+
padding: 0;
|
|
141
|
+
list-style: none;
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<div className={contentClass}>
|
|
146
|
+
{actions.length ? (
|
|
147
|
+
<DndProvider>
|
|
148
|
+
<ul className={listClass}>
|
|
149
|
+
{actions.map((action) => {
|
|
150
|
+
const { icon = 'AppstoreOutlined', color } = action.props;
|
|
151
|
+
const title = action.getTitle();
|
|
152
|
+
const entryActionUnavailable = isEntryActionUnavailable(action);
|
|
153
|
+
const renderActionContent = (compact = false) => (
|
|
154
|
+
<Card
|
|
155
|
+
bordered={false}
|
|
156
|
+
className={css`
|
|
157
|
+
height: 56px;
|
|
158
|
+
border-radius: ${token.borderRadius}px;
|
|
159
|
+
box-shadow: none !important;
|
|
160
|
+
opacity: ${compact ? token.opacityLoading : 1};
|
|
161
|
+
|
|
162
|
+
&:hover {
|
|
163
|
+
background: ${token.colorBgTextHover};
|
|
164
|
+
box-shadow: none !important;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.ant-card-body {
|
|
168
|
+
height: 100%;
|
|
169
|
+
padding: ${token.paddingXS}px;
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: ${token.marginXS}px;
|
|
173
|
+
}
|
|
174
|
+
`}
|
|
175
|
+
styles={{ body: { background: 'transparent' } }}
|
|
176
|
+
>
|
|
177
|
+
<Avatar
|
|
178
|
+
size={32}
|
|
179
|
+
shape="square"
|
|
180
|
+
icon={<Icon type={icon as string} />}
|
|
181
|
+
style={{
|
|
182
|
+
flex: '0 0 auto',
|
|
183
|
+
borderRadius: 6,
|
|
184
|
+
background: color || getDefaultIconColor(title),
|
|
185
|
+
}}
|
|
186
|
+
/>
|
|
187
|
+
<Typography.Text
|
|
188
|
+
ellipsis
|
|
189
|
+
title={typeof title === 'string' ? title : undefined}
|
|
190
|
+
style={{
|
|
191
|
+
minWidth: 0,
|
|
192
|
+
color: token.colorText,
|
|
193
|
+
fontSize: token.fontSize,
|
|
194
|
+
lineHeight: token.lineHeight,
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
{title}
|
|
198
|
+
</Typography.Text>
|
|
199
|
+
</Card>
|
|
200
|
+
);
|
|
201
|
+
action.enableEditDanger = false;
|
|
202
|
+
action.enableEditType = false;
|
|
203
|
+
action.enableEditIconOnly = false;
|
|
204
|
+
action.enableEditColor = true;
|
|
205
|
+
action.renderButton = () => {
|
|
206
|
+
if (entryActionUnavailable) {
|
|
207
|
+
return (
|
|
208
|
+
<Tooltip title={getEntryActionUnavailableMessage(action)}>
|
|
209
|
+
<Button className={buttonResetClass} onClick={action.onClick.bind(action)}>
|
|
210
|
+
{renderActionContent(true)}
|
|
211
|
+
</Button>
|
|
212
|
+
</Tooltip>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
return (
|
|
216
|
+
<Button className={buttonResetClass} onClick={action.onClick.bind(action)}>
|
|
217
|
+
{renderActionContent()}
|
|
218
|
+
</Button>
|
|
219
|
+
);
|
|
220
|
+
};
|
|
221
|
+
action.renderHiddenInConfig = () => (
|
|
222
|
+
<Tooltip
|
|
223
|
+
title={
|
|
224
|
+
entryActionUnavailable
|
|
225
|
+
? getEntryActionUnavailableMessage(action)
|
|
226
|
+
: this.context.t('The button is hidden and only visible when the UI Editor is active')
|
|
227
|
+
}
|
|
228
|
+
>
|
|
229
|
+
<Button className={buttonResetClass} onClick={action.onClick.bind(action)}>
|
|
230
|
+
{renderActionContent(true)}
|
|
231
|
+
</Button>
|
|
232
|
+
</Tooltip>
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
return (
|
|
236
|
+
<li key={action.uid} style={{ width: 260, height: 56, listStyle: 'none' }}>
|
|
237
|
+
<Droppable model={action}>
|
|
238
|
+
<FlowModelRenderer
|
|
239
|
+
model={action}
|
|
240
|
+
showFlowSettings={{ showBackground: false, showBorder: false, toolbarPosition: 'above' }}
|
|
241
|
+
extraToolbarItems={
|
|
242
|
+
designable
|
|
243
|
+
? [
|
|
244
|
+
{
|
|
245
|
+
key: 'drag-handler',
|
|
246
|
+
component: DragHandler,
|
|
247
|
+
sort: 1,
|
|
248
|
+
},
|
|
249
|
+
]
|
|
250
|
+
: []
|
|
251
|
+
}
|
|
252
|
+
/>
|
|
253
|
+
</Droppable>
|
|
254
|
+
</li>
|
|
255
|
+
);
|
|
256
|
+
})}
|
|
257
|
+
</ul>
|
|
258
|
+
</DndProvider>
|
|
259
|
+
) : (
|
|
260
|
+
<div style={{ width: 260, minHeight: token.marginXS }} />
|
|
261
|
+
)}
|
|
262
|
+
{designable && <div style={{ marginTop: token.marginXS }}>{this.renderConfigureActions()}</div>}
|
|
263
|
+
</div>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
AppSwitcherActionPanelModel.define({
|
|
269
|
+
label: 'App switcher actions',
|
|
270
|
+
children: false,
|
|
271
|
+
createModelOptions: {
|
|
272
|
+
use: 'AppSwitcherActionPanelModel',
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const AppSwitcherConfigureActionsButton = observer(({ model }: { model: AppSwitcherActionPanelModel }) => {
|
|
277
|
+
const entryActionsRevision = model.context.app.entryActionManager.revision;
|
|
278
|
+
return (
|
|
279
|
+
<AddSubModelButton
|
|
280
|
+
key={`app-switcher-add-actions-${entryActionsRevision}`}
|
|
281
|
+
model={model}
|
|
282
|
+
items={model.getConfigureActionsItems()}
|
|
283
|
+
subModelKey="actions"
|
|
284
|
+
keepDropdownOpen
|
|
285
|
+
>
|
|
286
|
+
<FlowSettingsButton icon={<SettingOutlined />}>{model.context.t('Actions')}</FlowSettingsButton>
|
|
287
|
+
</AddSubModelButton>
|
|
288
|
+
);
|
|
289
|
+
});
|