Skip to content

Commit

Permalink
Chore: Move controllers into a separate folder (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum committed Nov 3, 2017
1 parent b125b8b commit 3efa19f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/BoxAnnotations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DocAnnotator from './doc/DocAnnotator';
import ImageAnnotator from './image/ImageAnnotator';
import DrawingModeController from './drawing/DrawingModeController';
import DrawingModeController from './controllers/DrawingModeController';
import { TYPES } from './annotationConstants';
import { canLoadAnnotations } from './annotatorUtil';

Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/BoxAnnotations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import BoxAnnotations from '../BoxAnnotations';
import { TYPES } from '../annotationConstants';
import * as annotatorUtil from '../annotatorUtil';
import DrawingModeController from '../drawing/DrawingModeController';
import DrawingModeController from '../controllers/DrawingModeController';

let loader;
let stubs;
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('BoxAnnotations', () => {
enabled: true,
disabledTypes: ['point']
};

const docAnnotator = {
NAME: 'Document',
VIEWER: ['Document'],
Expand All @@ -153,7 +153,7 @@ describe('BoxAnnotations', () => {
});
expect(loader.getAnnotatorsForViewer).to.be.called;
});

it('should filter and only keep allowed types of annotations', () => {
const config = {
enabled: true,
Expand All @@ -166,7 +166,7 @@ describe('BoxAnnotations', () => {
TYPE: ['point', 'highlight', 'highlight-comment', 'draw'],
DEFAULT_TYPES: ['point', 'highlight']
};

sandbox.stub(loader, 'getAnnotatorsForViewer').returns(docAnnotator);
const annotator = loader.determineAnnotator(stubs.options, config);
expect(annotator.TYPE.includes('point')).to.be.true;
Expand All @@ -192,7 +192,7 @@ describe('BoxAnnotations', () => {
};
sandbox.stub(loader, 'getAnnotatorsForViewer').returns(docAnnotator);
const annotator = loader.determineAnnotator(stubs.options, config);

expect(annotator.TYPE).to.deep.equal(['point', 'draw']);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EventEmitter from 'events';
import { insertTemplate } from './annotatorUtil';
import { insertTemplate } from '../annotatorUtil';

class AnnotationModeController extends EventEmitter {
/** @property {Object} - Object of annotation threads indexed by threadID */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rbush from 'rbush';
import AnnotationModeController from '../AnnotationModeController';
import AnnotationModeController from './AnnotationModeController';
import annotationsShell from './../annotationsShell.html';
import DocDrawingThread from '../doc/DocDrawingThread';
import * as annotatorUtil from '../annotatorUtil';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import AnnotationModeController from '../AnnotationModeController';
import DocDrawingThread from '../doc/DocDrawingThread';
import * as util from '../annotatorUtil';
import DocDrawingThread from '../../doc/DocDrawingThread';
import * as util from '../../annotatorUtil';

let controller;
let stubs;
const sandbox = sinon.sandbox.create();

describe('AnnotationModeController', () => {
describe('controllers/AnnotationModeController', () => {
beforeEach(() => {
controller = new AnnotationModeController();
stubs = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rbush from 'rbush';
import AnnotationModeController from '../../AnnotationModeController';
import AnnotationModeController from '../AnnotationModeController';
import DrawingModeController from '../DrawingModeController';
import * as annotatorUtil from '../../annotatorUtil';
import { CLASS_ANNOTATION_DRAW} from '../../annotationConstants';
Expand All @@ -8,7 +8,7 @@ let controller;
let stubs;
const sandbox = sinon.sandbox.create();

describe('drawing/DrawingModeController', () => {
describe('controllers/DrawingModeController', () => {
beforeEach(() => {
controller = new DrawingModeController();
stubs = {};
Expand Down

0 comments on commit 3efa19f

Please sign in to comment.