Skip to content

Commit

Permalink
fix(core): correct category on recently viewed analytics events (#4933)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Mar 1, 2018
1 parent 86810c8 commit 8ef9acc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { ISearchResult, ISearchResultPodData, SearchResultPods } from './SearchR

export interface IChildComponentProps {
results: ISearchResultPodData[];
onResultClick: (categoryName: string) => void;
onRemoveItem?: (categoryName: string, itemId: string) => void;
onRemoveProject?: (projectId: string) => void;
onResultClick: (categoryName: string) => void;
}

export interface IRecentlyViewedItemsProps {
Expand Down Expand Up @@ -86,7 +86,7 @@ export class RecentlyViewedItems extends React.Component<IRecentlyViewedItemsPro
}

private handleResultClick(categoryName: string): void {
ReactGA.event({ category: 'Global Search', action: `Recent item selected from ${categoryName}` });
ReactGA.event({ category: 'Primary Search', action: `Recent item selected from ${categoryName}` });
}

public render() {
Expand All @@ -97,17 +97,17 @@ export class RecentlyViewedItems extends React.Component<IRecentlyViewedItemsPro
<Component
results={this.state.recentItems}
onRemoveItem={this.handleRemoveItem}
onResultClick={this.handleResultClick}
onRemoveProject={this.handleRemoveProject}
onResultClick={this.handleResultClick}
/>
) : (
// Once RecentlyViewedItems is no longer rendered as part of any angular
// templates, we can stop defaulting to SearchResultPods and require a component.
<SearchResultPods
results={this.state.recentItems}
onRemoveItem={this.handleRemoveItem}
onResultClick={this.handleResultClick}
onRemoveProject={this.handleRemoveProject}
onResultClick={this.handleResultClick}
/>
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { RECENTLY_VIEWED_ITEMS_COMPONENT } from './recentlyViewedItems.component
import { SEARCH_COMPONENT } from '../widgets/search.component';
import { SEARCH_INFRASTRUCTURE_V2_CONTROLLER } from './infrastructureSearchV2.component';
import { SEARCH_RESULT_COMPONENT } from './searchResult.component';
import { SEARCH_RESULT_PODS_COMPONENT } from './searchResultPods.component';

import './infrastructure.less';

Expand All @@ -17,5 +16,4 @@ module(SEARCH_INFRASTRUCTURE, [
SEARCH_COMPONENT,
SEARCH_INFRASTRUCTURE_V2_CONTROLLER,
SEARCH_RESULT_COMPONENT,
SEARCH_RESULT_PODS_COMPONENT,
]);

This file was deleted.

0 comments on commit 8ef9acc

Please sign in to comment.