Skip to content

Instantly share code, notes, and snippets.

@xavier-lc
Created January 14, 2021 15:01
Show Gist options
  • Save xavier-lc/b20b31ebbf74bc2255349a84fb66aee2 to your computer and use it in GitHub Desktop.
Save xavier-lc/b20b31ebbf74bc2255349a84fb66aee2 to your computer and use it in GitHub Desktop.
diff --git a/common/components/favorite-entities/FavoriteEntities.js b/common/components/favorite-entities/FavoriteEntities.js
index 92f3c16..6bed2fa 100644
--- a/common/components/favorite-entities/FavoriteEntities.js
+++ b/common/components/favorite-entities/FavoriteEntities.js
@@ -13,13 +13,14 @@ import {
getEntityTypeSchemasByDomainAndType,
getEntityTypeDataByDomainAndType,
getEntityUrl,
+ haveSameDomainType,
} from '../../utils/entity';
import { flatten } from '../../utils/array';
import { snakeCase } from '../../utils/string';
import { compareFavoriteSection } from '../../utils/favorites';
+import { DASHBOARD_ENTITY } from '../../constants/entity';
export default class FavoriteEntities extends PureComponent {
-
static propTypes = {
className: PropTypes.string,
entityTypes: PropTypes.arrayOf(PropTypes.object),
@@ -115,7 +116,7 @@ export default class FavoriteEntities extends PureComponent {
collection={COLLECTIONS.COLLAPSIBLES}
collapsibleType={Collapsible.TYPE.TABLE}
count={count}
- onToggle={(e) => this._onToggleCollapsible(e, trackingProperties)}
+ onToggle={e => this._onToggleCollapsible(e, trackingProperties)}
title={sectionTitle}
>
{() => {
@@ -141,6 +142,7 @@ export default class FavoriteEntities extends PureComponent {
favoriteIds={favoriteIds}
getEntityUrl={this._getEntityUrl}
hideAccount={hideAccount}
+ hideStatus={haveSameDomainType(entityGuid, DASHBOARD_ENTITY)}
onClickRow={this._onClickEntity}
/>
);
@@ -198,7 +200,7 @@ export default class FavoriteEntities extends PureComponent {
horizontalType={Stack.HORIZONTAL_TYPE.FILL}
directionType={Stack.DIRECTION_TYPE.VERTICAL}
>
- {sortedSchemas.map((entityTypeSchema) =>
+ {sortedSchemas.map(entityTypeSchema =>
this.renderFavoritesList({
accounts,
accountsLoading,
@@ -220,5 +222,4 @@ export default class FavoriteEntities extends PureComponent {
return <div className={classNames}>{this.renderFavoritesContent()}</div>;
}
-
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment