Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JustinHoldstock/box-content-previ…
Browse files Browse the repository at this point in the history
…ew into Highlight-annotations-on-mobile
  • Loading branch information
Justin Holdstock committed Jul 26, 2017
2 parents b9c1c14 + 499c06b commit 849fe7f
Show file tree
Hide file tree
Showing 23 changed files with 196 additions and 133 deletions.
19 changes: 17 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Change Log

## [v1.1.1](https://github.com/box/box-content-preview/tree/v1.1.1) (2017-07-19)
## [v1.2.0](https://github.com/box/box-content-preview/tree/v1.2.0) (2017-07-25)
[Full Changelog](https://github.com/box/box-content-preview/compare/v1.1.1...v1.2.0)

**Merged pull requests:**

- Fix: Update box3d to fix camera reload bug [\#245](https://github.com/box/box-content-preview/pull/245) ([MiiBond](https://github.com/MiiBond))
- New: added support for compressed \(DDS\) textures to 3D preview [\#244](https://github.com/box/box-content-preview/pull/244) ([ikerr](https://github.com/ikerr))
- Update Translations [\#240](https://github.com/box/box-content-preview/pull/240) ([boxmoji](https://github.com/boxmoji))
- Fix: Allow legacy annotations to render in PDF.js [\#238](https://github.com/box/box-content-preview/pull/238) ([jeremypress](https://github.com/jeremypress))
- Fix: Give preview some min width and height [\#237](https://github.com/box/box-content-preview/pull/237) ([priyajeet](https://github.com/priyajeet))
- Docs: Adding section of using Preview as a component [\#236](https://github.com/box/box-content-preview/pull/236) ([priyajeet](https://github.com/priyajeet))
- Fix: Increase controls timeout and fix controls behavior for mobile VR [\#235](https://github.com/box/box-content-preview/pull/235) ([jeremypress](https://github.com/jeremypress))
- Fix: Ensuring annotation scale is set on files with 0 annotations [\#234](https://github.com/box/box-content-preview/pull/234) ([pramodsum](https://github.com/pramodsum))
- Feature: DrawingAnnotations starting code [\#224](https://github.com/box/box-content-preview/pull/224) ([MinhHNguyen](https://github.com/MinhHNguyen))

## [v1.1.1](https://github.com/box/box-content-preview/tree/v1.1.1) (2017-07-20)
[Full Changelog](https://github.com/box/box-content-preview/compare/v1.1.0...v1.1.1)

**Merged pull requests:**
Expand Down Expand Up @@ -390,4 +405,4 @@
- Setting up Travis [\#1](https://github.com/box/box-content-preview/pull/1) ([tonyjin](https://github.com/tonyjin))


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Project Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat-square)](http://opensource.box.com/badges/)
[![Styled With Prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![build status](https://img.shields.io/travis/box/box-content-preview/master.svg?style=flat-square)](https://travis-ci.org/box/box-content-preview)
[![version](https://img.shields.io/badge/version-v1.1.1-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
[![version](https://img.shields.io/badge/version-v1.2.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
[![npm version](https://img.shields.io/npm/v/box-ui-elements.svg?style=flat-square)](https://www.npmjs.com/package/box-ui-elements)

[Box Content Preview](https://docs.box.com/docs/box-content-preview)
Expand All @@ -19,11 +19,11 @@ If you are using Internet Explorer 11, which doesn't natively support promises,

Current Version
---------------
* Version: v1.1.1
* Version: v1.2.0
* Locale: en-US

https://cdn01.boxcdn.net/platform/preview/1.1.1/en-US/preview.js
https://cdn01.boxcdn.net/platform/preview/1.1.1/en-US/preview.css
https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.js
https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.css

Supported Locales
-----------------
Expand Down Expand Up @@ -53,8 +53,8 @@ You can self-host the Box Content Preview UI Element or reference the versions a
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script>

<!-- Latest version of Preview SDK for your locale -->
<script src="https://cdn01.boxcdn.net/platform/preview/1.1.1/en-US/preview.js"></script>
<link rel="stylesheet" href="https://cdn01.boxcdn.net/platform/preview/1.1.1/en-US/preview.css" />
<script src="https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.js"></script>
<link rel="stylesheet" href="https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.css" />
</head>
<body>
<div class="preview-container" style="height:400px;width:575px"></div>
Expand Down
73 changes: 44 additions & 29 deletions build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ increment_version() {
OLD_VERSION=$(./build/current_version.sh)

if $major_release; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Bumping major version..."
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
npm --no-git-tag-version version major
elif $minor_release; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Bumping minor version..."
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
npm --no-git-tag-version version minor
elif $patch_release; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Bumping patch version..."
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
npm --no-git-tag-version version patch
fi

Expand All @@ -67,27 +67,27 @@ increment_version() {


update_changelog() {
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Updating CHANGELOG.md"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"

if github_changelog_generator box/box-content-preview --future-release v$VERSION --exclude-labels legacy-ignore; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Updated CHANGELOG successfully"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
else
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Error: Could not update the CHANGELOG for this version"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
return 1
fi
}


update_readme() {
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Updating README"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"

# Replace 'v{VERSION}' string
sed -i -e "s@v$OLD_VERSION@v$VERSION@g" README.md
Expand All @@ -106,19 +106,19 @@ push_to_github() {
# Force update tag after updating files
git tag -a v$VERSION -m $VERSION

echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Master version is now at" $VERSION
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"

# Push to Github including tags
if git push github-upstream master --tags --no-verify; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Pushed version" $VERSION "to git successfully"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
else
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Error while pushing version" $VERSION "to git"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
return 1
fi
}
Expand All @@ -127,7 +127,22 @@ push_to_github() {
# Check out latest code from git, build assets, increment version, and push tags
push_new_release() {
# Get latest commited code and tags
reset_to_master || return 1
if $patch_release; then
echo "----------------------------------------------------------------------"
echo "Starting patch release - skipping reset to master"
echo "IMPORTANT - your branch should be in the state you want for the patch"
echo "----------------------------------------------------------------------"
elif $minor_release; then
echo "----------------------------------------------------------------------"
echo "Starting minor release - reset to upstream master"
echo "----------------------------------------------------------------------"
reset_to_master || return 1
else
echo "----------------------------------------------------------------------"
echo "Starting major release - reset to upstream master"
echo "----------------------------------------------------------------------"
reset_to_master || return 1
fi

# Run build script, linting, and tests
build_lint_and_test || return 1
Expand Down Expand Up @@ -161,22 +176,22 @@ done

# Execute this entire script
if ! push_new_release; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Error while pushing new release!"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"

echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Cleaning workspace by checking out master and removing tags"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"

if ! reset_to_master; then
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Error while cleaning workspace!"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
else
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "Workspace succesfully cleaned!"
echo "----------------------------------------------------"
echo "----------------------------------------------------------------------"
fi;
exit 1
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "box-content-preview",
"version": "1.1.1",
"version": "1.2.0",
"description": "Box Content Preview UI Element",
"author": "Box (https://www.box.com/)",
"license": "SEE LICENSE IN LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/annotations/Annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Annotation {
this.annotationID = data.annotationID;
this.fileVersionId = data.fileVersionId;
this.threadID = data.threadID;
this.thread = data.thread;
this.threadNumber = data.threadNumber;
this.type = data.type;
this.text = data.text;
this.location = data.location;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/annotations/AnnotationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class AnnotationDialog extends EventEmitter {

// Adding thread number to dialog
if (annotations.length > 0) {
this.element.dataset.threadNumber = annotations[0].thread;
this.element.dataset.threadNumber = annotations[0].threadNumber;
}

this.bindDOMListeners();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/annotations/AnnotationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class AnnotationService extends EventEmitter {
threadID: annotation.threadID
},
message: annotation.text,
thread: annotation.thread
threadNumber: annotation.threadNumber
})
})
.then((response) => response.json())
Expand Down Expand Up @@ -227,7 +227,7 @@ class AnnotationService extends EventEmitter {
fileVersionId: data.item.id,
threadID: data.details.threadID,
type: data.details.type,
thread: data.thread,
threadNumber: data.thread,
text: data.message,
location: data.details.location,
user: {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/annotations/AnnotationThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AnnotationThread extends EventEmitter {
this.fileVersionId = data.fileVersionId;
this.location = data.location;
this.threadID = data.threadID || AnnotationService.generateID();
this.thread = data.thread || '';
this.threadNumber = data.threadNumber || '';
this.type = data.type;
this.locale = data.locale;
this.isMobile = data.isMobile;
Expand Down Expand Up @@ -158,8 +158,8 @@ class AnnotationThread extends EventEmitter {
}

// Add thread number to associated dialog and thread
this.thread = this.thread || savedAnnotation.thread;
this.dialog.element.dataset.threadNumber = this.thread;
this.threadNumber = this.threadNumber || savedAnnotation.threadNumber;
this.dialog.element.dataset.threadNumber = this.threadNumber;

// Otherwise, replace temporary annotation with annotation saved to server
this.annotations[tempIdx] = savedAnnotation;
Expand Down Expand Up @@ -454,7 +454,7 @@ class AnnotationThread extends EventEmitter {
location: this.location,
user: this.annotationService.user,
threadID: this.threadID,
thread: this.thread
threadNumber: this.threadNumber
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/annotations/__tests__/AnnotationDialog-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe('lib/annotations/AnnotationDialog', () => {
text: 'blah',
user: {},
permissions: {},
thread: 1
threadNumber: 1
});

dialog.isMobile = false;
Expand Down
Loading

0 comments on commit 849fe7f

Please sign in to comment.