Skip to content

Commit 8bb4242

Browse files
author
FalkWolsky
committed
Small adaptions for Marketplace
1 parent 9224fe0 commit 8bb4242

File tree

10 files changed

+526
-47
lines changed

10 files changed

+526
-47
lines changed

client/packages/lowcoder-comps/src/comps/calendarComp/calendarConstants.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ export const Wrapper = styled.div<{
205205
flex-direction: inherit;
206206
}
207207
.fc-day-today .fc-daygrid-day-number {
208-
background-color: ${(props) => props.$theme.primary};
208+
background-color: ${(props) => props.$theme?.primary ? props.$theme.primary : props.$style.background};
209209
color: ${(props) =>
210-
contrastText(props.$theme.primary || "", props.$theme.textDark, props.$theme.textLight)};
210+
contrastText(props.$theme?.primary || "", props.$theme?.textDark || "#000000", props.$theme?.textLight || "#ffffff")};
211211
}
212212
.fc-daygrid-day-events {
213213
padding: 1px 0 5px 0;
@@ -585,10 +585,10 @@ export const Wrapper = styled.div<{
585585
}
586586
.fc-day-today.fc-col-header-cell {
587587
background-color: ${(props) =>
588-
isDarkColor(props.$style.background) ? "#ffffff19" : toHex(props.$theme.primary!) + "19"};
588+
isDarkColor(props.$style.background) ? "#ffffff19" : toHex(props.$theme?.primary!) + "19"};
589589
a {
590590
color: ${(props) =>
591-
!isDarkColor(props.$style.background) && darkenColor(props.$theme.primary!, 0.1)};
591+
!isDarkColor(props.$style.background) && darkenColor(props.$theme?.primary!, 0.1)};
592592
}
593593
}
594594
.fc-col-header-cell-cushion {
Loading

client/packages/lowcoder/src/components/PermissionDialog/AppPermissionDialog.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { StyledLoading } from "./commonComponents";
2929
import { PermissionRole } from "./Permission";
3030
import { SHARE_TITLE } from "../../constants/apiConstants";
3131
import { messageInstance } from "lowcoder-design";
32+
import { Divider } from "antd";
3233

3334
export const AppPermissionDialog = (props: {
3435
applicationId: string;
@@ -207,23 +208,7 @@ function AppShareView(props: {
207208
}, [permissionInfo.publicToMarketplace]);
208209
return (
209210
<div style={{ marginBottom: "22px" }}>
210-
<PermissionSwitchWrapper>
211-
<TacoSwitch
212-
checked={isPublicToMarketplace}
213-
onChange={(checked) => {
214-
setPublicToMarketplace(checked);
215-
ApplicationApi.publicToMarketplace(applicationId, checked)
216-
.then((resp) => {
217-
validateResponse(resp);
218-
dispatch(updateAppPermissionInfo({ publicToMarketplace: checked }));
219-
})
220-
.catch((e) => {
221-
messageInstance.error(e.message);
222-
});
223-
}}
224-
label={isModule ? 'Public module to marketplace' : 'Public app to marketplace'}
225-
/>
226-
</PermissionSwitchWrapper>
211+
227212
<PermissionSwitchWrapper>
228213
<TacoSwitch
229214
checked={isPublic}
@@ -241,6 +226,27 @@ function AppShareView(props: {
241226
label={isModule ? trans("home.modulePublicMessage") : trans("home.appPublicMessage")}
242227
/>
243228
</PermissionSwitchWrapper>
229+
{isPublic &&
230+
<PermissionSwitchWrapper>
231+
<TacoSwitch
232+
checked={isPublicToMarketplace}
233+
onChange={(checked) => {
234+
setPublicToMarketplace(checked);
235+
ApplicationApi.publicToMarketplace(applicationId, checked)
236+
.then((resp) => {
237+
validateResponse(resp);
238+
dispatch(updateAppPermissionInfo({ publicToMarketplace: checked }));
239+
})
240+
.catch((e) => {
241+
messageInstance.error(e.message);
242+
});
243+
} }
244+
label={isModule ? trans("home.moduleMarketplaceMessage") : trans("home.appMarketplaceMessage")} />
245+
</PermissionSwitchWrapper> }
246+
{ isPublicToMarketplace && <><div style={{ margin: "10px 22px 22px 22px" }}>
247+
{trans("home.marketplaceGoodPublishing")}
248+
</div><Divider/></>}
249+
244250
{isPublic && <AppInviteView appId={applicationId} />}
245251
</div>
246252
);

client/packages/lowcoder/src/i18n/locales/de.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,8 +2111,12 @@ export const de = {
21112111
"allPermissions": "Besitzer",
21122112
"shareLink": "Link teilen: ",
21132113
"copyLink": "Link kopieren",
2114-
"appPublicMessage": "Mach die App öffentlich. Jeder kann sie sehen.",
2115-
"modulePublicMessage": "Mach das Modul öffentlich. Jeder kann es sehen.",
2114+
"appPublicMessage": "App veröffentlichen. Auf dem Marktplatz für jeden zu sehen.",
2115+
"modulePublicMessage": "Module veröffentlichen. Auf dem Marktplatz für jeden zu sehen.",
2116+
"appMarketplaceMessage": "Veröffentlichen Sie Ihre App auf dem Lowcoder-Marktplatz. Jeder kann sie dort sehen und kopieren.",
2117+
"moduleMarketplaceMessage": "Veröffentlichen Sie Ihr Modul auf dem Lowcoder-Marktplatz. Jeder kann es dort sehen und kopieren.",
2118+
"marketplaceGoodPublishing": "Bitte stellen Sie sicher, dass Ihre App gut benannt und einfach zu bedienen ist. Entfernen Sie alle sensiblen Informationen vor der Veröffentlichung. Entfernen Sie außerdem lokale Datenquellen und ersetzen Sie sie durch statische, integrierte temporäre Daten.",
2119+
"noMarketplaceApps": "Noch sind keine Anwendungen auf dem Marktplatz.",
21162120
"memberPermissionList": "Mitgliedschaftsberechtigungen: ",
21172121
"orgName": "{orgName} admins",
21182122
"addMember": "Mitglieder hinzufügen",

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,8 +2238,8 @@ export const en = {
22382238
"history": "History"
22392239
},
22402240
"home": {
2241-
"allApplications": "All Apps",
2242-
"allModules": "All Modules",
2241+
"allApplications": "Your Apps",
2242+
"allModules": "Your Modules",
22432243
"allFolders": "All Folders",
22442244
"modules": "Modules",
22452245
"module": "Module",
@@ -2304,6 +2304,10 @@ export const en = {
23042304
"copyLink": "Copy link",
23052305
"appPublicMessage": "Make the app public. Anyone can view.",
23062306
"modulePublicMessage": "Make the module public. Anyone can view.",
2307+
"appMarketplaceMessage": "Publish your App on Lowcoder Marketplace. Anyone can view and copy it from there.",
2308+
"moduleMarketplaceMessage": "Publish your Module on Lowcoder Marketplace. Anyone can view and copy it from there.",
2309+
"marketplaceGoodPublishing": "Please make sure your app is well-named and easy to use. Remove any sensitive information before publishing. Also, remove local datasources and replace by static built-in temporary data.",
2310+
"noMarketplaceApps": "No apps yet in the marketplace",
23072311
"memberPermissionList": "Member permissions: ",
23082312
"orgName": "{orgName} admins",
23092313
"addMember": "Add members",

client/packages/lowcoder/src/i18n/locales/zh.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,6 +2183,10 @@ home: {
21832183
copyLink: "复制链接",
21842184
appPublicMessage: "将应用设为公开,任何人都可以查看.",
21852185
modulePublicMessage: "将模块设为公开,任何人都可以查看.",
2186+
"appMarketplaceMessage": "发布您的应用程序到Lowcoder市场.任何人都可以在那里查看和复制它.",
2187+
"moduleMarketplaceMessage": "发布您的模块到Lowcoder市场.任何人都可以在那里查看和复制它.",
2188+
"marketplaceGoodPublishing": "请确保您的应用程序命名准确、易于使用。发布前请删除任何敏感信息。此外,移除本地数据源,代之以静态内置临时数据",
2189+
"noMarketplaceApps": "市场上还没有应用程序",
21862190
memberPermissionList: "成员权限:",
21872191
orgName: "{orgName}管理员",
21882192
addMember: "添加成员",

client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { CreateDropdown } from "./CreateDropdown";
3232
import { trans } from "../../i18n";
3333
import { isFetchingFolderElements } from "../../redux/selectors/folderSelector";
3434
import { checkIsMobile } from "util/commonUtils";
35+
import MarketplaceHeaderImage from "assets/images/marketplaceHeaderImage.jpg";
3536

3637
const Wrapper = styled.div`
3738
display: flex;
@@ -65,6 +66,23 @@ const OperationWrapper = styled.div`
6566
}
6667
`;
6768

69+
const MarketplaceHeader = styled.div`
70+
display: flex;
71+
align-items: center;
72+
justify-content: space-between;
73+
width: 100%;
74+
height: 200px;
75+
padding: 0 36px;
76+
margin: 8px 0 20px 0;
77+
@media screen and (max-width: 500px) {
78+
padding: 0 24px;
79+
}
80+
> img {
81+
width: 100%;
82+
object-fit: cover;
83+
}
84+
`;
85+
6886
const ContentWrapper = styled.div`
6987
position: relative;
7088
`;
@@ -364,6 +382,10 @@ export function HomeLayout(props: HomeLayoutProps) {
364382
{showNewUserGuide(user) && <HomepageTourV2 />}
365383
{/*<HomepageTourV2 />*/}
366384

385+
{mode === "marketplace" && (
386+
<MarketplaceHeader><img src={MarketplaceHeaderImage} alt="Lowcoder Application Marketplace"/></MarketplaceHeader>
387+
)}
388+
367389
<OperationWrapper>
368390
{mode !== "folders" && mode !== "module" && (
369391
<FilterDropdown
@@ -374,8 +396,9 @@ export function HomeLayout(props: HomeLayoutProps) {
374396
getFilterMenuItem(HomeResTypeEnum.All),
375397
getFilterMenuItem(HomeResTypeEnum.Application),
376398
getFilterMenuItem(HomeResTypeEnum.Module),
377-
getFilterMenuItem(HomeResTypeEnum.Navigation),
378-
...(mode !== "trash" ? [getFilterMenuItem(HomeResTypeEnum.Folder)] : []),
399+
...(mode !== "marketplace" ? [getFilterMenuItem(HomeResTypeEnum.Navigation)] : []),
400+
...(mode !== "trash" && mode !== "marketplace" ? [getFilterMenuItem(HomeResTypeEnum.Folder)] : []),
401+
379402
]}
380403
getPopupContainer={(node: any) => node}
381404
suffixIcon={<ArrowSolidIcon />}
@@ -396,6 +419,8 @@ export function HomeLayout(props: HomeLayoutProps) {
396419
</OperationWrapper>
397420

398421
<ContentWrapper>
422+
423+
399424
{isFetching && resList.length === 0 ? (
400425
<SkeletonStyle active paragraph={{ rows: 8, width: 648 }} title={false} />
401426
) : (
@@ -424,7 +449,7 @@ export function HomeLayout(props: HomeLayoutProps) {
424449
{mode === "trash"
425450
? trans("home.trashEmpty")
426451
: mode === "marketplace"
427-
? "No apps in marketplace yet"
452+
? trans("home.noMarketplaceApps")
428453
: user.orgDev
429454
? trans("home.projectEmptyCanAdd")
430455
: trans("home.projectEmpty")}

client/packages/lowcoder/src/pages/ApplicationV2/HomeResCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export function HomeResCard(props: { res: HomeRes; onMove: (res: HomeRes) => voi
168168
)}
169169
<CardInfo
170170
onClick={(e) => {
171-
console.log(res.isMarketplace);
172171
if (appNameEditing) {
173172
return;
174173
}

client/packages/lowcoder/src/pages/ApplicationV2/index.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export default function ApplicationHome() {
345345
selected ? <HomeActiveIcon {...otherProps} /> : <HomeIcon {...otherProps} />,
346346
},
347347
{
348-
text: <TabLabel>{trans("home.modules")}</TabLabel>,
348+
text: <TabLabel>{trans("home.allModules")}</TabLabel>,
349349
routePath: MODULE_APPLICATIONS_URL,
350350
routeComp: ModuleView,
351351
icon: ({ selected, ...otherProps }) =>
@@ -356,6 +356,19 @@ export default function ApplicationHome() {
356356
),
357357
visible: ({ user }) => user.orgDev,
358358
},
359+
{
360+
text: <TabLabel>{trans("home.marketplace")}</TabLabel>,
361+
routePath: MARKETPLACE_URL,
362+
routePathExact: false,
363+
routeComp: MarketplaceView,
364+
icon: ({ selected, ...otherProps }) =>
365+
selected ? (
366+
<MarketplaceActiveIcon {...otherProps} />
367+
) : (
368+
<MarketplaceIcon {...otherProps} />
369+
),
370+
visible: ({ user }) => user.orgDev,
371+
},
359372
{
360373
text: <TabLabel>{trans("home.trash")}</TabLabel>,
361374
routePath: TRASH_URL,
@@ -415,19 +428,6 @@ export default function ApplicationHome() {
415428
visible: ({ user }) => user.orgDev,
416429
onSelected: (_, currentPath) => currentPath.split("/")[1] === "datasource",
417430
},
418-
{
419-
text: <TabLabel>{trans("home.marketplace")}</TabLabel>,
420-
routePath: MARKETPLACE_URL,
421-
routePathExact: false,
422-
routeComp: MarketplaceView,
423-
icon: ({ selected, ...otherProps }) =>
424-
selected ? (
425-
<MarketplaceActiveIcon {...otherProps} />
426-
) : (
427-
<MarketplaceIcon {...otherProps} />
428-
),
429-
visible: ({ user }) => user.orgDev,
430-
},
431431
{
432432
text: <TabLabel>{trans("settings.title")}</TabLabel>,
433433
routePath: SETTING,

0 commit comments

Comments
 (0)