Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4295 from sarracini/bug_1480506
Browse files Browse the repository at this point in the history
Fix Bug 1480506 - Top Search Shortcuts should allow user to unpin
  • Loading branch information
k88hudson committed Aug 7, 2018
2 parents 59fa7d2 + 1ca281b commit d42c039
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion content-src/components/LinkMenu/LinkMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class _LinkMenu extends React.PureComponent {
const {site, index, source, isPrivateBrowsingEnabled, siteInfo, platform} = props;

// Handle special case of default site
const propOptions = !site.isDefault ? props.options : DEFAULT_SITE_MENU_OPTIONS;
const propOptions = (!site.isDefault || site.searchTopSite) ? props.options : DEFAULT_SITE_MENU_OPTIONS;

const options = propOptions.map(o => LinkMenuOptions[o](site, index, source, isPrivateBrowsingEnabled, siteInfo, platform)).map(option => {
const {action, impression, id, string_id, type, userEvent} = option;
Expand Down
3 changes: 2 additions & 1 deletion content-src/components/TopSites/TopSite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
MIN_CORNER_FAVICON_SIZE,
MIN_RICH_FAVICON_SIZE,
TOP_SITES_CONTEXT_MENU_OPTIONS,
TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS,
TOP_SITES_SOURCE
} from "./TopSitesConstants";
import {LinkMenu} from "content-src/components/LinkMenu/LinkMenu";
Expand Down Expand Up @@ -266,7 +267,7 @@ export class TopSite extends React.PureComponent {
dispatch={props.dispatch}
index={props.index}
onUpdate={this.onMenuUpdate}
options={TOP_SITES_CONTEXT_MENU_OPTIONS}
options={link.searchTopSite ? TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS : TOP_SITES_CONTEXT_MENU_OPTIONS}
site={link}
siteInfo={this._getTelemetryInfo()}
source={TOP_SITES_SOURCE} />
Expand Down
2 changes: 2 additions & 0 deletions content-src/components/TopSites/TopSitesConstants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export const TOP_SITES_SOURCE = "TOP_SITES";
export const TOP_SITES_CONTEXT_MENU_OPTIONS = ["CheckPinTopSite", "EditTopSite", "Separator",
"OpenInNewWindow", "OpenInPrivateWindow", "Separator", "BlockUrl", "DeleteUrl"];
// the special top site for search shortcut experiment can only have the option to unpin (which removes) the topsite
export const TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS = ["CheckPinTopSite", "Separator", "BlockUrl"];
// minimum size necessary to show a rich icon instead of a screenshot
export const MIN_RICH_FAVICON_SIZE = 96;
// minimum size necessary to show any icon in the top left corner with a screenshot
Expand Down

0 comments on commit d42c039

Please sign in to comment.