Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Resolved Kwasi's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
avdaredevil committed Nov 12, 2019
1 parent 7e33a43 commit b2c6a96
Showing 1 changed file with 1 addition and 73 deletions.
74 changes: 1 addition & 73 deletions frontend/src/pages/LineageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,17 @@ import * as React from 'react';
import {Page} from './Page';
import {classes} from 'typestyle';
import {commonCss} from '../Css';
import {/*Api, */ListRequest} from '../lib/Api';
// import {MlMetadataArtifact} from '../apis/service/api';
// import {Link} from 'react-router-dom';
// import {ArtifactType} from '../generated/src/apis/metadata/metadata_store_pb';
// import {GetArtifactTypesRequest} from '../generated/src/apis/metadata/metadata_store_service_pb';
import {ListRequest} from '../lib/Api';
import {ToolbarProps} from '../components/Toolbar';
// import {RoutePage, RouteParams} from '../components/Router';
// import {LineageRow} from '../components/LineageTypes'
import {LineageCardColumn, CardDetails} from '../components/LineageCardColumn';


interface LineageViewState {
// artifacts: MlMetadataArtifact[];
// expandedRows: Map<number, Row[]>;
columnNames: string[];
columnTypes: string[];
}

class LineageView extends Page<{}, LineageViewState> {
// private api = Api.getInstance();
// private nameCustomRenderer: React.FC<CustomRendererProps<string>> =
// (props: CustomRendererProps<string>) => {
// const [artifactType, artifactId] = props.id.split(':');
// const link = RoutePage.ARTIFACT_DETAILS
// .replace(`:${RouteParams.ARTIFACT_TYPE}+`, artifactType)
// .replace(`:${RouteParams.ID}`, artifactId);
// return (
// <Link onClick={(e) => e.stopPropagation()}
// className={commonCss.link}
// to={link}>
// {props.value}
// </Link>
// );
// }

constructor(props: any) {
super(props);
this.state = {
Expand Down Expand Up @@ -121,26 +97,12 @@ class LineageView extends Page<{}, LineageViewState> {
cards={mockOutputArtifacts}
reverseBindings={true}
title={`${columnNames[4]}`} />
{/* <CustomTable ref={this.tableRef}
columns={columns}
rows={rows}
disablePaging={true}
disableSelection={true}
reload={this.reload}
initialSortColumn='pipelineName'
initialSortOrder='asc'
getExpandComponent={this.getExpandedArtifactsRow}
toggleExpansion={this.toggleRowExpand}
emptyMessage='No artifacts found.' /> */}
</div>
);
}

public async refresh(): Promise<void> {
// Todo: Implement this!
// if (this.tableRef.current) {
// await this.tableRef.current.reload();
// }
}

private async reload(request: ListRequest): Promise<string> {
Expand All @@ -163,40 +125,6 @@ class LineageView extends Page<{}, LineageViewState> {
// });
return '';
}

/**
* Temporary solution to apply sorting, filtering, and pagination to the
* local list of artifacts until server-side handling is available
* TODO: Replace once https://github.com/kubeflow/metadata/issues/73 is done.
* @param request
*/
// private getRowsFromArtifacts(request: ListRequest): Row[] {
// const collapsedAndExpandedRows = groupRows(this.state.artifacts
// .map((a) => { // Flattens
// const typeNumber = Number(a.type_id);
// const type = this.artifactTypes && this.artifactTypes.get(typeNumber!) ?
// this.artifactTypes.get(typeNumber!)!.getName() : typeNumber;
// return {
// id: `${type}:${a.id}`, // Join with colon so we can build the link
// otherFields: [
// getResourceProperty(a, ArtifactProperties.PIPELINE_NAME)
// || getResourceProperty(a, ArtifactCustomProperties.WORKSPACE, true),
// getResourceProperty(a, ArtifactProperties.NAME),
// a.id,
// type,
// a.uri,
// // TODO: Get timestamp from the event that created this artifact.
// // formatDateString(
// // getArtifactProperty(a, ArtifactProperties.CREATE_TIME) || ''),
// ],
// } as Row;
// })
// .filter(rowFilterFn(request))
// .sort(rowCompareFn(request, this.state.columns)));

// this.setState({ expandedRows: collapsedAndExpandedRows.expandedRows });
// return collapsedAndExpandedRows.collapsedRows;
// }
}

export default LineageView;

0 comments on commit b2c6a96

Please sign in to comment.