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

UI: Display more metadata columns in DataSource and Feature list page #440

Merged
merged 1 commit into from
Jul 8, 2022
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
70 changes: 49 additions & 21 deletions ui/src/components/dataSourceList.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import React, { useCallback, useEffect, useState } from 'react';
import { Form, Select, Table } from "antd";
import { DataSourceAttributes, DataSource } from "../models/model";
import { DataSource } from "../models/model";
import { fetchDataSources, fetchProjects } from "../api";

const DataSourceList: React.FC = () => {
const columns = [
{
title: <div style={ { userSelect: "none" } }>Name</div>,
dataIndex: 'attributes',
key: 'name',
align: 'center' as 'center',
width: 120,
render: (row: DataSourceAttributes) => {
return row.name;
render: (row: DataSource) => {
return row.attributes.name;
},
onCell: () => {
return {
Expand All @@ -23,13 +22,12 @@ const DataSourceList: React.FC = () => {
}
},
{
title: <div style={ { userSelect: "none" } }>QualifiedName</div>,
dataIndex: 'attributes',
key: 'qualifiedName',
title: <div>Type</div>,
key: 'type',
align: 'center' as 'center',
width: 120,
render: (row: DataSourceAttributes) => {
return row.qualifiedName;
width: 80,
render: (row: DataSource) => {
return row.attributes.type;
},
onCell: () => {
return {
Expand All @@ -40,13 +38,44 @@ const DataSourceList: React.FC = () => {
}
},
{
title: <div style={ { userSelect: "none" } }>Type</div>,
dataIndex: 'attributes',
key: 'attributes',
title: <div>Path</div>,
key: 'path',
align: 'center' as 'center',
width: 80,
render: (row: DataSourceAttributes) => {
return row.type;
width: 190,
render: (row: DataSource) => {
return row.attributes.path;
},
onCell: () => {
return {
style: {
maxWidth: 120
}
}
}
},
{
title: <div>Pre Processing</div>,
key: 'preprocessing',
align: 'center' as 'center',
width: 190,
render: (row: DataSource) => {
return row.attributes.preprocessing;
},
onCell: () => {
return {
style: {
maxWidth: 120
}
}
}
},
{
title: <div>Event Timestamp Column</div>,
key: 'eventTimestampColumn',
align: 'center' as 'center',
width: 190,
render: (row: DataSource) => {
return row.attributes.eventTimestampColumn;
},
onCell: () => {
return {
Expand All @@ -57,13 +86,12 @@ const DataSourceList: React.FC = () => {
}
},
{
title: <div style={ { userSelect: "none" } }>Path</div>,
dataIndex: 'attributes',
key: 'attributes',
title: <div>Timestamp Format</div>,
key: 'timestampFormat',
align: 'center' as 'center',
width: 190,
render: (row: DataSourceAttributes) => {
return row.path;
render: (row: DataSource) => {
return row.attributes.timestampFormat;
},
onCell: () => {
return {
Expand Down
59 changes: 49 additions & 10 deletions ui/src/components/featureList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ const FeatureList: React.FC = () => {
const navigate = useNavigate();
const columns = [
{
title: <div style={ { userSelect: "none" } }>Name</div>,
dataIndex: 'displayText',
title: <div>Name</div>,
key: 'name',
width: 150,
render: (name: string, row: Feature) => {
return (
<Button type="link" onClick={ () => {
navigate(`/projects/${ project }/features/${ row.guid }`)
} }>{ name }</Button>
} }>{ row.displayText }</Button>
)
},
onCell: () => {
Expand All @@ -29,11 +28,14 @@ const FeatureList: React.FC = () => {
}
},
{
title: <div style={ { userSelect: "none" } }>Type</div>,
dataIndex: 'typeName',
title: <div>Type</div>,
key: 'type',
align: 'center' as 'center',
width: 190,
width: 120,
render: (name: string, row: Feature) => {
return (
<div>{ row.typeName.replace('feathr_', '').replace('_v1', '')}</div>
)
},
onCell: () => {
return {
style: {
Expand All @@ -43,9 +45,46 @@ const FeatureList: React.FC = () => {
}
},
{
title: (<div style={ { userSelect: "none" } }>Action <Tooltip
title={ <Link style={ { color: "cyan" } } to="/help">Learn more</Link> }></Tooltip></div>),
dataIndex: 'action',
title: <div>Transformation</div>,
key: 'transformation',
width: 190,
render: (name: string, row: Feature) => {
return (
<div>{ row.attributes.transformation.transformExpr ?? row.attributes.transformation.defExpr }</div>
)
},
onCell: () => {
return {
style: {
maxWidth: 120,
}
}
}
},
{
title: <div>Aggregation</div>,
key: 'aggregation',
width: 150,
render: (name: string, row: Feature) => {
return (
<>
<div>{ row.attributes.transformation.aggFunc && `Type: ${ row.attributes.transformation.aggFunc }` }</div>
<div>{ row.attributes.transformation.aggFunc && `Window: ${ row.attributes.transformation.window }` }</div>
<div>{ row.attributes.transformation.aggFunc && `Key: ${ row.attributes.key[0].keyColumn }` }</div>
</>
)
},
onCell: () => {
return {
style: {
maxWidth: 120,
}
}
}
},
{
title: (
<div>Action <Tooltip title={ <Link style={ { color: "cyan" } } to="/help">Learn more</Link> }></Tooltip></div>),
key: 'action',
align: 'center' as 'center',
width: 120,
Expand Down
7 changes: 4 additions & 3 deletions ui/src/models/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,20 @@ export interface DataSource {
attributes: DataSourceAttributes;
displayText: string;
guid: string;
labels: string[];
name: string;
qualifiedName: string;
lastModifiedTS: string;
status: string;
typeName: string;
version: string;
}

export interface DataSourceAttributes {
eventTimestampColumn: string;
name: string;
path: string;
preprocessing: string;
qualifiedName: string;
tags: string[];
timestampFormat: string;
type: string;
}

Expand Down