Merge remote-tracking branch 'origin/next' into develop

This commit is contained in:
xilesun 2024-11-15 17:46:28 +08:00
commit efbc0c6a1d
3 changed files with 16 additions and 14 deletions

View File

@ -25,19 +25,21 @@ jobs:
- 4873:4873
steps:
- name: Get pro plugins
id: get-pro-plugins
id: get-info
run: |
if [[ "${{ github.head_ref || github.ref_name }}" == "main" ]]; then
echo "proRepos=$(echo '${{ vars.PRO_PLUGIN_REPOS }}')" >> $GITHUB_OUTPUT
echo "branch=$(echo 'main')" >> $GITHUB_OUTPUT
else
echo "proRepos=$(echo '${{ vars.NEXT_PRO_PLUGIN_REPOS }}')" >> $GITHUB_OUTPUT
echo "branch=$(echo 'next')" >> $GITHUB_OUTPUT
fi
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.NOCOBASE_APP_ID }}
private-key: ${{ secrets.NOCOBASE_APP_PRIVATE_KEY }}
repositories: nocobase,pro-plugins,${{ join(fromJSON(steps.get-pro-plugins.outputs.proRepos), ',') }}
repositories: nocobase,pro-plugins,${{ join(fromJSON(steps.get-info.outputs.proRepos), ',') }}
skip-token-revoke: true
- name: Checkout
uses: actions/checkout@v4
@ -71,14 +73,14 @@ jobs:
- name: Clone pro repos
shell: bash
run: |
for repo in ${{ join(fromJSON(steps.get-pro-plugins.outputs.proRepos), ' ') }}
for repo in ${{ join(fromJSON(steps.get-info.outputs.proRepos), ' ') }}
do
git clone -b ${{ github.head_ref || github.ref_name }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
git clone -b ${{ steps.get-info.outputs.branch }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
done
- name: rm .git
run: |
rm -rf packages/pro-plugins/.git
for repo in ${{ join(fromJSON(steps.get-pro-plugins.outputs.proRepos), ' ') }}
for repo in ${{ join(fromJSON(steps.get-info.outputs.proRepos), ' ') }}
do
rm -rf packages/pro-plugins/@nocobase/$repo/.git
done

View File

@ -181,7 +181,7 @@ export const SubTable: any = observer(
return {
current: currentPage > page ? page : currentPage,
pageSize: pageSize || 10,
total: field?.value?.length,
total: field?.value,
onChange: (page, pageSize) => {
setCurrentPage(page);
setPageSize(pageSize);

View File

@ -200,23 +200,23 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
render: (v, record, index) => {
if (props.showDel(record)) {
return (
<CloseOutlined
style={{ cursor: 'pointer', color: 'gray' }}
<div
onClick={() => {
return action(() => {
const fieldIndex = (current - 1) * pageSize + index;
const deleteCount = field.value[fieldIndex] ? 1 : 2;
spliceArrayState(field, {
startIndex: fieldIndex,
deleteCount: 1,
});
field.value.splice(fieldIndex, 1);
setTimeout(() => {
field.value[field.value.length] = null;
deleteCount: deleteCount,
});
field.value.splice(fieldIndex, deleteCount);
field.setInitialValue(field.value);
return field.onInput(field.value);
});
}}
/>
>
<CloseOutlined style={{ cursor: 'pointer', color: 'gray' }} />
</div>
);
}
return;