diff --git a/src/i18n/en-US.properties b/src/i18n/en-US.properties index ef9d0243f..42d2cd82d 100644 --- a/src/i18n/en-US.properties +++ b/src/i18n/en-US.properties @@ -253,10 +253,6 @@ annotations_create_error=This annotation could not be created. Please try again. annotations_delete_error=This annotation could not be deleted. Please try again. # Text for when the authorization token is invalid annotations_authorization_error=Annotations could not be loaded for this file. You may not have permission to take this action. -# Text for Tooltip content showing new users about annotations experience -annotations_tooltip_body=Make notes and comments to highlight key information when previewing content. -# Text for Tooltip title showing new users about annotations experience -annotations_tooltip_title=Add feedback on content # Notifications # Default text for notification button that dismisses notification diff --git a/src/lib/viewers/controls/annotations/AnnotationsControls.tsx b/src/lib/viewers/controls/annotations/AnnotationsControls.tsx index 60bc6f8cb..e3cfd940a 100644 --- a/src/lib/viewers/controls/annotations/AnnotationsControls.tsx +++ b/src/lib/viewers/controls/annotations/AnnotationsControls.tsx @@ -2,7 +2,6 @@ import React from 'react'; import noop from 'lodash/noop'; import { bdlBoxBlue } from 'box-ui-elements/es/styles/variables'; import AnnotationsButton from './AnnotationsButton'; -import AnnotationsTargetedTooltip from './AnnotationsTargetedTooltip'; import IconDrawing24 from '../icons/IconDrawing24'; import IconExit24 from '../icons/IconExit24'; import IconHighlightText16 from '../icons/IconHighlightText16'; @@ -109,20 +108,18 @@ export default function AnnotationsControls({ > - - - - - + + + ; - -function AnnotationsTargetedTooltip({ children, isEnabled = false }: Props): JSX.Element | null { - const { experiences } = React.useContext(ExperiencesContext); - const { setIsForced } = React.useContext(ControlsLayerContext); - - return ( - -

{__('annotations_tooltip_title')}

-

{__('annotations_tooltip_body')}

- - } - theme="callout" - useTargetingApi={(): TargetingApi => { - return { - ...experiences.tooltipFlowAnnotationsExperience, - onClose: (): void => { - experiences.tooltipFlowAnnotationsExperience.onClose(); - setIsForced(false); - }, - onComplete: (): void => { - experiences.tooltipFlowAnnotationsExperience.onComplete(); - setIsForced(false); - }, - onShow: (): void => { - experiences.tooltipFlowAnnotationsExperience.onShow(); - setIsForced(true); - }, - }; - }} - > - {children} -
- ); -} - -export default AnnotationsTargetedTooltip; diff --git a/src/lib/viewers/controls/annotations/__tests__/AnnotationsTargetedTooltip-test.tsx b/src/lib/viewers/controls/annotations/__tests__/AnnotationsTargetedTooltip-test.tsx deleted file mode 100644 index 87e1c8d9d..000000000 --- a/src/lib/viewers/controls/annotations/__tests__/AnnotationsTargetedTooltip-test.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react'; -import { ReactWrapper, mount } from 'enzyme'; -import AnnotationsTargetedTooltip from '../AnnotationsTargetedTooltip'; - -describe('AnnotationsTargetedTooltip', () => { - const getWrapper = (props = {}): ReactWrapper => - mount( - -
Child
-
, - ); - - describe('render', () => { - beforeEach(() => { - jest.spyOn(React, 'useContext').mockImplementation(() => ({ - experiences: { - tooltipFlowAnnotationsExperience: { - canShow: true, - onClose: jest.fn(), - onComplete: jest.fn(), - onShow: jest.fn(), - }, - }, - setIsForced: jest.fn(), - })); - }); - - test('should return tooltip when is enabled', () => { - const wrapper = getWrapper({ - isEnabled: true, - }); - - expect(wrapper.children().text()).not.toBe('Child'); - expect(wrapper.children().prop('shouldTarget')).toBe(true); - expect(wrapper.children().prop('theme')).toBe('callout'); - expect(wrapper.children().prop('useTargetingApi')().canShow).toBe(true); - }); - - test('should return children when tooltip is disabled', () => { - const wrapper = getWrapper({ - isEnabled: false, - }); - - expect(wrapper.children().text()).toBe('Child'); - expect(wrapper.children().prop('shouldTarget')).toBe(false); - }); - }); -});