close
Skip to content

feat(insights): Added support for Advanced Content Insights - #3116

Merged
mergify[bot] merged 13 commits into
box:masterfrom
marcoartaviaq:insights-poc
Jan 19, 2023
Merged

feat(insights): Added support for Advanced Content Insights#3116
mergify[bot] merged 13 commits into
box:masterfrom
marcoartaviaq:insights-poc

Conversation

@marcoartaviaq

@marcoartaviaq marcoartaviaq commented Oct 27, 2022

Copy link
Copy Markdown
Contributor
  • Added a new component that handles ACI activation and deactivation.
    Screenshot 2022-11-23 at 3 43 44 PM
  • Unified Share Modal (USM): Added the option to toggle on/off Advanced Content Insights for a specific file.
    Screenshot 2022-11-23 at 3 41 48 PM
  • Modal Dialog: Added the option to show a back button (and a callback) inside the modal.
    Screenshot 2022-11-23 at 3 44 38 PM
  • Charts: Added the capability to show a label in each bar and return the bar’s offset position while hovering over it.
    Screenshot 2022-11-23 at 3 44 55 PM
  • Content Preview: Send Advanced Content Insights options to Box Content Preview.

@marcoartaviaq
marcoartaviaq requested review from a team as code owners October 27, 2022 21:56
@CLAassistant

CLAassistant commented Oct 27, 2022

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@marcoartaviaq
marcoartaviaq force-pushed the insights-poc branch 2 times, most recently from 8dd3258 to 405b430 Compare October 28, 2022 18:34
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
Comment thread src/features/unified-share-modal/UnifiedShareForm.js Outdated
@marcoartaviaq
marcoartaviaq dismissed a stale review via 43a2134 November 3, 2022 23:48
@marcoartaviaq
marcoartaviaq force-pushed the insights-poc branch 2 times, most recently from 43a2134 to 6a81727 Compare November 4, 2022 00:07
@marcoartaviaq
marcoartaviaq dismissed a stale review via 35df164 November 17, 2022 17:44

@tjuanitas tjuanitas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add screenshots of these changes?

I think it would be helpful in the future to split changes like these into smaller PRs

Comment thread src/components/modal/Modal.scss
Comment thread src/components/modal/ModalDialog.js Outdated
Comment thread src/components/modal/Modal.scss
Comment thread src/components/modal/ModalDialog.js Outdated
Comment thread src/components/modal/ModalDialog.js Outdated
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
Comment thread src/features/advanced-content-insights/ContentInsightsSection.js Outdated
@marcoartaviaq
marcoartaviaq dismissed a stale review via 4418d9e November 29, 2022 21:44
@marcoartaviaq
marcoartaviaq force-pushed the insights-poc branch 2 times, most recently from 4418d9e to 9e255ed Compare November 29, 2022 23:16
Comment thread src/features/advanced-content-insights/messages.ts Outdated
Comment thread src/features/advanced-content-insights/messages.ts Outdated
Comment thread src/features/content-insights/charts/bar/Bar.scss Outdated
Comment thread src/features/content-insights/charts/bar/BarChart.tsx Outdated
Comment thread src/features/content-insights/charts/bar/BarChart.tsx Outdated
Comment thread src/features/advanced-content-insights/AdvancedContentInsightsToggle.tsx Outdated
Comment thread src/features/unified-share-modal/UnifiedShareModal.scss Outdated
Comment thread src/features/advanced-content-insights/AdvancedContentInsightsToggle.tsx Outdated
@marcoartaviaq
marcoartaviaq requested review from bfoxx1906 and tjuanitas and removed request for bfoxx1906 and tjuanitas December 6, 2022 22:31

@tjuanitas tjuanitas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's looking good!

Comment thread src/features/advanced-content-insights/AdvancedContentInsightsToggle.tsx Outdated
Comment thread src/elements/content-preview/ContentPreview.js Outdated
Comment thread src/features/unified-share-modal/UnifiedShareForm.js Outdated
Comment thread src/features/unified-share-modal/UnifiedShareForm.js Outdated
Comment thread src/features/unified-share-modal/UnifiedShareModal.scss Outdated
Comment thread src/features/unified-share-modal/UnifiedShareForm.js Outdated
Comment thread src/features/unified-share-modal/UnifiedShareForm.js Outdated
Comment thread src/features/advanced-content-insights/flowTypes.js Outdated
Comment thread src/features/content-insights/charts/bar/Bar.tsx Outdated
Comment thread src/features/content-insights/charts/bar/__tests__/Bar.test.tsx Outdated

@tjuanitas tjuanitas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took another pass through since I saw the PR was still open


interface Props {
hasTooltip?: boolean;
isAdvancedContentInsightsChecked?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this prop could be isChecked since AdvancedContentInsights is part of the component name so it's not needed to include it in the prop name

note: the change would only be for this component. it still makes sense to keep it in UnifiedShareForm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @tjuanitas, changed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! one more place sorry:

isAdvancedContentInsightsChecked={isAdvancedContentInsightsChecked}

isChecked={isAdvancedContentInsightsChecked}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tjuanitas my bad! Updated

tjuanitas
tjuanitas previously approved these changes Dec 20, 2022
Comment thread src/components/modal/ModalDialog.js Outdated
);
});

describe('getThumbnail()', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test to ensure that the thumbnail has the properties that we are expecting. I notice we check for null but it might be helpful to test that the thumbnail is going to be returned properly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, for the thumbnail We are testing that the viewer.getThumbnail is called. So for unit testing I think is the way to go. That viewer function will need to unit test if the thumbnail is being returned properly. Also, this function is going to be removed before going GA since we are going to switch the thumbnail provider (not gonna use PDFjs)

allShareRestrictionWarning;

const showContentInsightsToggle =
onAdvancedContentInsightsToggle &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parts of this conditional are the exact same as the ones in the statement above. I'm guessing that combination of conditions has greater meaning in the context of the form than they do individually with regard to whether or not we want to show those elements. Do you think it would be a good idea to extract those common conditions out into their own function? It might make the code more readable and easy to understand.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bfoxx1906 , @tjuanitas . I added some logic regarding this comment @bfoxx1906 added. I agree with him that it would be better to make that condition more readable. PTAL and please fell free to share your thoughts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tjuanitas and @bfoxx1906 . Bumping this to get final feedback for this change. Thanks

@marcoartaviaq
marcoartaviaq dismissed stale reviews from tjuanitas and ghost via c010e1e December 21, 2022 21:09
Comment thread src/components/modal/ModalDialog.js
Comment thread src/features/unified-share-modal/UnifiedShareForm.js Outdated
!isInviteSectionExpanded &&
!showCollaboratorList &&
allShareRestrictionWarning;
const isMainUSMSectionShown = !isEmailLinkSectionExpanded && !isInviteSectionExpanded && !showCollaboratorList;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if these are better names but what about: isInitialStateShown or hasExpandedSections (requires inverting the boolean logic)

"main USM section" sounds a little ambiguous. i.e. what is the main section?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tjuanitas . Actually I like the hasExpandedSections better so I updated the code

@bfoxx1906
bfoxx1906 self-requested a review January 19, 2023 16:55
@mergify
mergify Bot merged commit a66ec89 into box:master Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants