Skip to content

Commit 824cbec

Browse files
author
FalkWolsky
committed
Introducing EE Version - active Development
1 parent 6a1df31 commit 824cbec

File tree

15 files changed

+49
-33
lines changed

15 files changed

+49
-33
lines changed

client/config/test/jest.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ export function currentDirName(importMetaUrl) {
66
return dirname(fileURLToPath(importMetaUrl));
77
}
88

9-
109
const globals = {};
1110
buildVars.forEach(({ name, defaultValue }) => {
1211
globals[name] = process.env[name] || defaultValue;
1312
});
14-
const edition = process.env.REACT_APP_EDITION;
15-
const isEEGlobal = edition === "enterprise-global";
16-
const isEE = edition === "enterprise" || isEEGlobal;
1713
const currentDir = currentDirName(import.meta.url);
1814

1915
export default {
@@ -22,8 +18,7 @@ export default {
2218
"react-markdown": path.resolve(currentDir, "./mocks/react-markdown.js"),
2319
"\\.md\\?url$": path.resolve(currentDir, "./mocks/markdown-url-module.js"),
2420
"^@lowcoder-ee(.*)$": path.resolve(
25-
currentDir,
26-
isEE ? "../../packages/lowcoder/src/ee/$1" : "../../packages/lowcoder/src/$1"
21+
currentDir, "../../packages/lowcoder/src/$1"
2722
),
2823
"lowcoder-sdk": path.resolve(currentDir, "../../packages/lowcoder/src/index.sdk"),
2924
},

client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"start": "yarn workspace lowcoder start",
1414
"start-win": "LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start",
1515
"start:ee": "REACT_APP_EDITION=enterprise yarn workspace lowcoder start",
16-
"start:ee-global": "REACT_APP_EDITION=enterprise-global yarn workspace lowcoder start",
1716
"build": "yarn node ./scripts/build.js",
1817
"test": "jest && yarn workspace lowcoder-comps test",
1918
"prepare": "yarn workspace lowcoder prepare",

client/packages/lowcoder-design/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ export { ReactComponent as RecyclerIcon } from "./remix/delete-bin-line.svg";
315315
export { ReactComponent as MarketplaceIcon } from "./icon-application-marketplace.svg";
316316
export { ReactComponent as FavoritesIcon } from "./icon-application-favorites.svg";
317317
export { ReactComponent as HomeSettingIcon } from "./remix/settings-4-line.svg";
318+
export { ReactComponent as EnterpriseIcon } from "./remix/earth-line.svg";
318319

319320

320321
// new

client/packages/lowcoder/src/app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ import {
1414
IMPORT_APP_FROM_TEMPLATE_URL,
1515
INVITE_LANDING_URL,
1616
isAuthUnRequired,
17-
MARKETPLACE_TYPE_URL,
1817
MARKETPLACE_URL,
1918
ORG_AUTH_LOGIN_URL,
2019
ORG_AUTH_REGISTER_URL,
2120
QUERY_LIBRARY_URL,
2221
SETTING,
2322
TRASH_URL,
2423
USER_AUTH_URL,
24+
ADMIN_APP_URL,
2525
} from "constants/routesURL";
26+
2627
import React from "react";
2728
import { createRoot } from "react-dom/client";
2829
import { Helmet } from "react-helmet";
@@ -38,7 +39,7 @@ import LazyRoute from "components/LazyRoute";
3839
import AppFromTemplate from "pages/ApplicationV2/AppFromTemplate";
3940
import AppEditor from "pages/editor/AppEditor";
4041
import { getAntdLocale } from "i18n/antdLocale";
41-
import { CodeEditorTooltipContainer } from "base/codeEditor/codeEditor";
42+
// import { CodeEditorTooltipContainer } from "base/codeEditor/codeEditor";
4243
import { ProductLoading } from "components/ProductLoading";
4344
import { language, trans } from "i18n";
4445
import { loadComps } from "comps";
@@ -155,6 +156,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
155156
TRASH_URL,
156157
SETTING,
157158
MARKETPLACE_URL,
159+
ADMIN_APP_URL,
158160
]}
159161
// component={ApplicationListPage}
160162
component={ApplicationHome}

client/packages/lowcoder/src/comps/comps/gridLayoutComp/canvasView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { ScrollBar } from "lowcoder-design";
2323

2424
const UICompContainer = styled.div<{ $maxWidth?: number; readOnly?: boolean; $bgColor: string }>`
2525
height: 100%;
26+
min-height: 100vh;
2627
margin: 0 auto;
2728
max-width: ${(props) => props.$maxWidth || 1600}px;
2829
background-color: ${(props) => props.$bgColor};

client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ async function npmLoader(
1111
remoteInfo: RemoteCompInfo
1212
): Promise<CompConstructor | null> {
1313

14-
console.log("remoteInfo: ", remoteInfo);
15-
1614
// Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
15+
const localPackageVersion = remoteInfo.packageVersion || "latest";
1716

1817
const { packageName, packageVersion, compName } = remoteInfo;
19-
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${packageVersion}/index.js`;
18+
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${localPackageVersion}/index.js`;
2019
// const entry = `../../../../../public/package/index.js`;
2120
// console.log("Entry", entry);
2221
try {

client/packages/lowcoder/src/constants/applicationConstants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ export interface AppPermissionInfo {
130130
publicToMarketplace: boolean;
131131
}
132132

133-
export type AppViewMode = "edit" | "preview" | "view" | "view_marketplace";
133+
// adding viewMode for marketplace and adminMode for Admin area use
134+
export type AppViewMode = "edit" | "preview" | "view" | "view_marketplace" | "admin";
134135

135136
export type AppPathParams = {
136137
viewMode: AppViewMode;

client/packages/lowcoder/src/constants/routesURL.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const PERMISSION_SETTING_DETAIL = `${PERMISSION_SETTING}/:groupId`;
2020
export const ORGANIZATION_SETTING_DETAIL = `${ORGANIZATION_SETTING}/:orgId`;
2121

2222
export const ALL_APPLICATIONS_URL = "/apps";
23+
export const ADMIN_APP_URL = "/ee/:applicationId/:viewMode";
2324
export const APPLICATION_MARKETPLACE_URL = `https://app.lowcoder.cloud/apps`;
2425
export const MODULE_APPLICATIONS_URL = "/apps/module";
2526
export const MARKETPLACE_URL = `/marketplace`;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,8 @@ export const en = {
15851585
"oauthProviders": "User Authentication",
15861586
"appUsage": "App Usage Logs",
15871587
"environments": "Environments",
1588-
"premium": "Premium"
1588+
"premium": "Premium",
1589+
"AppUsage": "Global App Usage",
15891590
},
15901591

15911592

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
QUERY_LIBRARY_URL,
1010
SETTING,
1111
TRASH_URL,
12+
ADMIN_APP_URL
1213
} from "constants/routesURL";
1314
import { getUser, isFetchingUser } from "redux/selectors/usersSelectors";
1415
import { useDispatch, useSelector } from "react-redux";
@@ -26,7 +27,8 @@ import {
2627
PointIcon,
2728
RecyclerIcon,
2829
MarketplaceIcon,
29-
AppsIcon
30+
AppsIcon,
31+
EnterpriseIcon
3032
} from "lowcoder-design";
3133
import React, { useEffect, useState } from "react";
3234
import { fetchAllApplications, fetchHomeData } from "redux/reduxActions/applicationActions";
@@ -53,6 +55,10 @@ import { foldersSelector } from "../../redux/selectors/folderSelector";
5355
import Setting from "pages/setting";
5456
import { TypographyText } from "../../components/TypographyText";
5557
import { messageInstance } from "lowcoder-design";
58+
import { isEE } from "util/envUtils";
59+
60+
// adding App Editor, so we can show Apps inside the Admin Area
61+
import AppEditor from "../editor/AppEditor";
5662

5763
const TabLabel = styled.div`
5864
font-weight: 500;
@@ -408,6 +414,18 @@ export default function ApplicationHome() {
408414
},
409415
],
410416
},
417+
isEE() ? {
418+
items: [
419+
{
420+
text: <TabLabel>{trans("settings.AppUsage")}</TabLabel>,
421+
routePath: "/ee/6600ae8724a23f365ba2ed4c/admin",
422+
routePathExact: false,
423+
routeComp: AppEditor,
424+
icon: ({ selected, ...otherProps }) => selected ? ( <EnterpriseIcon {...otherProps} width={"24px"}/> ) : ( <EnterpriseIcon {...otherProps} width={"24px"}/> ),
425+
visible: ({ user }) => user.orgDev,
426+
},
427+
],
428+
} : { items: [] },
411429
]}
412430
/>
413431
{user.orgDev && (

0 commit comments

Comments
 (0)