Skip to content

Worflows updates + Table fixes #626

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 11 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/publish-lowcoder-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -19,7 +20,9 @@ jobs:
id: check
with:
diff-search: true
static-checking: localIsNew
file-name: client/packages/lowcoder-cli/package.json
file-url: https://unpkg.com/lowcoder-cli@latest/package.json

- name: Version update detected
if: steps.check.outputs.changed == 'true'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-lowcoder-comps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -19,7 +20,9 @@ jobs:
id: check
with:
diff-search: true
static-checking: localIsNew
file-name: client/packages/lowcoder-comps/package.json
file-url: https://unpkg.com/lowcoder-comps@latest/package.json

- name: Version update detected
if: steps.check.outputs.changed == 'true'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-lowcoder-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -19,7 +20,9 @@ jobs:
id: check
with:
diff-search: true
static-checking: localIsNew
file-name: client/packages/lowcoder-core/package.json
file-url: https://unpkg.com/lowcoder-core@latest/package.json

- name: Version update detected
if: steps.check.outputs.changed == 'true'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-lowcoder-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -19,7 +20,9 @@ jobs:
id: check
with:
diff-search: true
static-checking: localIsNew
file-name: client/packages/lowcoder-sdk/package.json
file-url: https://unpkg.com/lowcoder-sdk@latest/package.json

- name: Version update detected
if: steps.check.outputs.changed == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { ColorControl } from "comps/controls/colorControl";
import { JSONValue } from "util/jsonTypes";
import styled from "styled-components";
import { TextOverflowControl } from "comps/controls/textOverflowControl";
import { TableColumnLinkStyle, styleControl } from "@lowcoder-ee/index.sdk";
import { default as Divider } from "antd/es/divider";
export type Render = ReturnType<ConstructorToComp<typeof RenderComp>["getOriginalComp"]>;
export const RenderComp = withSelectedMultiContext(ColumnTypeComp);
Expand Down Expand Up @@ -86,6 +85,7 @@ export type CellColorViewType = (param: {
export const columnChildrenMap = {
// column title
title: StringControl,
showTitle: withDefault(BoolControl, true),
// a custom column or a data column
isCustom: valueComp<boolean>(false),
// If it is a data column, it must be the name of the column and cannot be duplicated as a react key
Expand Down Expand Up @@ -149,6 +149,13 @@ export class ColumnComp extends ColumnInitComp {
)
);
}
if(action.type === CompActionTypes.CHANGE_VALUE) {
const title = comp.children.title.unevaledValue;
const dataIndex = comp.children.dataIndex.getView();
if(!Boolean(title)) {
comp.children.title.dispatchChangeValueAction(dataIndex);
}
}
return comp;
}

Expand Down Expand Up @@ -180,9 +187,14 @@ export class ColumnComp extends ColumnInitComp {
<>
{this.children.title.propertyView({
label: trans("table.columnTitle"),
placeholder: this.children.dataIndex.getView(),
})}
{/* FIXME: cast type currently, return type of withContext should be corrected later */}
{this.children.render.getPropertyView()}
{this.children.showTitle.propertyView({
label: trans("table.showTitle"),
tooltip: trans("table.showTitleTooltip"),
})}
{ColumnTypeCompMap[columnType].canBeEditable() &&
this.children.editable.propertyView({ label: trans("table.editable") })}
{this.children.sortable.propertyView({
Expand Down Expand Up @@ -311,6 +323,7 @@ export function newPrimaryColumn(
title?: string,
isTag?: boolean
): ConstructorToDataType<typeof ColumnComp> {
console.log('newPrimaryColumn', title);
return {
title: title ?? key,
dataIndex: key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class ColumnListComp extends ColumnListTmpComp {
dynamicColumn: boolean;
data: Array<JSONObject>;
}) {
console.log("dataChangedAction", param);
return customAction<ActionDataType>(
{
type: "dataChanged",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,6 @@ function ResizeableTable<RecordType extends object>(props: CustomTableProps<Reco
} else {
allColumnFixed = false;
}
if (allColumnFixed && index === props.columns.length - 1) {
// all column fixed, the last column fill extra space
colWidth = "auto";
minWidth = resizeWidth;
}
return {
...restCol,
RC_TABLE_INTERNAL_COL_DEFINE: {
Expand All @@ -583,14 +578,6 @@ function ResizeableTable<RecordType extends object>(props: CustomTableProps<Reco
width: resizeWidth,
title: col.titleText,
viewModeResizable: props.viewModeResizable,
// onResize: (width: number) => {
// if (width) {
// setResizeData({
// index: index,
// width: width,
// });
// }
// },
onResize: (width: React.SyntheticEvent) => {
if (width) {
setResizeData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ function ColumnSetting(props: {
allChecked = false;
}
return (
<ColumnCheckItem>
<ColumnCheckItem key={columnView.dataIndex}>
<CheckBox
checked={checked}
onChange={(e) => {
Expand Down Expand Up @@ -677,6 +677,7 @@ function ToolbarPopover(props: {
<Popover
open={visible}
overlayStyle={{ pointerEvents: "auto" }}
overlayInnerStyle={{ padding: '0' }}
content={
<div
ref={popOverRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export function columnsToAntdFormat(
}[];
const title = renderTitle({ title: column.title, editable: column.editable });
return {
title: title,
title: column.showTitle ? title : '',
titleText: column.title,
dataIndex: column.dataIndex,
align: column.align,
Expand Down
4 changes: 3 additions & 1 deletion client/packages/lowcoder/src/i18n/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,9 @@ export const de = {
"columnValueTooltip": "\\'{{currentCell}}\\': Aktuelle Zelldaten\n \\'{{currentRow}}\\': Aktuelle Zeilendaten\n \\'{{currentIndex}}\\': Aktueller Datenindex (beginnend bei 0)\n Beispiel: \\'{{currentCell * 5}}\\' Show 5 Times the Original Value Data.",
"imageSrc": "Bildquelle",
"imageSize": "Bildgröße",
"columnTitle": "Titel",
"columnTitle": "Titel anzeigen",
"showTitle": "Show Title",
"showTitleTooltip": "Spaltentitel im Tabellenkopf ein-/ausblenden",
"sortable": "Sortierbar",
"align": "Ausrichtung",
"fixedColumn": "Feste Säule",
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,8 @@ export const en = {
"imageSrc": "Image Source",
"imageSize": "Image Size",
"columnTitle": "Title",
"showTitle": "Show Title",
"showTitleTooltip": "Show/Hide column title in table header",
"sortable": "Sortable",
"align": "Alignment",
"fixedColumn": "Fixed Column",
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/src/i18n/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,8 @@ table: {
imageSrc: "图片链接",
imageSize: "图片尺寸",
columnTitle: "标题",
showTitle: "显示标题",
showTitleTooltip: "显示/隐藏表标题中的列标题",
sortable: "可排序",
align: "对齐方式",
fixedColumn: "固定列",
Expand Down