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

feat: add search header #643

Merged
merged 7 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const DATASET_HEADER_TITLE = 'DATASET';

export const SOURCE_HEADER_TITLE = 'SOURCE';

export const BADGES_HEADER_TITLE = 'BADGES';
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0

import * as React from 'react';

import './styles.scss';

import {
DATASET_HEADER_TITLE,
SOURCE_HEADER_TITLE,
BADGES_HEADER_TITLE,
} from './constants';

const ResourceListHeader: React.FC = () => {
return (
<div className="resource-list-header">
<span className="dataset">{DATASET_HEADER_TITLE}</span>
<span className="source">{SOURCE_HEADER_TITLE}</span>
<span className="badges">{BADGES_HEADER_TITLE}</span>
</div>
);
};

export default ResourceListHeader;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0

@import 'variables';

.resource-list-header {
display: flex;
flex-direction: row;
height: $spacer-3*2;
font-size: $font-size-small;
font-weight: $font-weight-body-bold;
font-family: $font-family-body;
color: $text-placeholder;
padding: $spacer-2 $spacer-3 $spacer-2;

.dataset{
flex: 7;
margin-right: $spacer-3;
min-width: 0;
}
.source{
flex: 2;
margin: auto $spacer-3;
}
.badges{
display: flex;
flex: 3;
flex-wrap: wrap;
margin-bottom: auto;
margin-left: $spacer-3;
margin-top: auto;
}
}
2 changes: 2 additions & 0 deletions amundsen_application/static/js/pages/SearchPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RouteComponentProps } from 'react-router';
import { Search as UrlSearch } from 'history';

import PaginatedApiResourceList from 'components/common/ResourceList/PaginatedApiResourceList';
import ResourceListHeader from 'components/common/ResourceList/ResourceListHeader';
import ShimmeringResourceLoader from 'components/common/ShimmeringResourceLoader';

import { GlobalState } from 'ducks/rootReducer';
Expand Down Expand Up @@ -146,6 +147,7 @@ export class SearchPage extends React.Component<SearchPageProps> {

return (
<div className="search-list-container">
<ResourceListHeader />
<PaginatedApiResourceList
activePage={page_index}
onPagination={this.props.setPageIndex}
Expand Down