diff --git a/audino/frontend/package.json b/audino/frontend/package.json index c1c631d6..b769712e 100644 --- a/audino/frontend/package.json +++ b/audino/frontend/package.json @@ -66,7 +66,7 @@ "eslint-config-prettier": "^6.10.1", "eslint-plugin-import": "^2.25.4", "eslint-plugin-prettier": "^3.4.1", - "eslint-plugin-react": "^7.30.1", + "eslint-plugin-react": "^7.34.3", "prettier": "^2.7.1", "pretty-quick": "^2.0.1" }, diff --git a/audino/frontend/src/app.js b/audino/frontend/src/app.js index 23e184a9..17a3e2ba 100644 --- a/audino/frontend/src/app.js +++ b/audino/frontend/src/app.js @@ -17,6 +17,7 @@ import { Data, CreateUser } from './pages'; +import BackError from './pages/backError' import NavBar from './containers/navbar'; const history = createBrowserHistory(); @@ -149,6 +150,7 @@ class App extends React.Component { /> + @@ -163,7 +165,7 @@ class App extends React.Component { - + ); diff --git a/audino/frontend/src/components/annotate/labelButtons.js b/audino/frontend/src/components/annotate/labelButtons.js index ce8dfc24..6fa735ba 100644 --- a/audino/frontend/src/components/annotate/labelButtons.js +++ b/audino/frontend/src/components/annotate/labelButtons.js @@ -20,7 +20,7 @@ const LabelButton = props => { setIsNoAudioBtnClicked(true); const waveSurfer = state.wavesurfer; const result = await waveSurfer.addRegion({id:"no audio", start:0, end:waveSurfer.getDuration()}); - console.log("region added"); + console.log("region added"); console.log(annotate); const noAudioLabelKey = Object.keys(annotate.state.labels)[0]; @@ -32,6 +32,8 @@ const LabelButton = props => { console.log("no audio clicked"); handleAllSegmentSave(annotate); + //window.location.replace('/dashboard'); + // // TODO - enter a location //document.getElementsByClassName("next")[0].getElementsByTagName('button')[0].click(); } diff --git a/audino/frontend/src/components/annotate/toggleYesNo.js b/audino/frontend/src/components/annotate/toggleYesNo.js index 727f3a58..a18507fa 100644 --- a/audino/frontend/src/components/annotate/toggleYesNo.js +++ b/audino/frontend/src/components/annotate/toggleYesNo.js @@ -18,18 +18,18 @@ class ToggleYesNo extends React.Component { componentDidMount() {} - handleClick(type) { - let newState = null; - if (type === 'yes') newState = { yes: true }; - else newState = { yes: false }; - this.setState(newState); + handleClick() { + + const newState = !this.state.yes; + this.setState({ yes: newState }); + this.annotate.setState({ isMarkedForReviewLoading: true }); axios({ method: 'patch', url: this.dataUrl, data: { - is_marked_for_review: !newState.yes + is_marked_for_review: newState } }) .then(response => { @@ -53,16 +53,16 @@ class ToggleYesNo extends React.Component { render() { const { yes } = this.state; let msg = ': '; - if (yes) msg = ': Yes'; - else msg = ': No'; + if (yes) msg = 'Click Here When Confident.'; + else msg = 'Nevermind! I\'m Unsure.'; return (
diff --git a/audino/frontend/src/containers/navbar.js b/audino/frontend/src/containers/navbar.js index 314488cb..47008d60 100644 --- a/audino/frontend/src/containers/navbar.js +++ b/audino/frontend/src/containers/navbar.js @@ -33,7 +33,9 @@ class NavBar extends React.Component { const { store } = this.props; const isUserLoggedIn = store.get('isUserLoggedIn'); const isAdmin = store.get('isAdmin'); + const projectId = localStorage.getItem('projectId'); // Retrieve projectId from local storage + return (