Skip to content

Dev -> Main - v2.3.1 Fix #737

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

Merged
merged 49 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
bc9d45c
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
freddysundowner Feb 19, 2024
c60dcce
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into dev
freddysundowner Feb 21, 2024
ebfbdfd
added licence key data field
freddysundowner Feb 22, 2024
e7014bb
Merge branch 'dev' of https://github.com/lowcoder-org/lowcoder into c…
freddysundowner Feb 23, 2024
df156a5
fixed access of licence in the full calendar
freddysundowner Feb 23, 2024
0e95abd
fixed bug on licence key input filled
freddysundowner Feb 23, 2024
a1918e5
"add premium and free calendar options drop down"
freddysundowner Feb 26, 2024
4b86584
removed hand coded licence key
freddysundowner Feb 26, 2024
50f87fc
Mention component height issue fix, checkbox component hover backgrou…
imtananikhwa Feb 26, 2024
658e299
Add logs for debugging
aq-ikhwa-tech Feb 27, 2024
4890116
fix for comps hide on adding to modal/drawer
raheeliftikhar5 Feb 27, 2024
6b8a497
Fixes and introduction of text-decoration and text transform property…
imtananikhwa Feb 27, 2024
f501802
CSS styles and propeties added to tabbed container while ensuring the…
imtananikhwa Feb 27, 2024
2c80045
CSS properties and their control added for segment control
imtananikhwa Feb 27, 2024
8e9ab45
Toasts Notification & Loading Mesages
sudoischenny Feb 27, 2024
36ccf9a
Merge branch 'lowcoder-org:main' into main
sudoischenny Feb 27, 2024
683179c
Update Toasts Image
sudoischenny Feb 27, 2024
3708c30
Added toast.destroy()
sudoischenny Feb 27, 2024
791cff1
Toast Dismiss
sudoischenny Feb 27, 2024
9857111
Add migration to fix existing application public view bug
aq-ikhwa-tech Feb 28, 2024
e5bbd35
Remove unnecessary logs
aq-ikhwa-tech Feb 28, 2024
a85f478
fixed styledcomponent warning in drawerComp
raheeliftikhar5 Feb 28, 2024
08b675a
added app meta fields
raheeliftikhar5 Feb 28, 2024
27d870d
Merge pull request #1 from lowcoder-org/dev
sudoischenny Feb 28, 2024
220c0cc
Merge branch 'lowcoder-org:main' into main
sudoischenny Feb 28, 2024
f30fdf2
TS issue fixed
imtananikhwa Feb 28, 2024
6e81667
Tab container type removal, due to compiler error
imtananikhwa Feb 28, 2024
a6be0ab
Merge pull request #718 from lowcoder-org/add-logs-to-debug-api-stats…
FalkWolsky Feb 28, 2024
2f7487b
Merge branch 'dev' into imtanan-task1
FalkWolsky Feb 28, 2024
b395356
Merge pull request #719 from imtananikhwa/imtanan-task1
FalkWolsky Feb 28, 2024
56d2086
Merge branch 'dev' into main
FalkWolsky Feb 28, 2024
eb3854b
Merge pull request #721 from sudoischenny/main
FalkWolsky Feb 28, 2024
8d6bf63
Merge branch 'dev' into fix_modal_comps_invisible
FalkWolsky Feb 28, 2024
5e5f73c
Merge pull request #724 from raheeliftikhar5/fix_modal_comps_invisible
FalkWolsky Feb 28, 2024
fa20094
Merge branch 'dev' into app_meta_field
FalkWolsky Feb 28, 2024
e379627
Merge pull request #725 from raheeliftikhar5/app_meta_field
FalkWolsky Feb 28, 2024
b6e1e2c
Added Comments to Marketplace Use
Feb 29, 2024
877f9f5
Add Support as App Category
Feb 29, 2024
4f58b96
Adding Admin Area Icons
Mar 1, 2024
1c44f3a
Changing Readme for latest ENV Variables
Mar 1, 2024
c96bb7e
Rounding Up Marketplace and Multi-Icon Component
Mar 3, 2024
cc5333c
Added comments based on common discussion
Feb 29, 2024
120fbc9
fix: sorted out application view rights for all cases
ludomikula Feb 29, 2024
de03572
fix: update location of marketplace app settings
ludomikula Mar 1, 2024
d5c9c32
fix: for now, allow to view non-published apps for logged in users
ludomikula Mar 1, 2024
35472c0
Adding mn height for App Cards in Marketplace
Mar 4, 2024
73ea344
Merge branch 'dev' into calendar-licenc-key
FalkWolsky Mar 4, 2024
3452d4b
Merge pull request #736 from lowcoder-org/calendar-licenc-key
FalkWolsky Mar 4, 2024
f31c4f9
Increase Lowcoder Comps Version
Mar 4, 2024
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
Prev Previous commit
Next Next commit
Rounding Up Marketplace and Multi-Icon Component
  • Loading branch information
FalkWolsky committed Mar 3, 2024
commit c96bb7e07b5d6b4672e7f7c7267d031d0cff5ee5
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const AppCategories = Object.keys(ApplicationCategoriesEnum).map(
const value = ApplicationCategoriesEnum[cat as AppCategoriesEnumKey];
return {
label: value,
value,
value: cat
}
}
)
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/comps/comps/iconComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,4 @@ IconBasicComp = class extends IconBasicComp {
export const IconComp = withExposingConfigs(IconBasicComp, [
NameConfigHidden,
]);

88 changes: 88 additions & 0 deletions client/packages/lowcoder/src/comps/comps/multiIconDisplay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { findIconDefinition, library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import * as AntdIcons from '@ant-design/icons';

library.add(far,fas);

function parseIconIdentifier(identifier: string) {
if (identifier.startsWith('/icon:antd/')) {
let name = identifier.split('/')[2];
return { type: 'antd', name };
}
else if (identifier.startsWith('/icon:solid/') || identifier.startsWith('/icon:regular/')) {
const [style, name] = identifier.substring(6).split('/');
return { type: 'fontAwesome', style, name };
}
else if (identifier.startsWith('data:image')) {
return { type: 'base64', data: identifier, name: "" };
}
else if (identifier.startsWith('http')) {
return { type: 'url', url: identifier, name: "" };
}
else {
return { type: 'unknown', name: "" };
}
}

interface IconProps {
identifier: string;
width?: string;
height?: string;
style?: React.CSSProperties;
}

const convertToCamelCase = (name: string) => {
return name.replace(/(-\w)/g, (match) => match[1].toUpperCase());
}

const appendStyleSuffix = (name: string) => {
if (name.endsWith('outlined')) {
return name.replace('outlined', 'Outlined');
} else if (name.endsWith('filled')) {
return name.replace('filled', 'Filled');
} else if (name.endsWith('twotone')) {
return name.replace('twotone', 'TwoTone');
}
return name;
}

// Multi icon Display Component

const baseMultiIconDisplay: React.FC<IconProps> = ({ identifier, width = '24px', height = '24px', style }) => {

const iconData = parseIconIdentifier(identifier);

if (iconData.type === 'fontAwesome') {
const prefix = iconData.style === 'solid' ? 'fas' : 'far'; // 'fas' for solid, 'far' for regular
// Find the icon definition using prefix and iconName
const iconLookup = findIconDefinition({ prefix: prefix as any, iconName: iconData.name as any });

if (!iconLookup) {
console.error(`Icon ${iconData.name} with prefix ${prefix} not found`);
return null;
}
return <FontAwesomeIcon icon={iconLookup} style={{ width, height, ...style }} />;
}
else if (iconData.type === 'antd') {
let iconName = convertToCamelCase(iconData.name);
iconName = appendStyleSuffix(iconName);
iconName = iconName.charAt(0).toUpperCase() + iconName.slice(1);
const AntdIcon = (AntdIcons as any)[iconName];
if (!AntdIcon) {
console.error(`ANTd Icon ${iconData.name} not found`);
return null;
}
return <AntdIcon style={{ fontSize: width, ...style }} />;
}
else if (iconData.type === 'url' || iconData.type === 'base64') {
return <img src={iconData.type === 'url' ? iconData.url : iconData.data} alt="icon" style={{ width, height, ...style }} />;
}
else {
return null; // Unknown type
}
};

export const MultiIconDisplay = baseMultiIconDisplay;
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function ColumnPropertyView<T extends MultiBaseComp<TableChildrenType>>(props: {
<ToolTipLabel title={trans("table.refreshButtonTooltip")}>
<StyledRefreshIcon
onClick={() => {
console.log("comp", comp);
// console.log("comp", comp);
comp.dispatch(
wrapChildAction(
"columns",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export interface ApplicationMeta {
creatorEmail?: string;
title?: string;
description?: string;
icon?: string;
image?: string;
category?: ApplicationCategoriesEnum;
showheader?: boolean;
orgId: string;
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2266,6 +2266,7 @@ export const en = {
"module": "Module",
"trash": "Trash",
"marketplace": "Marketplace",
"allCategories": "All Categories",
"queryLibrary": "Query Library",
"datasource": "Data Sources",
"selectDatasourceType": "Select Data Source Type",
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/i18n/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,7 @@ home: {
"errorMarketplaceApps": "获取市场应用程序错误",
"localMarketplaceTitle": "本地市场",
"globalMarketplaceTitle": "Lowcoder 市场",
"allCategories": "所有类别",
memberPermissionList: "成员权限:",
orgName: "{orgName}管理员",
addMember: "添加成员",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import styled from "styled-components";
import { HomeRes } from "./HomeLayout";
import { HomeResCard } from "./HomeResCard";
import { MarketplaceResCard } from "./MarketplaceResCard";
import React, { useState } from "react";
import { MoveToFolderModal } from "./MoveToFolderModal";

const ApplicationCardsWrapper = styled.div`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(408px, 1fr));
grid-template-rows: repeat(auto-fill, min(68px, 100%));
grid-template-rows: repeat(auto-fill, min(auto, 100%));
grid-column-gap: 112px;
grid-row-gap: 20px;
margin: 48px 26px 80px;
overflow: hidden;
@media screen and (max-width: 500px) {
Expand All @@ -23,6 +25,8 @@ export function HomeCardView(props: { resources: HomeRes[] }) {
return (
<ApplicationCardsWrapper>
{props.resources.map((res) => (
res.isMarketplace ?
<MarketplaceResCard key={res.id} res={res} /> :
<HomeResCard key={res.id} res={res} onMove={setNeedMoveRes} />
))}
<MoveToFolderModal source={needMoveRes} onClose={() => setNeedMoveRes(undefined)} />
Expand Down
76 changes: 64 additions & 12 deletions client/packages/lowcoder/src/pages/ApplicationV2/HomeLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { checkIsMobile } from "util/commonUtils";
import MarketplaceHeaderImage from "assets/images/marketplaceHeaderImage.jpg";
import { Divider } from "antd";
import { Margin } from "../setting/theme/styledComponents";
import { ApplicationCategoriesEnum } from "constants/applicationConstants";

const Wrapper = styled.div`
display: flex;
Expand Down Expand Up @@ -171,7 +172,7 @@ const FilterDropdown = styled(Select)`

const FilterMenuItem = styled.div`
display: flex;
align-items: center;
align-items: left;
height: 29px;
width: 100%;
`;
Expand Down Expand Up @@ -253,6 +254,10 @@ export interface HomeRes {
key: string;
id: string;
name: string;
title?: string;
description?: string;
category?: string;
icon?: string;
type: HomeResTypeEnum;
creator: string;
lastModifyTime: number;
Expand All @@ -276,20 +281,37 @@ export interface HomeLayoutProps {
}

export function HomeLayout(props: HomeLayoutProps) {


const { breadcrumb = [], elements = [], localMarketplaceApps = [], globalMarketplaceApps = [],mode } = props;

const categoryOptions = [
{ label: <FilterMenuItem>{trans("home.allCategories")}</FilterMenuItem>, value: 'All' },
...Object.entries(ApplicationCategoriesEnum).map(([key, value]) => ({
label: (
<FilterMenuItem>
{value}
</FilterMenuItem>
),
value: key,
})),
];

const user = useSelector(getUser);
const isFetching = useSelector(isFetchingFolderElements);
const isSelfHost = window.location.host !== 'app.lowcoder.cloud';
const [filterBy, setFilterBy] = useState<HomeResKey>("All");
const [typeFilter, setTypeFilter] = useState<HomeResKey>("All");
const [categoryFilter, setCategoryFilter] = useState<ApplicationCategoriesEnum | "All">("All");
const [searchValue, setSearchValue] = useState("");
const [layout, setLayout] = useState<HomeLayoutType>(
checkIsMobile(window.innerWidth) ? "card" : getHomeLayout()
);


useEffect(() => saveHomeLayout(layout), [layout]);

useEffect(() => {
// remove collision status from localstorage
// remove collision status from localstorage, as the next selected app may have another collision status
removeCollisionStatus();
}, []);

Expand All @@ -300,6 +322,7 @@ export function HomeLayout(props: HomeLayoutProps) {
}

var displayElements = elements;

if (mode === "marketplace" && isSelfHost) {
const markedLocalApps = localMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: true }));
const markedGlobalApps = globalMarketplaceApps.map(app => ({ ...app, isLocalMarketplace: false }));
Expand All @@ -319,18 +342,27 @@ export function HomeLayout(props: HomeLayoutProps) {
: true
)
.filter((e) => {
if (HomeResTypeEnum[filterBy].valueOf() === HomeResTypeEnum.All) {
if (HomeResTypeEnum[typeFilter].valueOf() === HomeResTypeEnum.All) {
return true;
}
if (e.folder) {
return HomeResTypeEnum[filterBy] === HomeResTypeEnum.Folder;
return HomeResTypeEnum[typeFilter] === HomeResTypeEnum.Folder;
} else {
if (filterBy === "Navigation") {
if (typeFilter === "Navigation") {
return NavigationTypes.map((t) => t.valueOf()).includes(e.applicationType);
}
return HomeResTypeEnum[filterBy].valueOf() === e.applicationType;
return HomeResTypeEnum[typeFilter].valueOf() === e.applicationType;
}
})
.filter((e) => {
// If "All" is selected, do not filter out any elements based on category
if (categoryFilter === 'All' || !categoryFilter) {
return true;
}
// Otherwise, filter elements based on the selected category
return !e.folder && e.category === categoryFilter.toString();
})

.map((e) =>
e.folder
? {
Expand All @@ -347,6 +379,10 @@ export function HomeLayout(props: HomeLayoutProps) {
key: e.applicationId,
id: e.applicationId,
name: e.name,
title: e.title,
description: e.description,
category: e.category,
icon: e.image,
type: HomeResTypeEnum[HomeResTypeEnum[e.applicationType] as HomeResKey],
creator: e?.creatorEmail ?? e.createBy,
lastModifyTime: e.lastModifyTime,
Expand Down Expand Up @@ -385,6 +421,14 @@ export function HomeLayout(props: HomeLayoutProps) {
}))
]

const testOptions = [
getFilterMenuItem(HomeResTypeEnum.All),
getFilterMenuItem(HomeResTypeEnum.Application),
getFilterMenuItem(HomeResTypeEnum.Module),
...(mode !== "marketplace" ? [getFilterMenuItem(HomeResTypeEnum.Navigation)] : []),
...(mode !== "trash" && mode !== "marketplace" ? [getFilterMenuItem(HomeResTypeEnum.Folder)] : []),
];

return (
<Wrapper>
<HeaderWrapper>
Expand Down Expand Up @@ -414,19 +458,27 @@ export function HomeLayout(props: HomeLayoutProps) {
{mode !== "folders" && mode !== "module" && (
<FilterDropdown
variant="borderless"
value={filterBy}
onChange={(value: any) => setFilterBy(value as HomeResKey)}
value={typeFilter}
onChange={(value: any) => setTypeFilter(value as HomeResKey)}
options={[
getFilterMenuItem(HomeResTypeEnum.All),
getFilterMenuItem(HomeResTypeEnum.Application),
getFilterMenuItem(HomeResTypeEnum.Module),
...(mode !== "marketplace" ? [getFilterMenuItem(HomeResTypeEnum.Navigation)] : []),
...(mode !== "trash" && mode !== "marketplace" ? [getFilterMenuItem(HomeResTypeEnum.Folder)] : []),

]}
getPopupContainer={(node: any) => node}
suffixIcon={<ArrowSolidIcon />}
/>
suffixIcon={<ArrowSolidIcon />} />
)}
{mode === "marketplace" && (
<FilterDropdown
style={{ minWidth: "220px" }}
variant="borderless"
value={categoryFilter}
onChange={(value: any) => setCategoryFilter(value as ApplicationCategoriesEnum)}
options={categoryOptions}
// getPopupContainer={(node) => node}
suffixIcon={<ArrowSolidIcon />} />
)}

<OperationRightWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Card = styled.div`
align-items: center;
height: 100%;
width: 100%;
border-bottom: 1px solid #f5f5f6;

padding: 0 10px;

button {
Expand Down
Loading