Skip to content

Commit

Permalink
add missing semicolons to gui components (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
benfoley committed Oct 19, 2022
1 parent 118fbce commit 33095bb
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 38 deletions.
8 changes: 4 additions & 4 deletions elpis/gui/src/components/Dataset/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DatasetDashboard extends Component {
state = {
column: null,
reverse: false,
}
};

componentDidMount() {
this.props.datasetList();
Expand All @@ -34,21 +34,21 @@ class DatasetDashboard extends Component {
this.setState({reverse: ! this.state.reverse});
arraySort(data, clickedColumn, {reverse: ! this.state.reverse});
}
}
};

handleLoad = name => {
const {datasetLoad} = this.props;
const postData = {name: name};

datasetLoad(postData);
}
};

handleDelete = name => {
const {datasetDelete} = this.props;
const postData = {name: name};

datasetDelete(postData);
}
};

render() {
const {t, currentEngine, name, list} = this.props;
Expand Down
2 changes: 1 addition & 1 deletion elpis/gui/src/components/Dataset/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FileUpload extends Component {
formData.append("file", file);
});
this.props.datasetFiles(formData);
}
};

render() {
const {t, name} = this.props;
Expand Down
4 changes: 2 additions & 2 deletions elpis/gui/src/components/Dataset/Files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class DatasetFiles extends Component {

datasetPrepare(history);
history.push(urls.gui.dataset.prepare);
}
};

handleDeleteButton = (file) => {
var deleteData = new FormData();

deleteData.append("file", file);
this.props.datasetFilesDelete(deleteData);
}
};

createFilesList = (files) => files.map(file => (
<List.Item key={file}>
Expand Down
4 changes: 2 additions & 2 deletions elpis/gui/src/components/Dataset/Prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DatasetPrepare extends Component {
state = {
column: null,
reverse: false,
}
};

componentDidMount() {
}
Expand All @@ -33,7 +33,7 @@ class DatasetPrepare extends Component {
});
arraySort(data, clickedColumn, {reverse: ! this.state.reverse});
}
}
};

render() {
const {t, additionalTextFiles, currentEngine, name, status, wordlist} = this.props;
Expand Down
8 changes: 4 additions & 4 deletions elpis/gui/src/components/Model/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ModelDashboard extends Component {
state = {
column: null,
reverse: false,
}
};

componentDidMount() {
this.props.modelList();
Expand All @@ -36,7 +36,7 @@ class ModelDashboard extends Component {
this.setState({reverse: ! this.state.reverse});
arraySort(data, clickedColumn, {reverse: ! this.state.reverse});
}
}
};

handleLoad = values => {
const {modelLoad} = this.props;
Expand All @@ -45,14 +45,14 @@ class ModelDashboard extends Component {
const pronDictData = {name: values.pron_dict_name};

modelLoad(modelData, datasetData, pronDictData);
}
};

handleDelete = values => {
const {modelDelete} = this.props;
const modelData = {name: values.name};

modelDelete(modelData);
}
};

render() {
const {t, engine, engineHumanNames, name, list} = this.props;
Expand Down
2 changes: 1 addition & 1 deletion elpis/gui/src/components/Model/Train.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ModelTrain extends Component {

handleTensorBoard = () => {
window.open(window.location.protocol + "//" + window.location.hostname + ":6006", "_blank").focus();
}
};

onScroll = () => {};

Expand Down
8 changes: 4 additions & 4 deletions elpis/gui/src/components/PronDict/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PronDictDashboard extends Component {
state = {
column: null,
reverse: false,
}
};

componentDidMount() {
this.props.pronDictList();
Expand All @@ -35,22 +35,22 @@ class PronDictDashboard extends Component {
this.setState({reverse: ! this.state.reverse});
arraySort(data, clickedColumn, {reverse: ! this.state.reverse});
}
}
};

handleLoad = values => {
const {pronDictLoad} = this.props;
const postData = {name: values.name};
const datasetData = {name: values.dataset_name};

pronDictLoad(postData, datasetData);
}
};

handleDelete = values => {
const {pronDictDelete} = this.props;
const postData = {name: values.name};

pronDictDelete(postData);
}
};

