-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTORING]: deleting the duplicated code (#82)
- Loading branch information
Showing
77 changed files
with
901 additions
and
398 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
v6y-apps/front-bo/src/commons/components/VitalityBaseTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Table } from 'antd'; | ||
import { AnyObject } from 'antd/es/_util/type'; | ||
import React from 'react'; | ||
|
||
const VitalityTable = ({ | ||
dataSource, | ||
columns, | ||
}: { | ||
dataSource: AnyObject[]; | ||
columns: AnyObject[]; | ||
}) => <Table dataSource={dataSource} columns={columns} rowKey="key" />; | ||
|
||
export default VitalityTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 27 additions & 10 deletions
37
v6y-apps/front-bo/src/commons/components/VitalityTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
import { Table } from 'antd'; | ||
import { AnyObject } from 'antd/es/_util/type'; | ||
|
||
const VitalityTable = ({ | ||
dataSource, | ||
columns, | ||
}: { | ||
dataSource: AnyObject[]; | ||
columns: AnyObject[]; | ||
}) => <Table dataSource={dataSource} columns={columns} rowKey="key" />; | ||
import React from 'react'; | ||
|
||
import { buildCommonTableColumns, buildCommonTableDataSource } from '../config/VitalityTableConfig'; | ||
import VitalityBaseTable from './VitalityBaseTable'; | ||
|
||
interface VitalityTableProps { | ||
dataSource: unknown[]; | ||
columnKeys: string[]; | ||
columnOptions: { | ||
enableEdit: boolean; | ||
enableShow: boolean; | ||
enableDelete: boolean; | ||
deleteMetaQuery?: { | ||
gqlMutation: string; | ||
operation: string; | ||
}; | ||
}; | ||
} | ||
|
||
const VitalityTable: React.FC<VitalityTableProps> = ({ dataSource, columnKeys, columnOptions }) => { | ||
return ( | ||
<VitalityBaseTable | ||
dataSource={buildCommonTableDataSource(dataSource)} | ||
columns={buildCommonTableColumns(dataSource, columnKeys, columnOptions)} | ||
/> | ||
); | ||
}; | ||
|
||
export default VitalityTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.