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

Added app meta fields title, description, category and icon in App settings#725

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
FalkWolsky merged 3 commits intolowcoder-org:devfromraheeliftikhar5:app_meta_field
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
88 changes: 78 additions & 10 deletionsclient/packages/lowcoder/src/comps/comps/appSettingsComp.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { ThemeDetail, ThemeType } from "api/commonSettingApi";
import { RecordConstructorToComp } from "lowcoder-core";
import { dropdownInputSimpleControl } from "comps/controls/dropdownInputSimpleControl";
import { MultiCompBuilder, valueComp } from "comps/generators";
import { MultiCompBuilder, valueComp, withDefault } from "comps/generators";
import { AddIcon, Dropdown } from "lowcoder-design";
import { EllipsisSpan } from "pages/setting/theme/styledComponents";
import { useEffect } from "react";
Expand All@@ -14,6 +14,10 @@ import { default as Divider } from "antd/es/divider";
import { THEME_SETTING } from "constants/routesURL";
import { CustomShortcutsComp } from "./customShortcutsComp";
import { DEFAULT_THEMEID } from "comps/utils/themeUtil";
import { StringControl } from "comps/controls/codeControl";
import { IconControl } from "comps/controls/iconControl";
import { dropdownControl } from "comps/controls/dropdownControl";
import { ApplicationCategoriesEnum } from "constants/applicationConstants";

const TITLE = trans("appSetting.title");
const USER_DEFINE = "__USER_DEFINE";
Expand DownExpand Up@@ -92,9 +96,37 @@ const SettingsStyled = styled.div`
`;

const DivStyled = styled.div`
div {
width: 100%;
display: block;
> div {
flex-wrap: wrap;
margin-bottom: 12px;

> div {
width: 100%;
display: block;
}

> div:first-child {
margin-bottom: 6px;
}

.tooltipLabel {
white-space: nowrap;
}

}
// custom styles for icon selector
.app-icon {
> div {
margin-bottom: 0;

> div:first-child {
margin-bottom: 6px;
}
> div:nth-child(2) {
width: 88%;
display: inline-block;
}
}
}
`;

Expand DownExpand Up@@ -134,7 +166,22 @@ const DividerStyled = styled(Divider)`
border-color: #e1e3eb;
`;

type AppCategoriesEnumKey = keyof typeof ApplicationCategoriesEnum
const AppCategories = Object.keys(ApplicationCategoriesEnum).map(
(cat) => {
const value = ApplicationCategoriesEnum[cat as AppCategoriesEnumKey];
return {
label: value,
value,
}
}
)