render() {
const {t, currentEngine, name, list} = this.props;
Expand Down
2 changes: 1 addition & 1 deletion elpis/gui/src/components/PronDict/L2S.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PronDictL2S extends Component {

formData.append("file", acceptedFiles[0]);
pronDictL2S(formData);
}
};

render() {
const {t, currentEngine, l2s, name} = this.props;
Expand Down
8 changes: 4 additions & 4 deletions elpis/gui/src/components/PronDict/Lexicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ class PronDictLexicon extends Component {
const {lexicon} = this.props;

if (!lexicon) this.generateLexicon();
}
};

generateLexicon = () => {
this.props.pronDictBuildLexicon();
}
};

saveLexicon = () => {
const data = {lexicon: this.props.lexicon};

this.props.pronDictSaveLexicon(data);
}
};

handleChange = (event) => {
this.props.pronDictUpdateLexicon({lexicon: event.target.value});
}
};

render() {
const {t, currentEngine, lexicon, name} = this.props;
Expand Down
2 changes: 1 addition & 1 deletion elpis/gui/src/components/Shared/Branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class StepBranding extends Component {
reset = () => {
this.props._configReset();
window.location.href = "/";
}
};

render() {
const {t, dev_mode, currentEngine, engineHumanNames} = this.props;
Expand Down
6 changes: 3 additions & 3 deletions elpis/gui/src/components/Transcription/ChooseModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ChooseModel extends Component {
this.props._modelUploadFinished();
this.props.history.push(urls.gui.transcription.new);
}
}
};

componentDidMount() {
this.redirectOnUploadFinish();
Expand All @@ -47,15 +47,15 @@ class ChooseModel extends Component {

_modelLoad(modelData, datasetData, engineName, pronDictData);
history.push(urls.gui.transcription.new);
}
};

onDrop = (acceptedFiles) => {
var formData = new FormData();

formData.append("file", acceptedFiles[0]);
this.props._modelUpload(formData);
this.setState({uploadStatus: "started"});
}
};


render() {
Expand Down
22 changes: 11 additions & 11 deletions elpis/gui/src/components/Transcription/New.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class NewTranscription extends Component {
state = {
uploading: false,
show_confidence_opacity: true,
}
};

statusInterval = null
statusInterval = null;

componentDidMount() {
this.props.modelList();
}

triggerStatusCheck = () => {
this.statusInterval = setInterval(this.doStatusCheck, 1000);
}
};

doStatusCheck = () => {
const {status} = this.props;
Expand All @@ -46,36 +46,36 @@ class NewTranscription extends Component {
if (status === "transcribed") {
clearInterval(this.statusInterval);
}
}
};

handleTranscribe = () => {
// pass in the status check function
// so we can fire it in .then after the dispatch is done
this.props.transcriptionTranscribe(this.triggerStatusCheck);
}
};

handleDownloadText = () => {
const {filename, text} = this.props;
const file_basename = filename.split(".").slice(0, -1).join(".");
const text_file_name = file_basename + ".txt";

downloadjs(text, text_file_name, "text/txt");
}
};

handleDownloadElan = () => {
const {filename, elan} = this.props;
const file_basename = filename.split(".").slice(0, -1).join(".");

downloadjs(elan, file_basename + ".eaf", "text/xml");
}
};

onDrop = (acceptedFiles) => {
var formData = new FormData();

formData.append("file", acceptedFiles[0]);
this.props.transcriptionNew(formData);
this.setState({uploading: true});
}
};

handleSelectModel = (e, {value}) => {
const {list, modelLoad} = this.props;
Expand All @@ -86,11 +86,11 @@ class NewTranscription extends Component {
const pronDictData = {name: selectedModel[0].pron_dict_name};

modelLoad(modelData, datasetData, engineName, pronDictData);
}
};

handleOpacityToggle = (e, data) => {
this.setState({show_confidence_opacity: data.checked});
}
};

render = () => {
const {
Expand Down Expand Up @@ -253,7 +253,7 @@ class NewTranscription extends Component {
</Segment>
</div>
);
}
};
}

const mapStateToProps = state => {
Expand Down

0 comments on commit 33095bb

Please sign in to comment.