Unverified Commit f5a1c32a authored by Marcos Iglesias's avatar Marcos Iglesias Committed by GitHub

fix: Updates the markup of some titles (#490)

* Homepage headings

* Headings on announcements page

* Updating search result group title

* Some extra headings
parent 5381de39
...@@ -84,12 +84,14 @@ body { ...@@ -84,12 +84,14 @@ body {
.title-2 { .title-2 {
font-size: 16px; font-size: 16px;
font-weight: $font-weight-body-bold; font-weight: $font-weight-body-bold;
line-height: 1.42857;
} }
.title-3 { .title-3 {
color: $text-secondary; color: $text-secondary;
font-size: 14px; font-size: 14px;
font-weight: $font-weight-body-bold; font-weight: $font-weight-body-bold;
line-height: 1.42857;
} }
.subtitle-1 { .subtitle-1 {
......
...@@ -33,7 +33,7 @@ export class AnnouncementPage extends React.Component<AnnouncementPageProps> { ...@@ -33,7 +33,7 @@ export class AnnouncementPage extends React.Component<AnnouncementPageProps> {
return ( return (
<div key={`post:${postIndex}`} className="post-container"> <div key={`post:${postIndex}`} className="post-container">
<div className="post-header"> <div className="post-header">
<div className="post-title title-2">{post.title}</div> <h2 className="post-title title-2">{post.title}</h2>
<div className="body-secondary-3">{post.date}</div> <div className="body-secondary-3">{post.date}</div>
</div> </div>
<div className="post-content"> <div className="post-content">
......
...@@ -45,12 +45,12 @@ export class HomePage extends React.Component<HomePageProps> { ...@@ -45,12 +45,12 @@ export class HomePage extends React.Component<HomePageProps> {
/> />
</div> </div>
<div className="home-element-container"> <div className="home-element-container">
<div <h2
id="browse-tags-header" id="browse-tags-header"
className="title-1 browse-tags-header" className="title-1 browse-tags-header"
> >
{TAGS_TITLE} {TAGS_TITLE}
</div> </h2>
<TagsList /> <TagsList />
</div> </div>
<div className="home-element-container"> <div className="home-element-container">
......
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
mapStateToProps, mapStateToProps,
ResourceSelector, ResourceSelector,
ResourceSelectorProps, ResourceSelectorProps,
} from '..'; } from '.';
jest.mock('config/config-utils', () => ({ jest.mock('config/config-utils', () => ({
getDisplayNameByResource: jest.fn(() => 'Resource'), getDisplayNameByResource: jest.fn(() => 'Resource'),
......
...@@ -19,6 +19,8 @@ import { ...@@ -19,6 +19,8 @@ import {
} from 'ducks/search/types'; } from 'ducks/search/types';
import { ResourceType } from 'interfaces/Resources'; import { ResourceType } from 'interfaces/Resources';
const RESOURCE_SELECTOR_TITLE = 'Resource';
export interface StateFromProps { export interface StateFromProps {
resource: ResourceType; resource: ResourceType;
tables: TableSearchResults; tables: TableSearchResults;
...@@ -91,7 +93,7 @@ export class ResourceSelector extends React.Component<ResourceSelectorProps> { ...@@ -91,7 +93,7 @@ export class ResourceSelector extends React.Component<ResourceSelectorProps> {
return ( return (
<> <>
<div className="title-2">Resource</div> <h2 className="title-2">{RESOURCE_SELECTOR_TITLE}</h2>
{resourceOptions.map((option, index) => {resourceOptions.map((option, index) =>
this.renderRadioOption(option, index) this.renderRadioOption(option, index)
)} )}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
display: flex; display: flex;
flex: 0 0 $search-panel-width; flex: 0 0 $search-panel-width;
flex-direction: column; flex-direction: column;
overflow-y: scroll; overflow-y: auto;
.section { .section {
padding: 32px 24px 32px 32px; padding: 32px 24px 32px 32px;
......
...@@ -19,6 +19,7 @@ export const SEARCH_SOURCE_NAME = 'search_results'; ...@@ -19,6 +19,7 @@ export const SEARCH_SOURCE_NAME = 'search_results';
export const SEARCH_ERROR_MESSAGE_PREFIX = 'Your search did not match any '; export const SEARCH_ERROR_MESSAGE_PREFIX = 'Your search did not match any ';
export const SEARCH_ERROR_MESSAGE_SUFFIX = ' results'; export const SEARCH_ERROR_MESSAGE_SUFFIX = ' results';
export const RESOURCE_SELECTOR_TITLE = 'Resource';
export const DASHBOARD_RESOURCE_TITLE = getDisplayNameByResource( export const DASHBOARD_RESOURCE_TITLE = getDisplayNameByResource(
ResourceType.dashboard ResourceType.dashboard
); );
......
...@@ -91,7 +91,7 @@ export class MyBookmarks extends React.Component<MyBookmarksProps> { ...@@ -91,7 +91,7 @@ export class MyBookmarks extends React.Component<MyBookmarksProps> {
return ( return (
<div className="bookmark-list"> <div className="bookmark-list">
<div className="title-1">{BOOKMARK_TITLE}</div> <h2 className="title-1">{BOOKMARK_TITLE}</h2>
{content} {content}
</div> </div>
); );
......
...@@ -75,7 +75,7 @@ describe('PopularTables', () => { ...@@ -75,7 +75,7 @@ describe('PopularTables', () => {
}); });
it('renders correct label for content', () => { it('renders correct label for content', () => {
const actual = wrapper.children().find('label').text(); const actual = wrapper.children().find('.title-1').text();
const expected = POPULAR_TABLES_LABEL; const expected = POPULAR_TABLES_LABEL;
expect(actual).toEqual(expected); expect(actual).toEqual(expected);
......
...@@ -55,7 +55,7 @@ export class PopularTables extends React.Component<PopularTablesProps> { ...@@ -55,7 +55,7 @@ export class PopularTables extends React.Component<PopularTablesProps> {
return ( return (
<> <>
<div className="popular-tables-header"> <div className="popular-tables-header">
<label className="title-1">{POPULAR_TABLES_LABEL}</label> <h2 className="title-1">{POPULAR_TABLES_LABEL}</h2>
<InfoButton infoText={POPULAR_TABLES_INFO_TEXT} /> <InfoButton infoText={POPULAR_TABLES_INFO_TEXT} />
</div> </div>
{content} {content}
......
...@@ -40,6 +40,7 @@ class ResultItemList extends React.Component<ResultItemListProps, {}> { ...@@ -40,6 +40,7 @@ class ResultItemList extends React.Component<ResultItemListProps, {}> {
return results.map((item, index) => { return results.map((item, index) => {
const { href, iconClass, subtitle, titleNode, type } = item; const { href, iconClass, subtitle, titleNode, type } = item;
const id = `inline-resultitem-${this.props.resourceType}:${index}`; const id = `inline-resultitem-${this.props.resourceType}:${index}`;
return ( return (
<ResultItem <ResultItem
key={id} key={id}
...@@ -59,12 +60,12 @@ class ResultItemList extends React.Component<ResultItemListProps, {}> { ...@@ -59,12 +60,12 @@ class ResultItemList extends React.Component<ResultItemListProps, {}> {
const { resourceType, suggestedResults, title } = this.props; const { resourceType, suggestedResults, title } = this.props;
return ( return (
<> <>
<div className="section-title title-3"> <h3 className="section-title title-3">
{title} {title}
{resourceType === ResourceType.dashboard && ( {resourceType === ResourceType.dashboard && (
<Flag text="beta" labelStyle="default" /> <Flag text="beta" labelStyle="default" />
)} )}
</div> </h3>
<ul className="list-group"> <ul className="list-group">
{this.renderResultItems(suggestedResults)} {this.renderResultItems(suggestedResults)}
</ul> </ul>
......
// TODO: Hard-coded text strings should be translatable/customizable // TODO: Hard-coded text strings should be translatable/customizable
export const PLACEHOLDER_DEFAULT = 'search for data resources...'; export const PLACEHOLDER_DEFAULT = 'Search for data resources...';
export const SEARCH_BUTTON_TEXT = 'Search'; export const SEARCH_BUTTON_TEXT = 'Search';
export const BUTTON_CLOSE_TEXT = 'Close'; export const BUTTON_CLOSE_TEXT = 'Close';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment