Skip to content

Commit

Permalink
Add description field
Browse files Browse the repository at this point in the history
  • Loading branch information
kaapstorm committed Feb 5, 2024
1 parent 9addfba commit 2573dff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
};

const columns = [
{
Header: t('Description'),
accessor: 'description',
},
{
Cell: ({ row: { original } }: any) => (
<StyledSpan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Database = {
export type Dataset = {
id: number;
table_name: string;
description?: string;
datasource_type?: string;
schema: string;
database: Database;
Expand Down Expand Up @@ -105,17 +106,23 @@ export const DatasetSelectLabel = (item: Dataset) => (
? item.table_name
: t('Not defined')}
</div>
<div className="tooltip-description">
<div>
{t('Database')}: {item.database.database_name}
{item.description ? (
<div className="tooltip-description">
<div className="tooltip-description">{item.description}</div>
</div>
<div>
{t('Schema')}:{' '}
{item.schema && isValidValue(item.schema)
? item.schema
: t('Not defined')}
) : (
<div className="tooltip-description">
<div>
{t('Database')}: {item.database.database_name}
</div>
<div>
{t('Schema')}:{' '}
{item.schema && isValidValue(item.schema)
? item.schema
: t('Not defined')}
</div>
</div>
</div>
)}
</TooltipContent>
}
>
Expand Down
5 changes: 5 additions & 0 deletions superset-frontend/src/pages/DatasetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
size: 'xs',
id: 'id',
},
{
Header: t('Description'),
accessor: 'description',
size: 'md',
},
{
Cell: ({
row: {
Expand Down

0 comments on commit 2573dff

Please sign in to comment.