const childrenMap = {
title: withDefault(StringControl, ''),
description: withDefault(StringControl, ''),
icon: IconControl,
category: dropdownControl(AppCategories, ApplicationCategoriesEnum.BUSINESS),
maxWidth: dropdownInputSimpleControl(OPTIONS, USER_DEFINE, "1920"),
themeId: valueComp<string>(DEFAULT_THEMEID),
customShortcuts: CustomShortcutsComp,
Expand All@@ -146,7 +193,16 @@ type ChildrenInstance = RecordConstructorToComp<typeof childrenMap> & {
};

function AppSettingsModal(props: ChildrenInstance) {
const { themeList, defaultTheme, themeId, maxWidth } = props;
const {
themeList,
defaultTheme,
themeId,
maxWidth,
title,
description,
icon,
category,
} = props;
const THEME_OPTIONS = themeList?.map((theme) => ({
label: theme.name,
value: theme.id + "",
Expand DownExpand Up@@ -182,16 +238,30 @@ function AppSettingsModal(props: ChildrenInstance) {
<SettingsStyled>
<Title>{TITLE}</Title>
<DivStyled>
{title.propertyView({
label: trans("appSetting.appTitle"),
placeholder: trans("appSetting.appTitle")
})}
{description.propertyView({
label: trans("appSetting.appDescription"),
placeholder: trans("appSetting.appDescription")
})}
{category.propertyView({
label: trans("appSetting.appCategory"),
})}
<div className="app-icon">
{icon.propertyView({
label: trans("icon"),
tooltip: trans("aggregation.iconTooltip"),
})}
</div>
{maxWidth.propertyView({
dropdownLabel: trans("appSetting.canvasMaxWidth"),
inputLabel: trans("appSetting.userDefinedMaxWidth"),
inputPlaceholder: trans("appSetting.inputUserDefinedPxValue"),
placement: "bottom",
min: 350,
lastNode: <span>{trans("appSetting.maxWidthTip")}</span>,
labelStyle: {marginBottom: "8px"},
dropdownStyle: {marginBottom: "12px"},
inputStyle: {marginBottom: "12px"}
})}
<Dropdown
defaultValue={
Expand All@@ -205,8 +275,6 @@ function AppSettingsModal(props: ChildrenInstance) {
options={THEME_OPTIONS}
label={trans("appSetting.themeSetting")}
placement="bottom"
labelStyle={{marginBottom: "8px"}}
dropdownStyle={{marginBottom: "12px"}}
itemNode={(value) => <DropdownItem value={value} />}
preNode={() => (
<>
Expand Down
58 changes: 30 additions & 28 deletionsclient/packages/lowcoder/src/comps/hooks/drawerComp.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,6 +35,35 @@ const DrawerWrapper = styled.div`
pointer-events: auto;
`;

const ButtonStyle = styled(Button)<{$closePosition?: string}>`
position: absolute;
${(props) => props.$closePosition === "right" ? "right: 0;" : "left: 0;"}
top: 0;
z-index: 10;
font-weight: 700;
box-shadow: none;
color: rgba(0, 0, 0, 0.45);
height: 54px;
width: 54px;

svg {
width: 16px;
height: 16px;
}

&,
:hover,
:focus {
background-color: transparent;
border: none;
}

:hover,
:focus {
color: rgba(0, 0, 0, 0.75);
}
`;

// If it is a number, use the px unit by default
function transToPxSize(size: string | number) {
return isNumeric(size) ? size + "px" : (size as string);
Expand DownExpand Up@@ -103,34 +132,6 @@ let TmpDrawerComp = (function () {
},
[dispatch, isTopBom]
);
const ButtonStyle = styled(Button)`
position: absolute;
${props.closePosition === "right" ? "right: 0;" : "left: 0;"}
top: 0;
z-index: 10;
font-weight: 700;
box-shadow: none;
color: rgba(0, 0, 0, 0.45);
height: 54px;
width: 54px;

svg {
width: 16px;
height: 16px;
}

&,
:hover,
:focus {
background-color: transparent;
border: none;
}

:hover,
:focus {
color: rgba(0, 0, 0, 0.75);
}
`;
return (
<BackgroundColorContext.Provider value={props.style.background}>
<DrawerWrapper>
Expand DownExpand Up@@ -168,6 +169,7 @@ let TmpDrawerComp = (function () {
mask={props.showMask}
>
<ButtonStyle
$closePosition={props.closePosition}
onClick={() => {
props.visible.onChange(false);
}}
Expand Down
5 changes: 4 additions & 1 deletionclient/packages/lowcoder/src/i18n/locales/de.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1860,7 +1860,10 @@ export const de = {
"maxWidthTip": "Die maximale Breite sollte größer als oder gleich 350 sein",
"themeSetting": "Angewandter Stil Thema",
"themeSettingDefault": "Standard",
"themeCreate": "Thema erstellen"
"themeCreate": "Thema erstellen",
"appTitle": "Titel",
"appDescription": "Beschreibung",
"appCategory": "Kategorie",
},
"customShortcut": {
"title": "Benutzerdefinierte Abkürzungen",
Expand Down
5 changes: 4 additions & 1 deletionclient/packages/lowcoder/src/i18n/locales/en.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2045,7 +2045,10 @@ export const en = {
"maxWidthTip": "Max Width Should Be Greater Than or Equal to 350",
"themeSetting": "Applied Style Theme",
"themeSettingDefault": "Default",
"themeCreate": "Create Theme"
"themeCreate": "Create Theme",
"appTitle": "Title",
"appDescription": "Description",
"appCategory": "Category",
},
"customShortcut": {
"title": "Custom Shortcuts",
Expand Down
3 changes: 3 additions & 0 deletionsclient/packages/lowcoder/src/i18n/locales/zh.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1933,6 +1933,9 @@ appSetting: {
themeSetting: "主题设置",
themeSettingDefault: "默认",
themeCreate: "创建主题",
appTitle: "标题",
appDescription: "描述",
appCategory: "类别",
},
customShortcut: {
title: "自定义快捷键",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,7 @@ const RightStyledCard = styled(Card)`

export const LeftPanel = styled(StyledCard)`
display: block;
z-index: ${Layers.rightPanel};
`;
export const RightPanelWrapper = styled(RightStyledCard)`
display: flex;
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,6 +148,6 @@ export const CollapseWrapper = styled.div<{ $clientX?: number }>`
display: none;
}
.simplebar-content > div {
padding: 0;
//padding: 0;
}
`;

[8]ページ先頭

©2009-2025 Movatter.jp