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

Feature: drawingSelectionUI #362

Merged
merged 7 commits into from
Sep 5, 2017
Merged

Feature: drawingSelectionUI #362

merged 7 commits into from
Sep 5, 2017

Conversation

Minh-Ng
Copy link
Contributor

@Minh-Ng Minh-Ng commented Sep 2, 2017

  • Select saved drawings
  • Pop up dialog and position dialog in drawing mode
  • Dialog implementation is in a separate PR

@Minh-Ng Minh-Ng mentioned this pull request Sep 3, 2017
@Minh-Ng Minh-Ng changed the title Feature/drawingSelectionUI Feature: drawingSelectionUI Sep 3, 2017
@@ -454,6 +454,10 @@ class DocAnnotator extends Annotator {
bindDOMListeners() {
super.bindDOMListeners();

if (!this.permissions.canAnnotate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

double check that this doesn't block triggering highlight annotations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing these. For some reason I had thought that the upstream codebase had if (!this.canAnnotate)

@@ -485,6 +489,12 @@ class DocAnnotator extends Annotator {
this.highlightThrottleHandle = null;
}

if (!this.permissions.canAnnotate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@@ -135,6 +135,12 @@ annotation_highlight_toggle=Highlight text
annotation_highlight_comment=Add comment to highlighted text
# Text for which user made the highlight annotation
annotation_who_highlighted={1} highlighted
# Text for which user made the drawn annotation
annotation_who_drew={1} drew
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe drawn by {1}? We can double check wording with Varun

Copy link
Contributor

@pramodsum pramodsum Sep 5, 2017

Choose a reason for hiding this comment

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

Personally I prefer keeping this consistent w/ highlights so {1} highlighted or {1} drew

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used '{1} drew' for consistency. This can easily be changed in the future.

@@ -448,7 +448,8 @@ export function validateThreadParams(thread) {
export function eventToLocationHandler(locationFunction, callback) {
return (event) => {
const evt = event || window.event;
if (!evt) {
// Do nothing when the target isn't the text layer in case the text layer receives event precedence over buttons
if (!evt || (event.target && event.target.className !== 'textLayer')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember this from our conversation but is the textlayer guaranteed to be on top? Does this method only apply for documents?

Copy link
Contributor Author

@Minh-Ng Minh-Ng Sep 5, 2017

Choose a reason for hiding this comment

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

This is indeed only for documents. I have only tested this on documents with textlayers. Clearly this would cause drawing to not work on images.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding a note about this for future development

@@ -1,6 +1,8 @@
import AnnotationDialog from '../AnnotationDialog';

class DocDrawingDialog extends AnnotationDialog {
visible = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

JSDoc in here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

JSDoc is in #364, I separated them to make it easier to read. DocDrawingDialog is simply a stub in this PR.

this.reset();

// Only make save request to server if there exist paths to save
const { undoCount } = this.pathContainer.getNumberOfItems();
if (undoCount === 0) {
if (this.pathContainer.isUndoEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're reusing undo logic to determine if we should save I might rename to just isEmpty since you're already accessing the path container.

*
* @return {void}
*/
cleanSelector() {
Copy link
Contributor

Choose a reason for hiding this comment

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

"clean" doesn't really mean much to me, maybe destroy or remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to removeSelection

@Minh-Ng Minh-Ng merged commit 318501f into box:master Sep 5, 2017
@Minh-Ng Minh-Ng deleted the feature/drawingBar branch September 5, 2017 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants