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

Dev > Main 2.4.10#1241

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 24 commits intomainfromdev
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
24 commits
Select commitHold shift + click to select a range
6fa4c5f
added min-width feature in stepControl
MenamAfzalSep 26, 2024
a9f53f0
pull from origin
MenamAfzalOct 3, 2024
4a9e441
Merge branch 'dev' into fix/stepControl
MenamAfzalOct 3, 2024
5609af5
set api_url for npm packages
raheeliftikhar5Oct 4, 2024
a9f94b2
Fixed /api/npm/package/* endpoint response type
goldantsOct 4, 2024
66b527b
fix events data mapping in calendar
raheeliftikhar5Oct 5, 2024
5c37d58
add applicationid param to private npm repository endpoint
dragonpooOct 8, 2024
79f8f03
send appId in registry/package endpoints
raheeliftikhar5Oct 8, 2024
a839beb
enable anonymous api
dragonpooOct 8, 2024
6a8b55d
Boomi as DataSource
Oct 9, 2024
c35cc2a
Boomi as DataSource
Oct 9, 2024
d205a54
Boomi as DataSource
Oct 9, 2024
75fc901
Merge pull request #1231 from lowcoder-org/feature-private-repo
FalkWolskyOct 9, 2024
3385d27
Merge branch 'dev' into feature-boomi-datasource
FalkWolskyOct 9, 2024
08631d1
Updating Yarn Lock file
Oct 9, 2024
8393147
Merge pull request #1237 from lowcoder-org/feature-boomi-datasource
FalkWolskyOct 9, 2024
31f1cac
Merge pull request #1225 from MenamAfzal/fix/stepControl
FalkWolskyOct 9, 2024
28cb379
fix null registry settings
dragonpooOct 10, 2024
5dbcd8d
Merge pull request #1239 from lowcoder-org/feature-private-repo
FalkWolskyOct 10, 2024
04e6731
Update Boomi Specs
Oct 10, 2024
db2bce4
Hiding Boomi as for now for cyclic references
Oct 10, 2024
b8f41c2
Hiding Boomi as for now for cyclic references
Oct 10, 2024
9cad22d
Update Yarn Lock file
Oct 10, 2024
d632bbd
send applicationId for npm plugins
raheeliftikhar5Oct 10, 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
2 changes: 1 addition & 1 deletionclient/packages/lowcoder-comps/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "lowcoder-comps",
"version": "2.4.18",
"version": "2.4.19",
"type": "module",
"license": "MIT",
"dependencies": {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,34 +84,67 @@ function fixOldData(oldData: any) {
if(!Boolean(oldData)) return;
let {events, resourcesEvents, ...data } = oldData;
let allEvents: any[] = [];
let isDynamicEventData = false;

if (events && typeof events === 'string') {
let eventsList = JSON.parse(events);
if (eventsList && eventsList.length) {
eventsList = eventsList?.map(event => {
const {title, ...eventData} = event;
return {
...eventData,
label: title, // replace title field with label
}
});
allEvents = allEvents.concat(eventsList);
try {
let eventsList = JSON.parse(events);
if (eventsList && eventsList.length) {
eventsList = eventsList?.map(event => {
const {title, ...eventData} = event;
return {
...eventData,
label: title, // replace title field with label
}
});
allEvents = allEvents.concat(eventsList);
}
} catch (_) {
isDynamicEventData = true;
}
}
if (resourcesEvents && typeof resourcesEvents === 'string') {
let resourceEventsList = JSON.parse(resourcesEvents);
if (resourceEventsList && resourceEventsList.length) {
resourceEventsList = resourceEventsList?.map(event => {
const {title, ...eventData} = event;
return {
...eventData,
label: title, // replace title field with label
}
});
allEvents = allEvents.concat(resourceEventsList);
}
try {
let resourceEventsList = JSON.parse(resourcesEvents);
if (resourceEventsList && resourceEventsList.length) {
resourceEventsList = resourceEventsList?.map(event => {
const {title, ...eventData} = event;
return {
...eventData,
label: title, // replace title field with label
}
});
allEvents = allEvents.concat(resourceEventsList);
}
} catch (_) {}
}

if (isDynamicEventData) {
return {
...data,
events: {
manual: {
manual: allEvents,
},
mapData: {
data: events,
mapData: {
id: "{{item.id}}",
label: "{{item.title}}",
detail: "{{item.detail}}",
start: "{{item.start}}",
end: "{{item.end}}",
color: "{{item.color}}",
allDay: "{{item.allDay}}",
groupId: "{{item.groupId}}",
resourceId: "{{item.resourceId}}",
}
},
optionType: "map",
},
};
}

if (allEvents.length) {
return {
...data,
Expand All@@ -121,11 +154,23 @@ function fixOldData(oldData: any) {
},
mapData: {
data: JSON.stringify(allEvents, null, 2),
mapData: {
id: "{{item.id}}",
label: "{{item.title}}",
detail: "{{item.detail}}",
start: "{{item.start}}",
end: "{{item.end}}",
color: "{{item.color}}",
allDay: "{{item.allDay}}",
groupId: "{{item.groupId}}",
resourceId: "{{item.resourceId}}",
}
},
optionType: "manual",
},
};
}

return {
...data,
events,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,13 +8,16 @@ import {
} from "types/remoteComp";

async function npmLoader(
remoteInfo: RemoteCompInfo
{
appId,
...remoteInfo
}: RemoteCompInfo & {appId?: string}
): Promise<CompConstructor | null> {

// Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
const localPackageVersion = remoteInfo.packageVersion || "latest";
const { packageName, packageVersion, compName } = remoteInfo;
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${localPackageVersion}/index.js`;
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${appId}/${packageName}@${localPackageVersion}/index.js`;

try {
const module = await import(
Expand DownExpand Up@@ -51,7 +54,7 @@ async function bundleLoader(
return comp;
}

export const loaders: Record<RemoteCompSource, RemoteCompLoader> = {
export const loaders: Record<RemoteCompSource, RemoteCompLoader<RemoteCompInfo & {appId?: string}>> = {
npm: npmLoader,
bundle: bundleLoader,
};
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ import { CompContext } from "@lowcoder-ee/comps/utils/compContext";
import React from "react";
import type { AppState } from "@lowcoder-ee/redux/reducers";
import { useSelector } from "react-redux";
import { useApplicationId } from "@lowcoder-ee/util/hooks";

const ViewError = styled.div`
display: flex;
Expand DownExpand Up@@ -51,7 +52,7 @@ interface RemoteCompReadyAction {

interface RemoteCompViewProps {
isLowcoderComp?: boolean;
loadComp: (packageVersion?: string) => Promise<void>;
loadComp: (packageVersion?: string, appId?: string) => Promise<void>;
loadingElement?: () => React.ReactNode;
errorElement?: (error: any) => React.ReactNode;
source?: RemoteCompSource;
Expand All@@ -62,6 +63,7 @@ const RemoteCompView = React.memo((props: React.PropsWithChildren<RemoteCompView
const [error, setError] = useState<any>("");
const editorState = useContext(EditorContext);
const compState = useContext(CompContext);
const appId = useApplicationId();
const lowcoderCompPackageVersion = editorState?.getAppSettings().lowcoderCompVersion || 'latest';
const latestLowcoderCompsVersion = useSelector((state: AppState) => state.npmPlugin.packageVersion['lowcoder-comps']);

Expand All@@ -79,7 +81,7 @@ const RemoteCompView = React.memo((props: React.PropsWithChildren<RemoteCompView

useMount(() => {
setError("");
loadComp(packageVersion).catch((e) => {
loadComp(packageVersion, appId).catch((e) => {
setError(String(e));
});
});
Expand DownExpand Up@@ -117,7 +119,7 @@ export function remoteComp<T extends RemoteCompInfo = RemoteCompInfo>(
this.compValue = params.value;
}

private async load(packageVersion = 'latest') {
private async load(packageVersion = 'latest', appId = 'none') {
if (!remoteInfo) {
return;
}
Expand All@@ -129,7 +131,7 @@ export function remoteComp<T extends RemoteCompInfo = RemoteCompInfo>(
log.error("loader not found, remote info:", remoteInfo);
return;
}
const RemoteExportedComp = await finalLoader({...remoteInfo, packageVersion});
const RemoteExportedComp = await finalLoader({...remoteInfo, packageVersion, appId});
if (!RemoteExportedComp) {
return;
}
Expand DownExpand Up@@ -159,7 +161,7 @@ export function remoteComp<T extends RemoteCompInfo = RemoteCompInfo>(
<RemoteCompView
key={key}
isLowcoderComp={remoteInfo?.packageName === 'lowcoder-comps'}
loadComp={(packageVersion?: string) => this.load(packageVersion)}
loadComp={(packageVersion?: string, appId?: string) => this.load(packageVersion, appId)}
loadingElement={loadingElement}
source={remoteInfo?.source}
/>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,7 +95,7 @@ const StepsChildrenMap = {
style: styleControl(StepsStyle , 'style'),
viewRef: RefControl<HTMLDivElement>,
animationStyle: styleControl(AnimationStyle ,'animationStyle' ),
showVerticalScrollbar: withDefault(BoolControl, false),
showScrollBars: withDefault(BoolControl, false),
minHorizontalWidth: withDefault(RadiusControl, ''),
};

Expand DownExpand Up@@ -182,7 +182,7 @@ let StepControlBasicComp = (function () {
padding: "0px",
}}
overflow="scroll"
hideScrollbar={!props.showVerticalScrollbar}>
hideScrollbar={!props.showScrollBars}>
<Steps
initial={props.initialValue.value -1}
current={current}
Expand All@@ -197,6 +197,7 @@ let StepControlBasicComp = (function () {
>
{props.options.map((option, index) => (
<Steps.Step
style={{minWidth:props.minHorizontalWidth || '100%'}}
key={index}
title={option.label}
subTitle={option.subTitle}
Expand DownExpand Up@@ -234,15 +235,6 @@ let StepControlBasicComp = (function () {
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
<Section name={sectionNames.layout}>
{children.autoHeight.getPropertyView()}
{!children.autoHeight.getView() && (
children.showVerticalScrollbar.propertyView({
label: trans("prop.showVerticalScrollbar"),
})
)}
{children.minHorizontalWidth.propertyView({
label: trans("prop.minHorizontalWidth"),
placeholder: '100px',
})}
{children.size.propertyView({
label: trans("step.size"),
radioButton: true,
Expand All@@ -261,15 +253,23 @@ let StepControlBasicComp = (function () {
radioButton: true,
})
}
{children.direction.getView() == "horizontal" && (
children.minHorizontalWidth.propertyView({
label: trans("prop.minHorizontalWidth"),
placeholder: '100px',
})
)}
{!children.autoHeight.getView() && (
children.showScrollBars.propertyView({
label: trans("prop.scrollbar"),
})
)}
{ children.displayType.getView() != "inline" && !children.showIcons.getView() && (
children.showDots.propertyView({label: trans("step.showDots")}
))}
{ children.displayType.getView() != "inline" && !children.showDots.getView() && (
children.showIcons.propertyView({label: trans("step.showIcons")}
))}
{!children.autoHeight.getView() && (
children.showVerticalScrollbar.propertyView({label: trans("prop.showVerticalScrollbar")})
)}
</Section>
)}

Expand Down
2 changes: 1 addition & 1 deletionclient/packages/lowcoder/src/comps/utils/remote.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,7 +39,7 @@ export function parseCompType(compType: string) {
}

export async function getNpmPackageMeta(packageName: string) {
const res = await axios.get<NpmPackageMeta>(`${NPM_REGISTRY_URL}/${packageName}`);
const res = await axios.get<NpmPackageMeta>(`${NPM_REGISTRY_URL}/none/${packageName}`);
if (res.status >= 400) {
return null;
}
Expand Down
10 changes: 7 additions & 3 deletionsclient/packages/lowcoder/src/constants/npmPlugins.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
export const SERVER_HOST = `${REACT_APP_NODE_SERVICE_URL ?? ""}`;
export const NPM_REGISTRY_URL = `${SERVER_HOST}/node-service/api/npm/registry`;
export const NPM_PLUGIN_ASSETS_BASE_URL = `${SERVER_HOST}/node-service/api/npm/package`;
// export const SERVER_HOST = `${REACT_APP_NODE_SERVICE_URL ?? ""}`;
// export const NPM_REGISTRY_URL = `${SERVER_HOST}/node-service/api/npm/registry`;
// export const NPM_PLUGIN_ASSETS_BASE_URL = `${SERVER_HOST}/node-service/api/npm/package`;

export const SERVER_HOST = `${REACT_APP_API_SERVICE_URL ?? ""}`;
export const NPM_REGISTRY_URL = `${SERVER_HOST}/api/npm/registry`;
export const NPM_PLUGIN_ASSETS_BASE_URL = `${SERVER_HOST}/api/npm/package`;
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,7 @@ import { LowcoderCompMeta } from "types/remoteComp";
import { TransparentImg } from "util/commonUtils";
import { ModuleIcon } from "lowcoder-design";
import { NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins";
import { useApplicationId } from "@lowcoder-ee/index.sdk";

const ItemWrapper = styled.div`
display: flex;
Expand DownExpand Up@@ -75,10 +76,11 @@ interface PluginCompItemProps {
}

export function PluginCompItem(props: PluginCompItemProps) {
const appId = useApplicationId();
const { packageName, packageVersion, compName, compMeta, onDrag } = props;
const compType = getRemoteCompType("npm", packageName, packageVersion, compName);

const icon = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${packageVersion}/${compMeta.icon}`;
const icon = `${NPM_PLUGIN_ASSETS_BASE_URL}/${appId}/${packageName}@${packageVersion}/${compMeta.icon}`;

return (
<ItemWrapper
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import axios from "axios";
import { EmptyContent } from "components/EmptyContent";
import { LinkButton } from "lowcoder-design";
import { useShallowEqualSelector } from "util/hooks";
import {useApplicationId,useShallowEqualSelector } from "util/hooks";
import { useContext, useEffect, useMemo, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { AppState } from "redux/reducers";
Expand DownExpand Up@@ -55,6 +55,7 @@ interface PluginViewProps {
export function PluginItem(props: PluginViewProps) {
const { name, onRemove } = props;
const dispatch = useDispatch();
const appId = useApplicationId();
const { onDrag, searchValue } = useContext(RightContext);
const [loading, setLoading] = useState(false);
const packageMeta = useShallowEqualSelector(
Expand All@@ -67,7 +68,7 @@ export function PluginItem(props: PluginViewProps) {

useEffect(() => {
setLoading(true);
axios.get<NpmPackageMeta>(`${NPM_REGISTRY_URL}/${name}`).then((res) => {
axios.get<NpmPackageMeta>(`${NPM_REGISTRY_URL}/${appId}/${name}`).then((res) => {
if (res.status >= 400) {
return;
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,6 +145,7 @@ SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.ORGANIZATION_URL + "/*/datasourceTypes"), // datasource types
ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.ORGANIZATION_URL + "/byuser/*"),
ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.DATASOURCE_URL + "/jsDatasourcePlugins"),
ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.NPM_REGISTRY + "/**"),
ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/api/docs/**")
)
.permitAll()
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp