mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 18:23:21 +08:00
fix(build): FIx linting and react errors and popover spec
This commit is contained in:
parent
91b2d5b8e3
commit
bec4a86629
4 changed files with 10 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
import React from 'react';
|
||||
import {findDOMNode} from 'react-dom';
|
||||
import {Actions} from 'nylas-exports';
|
||||
import {RetinaImg, ScrollRegion} from 'nylas-component-kit';
|
||||
|
||||
|
@ -234,7 +235,7 @@ class EmojiButtonPopover extends React.Component {
|
|||
}
|
||||
|
||||
renderCanvas() {
|
||||
const canvas = React.findDOMNode(this.refs.emojiCanvas);
|
||||
const canvas = findDOMNode(this.refs.emojiCanvas);
|
||||
const keys = Object.keys(this.state.categoryPositions);
|
||||
canvas.height = this.state.categoryPositions[keys[keys.length - 1]].bottom * 2;
|
||||
const ctx = canvas.getContext("2d");
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, {addons} from 'react/addons';
|
||||
import {findDOMNode} from 'react-dom';
|
||||
import {renderIntoDocument} from '../../../spec/nylas-test-utils';
|
||||
import Contenteditable from '../../../src/components/contenteditable/contenteditable';
|
||||
import EmojiButtonPopover from '../lib/emoji-button-popover';
|
||||
|
@ -21,12 +22,12 @@ describe('EmojiButtonPopover', ()=> {
|
|||
onChange={jasmine.createSpy('onChange')}
|
||||
extensions={[EmojiComposerExtension]} />
|
||||
);
|
||||
this.editableNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithAttr(this.composer, 'contentEditable'));
|
||||
this.editableNode = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithAttr(this.composer, 'contentEditable'));
|
||||
this.editableNode.innerHTML = "Testing!";
|
||||
const sel = document.getSelection()
|
||||
const textNode = this.editableNode.childNodes[0];
|
||||
sel.setBaseAndExtent(textNode, textNode.nodeValue.length, textNode, textNode.nodeValue.length);
|
||||
this.canvas = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(this.component, 'canvas'));
|
||||
this.canvas = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(this.component, 'canvas'));
|
||||
});
|
||||
|
||||
describe('when inserting emoji', ()=> {
|
||||
|
@ -54,7 +55,7 @@ describe('EmojiButtonPopover', ()=> {
|
|||
|
||||
describe('when searching for emoji', ()=> {
|
||||
it('should filter for matches', ()=> {
|
||||
this.searchNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithClass(this.component, 'search'))
|
||||
this.searchNode = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithClass(this.component, 'search'))
|
||||
const event = {
|
||||
target: {
|
||||
value: "heart",
|
||||
|
|
|
@ -120,7 +120,7 @@ class FixedPopover extends Component {
|
|||
|
||||
onBlur = (event)=> {
|
||||
const target = event.nativeEvent.relatedTarget;
|
||||
if (!target || (!React.findDOMNode(this).contains(target))) {
|
||||
if (!target || (!findDOMNode(this).contains(target))) {
|
||||
Actions.closePopover();
|
||||
}
|
||||
};
|
||||
|
@ -142,12 +142,14 @@ class FixedPopover extends Component {
|
|||
}
|
||||
};
|
||||
|
||||
static Directions = Directions;
|
||||
|
||||
focusElementWithTabIndex = ()=> {
|
||||
if (!this.mounted) {
|
||||
return;
|
||||
}
|
||||
// Automatically focus the element inside us with the lowest tab index
|
||||
const popoverNode = React.findDOMNode(this);
|
||||
const popoverNode = findDOMNode(this);
|
||||
|
||||
// _.sortBy ranks in ascending numerical order.
|
||||
const focusable = popoverNode.querySelectorAll("[tabIndex], input");
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import _ from 'underscore';
|
||||
import Message from '../models/message';
|
||||
import MessageUtils from '../models/message-utils';
|
||||
import MessageStore from './message-store';
|
||||
import DatabaseStore from './database-store';
|
||||
|
||||
|
|
Loading…
Reference in a new issue