-
Notifications
You must be signed in to change notification settings - Fork 344
feat(classification): add Blueprint rendering behind isRedesignEnabled flag #4448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad36350
feat(classification): migrate Classification to Blueprint for sidebar…
Nefaris 2da2ac4
test(classification): update SecurityControls snapshots for redesign …
Nefaris 1512d6f
feat(classification): add Classification storybook stories for legacy…
Nefaris 9f903e5
feat(classification): add AI classification stories and remove applie…
Nefaris 83f34af
feat(classification): use dynamic color for redesigned Status badge
Nefaris 783fbdd
refactor(classification): use classNames util and remove unnecessary …
Nefaris ac795d4
fix(classification): resolve Flow type errors in SecurityControlsItem…
Nefaris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| import * as React from 'react'; | ||
|
|
||
| import Classification, { STYLE_INLINE } from './Classification'; | ||
| import { SECURITY_CONTROLS_FORMAT } from './constants'; | ||
|
|
||
| const definition = | ||
| '[Prohibits external access] Internal data is not accessible by external users and can only be accessed by Box employees and contractors. Examples: New hire documents, policies, procedures, announcements, and Boxer training.'; | ||
|
|
||
| const controls = { | ||
| boxSignRequest: { enabled: true }, | ||
| download: { desktop: { restrictManagedUsers: 'ownersCoOwners' } }, | ||
| sharedLink: { accessLevel: 'collabOnly' }, | ||
| }; | ||
|
|
||
| const baseProps = { | ||
| color: '#ffeb7f', | ||
| definition, | ||
| messageStyle: STYLE_INLINE, | ||
| name: 'BOX-ONLY', | ||
| modifiedAt: '2025-01-15T10:30:00Z', | ||
| modifiedBy: 'Robert Robertson', | ||
| }; | ||
|
|
||
| export const Legacy = () => <Classification {...baseProps} />; | ||
|
|
||
| export const Redesigned = () => <Classification {...baseProps} isRedesignEnabled />; | ||
|
|
||
| export const RedesignedWithControls = () => ( | ||
| <Classification | ||
| {...baseProps} | ||
| controls={controls} | ||
| controlsFormat={SECURITY_CONTROLS_FORMAT.SHORT_WITH_BTN} | ||
| isRedesignEnabled | ||
| itemName="welcome.pdf" | ||
| /> | ||
| ); | ||
|
|
||
| const aiClassificationReason = { | ||
| answer: 'This document contains internal policies, onboarding procedures, and employee training materials that are restricted to Box employees and contractors only.', | ||
| modifiedAt: '2025-01-15T10:30:00Z', | ||
| citations: [ | ||
| { content: 'New hire onboarding policy v3', fileId: '123', location: 'Page 1', title: 'Onboarding Policy.pdf' }, | ||
| { content: 'Internal training schedule 2025', fileId: '456', location: 'Page 2', title: 'Training Guide.docx' }, | ||
| ], | ||
| }; | ||
|
|
||
| export const RedesignedWithAiClassification = () => ( | ||
| <Classification | ||
| {...baseProps} | ||
| aiClassificationReason={aiClassificationReason} | ||
| isRedesignEnabled | ||
| shouldUseAppliedByLabels | ||
| /> | ||
| ); | ||
|
|
||
| export const RedesignedFull = () => ( | ||
| <Classification | ||
| {...baseProps} | ||
| aiClassificationReason={aiClassificationReason} | ||
| controls={controls} | ||
| controlsFormat={SECURITY_CONTROLS_FORMAT.SHORT_WITH_BTN} | ||
| isRedesignEnabled | ||
| itemName="welcome.pdf" | ||
| shouldUseAppliedByLabels | ||
| /> | ||
| ); | ||
|
|
||
| export const LegacyWithAiClassification = () => ( | ||
| <Classification {...baseProps} aiClassificationReason={aiClassificationReason} shouldUseAppliedByLabels /> | ||
| ); | ||
|
|
||
| export const LegacyWithControls = () => ( | ||
| <Classification | ||
| {...baseProps} | ||
| controls={controls} | ||
| controlsFormat={SECURITY_CONTROLS_FORMAT.SHORT_WITH_BTN} | ||
| itemName="welcome.pdf" | ||
| /> | ||
| ); | ||
|
|
||
| export default { | ||
| title: 'Features/Classification', | ||
| component: Classification, | ||
| decorators: [(story: () => React.ReactNode) => <div style={{ width: 260 }}>{story()}</div>], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.