Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb5ff45

Browse files
committed
Removed additional props from multi
1 parent2b9de40 commitcb5ff45

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

‎client/packages/lowcoder/src/comps/comps/appSettingsComp.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import { DEFAULT_THEMEID } from "comps/utils/themeUtil";
1717
import{NumberControl,RangeControl,StringControl}from"comps/controls/codeControl";
1818
import{IconControl}from"comps/controls/iconControl";
1919
import{dropdownControl}from"comps/controls/dropdownControl";
20-
import{ApplicationCategoriesEnum}from"constants/applicationConstants";
20+
import{ApplicationCategoriesEnum,AppUILayoutType}from"constants/applicationConstants";
2121
import{BoolControl}from"../controls/boolControl";
22-
import{getNpmPackageMeta}from"../utils/remote";
2322
import{getPromiseAfterDispatch}from"@lowcoder-ee/util/promiseUtils";
2423
importtype{AppState}from"@lowcoder-ee/redux/reducers";
2524
import{ColorControl}from"../controls/colorControl";
2625
import{DEFAULT_ROW_COUNT}from"@lowcoder-ee/layout/calculateUtils";
2726
import{AppSettingContext}from"../utils/appSettingContext";
28-
import{isPublicApplication}from"@lowcoder-ee/redux/selectors/applicationSelector";
27+
import{currentApplication,isPublicApplication}from"@lowcoder-ee/redux/selectors/applicationSelector";
28+
import{isAggregationApp}from"util/appUtils";
2929

3030
constTITLE=trans("appSetting.title");
3131
constUSER_DEFINE="__USER_DEFINE";
@@ -233,11 +233,8 @@ type ChildrenInstance = RecordConstructorToComp<typeof childrenMap> & {
233233
defaultTheme:string;
234234
};
235235

