Skip to content
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

[Feature] [Metadata] Support add new row data #520

Closed
Closed
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
45 changes: 45 additions & 0 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish package to the Maven Central Repository and GitHub Packages

on:
push

jobs:
publish-maven-central:
runs-on: ubuntu-18.04
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: '11'
distribution: 'temurin'

- name: Publish to the Maven Central Repository
uses: samuelmeuli/action-maven-publish@v1
with:
maven_args: '-DskipTests'
gpg_private_key: ${{ secrets.GPG_SECRET }}
gpg_passphrase: ${{ secrets.GPG_PASSWORD }}
nexus_username: ${{ secrets.OSSRH_USERNAME }}
nexus_password: ${{ secrets.OSSRH_TOKEN }}

# publish-github-package:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v4
# - name: Set up Java for publishing to GitHub Packages
# uses: actions/setup-java@v3
# with:
# java-version: '11'
# distribution: 'temurin'
# - name: Publish to GitHub Packages
# run: |
# chmod 755 ./mvnw
# ./mvnw clean install package deploy -Dfindbugs.skip -Dgpg.skip -Dcheckstyle.skip -DskipTests=true
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
2 changes: 2 additions & 0 deletions core/datacap-web/src/fontawesome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
faKey,
faMagnifyingGlass,
faMinus,
faPlus,
faRepeat,
faSun,
faTable,
Expand All @@ -39,6 +40,7 @@ import {
*/
const createIcons = (app: any) => {
library.add(faArrowRight,
faPlus,
faTablet,
faMinus,
faUpload,
Expand Down
1 change: 1 addition & 0 deletions core/datacap-web/src/i18n/langs/en/source/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default {
resetTo: 'Reset To',
filter: 'Filter',
addFilter: 'Add Filter',
addRows: 'Add Rows',
}
3 changes: 2 additions & 1 deletion core/datacap-web/src/i18n/langs/zhCn/source/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export default {
resetAutoIncrement: '重置自增列',
resetTo: '重置为',
filter: '筛选器',
addFilter: '添加筛选器'
addFilter: '添加筛选器',
addRows: '添加行',
}
25 changes: 25 additions & 0 deletions core/datacap-web/src/views/admin/source/components/TableData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,20 @@
{{ $t('common.row') }}
</Space>
<Space style="margin-left: 30px;">
<Tooltip :content="$t('source.manager.addRows')"
transfer>
<Button size="small"
shape="circle"
type="text"
@click="handlerAddRow">
<FontAwesomeIcon icon="plus"/>
</Button>
</Tooltip>
<Tooltip :content="$t('source.manager.deleteRows')"
transfer>
<Button size="small"
shape="circle"
type="text"
:disabled="!dataSelectedChanged.changed"
@click="handlerSelectedChangedPreview(true)">
<FontAwesomeIcon icon="minus"/>
Expand All @@ -89,6 +99,7 @@
transfer>
<Button size="small"
shape="circle"
type="text"
:disabled="!dataCellChanged.changed && dataCellChanged.columns.length === 0"
@click="handlerCellChangedPreview(true)">
<FontAwesomeIcon icon="upload"/>
Expand All @@ -97,6 +108,7 @@
<Tooltip :content="$t('common.preview')"
transfer>
<Button size="small"
type="text"
@click="handlerVisibleContent(true)">
<FontAwesomeIcon icon="eye"/>
</Button>
Expand All @@ -108,6 +120,7 @@
placement="bottom-end"
transfer>
<Button size="small"
type="text"
@click="handlerFilterConfigure(true)">
<FontAwesomeIcon icon="filter"/>
</Button>
Expand All @@ -116,6 +129,7 @@
placement="bottom-end"
transfer>
<Button size="small"
type="text"
@click="handlerVisibleColumn(null, true)">
<FontAwesomeIcon icon="columns"/>
</Button>
Expand Down Expand Up @@ -225,6 +239,7 @@ export default defineComponent({
gridApi: null as GridApi,
gridColumnApi: null as ColumnApi,
originalColumns: [],
newRows: [],
configure: {
headers: [],
columns: [],
Expand Down Expand Up @@ -425,6 +440,16 @@ export default defineComponent({
{
this.filterConfigure.configure = value;
},
handlerAddRow()
{
const newData = {};
this.originalColumns.forEach((column: { field: string; }) => {
newData[column.field] = null;
});
this.configure.datasets.push(newData);
this.newRows.push(newData);
this.gridApi.setRowData(this.configure.datasets);
},
getSortConfigure(configure: TableFilter)
{
const columnState = this.gridColumnApi.getColumnState();
Expand Down