@@ -17,15 +17,15 @@ import { DEFAULT_THEMEID } from "comps/utils/themeUtil";
1717import { NumberControl , RangeControl , StringControl } from "comps/controls/codeControl" ;
1818import { IconControl } from "comps/controls/iconControl" ;
1919import { dropdownControl } from "comps/controls/dropdownControl" ;
20- import { ApplicationCategoriesEnum } from "constants/applicationConstants" ;
20+ import { ApplicationCategoriesEnum , AppUILayoutType } from "constants/applicationConstants" ;
2121import { BoolControl } from "../controls/boolControl" ;
22- import { getNpmPackageMeta } from "../utils/remote" ;
2322import { getPromiseAfterDispatch } from "@lowcoder-ee/util/promiseUtils" ;
2423import type { AppState } from "@lowcoder-ee/redux/reducers" ;
2524import { ColorControl } from "../controls/colorControl" ;
2625import { DEFAULT_ROW_COUNT } from "@lowcoder-ee/layout/calculateUtils" ;
2726import { 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
3030const TITLE = trans ( "appSetting.title" ) ;
3131const USER_DEFINE = "__USER_DEFINE" ;
@@ -233,11 +233,8 @@ type ChildrenInstance = RecordConstructorToComp<typeof childrenMap> & {
233233 defaultTheme : string ;
234234} ;
235235
236- type AppSettingsExtraProps = { isAggregationApp ?: boolean } ;
237- type AppGeneralSettingsModalProps = ChildrenInstance & AppSettingsExtraProps ;
238- type AppCanvasSettingsModalProps = ChildrenInstance & AppSettingsExtraProps ;
239-
240- function AppGeneralSettingsModal ( props : AppGeneralSettingsModalProps ) {
236+ function AppGeneralSettingsModal ( props : ChildrenInstance ) {
237+ const application = useSelector ( currentApplication ) ;
241238 const lowcoderCompsMeta = 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- function AppCanvasSettingsModal ( props : AppCanvasSettingsModalProps ) {
343+ function AppCanvasSettingsModal ( props : ChildrenInstance ) {
347344 const isPublicApp = 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 const themeList = useSelector ( getThemeList ) || [ ] ;
528525 const defaultTheme = ( useSelector ( getDefaultTheme ) || "" ) . toString ( ) ;
529526 return settingType === '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 ( ) ;
0 commit comments