236-
typeAppSettingsExtraProps={isAggregationApp?:boolean};
237-
typeAppGeneralSettingsModalProps=ChildrenInstance&AppSettingsExtraProps;
238-
typeAppCanvasSettingsModalProps=ChildrenInstance&AppSettingsExtraProps;
239-
240-
functionAppGeneralSettingsModal(props:AppGeneralSettingsModalProps){
236+
functionAppGeneralSettingsModal(props:ChildrenInstance){
237+
constapplication=useSelector(currentApplication);
241238
constlowcoderCompsMeta=useSelector((state:AppState)=>state.npmPlugin.packageMeta['lowcoder-comps']);
242239
const[lowcoderCompVersions,setLowcoderCompVersions]=useState(['latest']);
243240
const{
@@ -247,7 +244,6 @@ function AppGeneralSettingsModal(props: AppGeneralSettingsModalProps) {
247244
category,
248245
showHeaderInPublic,
249246
lowcoderCompVersion,
250-
isAggregationApp
251247
}=props;
252248

253249
useEffect(()=>{
@@ -293,7 +289,7 @@ function AppGeneralSettingsModal(props: AppGeneralSettingsModalProps) {
293289
</div>
294290
</DivStyled>
295291
</BaseSection>
296-
{!isAggregationApp&&
292+
{application&&!isAggregationApp(AppUILayoutType[application.applicationType])&&
297293
<BaseSection
298294
name={"Lowcoder Comps"}
299295
width={288}
@@ -325,7 +321,8 @@ function AppGeneralSettingsModal(props: AppGeneralSettingsModalProps) {
325321
}}
326322
/>
327323
</DivStyled>
328-
</BaseSection>}
324+
</BaseSection>
325+
}
329326
<BaseSection
330327
name={"Shortcuts"}
331328
width={288}
@@ -343,7 +340,7 @@ function AppGeneralSettingsModal(props: AppGeneralSettingsModalProps) {
343340
);
344341
}
345342

346-
functionAppCanvasSettingsModal(props:AppCanvasSettingsModalProps){
343+
functionAppCanvasSettingsModal(props:ChildrenInstance){
347344
constisPublicApp=useSelector(isPublicApplication);
348345
const{
349346
themeList,
@@ -522,12 +519,12 @@ export const AppSettingsComp = new MultiCompBuilder(childrenMap, (props) => {
522519
maxWidth:Number(props.maxWidth),
523520
};
524521
})
525-
.setPropertyViewFn((children,extraProps)=>{
522+
.setPropertyViewFn((children)=>{
526523
const{ settingType}=useContext(AppSettingContext);
527524
constthemeList=useSelector(getThemeList)||[];
528525
constdefaultTheme=(useSelector(getDefaultTheme)||"").toString();
529526
returnsettingType==='canvas'
530-
?<AppCanvasSettingsModal{...children}themeList={themeList}defaultTheme={defaultTheme}{...(extraProps||{})}/>
531-
:<AppGeneralSettingsModal{...children}themeList={themeList}defaultTheme={defaultTheme}{...(extraProps||{})}/>;
527+
?<AppCanvasSettingsModal{...children}themeList={themeList}defaultTheme={defaultTheme}/>
528+
:<AppGeneralSettingsModal{...children}themeList={themeList}defaultTheme={defaultTheme}/>;
532529
})
533530
.build();

‎client/packages/lowcoder/src/comps/generators/multi.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ export type ViewFnTypeForComp<ViewReturn, ChildrenCompMap> = ViewFnType<
5151
ViewReturn,
5252
ToViewReturn<ChildrenCompMap>
5353
>;
54-
exporttypePropertyViewFnTypeForComp<ChildrenCompMap,ExtraProps=any>=(
54+
exporttypePropertyViewFnTypeForComp<ChildrenCompMap>=(
5555
children:ChildrenCompMap,
56-
dispatch:(action:CompAction)=>void,
57-
extraProps?:ExtraProps
56+
dispatch:(action:CompAction)=>void
5857
)=>ReactNode;
5958

6059
exportfunctionparseChildrenFromValueAndChildrenMap<
@@ -84,10 +83,10 @@ export function parseChildrenFromValueAndChildrenMap<
8483
* Building comp this way can use typescript's type inference capabilities.
8584
* Using ChildrenCompMap as a generic is to retain the information of each class, such as not wanting StringControl to degenerate into Comp<string>
8685
*/
87-
exportclassMultiCompBuilder<ViewReturn,ChildrenCompMapextendsRecord<string,Comp<unknown>>,ExtraProps=any>{
86+
exportclassMultiCompBuilder<ViewReturn,ChildrenCompMapextendsRecord<string,Comp<unknown>>>{
8887
privatechildrenMap:ToConstructor<ChildrenCompMap>;
8988
privateviewFn:ViewFnTypeForComp<ViewReturn,ChildrenCompMap>;
90-
privatepropertyViewFn?:PropertyViewFnTypeForComp<ChildrenCompMap,ExtraProps>;
89+
privatepropertyViewFn?:PropertyViewFnTypeForComp<ChildrenCompMap>;
9190

9291
/**
9392
* If viewFn is not placed in the constructor, the type of ViewReturn cannot be inferred
@@ -100,7 +99,7 @@ export class MultiCompBuilder<ViewReturn, ChildrenCompMap extends Record<string,
10099
this.viewFn=viewFn;
101100
}
102101

103-
setPropertyViewFn(propertyViewFn:PropertyViewFnTypeForComp<ChildrenCompMap,ExtraProps>){
102+
setPropertyViewFn(propertyViewFn:PropertyViewFnTypeForComp<ChildrenCompMap>){
104103
this.propertyViewFn=propertyViewFn;
105104
returnthis;
106105
}
@@ -130,8 +129,8 @@ export class MultiCompBuilder<ViewReturn, ChildrenCompMap extends Record<string,
130129
);
131130
}
132131

133-
overridegetPropertyView(extraProps?:ExtraProps):ReactNode{
134-
return<PropertyViewcomp={this}propertyViewFn={builder.propertyViewFn}extraProps={extraProps}/>;
132+
overridegetPropertyView():ReactNode{
133+
return<PropertyViewcomp={this}propertyViewFn={builder.propertyViewFn}/>;
135134
}
136135
}
137136

@@ -142,12 +141,12 @@ export class MultiCompBuilder<ViewReturn, ChildrenCompMap extends Record<string,
142141
/**
143142
* Guaranteed to be in a react component, so that react hooks can be used internally
144143
*/
145-
exportfunctionPropertyView(props:{comp:any;propertyViewFn:any;extraProps?:any}){
144+
exportfunctionPropertyView(props:{comp:any;propertyViewFn:any}){
146145
constcomp=props.comp;
147146
if(!props.propertyViewFn){
148147
returnnull;
149148
}
150-
returnprops.propertyViewFn(comp.children,comp.dispatch,props.extraProps);
149+
returnprops.propertyViewFn(comp.children,comp.dispatch);
151150
}
152151

153152
exportfunctionchildrenToProps<ChildrenCompMapextendsRecord<string,Comp<unknown>>>(

‎client/packages/lowcoder/src/pages/editor/editorView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ function EditorView(props: EditorViewProps) {
712712
{application&&
713713
(
714714
<>
715-
{appSettingsComp.getPropertyView({isAggregationApp:isAggregationApp(AppUILayoutType[application.applicationType])})}
715+
{appSettingsComp.getPropertyView()}
716716
</>
717717
)}
718718
</ScrollBar>
@@ -726,7 +726,7 @@ function EditorView(props: EditorViewProps) {
726726
AppUILayoutType[application.applicationType]
727727
)&&(
728728
<>
729-
{appSettingsComp.getPropertyView({isAggregationApp:isAggregationApp(AppUILayoutType[application.applicationType])})}
729+
{appSettingsComp.getPropertyView()}
730730
</>
731731
)}
732732
</ScrollBar>

‎client/packages/lowcoder/src/redux/sagas/orgSagas.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, pageSize
346346

347347
if(validateResponse(response)){
348348
constapiData=response.data.data;
349-
console.log("apiData",apiData);
350349

351350
// Transform orgId/orgName to match Org interface
352351
consttransformedItems=apiData.data.map(item=>({

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp