diff --git a/src/actions/createActions.ts b/src/actions/createActions.ts index 13bacf88..99958e54 100644 --- a/src/actions/createActions.ts +++ b/src/actions/createActions.ts @@ -1,6 +1,6 @@ import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes, TrainDialog, LogDialog, Session, Teach } from 'blis-models'; +import { BlisAppBase, EntityBase, ActionBase, TrainDialog, LogDialog, Session, Teach } from 'blis-models'; export const createBLISApplicationAsync = (key : string, userId : string, application: BlisAppBase): ActionObject => { diff --git a/src/actions/deleteActions.ts b/src/actions/deleteActions.ts index 76b77212..4bc7ba11 100644 --- a/src/actions/deleteActions.ts +++ b/src/actions/deleteActions.ts @@ -1,9 +1,9 @@ import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, EntityBase, ActionBase, Session, Teach, TrainDialog, LogDialog} from 'blis-models' +import { BlisAppBase, EntityBase, ActionBase, Session, Teach, TrainDialog } from 'blis-models' export const deleteBLISApplicationAsync = (key: string, GUID: string, blisApp: BlisAppBase): ActionObject => { - + return { type: AT.DELETE_BLIS_APPLICATION_ASYNC, key: key, @@ -20,7 +20,7 @@ export const deleteBLISApplicationFulfilled = (blisAppGUID: string): ActionObjec } export const deleteEntityAsync = (key: string, GUID: string, entity: EntityBase, currentAppId: string): ActionObject => { - + return { type: AT.DELETE_ENTITY_ASYNC, key: key, @@ -50,7 +50,7 @@ export const deleteEntityFulfilled = (key: string, deletedEntityId: string, curr } export const deleteActionAsync = (key: string, GUID: string, action: ActionBase, currentAppId: string): ActionObject => { - + return { type: AT.DELETE_ACTION_ASYNC, key: key, @@ -68,7 +68,7 @@ export const deleteActionFulfilled = (actionGUID: string): ActionObject => { } export const deleteChatSessionAsync = (key: string, session: Session, currentAppId: string): ActionObject => { - + return { type: AT.DELETE_CHAT_SESSION_ASYNC, key: key, @@ -85,12 +85,12 @@ export const deleteChatSessionFulfilled = (sessionGUID: string): ActionObject => } export const deleteTeachSessionAsync = (key: string, teachSession: Teach, currentAppId: string, save: boolean): ActionObject => { - + return { type: AT.DELETE_TEACH_SESSION_ASYNC, key: key, teachSession: teachSession, - currentAppId: currentAppId, + currentAppId: currentAppId, save: save } } diff --git a/src/actions/displayActions.ts b/src/actions/displayActions.ts index 457f96dc..1eb097f9 100644 --- a/src/actions/displayActions.ts +++ b/src/actions/displayActions.ts @@ -1,8 +1,8 @@ import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { DisplayMode, TeachMode } from '../types/const' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes, TrainDialog, LogDialog, Session, Teach } from 'blis-models'; +import { DisplayMode } from '../types/const' +import { BlisAppBase, TrainDialog, LogDialog, Session, Teach } from 'blis-models'; export const setCurrentBLISApp = (key: string, app: BlisAppBase) : ActionObject => { diff --git a/src/actions/fetchActions.ts b/src/actions/fetchActions.ts index 9cb1330e..4e7d887a 100644 --- a/src/actions/fetchActions.ts +++ b/src/actions/fetchActions.ts @@ -1,10 +1,15 @@ import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, BotInfo, - EntityBase, EntityMetaData, EntityList, - ActionBase, ActionMetaData, ActionList, ActionTypes, - TrainDialog, LogDialog, - Session, Teach } from 'blis-models'; +import { + BlisAppBase, + BotInfo, + EntityBase, + ActionBase, + TrainDialog, + LogDialog, + Session, + Teach +} from 'blis-models'; export const fetchAllTrainDialogsAsync = (key: string, blisAppID: string): ActionObject => { return { @@ -51,12 +56,12 @@ export const fetchBotInfoFulfilled = (botInfo: BotInfo): ActionObject => { } } -export const fetchApplicationsAsync = (key: string, userId : string): ActionObject => { +export const fetchApplicationsAsync = (key: string, userId: string): ActionObject => { //needs a fulfilled version to handle response from Epic return { type: AT.FETCH_APPLICATIONS_ASYNC, key: key, - userId : userId + userId: userId } } diff --git a/src/actions/teachActions.ts b/src/actions/teachActions.ts index 4bfc25c8..ed35fed7 100644 --- a/src/actions/teachActions.ts +++ b/src/actions/teachActions.ts @@ -1,6 +1,6 @@ import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { UserInput, TrainExtractorStep, ExtractResponse, UIScoreInput, UIExtractResponse, UIScoreResponse, TrainScorerStep, TeachResponse } from 'blis-models' +import { UserInput, ExtractResponse, UIScoreInput, UIExtractResponse, UIScoreResponse, TrainScorerStep, TeachResponse } from 'blis-models' export const runExtractorAsync = (key: string, appId: string, teachId: string, userInput: UserInput) : ActionObject => { return { diff --git a/src/actions/updateActions.ts b/src/actions/updateActions.ts index 57309076..201eadb8 100644 --- a/src/actions/updateActions.ts +++ b/src/actions/updateActions.ts @@ -1,8 +1,7 @@ import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { DisplayMode } from '../types/const' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes, TrainDialog, LogDialog, Session, Teach } from 'blis-models'; +import { BlisAppBase, EntityBase, ActionBase, TrainDialog, LogDialog } from 'blis-models'; export const editBLISApplicationAsync = (key: string, application: BlisAppBase) : ActionObject => { diff --git a/src/containers/ActionResponseCreatorEditor.tsx b/src/containers/ActionResponseCreatorEditor.tsx index 6abbbb34..679ea2f3 100644 --- a/src/containers/ActionResponseCreatorEditor.tsx +++ b/src/containers/ActionResponseCreatorEditor.tsx @@ -5,9 +5,9 @@ import { editActionAsync } from '../actions/updateActions'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; -import { CommandButton, Dialog, DialogFooter, DialogType, ChoiceGroup, DefaultButton, Dropdown, TagPicker, Label, Checkbox, List } from 'office-ui-fabric-react'; +import { CommandButton, Dropdown, TagPicker, Label, Checkbox, List } from 'office-ui-fabric-react'; import { TextFieldPlaceholder } from './TextFieldPlaceholder'; -import { ActionBase, ActionMetaData, ActionTypes, EntityBase, EntityMetaData, EntitySuggestion } from 'blis-models' +import { ActionBase, ActionMetaData, ActionTypes, EntityBase, EntitySuggestion } from 'blis-models' import { State } from '../types'; import EntityCreatorEditor from './EntityCreatorEditor'; import AutocompleteListItem from '../components/AutocompleteListItem'; @@ -350,7 +350,7 @@ class ActionResponseCreatorEditor extends React.Component { } updateSpecialCharIndexesToDisregard(newPayload: string): SpecialIndex[] { let indexesToSet: SpecialIndex[] = []; - let requiredEntities = [...this.state.reqEntitiesVal]; + // let requiredEntities = [...this.state.reqEntitiesVal]; let updatedIndex = this.findUpdatedIndex(newPayload); if (newPayload.length > this.state.payloadVal.length) { //we added a letter. Find which index was updated. Increment every index in the current special indexes array >= to the updated index @@ -392,7 +392,7 @@ class ActionResponseCreatorEditor extends React.Component { } findWordFollowingSpecialCharacter(text: string): string { let word: string = ""; - let current: string = this.state.payloadVal; + // let current: string = this.state.payloadVal; for (let i = this.state.dropdownIndex + 1; i < text.length; i++) { if (text[i] !== " " && text[i] !== "") { word += text[i] @@ -545,7 +545,6 @@ class ActionResponseCreatorEditor extends React.Component { } } findIndexOfLastCharacterFollowingSpecialCharacterPreSpace(): number { - let word: string = ""; let text: string = this.state.payloadVal; let index: number = this.state.dropdownIndex; for (let i = this.state.dropdownIndex + 1; i < text.length + 1; i++) { @@ -602,7 +601,7 @@ class ActionResponseCreatorEditor extends React.Component { let names: string[] = filteredEntities.map((e: EntityBase) => { return e.entityName; }) - let ordered = names.sort(); + names.sort(); let options: TextObject[] = names.map((name: string) => { let ent: EntityBase = this.props.entities.find((e: EntityBase) => e.entityName == name); return { diff --git a/src/containers/ActionResponsesList.tsx b/src/containers/ActionResponsesList.tsx index fc385797..426954b5 100644 --- a/src/containers/ActionResponsesList.tsx +++ b/src/containers/ActionResponsesList.tsx @@ -6,7 +6,7 @@ import TrainingGroundArenaHeader from '../components/TrainingGroundArenaHeader'; import { deleteActionAsync } from '../actions/deleteActions' import { DetailsList, CommandButton, Link, CheckboxVisibility, List, IColumn, SearchBox } from 'office-ui-fabric-react'; import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; -import { ActionBase, ActionMetaData, EntityBase, EntityMetaData, ModelUtils } from 'blis-models' +import { ActionBase, EntityBase, ModelUtils } from 'blis-models' import ActionResponseCreatorEditor from './ActionResponseCreatorEditor'; import EntityTile from '../components/EntityTile'; import { State } from '../types' @@ -117,7 +117,7 @@ class ActionResponsesHomepage extends React.Component { }) } onColumnClick(event: any, column: any) { - let { sortedItems, columns } = this.state; + let { columns } = this.state; let isSortedDescending = column.isSortedDescending; // If we've sorted this column, flip it. diff --git a/src/containers/App.tsx b/src/containers/App.tsx index 6f94cf3f..984a3abc 100644 --- a/src/containers/App.tsx +++ b/src/containers/App.tsx @@ -1,14 +1,10 @@ import * as React from 'react'; -import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; +import { BrowserRouter as Router, Route } from 'react-router-dom'; import BLISAppsHomepage from '../containers/BLISAppsHomepage'; import Header from '../components/Header'; import Docs from '../components/otherPages/Docs'; import About from '../components/otherPages/About'; import Support from '../components/otherPages/Support'; -import { bindActionCreators } from 'redux'; -import { connect } from 'react-redux'; -import { State } from '../types' -import axios from 'axios'; export default class App extends React.Component { render() { diff --git a/src/containers/AppAdmin.tsx b/src/containers/AppAdmin.tsx index dc5c1cd2..98a21583 100644 --- a/src/containers/AppAdmin.tsx +++ b/src/containers/AppAdmin.tsx @@ -1,15 +1,14 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import { fetchAllActionsAsync, fetchAllEntitiesAsync, fetchApplicationsAsync, fetchAllTrainDialogsAsync } from '../actions/fetchActions'; +import { fetchApplicationsAsync } from '../actions/fetchActions'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import EntitiesList from './EntitiesList'; import TrainDialogsList from './TrainDialogsList'; import ActionResponsesList from './ActionResponsesList'; -import BLISAppsHomepage from './BLISAppsHomepage'; import AppDashboard from './AppDashboard'; import AppSettings from './AppSettings'; -import { Nav, INavLink, INavLinkGroup, Link } from 'office-ui-fabric-react'; +import { Nav, Link } from 'office-ui-fabric-react'; import { setDisplayMode } from '../actions/displayActions'; import { State } from '../types'; import LogDialogsList from './LogDialogsList'; diff --git a/src/containers/AppDashboard.tsx b/src/containers/AppDashboard.tsx index 30b07de8..da43ed85 100644 --- a/src/containers/AppDashboard.tsx +++ b/src/containers/AppDashboard.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import TrainingGroundArenaHeader from '../components/TrainingGroundArenaHeader' import { State } from '../types' diff --git a/src/containers/AppSettings.tsx b/src/containers/AppSettings.tsx index 102228c1..122ea733 100644 --- a/src/containers/AppSettings.tsx +++ b/src/containers/AppSettings.tsx @@ -5,7 +5,7 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import TrainingGroundArenaHeader from '../components/TrainingGroundArenaHeader' import { State } from '../types'; -import { CommandButton, ChoiceGroup, TextField, DefaultButton, Dropdown, Label, List } from 'office-ui-fabric-react'; +import { CommandButton, TextField, Dropdown, Label, List } from 'office-ui-fabric-react'; import { TextFieldPlaceholder } from './TextFieldPlaceholder'; import { BlisAppBase, BlisAppMetaData } from 'blis-models' diff --git a/src/containers/BLISAppCreator.tsx b/src/containers/BLISAppCreator.tsx index 000e8b1d..beaa5ded 100644 --- a/src/containers/BLISAppCreator.tsx +++ b/src/containers/BLISAppCreator.tsx @@ -5,7 +5,7 @@ import { createBLISApplicationAsync } from '../actions/createActions'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; -import { CommandButton, Dialog, DialogFooter, DialogType, ChoiceGroup, TextField, DefaultButton, Dropdown } from 'office-ui-fabric-react'; +import { CommandButton, Dropdown } from 'office-ui-fabric-react'; import { TextFieldPlaceholder } from './TextFieldPlaceholder'; import { setDisplayMode, emptyStateProperties } from '../actions/displayActions' import { fetchAllActionsAsync, fetchAllEntitiesAsync, fetchAllTrainDialogsAsync } from '../actions/fetchActions'; diff --git a/src/containers/BLISAppsList.tsx b/src/containers/BLISAppsList.tsx index bba849d1..60b934d3 100644 --- a/src/containers/BLISAppsList.tsx +++ b/src/containers/BLISAppsList.tsx @@ -6,13 +6,10 @@ import { deleteBLISApplicationAsync } from '../actions/deleteActions' import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import BLISAppCreator from './BLISAppCreator' -import AppAdmin from './AppAdmin'; -import { DetailsList, CommandButton, Link, CheckboxVisibility, IColumn } from 'office-ui-fabric-react'; +import { DetailsList, Link, CheckboxVisibility, IColumn } from 'office-ui-fabric-react'; import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; import { State } from '../types'; -import { BlisAppBase, BlisAppList, BlisAppMetaData } from 'blis-models' -import { DisplayMode } from '../types/const' - +import { BlisAppBase } from 'blis-models' let columns: IColumn[] = [ { @@ -103,7 +100,7 @@ class BLISAppsList extends React.Component { // this.props.fetchAllTeachSessions(this.props.user.key, appSelected.appId); } onColumnClick(event: any, column : any) { - let { sortedItems, columns } = this.state; + let { columns } = this.state; let isSortedDescending = column.isSortedDescending; // If we've sorted this column, flip it. diff --git a/src/containers/ChatSessionAdmin.tsx b/src/containers/ChatSessionAdmin.tsx index 0dc1f22e..fb191ec1 100644 --- a/src/containers/ChatSessionAdmin.tsx +++ b/src/containers/ChatSessionAdmin.tsx @@ -1,7 +1,5 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import { createBLISApplicationAsync } from '../actions/createActions'; -import { CommandButton } from 'office-ui-fabric-react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { State } from '../types' diff --git a/src/containers/ChatSessionWindow.tsx b/src/containers/ChatSessionWindow.tsx index 1762bfc3..d21ae941 100644 --- a/src/containers/ChatSessionWindow.tsx +++ b/src/containers/ChatSessionWindow.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import { Nav, INavLink, INavLinkGroup, Link, CommandButton } from 'office-ui-fabric-react'; +import { CommandButton } from 'office-ui-fabric-react'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; import { State } from '../types'; import { DisplayMode } from '../types/const'; @@ -11,7 +11,7 @@ import ChatSessionAdmin from './ChatSessionAdmin' import { Session } from 'blis-models' import { deleteChatSessionAsync } from '../actions/deleteActions' import { createChatSessionAsync } from '../actions/createActions' -import { setCurrentTrainDialog, setCurrentTeachSession, setDisplayMode } from '../actions/displayActions' +import { setDisplayMode } from '../actions/displayActions' class SessionWindow extends React.Component { diff --git a/src/containers/EntitiesList.tsx b/src/containers/EntitiesList.tsx index e80c9c33..437dbbee 100644 --- a/src/containers/EntitiesList.tsx +++ b/src/containers/EntitiesList.tsx @@ -6,9 +6,9 @@ import TrainingGroundArenaHeader from '../components/TrainingGroundArenaHeader'; import EntityCreatorEditor from './EntityCreatorEditor'; import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; import { deleteEntityAsync } from '../actions/deleteActions' -import { DetailsList, CommandButton, Link, CheckboxVisibility, IColumn, SearchBox } from 'office-ui-fabric-react'; +import { DetailsList, CommandButton, CheckboxVisibility, IColumn, SearchBox } from 'office-ui-fabric-react'; import { State } from '../types'; -import { EntityBase, EntityIdList, EntityList, EntityMetaData, ActionBase, ActionMetaData } from 'blis-models' +import { EntityBase, ActionBase } from 'blis-models' import { Modal } from 'office-ui-fabric-react/lib/Modal'; let columns: IColumn[] = [ @@ -106,7 +106,7 @@ class EntitiesList extends React.Component { } } onColumnClick(event: any, column : any) { - let { sortedItems, columns } = this.state; + let { columns } = this.state; let isSortedDescending = column.isSortedDescending; // If we've sorted this column, flip it. diff --git a/src/containers/EntityCreatorEditor.tsx b/src/containers/EntityCreatorEditor.tsx index 0b55e17b..9e2314e2 100644 --- a/src/containers/EntityCreatorEditor.tsx +++ b/src/containers/EntityCreatorEditor.tsx @@ -5,9 +5,9 @@ import { editEntityAsync } from '../actions/updateActions'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; -import { CommandButton, Dialog, DialogFooter, DialogType, ChoiceGroup, TextField, DefaultButton, Dropdown, DropdownMenuItemType, Checkbox } from 'office-ui-fabric-react'; +import { CommandButton, Dropdown, DropdownMenuItemType, Checkbox } from 'office-ui-fabric-react'; import { TextFieldPlaceholder } from './TextFieldPlaceholder'; -import { State, PreBuiltEntities, PreBuilts, LocalePreBuilts } from '../types'; +import { State, PreBuiltEntities, LocalePreBuilts } from '../types'; import { EntityBase, EntityMetaData } from 'blis-models' const initState = { diff --git a/src/containers/Error.tsx b/src/containers/Error.tsx index b7fe3c0a..20a90c91 100644 --- a/src/containers/Error.tsx +++ b/src/containers/Error.tsx @@ -1,16 +1,17 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import axios from 'axios'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; -import { CommandButton, Dialog, DialogFooter, DialogType, ChoiceGroup, TextField, DefaultButton, Dropdown } from 'office-ui-fabric-react'; +import { CommandButton } from 'office-ui-fabric-react'; import { clearErrorDisplay } from '../actions/displayActions' import { State } from '../types' -type CultureObject = { - CultureCode: string; - CultureName: string; -} + +// TODO: This was unused, but interested what was this used for? +// type CultureObject = { +// CultureCode: string; +// CultureName: string; +// } class UIError extends React.Component { constructor(p: any) { super(p); diff --git a/src/containers/ExtractorResponseEditor.tsx b/src/containers/ExtractorResponseEditor.tsx index d7ecc14e..e418786a 100644 --- a/src/containers/ExtractorResponseEditor.tsx +++ b/src/containers/ExtractorResponseEditor.tsx @@ -1,14 +1,13 @@ -import { editActionAsync } from '../actions/updateActions'; import * as React from 'react'; import { bindActionCreators } from 'redux'; +import { returntypeof } from 'react-redux-typescript'; import { connect } from 'react-redux'; -import { ExtractResponse, TrainExtractorStep, PredictedEntity, LabeledEntity, EntityBase } from 'blis-models' +import { ExtractResponse, PredictedEntity, EntityBase } from 'blis-models' import { updateExtractResponse, removeExtractResponse } from '../actions/teachActions'; -import { IconButton } from 'office-ui-fabric-react'; import { State } from '../types'; -import { TextField, Dropdown, Label, IDropdownOption, DropdownMenuItemType } from 'office-ui-fabric-react' +import { Dropdown, IDropdownOption, DropdownMenuItemType } from 'office-ui-fabric-react' -interface PassedProps { +export interface PassedProps { extractResponse: ExtractResponse; isPrimary: boolean; isValid: boolean; @@ -82,7 +81,7 @@ const styles = { } } -class ExtractorResponseEditor extends React.Component { +class ExtractorResponseEditor extends React.Component { constructor(p: any) { super(p); this.state = { @@ -613,7 +612,7 @@ class ExtractorResponseEditor extends React.Component { let allObjects = this.state.substringObjects; if (substringClicked.entityId === null) { - let currentlyClickedSubstrings = this.state.substringsClicked; + // let currentlyClickedSubstrings = this.state.substringsClicked; if (this.state.substringsClicked.length == 1) { let newClickedSubstringObject: SubstringObject = { ...substringClicked, entityName: entitySelected.entityName, entityId: entitySelected.entityId, dropdownStyle: styles.hidden, labelStyle: styles.normal } allObjects[indexOfClickedSubstring] = newClickedSubstringObject; @@ -667,7 +666,7 @@ class ExtractorResponseEditor extends React.Component { let names: string[] = this.props.entities.map((e: EntityBase) => { return e.entityName; }) - let ordered = names.sort(); + names.sort(); let options: IDropdownOption[] = names.map((name: string) => { let ent: EntityBase = this.props.entities.find((e: EntityBase) => e.entityName == name); return { @@ -760,4 +759,10 @@ const mapStateToProps = (state: State, ownProps: any) => { entities: state.entities } } -export default connect(mapStateToProps, mapDispatchToProps)(ExtractorResponseEditor as React.ComponentClass); \ No newline at end of file + +// Props types inferred from mapStateToProps & dispatchToProps +const stateProps = returntypeof(mapStateToProps); +const dispatchProps = returntypeof(mapDispatchToProps); +type Props = typeof stateProps & typeof dispatchProps & PassedProps; + +export default connect(mapStateToProps, mapDispatchToProps)(ExtractorResponseEditor); \ No newline at end of file diff --git a/src/containers/ExtractorTextVariationCreator.tsx b/src/containers/ExtractorTextVariationCreator.tsx index 8fd7b5d2..0dde895b 100644 --- a/src/containers/ExtractorTextVariationCreator.tsx +++ b/src/containers/ExtractorTextVariationCreator.tsx @@ -1,10 +1,8 @@ -import { editActionAsync } from '../actions/updateActions'; import * as React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { UserInput } from 'blis-models' import { State } from '../types'; -import { IconButton } from 'office-ui-fabric-react'; import { TextFieldPlaceholder } from './TextFieldPlaceholder'; import { returntypeof } from 'react-redux-typescript'; import { runExtractorAsync } from '../actions/teachActions'; diff --git a/src/containers/LogDialogAdmin.tsx b/src/containers/LogDialogAdmin.tsx index 290bad75..e966f14d 100644 --- a/src/containers/LogDialogAdmin.tsx +++ b/src/containers/LogDialogAdmin.tsx @@ -4,7 +4,7 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { State } from '../types' import ExtractorResponseEditor from './ExtractorResponseEditor'; -import { Activity, Message } from 'botframework-directlinejs' +import { Activity } from 'botframework-directlinejs' import { LogDialog, LogRound, LogScorerStep, ActionBase, EntityBase } from 'blis-models' class LogDialogAdmin extends React.Component { diff --git a/src/containers/LogDialogsList.tsx b/src/containers/LogDialogsList.tsx index 62ce1acc..78fccf59 100644 --- a/src/containers/LogDialogsList.tsx +++ b/src/containers/LogDialogsList.tsx @@ -3,12 +3,10 @@ import { returntypeof } from 'react-redux-typescript'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import TrainingGroundArenaHeader from '../components/TrainingGroundArenaHeader' -import { DetailsList, CommandButton, Link, CheckboxVisibility, IColumn, SearchBox } from 'office-ui-fabric-react'; -import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; +import { DetailsList, CommandButton, CheckboxVisibility, IColumn, SearchBox } from 'office-ui-fabric-react'; import { setDisplayMode } from '../actions/displayActions' -import { createLogDialog, createChatSessionAsync } from '../actions/createActions' import { State } from '../types' -import { LogDialog, Session } from 'blis-models' +import { LogDialog } from 'blis-models' import { DisplayMode } from '../types/const'; import LogDialogModal from './LogDialogModal'; @@ -86,7 +84,7 @@ class LogDialogsList extends React.Component { } renderLogDialogItems(): LogDialog[] { - let lcString = this.state.searchValue.toLowerCase(); + // let lcString = this.state.searchValue.toLowerCase(); let filteredLogDialogs = this.props.logDialogs.all.filter((logDialogItems: LogDialog) => { return true }) diff --git a/src/containers/SpinnerWindow.tsx b/src/containers/SpinnerWindow.tsx index 99595616..649d941c 100644 --- a/src/containers/SpinnerWindow.tsx +++ b/src/containers/SpinnerWindow.tsx @@ -1,7 +1,5 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import axios from 'axios'; -import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner'; diff --git a/src/containers/TeachSessionAdmin.tsx b/src/containers/TeachSessionAdmin.tsx index 858a8ed4..2bf5a409 100644 --- a/src/containers/TeachSessionAdmin.tsx +++ b/src/containers/TeachSessionAdmin.tsx @@ -1,17 +1,12 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import { createBLISApplicationAsync } from '../actions/createActions'; -import { CommandButton } from 'office-ui-fabric-react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { State } from '../types' -import { UserInput } from 'blis-models' -import { DisplayMode, TeachMode } from '../types/const'; +import { TeachMode } from '../types/const'; import TeachSessionScorer from './TeachSessionScorer'; import TeachSessionExtractor from './TeachSessionExtractor'; import TeachSessionMemory from './TeachSessionMemory'; -import { TextFieldPlaceholder } from './TextFieldPlaceholder'; - class TeachSessionAdmin extends React.Component { render() { diff --git a/src/containers/TeachSessionExtractor.tsx b/src/containers/TeachSessionExtractor.tsx index cda0b898..ad797e5d 100644 --- a/src/containers/TeachSessionExtractor.tsx +++ b/src/containers/TeachSessionExtractor.tsx @@ -3,7 +3,7 @@ import { returntypeof } from 'react-redux-typescript'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { State } from '../types' -import { UIScoreInput, ExtractResponse, TrainExtractorStep, PredictedEntity, LabeledEntity, TextVariation } from 'blis-models' +import { UIScoreInput, ExtractResponse, TrainExtractorStep, TextVariation } from 'blis-models' import { runScorerAsync } from '../actions/teachActions'; import { CommandButton } from 'office-ui-fabric-react'; import ExtractorTextVariationCreator from './ExtractorTextVariationCreator'; @@ -12,7 +12,7 @@ import EntityCreatorEditor from './EntityCreatorEditor'; import { TeachMode } from '../types/const' import PopUpMessage from '../components/PopUpMessage'; -class TeachSessionExtractor extends React.Component { +class TeachSessionExtractor extends React.Component { constructor(p: any) { super(p) this.state = { diff --git a/src/containers/TeachSessionMemory.tsx b/src/containers/TeachSessionMemory.tsx index b721f5f2..a8672009 100644 --- a/src/containers/TeachSessionMemory.tsx +++ b/src/containers/TeachSessionMemory.tsx @@ -43,7 +43,7 @@ class TeachSessionMemory extends React.Component { } } onColumnClick(event: any, column : any) { - let { sortedItems, columns } = this.state; + let { columns } = this.state; let isSortedDescending = column.isSortedDescending; // If we've sorted this column, flip it. diff --git a/src/containers/TeachSessionScorer.tsx b/src/containers/TeachSessionScorer.tsx index 0c04c5a8..bab49afb 100644 --- a/src/containers/TeachSessionScorer.tsx +++ b/src/containers/TeachSessionScorer.tsx @@ -2,9 +2,9 @@ import * as React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { returntypeof } from 'react-redux-typescript'; -import { ActionTypes, ModelUtils } from 'blis-models'; +import { ModelUtils } from 'blis-models'; import { State } from '../types' -import { TrainScorerStep, ScoredBase, ActionBase, EntityBase, Memory, ScoreInput, ScoredAction, UnscoredAction, ScoreReason } from 'blis-models'; +import { TrainScorerStep, ScoredBase, ActionBase, EntityBase, Memory, ScoredAction, UnscoredAction, ScoreReason } from 'blis-models'; import { postScorerFeedbackAsync, toggleAutoTeach } from '../actions/teachActions' import { CommandButton } from 'office-ui-fabric-react'; import { TeachMode } from '../types/const' @@ -118,7 +118,7 @@ class TeachSessionScorer extends React.Component { }) } onColumnClick(event: any, column : any) { - let { sortedItems, columns } = this.state; + let { columns } = this.state; let isSortedDescending = column.isSortedDescending; // If we've sorted this column, flip it. @@ -159,7 +159,6 @@ class TeachSessionScorer extends React.Component { } handleActionSelection(actionId : string) { - let labelAction = actionId; let scoredAction = this.props.teachSession.scoreResponse.scoredActions.filter((a: ScoredAction) => a.actionId == actionId)[0]; if (!scoredAction) { let unscoredAction = this.props.teachSession.scoreResponse.unscoredActions.filter((a: UnscoredAction) => a.actionId == actionId)[0]; @@ -234,7 +233,6 @@ class TeachSessionScorer extends React.Component { } for (let entityId of action.negativeEntities) { let found = this.entityInMemory(entityId); - let key = `${actionId}_${found.name}` if (found.match) { return ScoreReason.NotAvailable; } diff --git a/src/containers/TeachSessionWindow.tsx b/src/containers/TeachSessionWindow.tsx index d418baed..8cfbd1be 100644 --- a/src/containers/TeachSessionWindow.tsx +++ b/src/containers/TeachSessionWindow.tsx @@ -3,7 +3,7 @@ import { returntypeof } from 'react-redux-typescript'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; -import { Nav, INavLink, INavLinkGroup, Link, CommandButton, Checkbox } from 'office-ui-fabric-react'; +import { CommandButton, Checkbox } from 'office-ui-fabric-react'; import { State } from '../types'; import { DisplayMode, TeachMode } from '../types/const'; import Webchat from './Webchat' @@ -11,8 +11,8 @@ import TeachSessionAdmin from './TeachSessionAdmin' import { Teach } from 'blis-models' import { deleteTeachSessionAsync } from '../actions/deleteActions' import { toggleAutoTeach } from '../actions/teachActions' -import { createTrainDialog, createTeachSessionAsync } from '../actions/createActions' -import { setCurrentTrainDialog, setCurrentTeachSession, setDisplayMode } from '../actions/displayActions' +import { createTeachSessionAsync } from '../actions/createActions' +import { setDisplayMode } from '../actions/displayActions' import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; class TeachWindow extends React.Component { diff --git a/src/containers/TrainDialogAdmin.tsx b/src/containers/TrainDialogAdmin.tsx index 8674f129..7cf337e8 100644 --- a/src/containers/TrainDialogAdmin.tsx +++ b/src/containers/TrainDialogAdmin.tsx @@ -1,16 +1,9 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import { createBLISApplicationAsync } from '../actions/createActions'; -import { CommandButton } from 'office-ui-fabric-react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { State } from '../types' -import { UserInput, ActionBase, TrainScorerStep, EntityBase } from 'blis-models' -import { DisplayMode, TeachMode } from '../types/const'; -import TeachSessionScorer from './TeachSessionScorer'; -import TeachSessionExtractor from './TeachSessionExtractor'; -import TeachSessionMemory from './TeachSessionMemory'; -import { TextFieldPlaceholder } from './TextFieldPlaceholder'; +import { ActionBase, TrainScorerStep, EntityBase } from 'blis-models' import ExtractorResponseEditor from './ExtractorResponseEditor'; class TrainDialogAdmin extends React.Component { diff --git a/src/containers/TrainDialogWindow.tsx b/src/containers/TrainDialogWindow.tsx index 96efa71e..30c734d4 100644 --- a/src/containers/TrainDialogWindow.tsx +++ b/src/containers/TrainDialogWindow.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import { Nav, INavLink, INavLinkGroup, Link, CommandButton } from 'office-ui-fabric-react'; +import { CommandButton } from 'office-ui-fabric-react'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; import { State } from '../types'; import { DisplayMode } from '../types/const'; @@ -12,7 +12,7 @@ import { Session, ActionBase } from 'blis-models' import { deleteChatSessionAsync, deleteTrainDialogAsync } from '../actions/deleteActions' import { createChatSessionAsync } from '../actions/createActions' import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; -import { setCurrentTrainDialog, setCurrentTeachSession, setDisplayMode } from '../actions/displayActions' +import { setDisplayMode } from '../actions/displayActions' import { Activity } from 'botframework-directlinejs'; diff --git a/src/containers/TrainDialogsList.tsx b/src/containers/TrainDialogsList.tsx index d4f521d9..c0544685 100644 --- a/src/containers/TrainDialogsList.tsx +++ b/src/containers/TrainDialogsList.tsx @@ -3,13 +3,12 @@ import { returntypeof } from 'react-redux-typescript'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import TrainingGroundArenaHeader from '../components/TrainingGroundArenaHeader' -import { DetailsList, CommandButton, Link, CheckboxVisibility, IColumn, SearchBox } from 'office-ui-fabric-react'; -import ConfirmDeleteModal from '../components/ConfirmDeleteModal'; +import { DetailsList, CommandButton, CheckboxVisibility, IColumn, SearchBox } from 'office-ui-fabric-react'; import { setDisplayMode, setCurrentTrainDialog, setCurrentTeachSession } from '../actions/displayActions' -import { createTrainDialog, createTeachSessionAsync } from '../actions/createActions' +import { createTrainDialog } from '../actions/createActions' import { fetchAllTrainDialogsAsync } from '../actions/fetchActions'; import { State } from '../types' -import { TrainDialog, Teach } from 'blis-models' +import { TrainDialog } from 'blis-models' import { DisplayMode } from '../types/const'; let columns: IColumn[] = [ @@ -93,7 +92,6 @@ class TrainDialogsList extends React.Component { } } renderItemColumn(item?: any, index?: number, column?: IColumn) { - let self = this; let fieldContent = item[column.fieldName]; switch (column.key) { case 'firstInput': @@ -122,7 +120,7 @@ class TrainDialogsList extends React.Component { }) } renderTrainDialogItems(): TrainDialog[] { - let lcString = this.state.searchValue.toLowerCase(); + // let lcString = this.state.searchValue.toLowerCase(); let filteredTrainDialogs = this.props.trainDialogs.all.filter((t: TrainDialog) => { return true }) diff --git a/src/containers/UserLogin.tsx b/src/containers/UserLogin.tsx index a8e14f10..47e53358 100644 --- a/src/containers/UserLogin.tsx +++ b/src/containers/UserLogin.tsx @@ -1,20 +1,18 @@ import * as React from 'react'; import { returntypeof } from 'react-redux-typescript'; -import axios from 'axios'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { Modal } from 'office-ui-fabric-react/lib/Modal'; -import { CommandButton, Dialog, DialogFooter, DialogType, ChoiceGroup, TextField, DefaultButton, Dropdown } from 'office-ui-fabric-react'; +import { CommandButton } from 'office-ui-fabric-react'; import { TextFieldPlaceholder } from './TextFieldPlaceholder'; import { setUser, logout, setLoginDisplay } from '../actions/displayActions' -import { BlisAppBase, BlisAppMetaData } from 'blis-models' -import { developmentSubKeyLUIS } from '../secrets' import { State } from '../types'; -type CultureObject = { - CultureCode: string; - CultureName: string; -} +// type CultureObject = { +// CultureCode: string; +// CultureName: string; +// } + class UserLogin extends React.Component { constructor(p: any) { super(p); diff --git a/src/containers/Webchat.tsx b/src/containers/Webchat.tsx index 5fa18f77..892730c2 100644 --- a/src/containers/Webchat.tsx +++ b/src/containers/Webchat.tsx @@ -3,8 +3,7 @@ import { returntypeof } from 'react-redux-typescript'; import { toggleTrainDialog, addMessageToTeachConversationStack, addMessageToChatConversationStack } from '../actions/displayActions'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import { State, TrainDialogState } from '../types'; -import { generateGUID } from '../util'; +import { State } from '../types'; import * as BotChat from 'blis-webchat' import { Chat } from 'blis-webchat' import { UserInput } from 'blis-models' diff --git a/src/epics/apiHelpers.ts b/src/epics/apiHelpers.ts index cc678a20..8eaee83b 100644 --- a/src/epics/apiHelpers.ts +++ b/src/epics/apiHelpers.ts @@ -1,14 +1,15 @@ import 'rxjs' import axios, { AxiosResponse, AxiosRequestConfig } from 'axios' import { - BlisAppBase, BlisAppMetaData, BlisAppList, - EntityBase, EntityMetaData, EntityList, - ActionBase, ActionMetaData, ActionList, ActionTypes, + BlisAppBase, + EntityBase, + ActionBase, UserInput, - TrainDialog, LogDialog, - TrainExtractorStep, ExtractResponse, TrainScorerStep, - Session, Teach, - UIExtractResponse, UIScoreResponse, UIScoreInput + TrainDialog, + TrainScorerStep, + Session, + Teach, + UIScoreInput } from 'blis-models' import * as Rx from 'rxjs'; import { Observable, Observer } from 'rxjs' @@ -299,7 +300,9 @@ const makeRoute = (key: string, actionRoute : string, qstring? : string) => /** START SESSION : Creates a new session and a corresponding logDialog */ export const createChatSession = (key: string, session: Session, appId: string): Observable => { let addSessionRoute: string = makeRoute(key, `app/${appId}/session`); - let configWithBody = {...config, body: session} + + // TODO: It seems like this should be used instead of default config since it has the session object in the body, but yet the API works? + // let configWithBody = {...config, body: session} return Rx.Observable.create((obs : Rx.Observer) => axios.post(addSessionRoute, config).then(response => { let newSessionId = response.data.sessionId; obs.next(createChatSessionFulfilled(session, newSessionId)); @@ -347,7 +350,9 @@ const makeRoute = (key: string, actionRoute : string, qstring? : string) => /** START SESSION : Creates a new session and a corresponding logDialog */ export const createTeachSession = (key: string, teachSession: Teach, appId: string): Observable => { let addTeachRoute: string = makeRoute(key, `app/${appId}/teach`); - let configWithBody = {...config, body: teachSession} + + // TODO: It seems like this should be used instead of default config since it has the session object in the body, but yet the API works? + // let configWithBody = {...config, body: teachSession} return Rx.Observable.create((obs : Rx.Observer) => axios.post(addTeachRoute, config).then(response => { let newTeachSessionId = response.data.teachId; obs.next(createTeachSessionFulfilled(teachSession, newTeachSessionId)); diff --git a/src/epics/createEpics.ts b/src/epics/createEpics.ts index 55a6003d..40394437 100644 --- a/src/epics/createEpics.ts +++ b/src/epics/createEpics.ts @@ -3,10 +3,7 @@ import * as Rx from 'rxjs'; import { ActionsObservable, Epic } from 'redux-observable' import { State, ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; import { createBlisApp, createBlisAction, createBlisEntity, createChatSession, createTeachSession } from "./apiHelpers"; -import { createApplicationFulfilled, createPositiveEntityFulfilled, createNegativeEntityFulfilled } from '../actions/createActions' -import { setErrorDisplay } from '../actions/displayActions' export const createNewApplicationEpic: Epic = (action$: ActionsObservable): Rx.Observable => { return action$.ofType(AT.CREATE_BLIS_APPLICATION_ASYNC) diff --git a/src/epics/deleteEpics.ts b/src/epics/deleteEpics.ts index 79742c24..fcdd7750 100644 --- a/src/epics/deleteEpics.ts +++ b/src/epics/deleteEpics.ts @@ -3,7 +3,6 @@ import * as Rx from 'rxjs'; import { ActionsObservable, Epic } from 'redux-observable' import { State, ActionObject, DeleteLogDialogAsyncAction } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; import { deleteBlisApp, deleteBlisEntity, deleteBlisAction, deleteChatSession, deleteTeachSession, deleteTrainDialog, deleteLogDialog } from "./apiHelpers"; export const deleteApplicationEpic: Epic = (action$: ActionsObservable): Rx.Observable => { diff --git a/src/epics/fetchEpics.ts b/src/epics/fetchEpics.ts index 8b8baa5f..05fe3eda 100644 --- a/src/epics/fetchEpics.ts +++ b/src/epics/fetchEpics.ts @@ -3,10 +3,7 @@ import * as Rx from 'rxjs'; import { ActionsObservable, Epic } from 'redux-observable' import { State, ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; import { getBotInfo, getAllBlisApps, getAllEntitiesForBlisApp, getAllActionsForBlisApp, getAllSessionsForBlisApp, getAllTeachSessionsForBlisApp, getAllTrainDialogsForBlisApp, getAllLogDialogsForBlisApp } from "./apiHelpers"; -import { fetchApplicationsFulfilled, fetchAllEntitiesFulfilled, fetchAllActionsFulfilled } from '../actions/fetchActions' -import { setErrorDisplay } from '../actions/displayActions' export const fetchBotInfoEpic: Epic = (action$: ActionsObservable): Rx.Observable => { return action$.ofType(AT.FETCH_BOTINFO_ASYNC) diff --git a/src/epics/root.ts b/src/epics/root.ts index d84d7d32..623f4be5 100644 --- a/src/epics/root.ts +++ b/src/epics/root.ts @@ -1,6 +1,5 @@ import 'rxjs'; -import * as Rx from 'rxjs'; -import { combineEpics, ActionsObservable, Epic } from 'redux-observable' +import { combineEpics, Epic } from 'redux-observable' import { State, ActionObject } from '../types' import { fetchApplicationsEpic, fetchBotInfoEpic, fetchEntitiesEpic, fetchActionsEpic, fetchChatSessionsEpic, fetchTeachSessionsEpic, fetchTrainDialogsEpic, fetchLogDialogsEpic } from './fetchEpics' import { createNewApplicationEpic, createNewEntityEpic, createNewActionEpic, createNegativeEntity, createNewChatSessionEpic, createNewTeachSessionEpic } from './createEpics' @@ -8,7 +7,7 @@ import { deleteActionEpic, deleteApplicationEpic, deleteEntityEpic, deleteTrainD import { editActionEpic, editApplicationEpic, editEntityEpic, setBlisApplicationEpic } from './updateEpics' import { runExtractorEpic, runScorerEpic, scorerFeedbackEpic, postScoreFeedbackFulfilledWaitEpic } from './teachEpics' -const rootEpic = combineEpics( +const rootEpic: Epic = combineEpics( fetchApplicationsEpic, fetchBotInfoEpic, fetchEntitiesEpic, diff --git a/src/epics/teachEpics.ts b/src/epics/teachEpics.ts index 8d2fb8ef..8375c2c4 100644 --- a/src/epics/teachEpics.ts +++ b/src/epics/teachEpics.ts @@ -3,7 +3,6 @@ import * as Rx from 'rxjs'; import { ActionsObservable, Epic } from 'redux-observable' import { State, ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { UserInput, TrainExtractorStep, ExtractResponse } from 'blis-models'; import { putExtract, putScore, postScore } from "./apiHelpers"; export const runExtractorEpic: Epic = (action$: ActionsObservable): Rx.Observable => { diff --git a/src/epics/updateEpics.ts b/src/epics/updateEpics.ts index 03ae5fbb..0c6c1020 100644 --- a/src/epics/updateEpics.ts +++ b/src/epics/updateEpics.ts @@ -3,7 +3,6 @@ import * as Rx from 'rxjs'; import { ActionsObservable, Epic } from 'redux-observable' import { State, ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; import { editBlisAction, editBlisApp, editBlisEntity, setBlisApp } from "./apiHelpers"; export const editApplicationEpic: Epic = (action$: ActionsObservable): Rx.Observable => { diff --git a/src/reducers/actionsReducer.ts b/src/reducers/actionsReducer.ts index 6463120b..eeeec594 100644 --- a/src/reducers/actionsReducer.ts +++ b/src/reducers/actionsReducer.ts @@ -1,7 +1,6 @@ import { ActionObject } from '../types' import { ActionState } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; import { Reducer } from 'redux' const initialState: ActionState = []; diff --git a/src/reducers/appsReducer.ts b/src/reducers/appsReducer.ts index 301adf5e..317714e6 100644 --- a/src/reducers/appsReducer.ts +++ b/src/reducers/appsReducer.ts @@ -1,7 +1,6 @@ import { AppState } from '../types' import { ActionObject } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; import { Reducer } from 'redux' const initialState: AppState = { diff --git a/src/reducers/botReducer.ts b/src/reducers/botReducer.ts index 623ccd80..7701c73f 100644 --- a/src/reducers/botReducer.ts +++ b/src/reducers/botReducer.ts @@ -1,7 +1,6 @@ import { BotState } from '../types' import { AT } from '../types/ActionTypes' import { ActionObject } from '../types' -import { BotInfo } from 'blis-models'; import { Reducer } from 'redux' const initialState: BotState = { diff --git a/src/reducers/entitiesReducer.ts b/src/reducers/entitiesReducer.ts index fcbb975f..04b5d613 100644 --- a/src/reducers/entitiesReducer.ts +++ b/src/reducers/entitiesReducer.ts @@ -1,7 +1,7 @@ import { ActionObject} from '../types' import { EntityState } from '../types' import { AT } from '../types/ActionTypes' -import { BlisAppBase, BlisAppMetaData, BlisAppList, EntityBase, EntityMetaData, EntityList, ActionBase, ActionMetaData, ActionList, ActionTypes } from 'blis-models'; +import { EntityBase } from 'blis-models'; import { Reducer } from 'redux' const initialState: EntityState = []; diff --git a/src/reducers/logDialogsReducer.ts b/src/reducers/logDialogsReducer.ts index f7f00333..2537d319 100644 --- a/src/reducers/logDialogsReducer.ts +++ b/src/reducers/logDialogsReducer.ts @@ -1,7 +1,6 @@ import { ActionObject } from '../types' import { LogDialogState } from '../types' import { AT } from '../types/ActionTypes' -import { LogDialog } from 'blis-models' import { Reducer } from 'redux' const initialState: LogDialogState = { diff --git a/src/reducers/root.ts b/src/reducers/root.ts index 671e79d9..fcc80494 100644 --- a/src/reducers/root.ts +++ b/src/reducers/root.ts @@ -12,7 +12,7 @@ import teachSessionReducer from './teachSessionReducer'; import chatSessionReducer from './chatSessionReducer'; import { State } from '../types'; -const rootReducer = combineReducers({ +const rootReducer: Reducer = combineReducers({ user: userReducer, apps: appsReducer, bot: botReducer, diff --git a/src/reducers/teachSessionReducer.ts b/src/reducers/teachSessionReducer.ts index dd2c207c..14652739 100644 --- a/src/reducers/teachSessionReducer.ts +++ b/src/reducers/teachSessionReducer.ts @@ -18,10 +18,6 @@ const initialState: TeachSessionState = { autoTeach: false }; -const newTeachState = { - -} - const teachSessionReducer: Reducer = (state = initialState, action: ActionObject) => { switch (action.type) { case AT.LOGOUT: diff --git a/src/reducers/trainDialogsReducer.ts b/src/reducers/trainDialogsReducer.ts index cad8ff64..330c16a9 100644 --- a/src/reducers/trainDialogsReducer.ts +++ b/src/reducers/trainDialogsReducer.ts @@ -1,7 +1,6 @@ import { ActionObject } from '../types' import { TrainDialogState } from '../types' import { AT } from '../types/ActionTypes' -import { TrainDialog } from 'blis-models' import { Reducer } from 'redux' import { TeachMode } from '../types/const' diff --git a/src/reduxStore.ts b/src/reduxStore.ts index c3788b3a..a5118cc8 100644 --- a/src/reduxStore.ts +++ b/src/reduxStore.ts @@ -4,7 +4,7 @@ import { State } from './types' import rootEpic from './epics/root'; import rootReducer from './reducers/root'; -export const createReduxStore = () => +export const createReduxStore = (): Store => createStore(rootReducer, applyMiddleware(createEpicMiddleware(rootEpic)) ); \ No newline at end of file diff --git a/src/types/ActionObject.ts b/src/types/ActionObject.ts index b68e4e87..f4b09af4 100644 --- a/src/types/ActionObject.ts +++ b/src/types/ActionObject.ts @@ -1,10 +1,11 @@ -import { BlisAppBase, BlisAppMetaData, BlisAppList, BotInfo, - EntityBase, EntityMetaData, EntityList, - ActionBase, ActionMetaData, ActionList, ActionTypes, +import { BlisAppBase, + BotInfo, + EntityBase, + ActionBase, TrainDialog, LogDialog, Session, Teach, - UserInput, TrainExtractorStep, ExtractResponse, UIExtractResponse, TrainScorerStep, + UserInput, ExtractResponse, UIExtractResponse, TrainScorerStep, TeachResponse, UIScoreInput, UIScoreResponse } from 'blis-models' -import { DisplayMode, TeachMode } from '../types/const' +import { DisplayMode } from '../types/const' import { AT } from '../types/ActionTypes' export type UpdateAction = { diff --git a/src/types/StateTypes.ts b/src/types/StateTypes.ts index a54f1dd5..22c189bd 100644 --- a/src/types/StateTypes.ts +++ b/src/types/StateTypes.ts @@ -1,6 +1,7 @@ -import { BlisAppBase, BlisAppMetaData, BlisAppList, BotInfo, - EntityBase, EntityMetaData, EntityList, - ActionBase, ActionMetaData, ActionList, ActionTypes, +import { BlisAppBase, + BotInfo, + EntityBase, + ActionBase, TrainDialog, LogDialog, Teach, Session, Memory, UIScoreInput, ScoreInput, ExtractResponse, ScoreResponse } from 'blis-models'; import { DisplayMode, TeachMode } from '../types/const' diff --git a/tsconfig.json b/tsconfig.json index c06224be..97e6b198 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,8 @@ "module": "commonjs", "outDir": "./dist/", "target": "es5", - "sourceMap": true + "sourceMap": true, + "noUnusedLocals": true }, "files": [ "src/index.tsx"