Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Updated navigation app for settings and JS #1793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions client/packages/lowcoder/src/comps/comps/appSettingsComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import { DEFAULT_THEMEID } from "comps/utils/themeUtil";
import { NumberControl, RangeControl, StringControl } from "comps/controls/codeControl";
import { IconControl } from "comps/controls/iconControl";
import { dropdownControl } from "comps/controls/dropdownControl";
import { ApplicationCategoriesEnum } from "constants/applicationConstants";
import { ApplicationCategoriesEnum, AppUILayoutType } from "constants/applicationConstants";
import { BoolControl } from "../controls/boolControl";
import { getNpmPackageMeta } from "../utils/remote";
import { getPromiseAfterDispatch } from "@lowcoder-ee/util/promiseUtils";
import type { AppState } from "@lowcoder-ee/redux/reducers";
import { ColorControl } from "../controls/colorControl";
import { DEFAULT_ROW_COUNT } from "@lowcoder-ee/layout/calculateUtils";
import { AppSettingContext } from "../utils/appSettingContext";
import { isPublicApplication } from "@lowcoder-ee/redux/selectors/applicationSelector";
import { currentApplication, isPublicApplication } from "@lowcoder-ee/redux/selectors/applicationSelector";
import { isAggregationApp } from "util/appUtils";

const TITLE = trans("appSetting.title");
const USER_DEFINE = "__USER_DEFINE";
Expand Down Expand Up @@ -234,6 +234,7 @@ type ChildrenInstance = RecordConstructorToComp<typeof childrenMap> & {
};

function AppGeneralSettingsModal(props: ChildrenInstance) {
const application = useSelector(currentApplication);
const lowcoderCompsMeta = useSelector((state: AppState) => state.npmPlugin.packageMeta['lowcoder-comps']);
const [lowcoderCompVersions, setLowcoderCompVersions] = useState(['latest']);
const {
Expand Down Expand Up @@ -288,7 +289,8 @@ function AppGeneralSettingsModal(props: ChildrenInstance) {
</div>
</DivStyled>
</BaseSection>
<BaseSection
{application && !isAggregationApp(AppUILayoutType[application.applicationType]) &&
<BaseSection
name={"Lowcoder Comps"}
width={288}
noMargin
Expand Down Expand Up @@ -320,6 +322,7 @@ function AppGeneralSettingsModal(props: ChildrenInstance) {
/>
</DivStyled>
</BaseSection>
}
<BaseSection
name={"Shortcuts"}
width={288}
Expand Down Expand Up @@ -520,7 +523,6 @@ export const AppSettingsComp = new MultiCompBuilder(childrenMap, (props) => {
const { settingType } = useContext(AppSettingContext);
const themeList = useSelector(getThemeList) || [];
const defaultTheme = (useSelector(getDefaultTheme) || "").toString();

return settingType === 'canvas'
? <AppCanvasSettingsModal {...children} themeList={themeList} defaultTheme={defaultTheme} />
: <AppGeneralSettingsModal {...children} themeList={themeList} defaultTheme={defaultTheme} />;
Expand Down
10 changes: 6 additions & 4 deletions client/packages/lowcoder/src/pages/editor/editorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ const aggregationSiderItems = [
{
key: SiderKey.Setting,
icon: <LeftSettingIcon />,
}
},
{
key: SiderKey.JS,
icon: <LeftJSSettingIcon />,
},
];

const DeviceWrapper = ({
Expand Down Expand Up @@ -706,9 +710,7 @@ function EditorView(props: EditorViewProps) {
<SettingsDiv>
<ScrollBar>
{application &&
!isAggregationApp(
AppUILayoutType[application.applicationType]
) && (
(
<>
{appSettingsComp.getPropertyView()}
</>
Expand Down