Skip to content
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

feat(archive-viewer): add archive loader, viewer, and archive explorer #1112

Merged
merged 2 commits into from
Dec 13, 2019

Conversation

mxiao6
Copy link
Contributor

@mxiao6 mxiao6 commented Dec 5, 2019

@boxcla
Copy link

boxcla commented Dec 5, 2019

Verified that @mxiao6 has signed the CLA. Thanks for the pull request!

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/lib/viewers/archive/Archive.scss Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/Archive.scss Show resolved Hide resolved
src/lib/viewers/archive/ArchiveViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
import { Column } from 'react-virtualized/dist/es/Table/index';
import { TABLE_COLUMNS } from './constants';

const { KEY_NAME, KEY_MODIFIED_AT } = TABLE_COLUMNS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think destructuring is necessary here.

Copy link
Contributor Author

@mxiao6 mxiao6 Dec 10, 2019

Choose a reason for hiding this comment

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

I don't think destructuring is necessary here.

why? isn't TABLE_COLUMNS.KEY_NAME too long?

src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Show resolved Hide resolved
src/lib/viewers/archive/ArchiveViewer.js Outdated Show resolved Hide resolved
@box box deleted a comment from sarahsab Dec 10, 2019
Copy link
Collaborator

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

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

LGTM overall.

src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveExplorer.js Outdated Show resolved Hide resolved
build/webpack.karma.config.js Show resolved Hide resolved
@mxiao6 mxiao6 force-pushed the zip-explorar branch 2 times, most recently from 3d298f0 to ac0fbf8 Compare December 12, 2019 05:11
@mxiao6 mxiao6 marked this pull request as ready for review December 12, 2019 19:28
@mxiao6 mxiao6 requested a review from a team as a code owner December 12, 2019 19:28
build/karma.conf.js Outdated Show resolved Hide resolved
@@ -89,6 +91,8 @@
"raw-loader": "^3.1.0",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-intl": "^2.9.0",
"react-tether": "^1.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is react-tether used in the virtualized table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where is react-tether used in the virtualized table?

If I don't add it, the building process gives me error about dropdown-menu. I guess it's because one of the renderers uses breadcrumb and breadcrumb imports dropdown-menu.

@@ -311,7 +311,7 @@ class ThumbnailsSidebar {
* @return {Promise} - promise reolves with the image HTMLElement or null if generation is in progress
*/
createThumbnailImage(itemIndex) {
const cacheEntry = this.thumbnailImageCache.get(itemIndex);
const cacheEntry = this.thumbnailImageCache && this.thumbnailImageCache.get(itemIndex);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change seems unrelated to the archive viewer. Is it meant to address a separate bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change seems unrelated to the archive viewer. Is it meant to address a separate bug?

This change is to fix a sanity test. The thumbnailImageCache is sometimes not initialized in time because the travis testing machine is too slow. Should I open another pr for this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we revert this change since we have the other PR open?

@@ -93,7 +93,7 @@ export const STATUS_SUCCESS = 'success';
export const STATUS_VIEWABLE = 'viewable';

// X-Rep-Hints for Representations API
export const X_REP_HINT_BASE = '[3d][pdf][text][mp3]';
export const X_REP_HINT_BASE = '[3d][pdf][text][mp3][json]';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this have any immediate performance/capacity implications for existing file types or for the representations service? We'll be requesting json reps for all file types, right?

package.json Show resolved Hide resolved
src/lib/viewers/archive/ArchiveLoader.js Outdated Show resolved Hide resolved
src/lib/viewers/archive/ArchiveLoader.js Outdated Show resolved Hide resolved
jstoffan
jstoffan previously approved these changes Dec 13, 2019
Copy link
Collaborator

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

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

Nice job.

@mergify mergify bot merged commit 6797c70 into box:master Dec 13, 2019
@mxiao6 mxiao6 deleted the zip-explorar branch December 23, 2019 18:10
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.

4 participants