Skip to content

Commit ab6d195

Browse files
author
FalkWolsky
committed
Regenerate Columns in Table Fix
Include Readme in Component Plugins
1 parent 2416789 commit ab6d195

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

client/packages/lowcoder-cli/actions/build.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { execSync } from "child_process";
22
import fsExtra from "fs-extra";
33
import { build } from "vite";
4-
import { writeFileSync, existsSync, readFileSync } from "fs";
4+
import { writeFileSync, existsSync, readFileSync, readdirSync } from "fs";
55
import { resolve } from "path";
66
import paths from "../config/paths.js";
77
import "../util/log.js";
@@ -45,6 +45,12 @@ function validPackageJSON() {
4545
}
4646
}
4747

48+
function findReadmeFileName(directory) {
49+
const files = readdirSync(directory);
50+
const readmeFile = files.find(file => file.toLowerCase() === 'readme.md');
51+
return readmeFile ? `${directory}/${readmeFile}` : null;
52+
}
53+
4854
/**
4955
* 1. webpack production build
5056
* 2. generate package.json
@@ -94,6 +100,16 @@ export default async function buildAction(options) {
94100
}
95101
});
96102

103+
// copy readme file
104+
const readmePath = findReadmeFileName(paths.appPath);
105+
if (readmePath) {
106+
const destinationPath = resolve(paths.appOutPath, 'readme.md');
107+
copySync(readmePath, destinationPath);
108+
console.log(`Copied README file to: ${destinationPath}`);
109+
} else {
110+
console.warn('README.md file not found.');
111+
}
112+
97113
if (options.publish) {
98114
// publish
99115
execSync("npm publish", {

client/packages/lowcoder/src/comps/comps/tableComp/column/tableColumnListComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export class ColumnListComp extends ColumnListTmpComp {
101101
dynamicColumn: boolean;
102102
data: Array<JSONObject>;
103103
}) {
104+
console.log("dataChangedAction", param);
104105
return customAction<ActionDataType>(
105106
{
106107
type: "dataChanged",

client/packages/lowcoder/src/comps/comps/tableComp/tablePropertyView.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import React, { useMemo, useState } from "react";
3333
import { GreyTextColor } from "constants/style";
3434
import { alignOptions } from "comps/controls/dropdownControl";
3535
import { ColumnTypeCompMap } from "comps/comps/tableComp/column/columnTypeComp";
36+
import { changeChildAction } from "lowcoder-core";
3637

3738
const InsertDiv = styled.div`
3839
display: flex;
@@ -265,13 +266,14 @@ function ColumnPropertyView<T extends MultiBaseComp<TableChildrenType>>(props: {
265266
<InsertDiv>
266267
<div style={{ display: "flex", alignItems: "center", marginRight: "auto" }}>
267268
<TextLabel label={props.columnLabel} />
268-
<Graylabel>{"(" + columns.length + ")"}</Graylabel>
269+
<Graylabel>{" (" + columns.length + ")"}</Graylabel>
269270
</div>
270271
{rowExample && (
271272
<ToolTipLabel title={trans("table.refreshButtonTooltip")}>
272273
<StyledRefreshIcon
273274
onClick={() => {
274-
const actions = [
275+
console.log("comp", comp);
276+
comp.dispatch(
275277
wrapChildAction(
276278
"columns",
277279
comp.children.columns.dataChangedAction({
@@ -280,10 +282,10 @@ function ColumnPropertyView<T extends MultiBaseComp<TableChildrenType>>(props: {
280282
dynamicColumn: dynamicColumn,
281283
data: data,
282284
})
283-
),
284-
comp.changeChildAction("dataRowExample", null),
285-
];
286-
actions.forEach((action) => comp.dispatch(deferAction(action)));
285+
)
286+
);
287+
// the function below is not working
288+
// comp.dispatch(comp.changeChildAction("dataRowExample", null));
287289
}}
288290
/>
289291
</ToolTipLabel>

0 commit comments

Comments
 (0)