Skip to content
Snippets Groups Projects
Unverified Commit 022bb083 authored by Chris Beer's avatar Chris Beer Committed by GitHub
Browse files

Merge pull request #33 from ProjectMirador/switch-ci

Switch to GitHub actions for CI
parents 6acdb9f1 43f9e6ee
No related branches found
No related tags found
No related merge requests found
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: npm install -g codecov
- run: npm install
- run: npm test
- run: codecov
sudo: false
language: node_js
node_js:
- 'lts/*'
before_install:
- npm install
- npm install codecov.io coveralls
after_success:
- cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
...@@ -93,36 +93,36 @@ class AnnotationCreation extends Component { ...@@ -93,36 +93,36 @@ class AnnotationCreation extends Component {
} }
/** */ /** */
openChooseColor(e) { handleCloseLineWeight(e) {
this.setState({ this.setState({
colorPopoverOpen: true, lineWeightPopoverOpen: false,
currentColorType: e.currentTarget.value, popoverLineWeightAnchorEl: null,
popoverAnchorEl: e.currentTarget,
}); });
} }
/** */ /** */
openChooseLineWeight(e) { handleLineWeightSelect(e) {
this.setState({ this.setState({
lineWeightPopoverOpen: true, lineWeightPopoverOpen: false,
popoverLineWeightAnchorEl: e.currentTarget, popoverLineWeightAnchorEl: null,
strokeWidth: e.currentTarget.value,
}); });
} }
/** */ /** */
handleLineWeightSelect(e) { openChooseColor(e) {
this.setState({ this.setState({
lineWeightPopoverOpen: false, colorPopoverOpen: true,
popoverLineWeightAnchorEl: null, currentColorType: e.currentTarget.value,
strokeWidth: e.currentTarget.value, popoverAnchorEl: e.currentTarget,
}); });
} }
/** */ /** */
handleCloseLineWeight(e) { openChooseLineWeight(e) {
this.setState({ this.setState({
lineWeightPopoverOpen: false, lineWeightPopoverOpen: true,
popoverLineWeightAnchorEl: null, popoverLineWeightAnchorEl: e.currentTarget,
}); });
} }
......
...@@ -22,21 +22,6 @@ class TextEditor extends Component { ...@@ -22,21 +22,6 @@ class TextEditor extends Component {
this.handleFormating = this.handleFormating.bind(this); this.handleFormating = this.handleFormating.bind(this);
} }
/** */
onChange(editorState) {
const { updateAnnotationBody } = this.props;
this.setState({ editorState });
if (updateAnnotationBody) {
const options = {
inlineStyles: {
BOLD: { element: 'b' },
ITALIC: { element: 'i' },
},
};
updateAnnotationBody(stateToHTML(editorState.getCurrentContent(), options).toString());
}
}
/** */ /** */
handleFormating(e, newFormat) { handleFormating(e, newFormat) {
const { editorState } = this.state; const { editorState } = this.state;
...@@ -53,6 +38,21 @@ class TextEditor extends Component { ...@@ -53,6 +38,21 @@ class TextEditor extends Component {
return 'not-handled'; return 'not-handled';
} }
/** */
onChange(editorState) {
const { updateAnnotationBody } = this.props;
this.setState({ editorState });
if (updateAnnotationBody) {
const options = {
inlineStyles: {
BOLD: { element: 'b' },
ITALIC: { element: 'i' },
},
};
updateAnnotationBody(stateToHTML(editorState.getCurrentContent(), options).toString());
}
}
/** */ /** */
render() { render() {
const { classes } = this.props; const { classes } = this.props;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment