Skip to content

Commit

Permalink
feat(content-sidebar): Add performance mark for MetadataSidebarRedesign
Browse files Browse the repository at this point in the history
  • Loading branch information
jankowiakdawid committed Jul 18, 2024
1 parent 89839c2 commit 8e3e443
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export const ORIGIN_ACTIVITY_SIDEBAR: 'activity_sidebar' = 'activity_sidebar';
export const ORIGIN_DETAILS_SIDEBAR: 'details_sidebar' = 'details_sidebar';
export const ORIGIN_DOCGEN_SIDEBAR: 'docgen_sidebar' = 'docgen_sidebar';
export const ORIGIN_METADATA_SIDEBAR: 'metadata_sidebar' = 'metadata_sidebar';
export const ORIGIN_METADATA_SIDEBAR_REDESIGN: 'metadata_sidebar_redesign' = 'metadata_sidebar_redesign';
export const ORIGIN_SKILLS_SIDEBAR: 'skills_sidebar' = 'skills_sidebar';
export const ORIGIN_VERSIONS_SIDEBAR: 'versions_sidebar' = 'versions_sidebar';
export const ORIGIN_PREVIEW: 'preview' = 'preview';
Expand Down
2 changes: 2 additions & 0 deletions src/elements/common/flowTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ORIGIN_ACTIVITY_SIDEBAR,
ORIGIN_SKILLS_SIDEBAR,
ORIGIN_METADATA_SIDEBAR,
ORIGIN_METADATA_SIDEBAR_REDESIGN,
ORIGIN_OPEN_WITH,
} from '../../constants';

Expand Down Expand Up @@ -44,6 +45,7 @@ type ElementOrigin =
| typeof ORIGIN_ACTIVITY_SIDEBAR
| typeof ORIGIN_SKILLS_SIDEBAR
| typeof ORIGIN_METADATA_SIDEBAR
| typeof ORIGIN_METADATA_SIDEBAR_REDESIGN
| typeof ORIGIN_OPEN_WITH;

type Alignment = 'left' | 'right';
Expand Down
12 changes: 9 additions & 3 deletions src/elements/content-sidebar/MetadataSidebarRedesign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ import { FormattedMessage } from 'react-intl';
import { withAPIContext } from '../common/api-context';
import { withErrorBoundary } from '../common/error-boundary';
import { withLogger } from '../common/logger';
import { ORIGIN_METADATA_SIDEBAR } from '../../constants';
import { ORIGIN_METADATA_SIDEBAR_REDESIGN } from '../../constants';
import { EVENT_JS_READY } from '../common/logger/constants';
import { mark } from '../../utils/performance';
import messages from '../common/messages';

import './MetadataSidebarRedesign.scss';

const MARK_NAME_JS_READY = `${ORIGIN_METADATA_SIDEBAR_REDESIGN}_${EVENT_JS_READY}`;

mark(MARK_NAME_JS_READY);

function MetadataSidebarRedesign() {
return (
<div className="bcs-MetadataSidebarRedesign">
Expand All @@ -27,7 +33,7 @@ function MetadataSidebarRedesign() {

export { MetadataSidebarRedesign as MetadataSidebarRedesignComponent };
export default flow([
withLogger(ORIGIN_METADATA_SIDEBAR),
withErrorBoundary(ORIGIN_METADATA_SIDEBAR),
withLogger(ORIGIN_METADATA_SIDEBAR_REDESIGN),
withErrorBoundary(ORIGIN_METADATA_SIDEBAR_REDESIGN),
withAPIContext,
])(MetadataSidebarRedesign);

0 comments on commit 8e3e443

Please sign in to comment.