Skip to content

Commit

Permalink
Release 7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
il1tvinov committed Aug 4, 2020
1 parent 9061ea2 commit f381758
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 103 deletions.
1 change: 0 additions & 1 deletion chatbot/data/nlu.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
- report for [today](period) please
- [Today](period)
- [Yesterday](period)
- [Today](period)

## intent:out_of_scope
- please help with my ice cream it's dripping
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/common/store/configureStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {generalSettingsStore} from "app/common/store/settings/reducers";
import {virtualAssistantReducer} from "app/common/store/virtual-assistant/reducers";
import {createBrowserHistory, History} from "history";
import {RootStore} from "app/common/types/store.types";
import { settingsTrainingReducer } from 'app/modules/settings/fields/settings_training/store/reducer';

export const history = createBrowserHistory();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,15 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
this.setState({status});
}

<<<<<<< HEAD
editTableRowData = (index: number) => () => {
=======
editPosition = (index: number) => () => {
>>>>>>> [Settings][Filter] Refactoring
let {status} = this.state, dataEdit = {...this.state.settings[index]};

status[index] = FilterElementType.edited;

this.setState({status, dataEdit});
};

<<<<<<< HEAD
acceptTableRowEditing = (index: number) => () => {
=======
acceptPositionEditing = (index: number) => () => {
>>>>>>> [Settings][Filter] Refactoring
let {settings,status} = this.state;

settings[index]={...this.state.dataEdit};
Expand All @@ -129,42 +121,13 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
this.detectIsSettingsDefault();
}

<<<<<<< HEAD
setDefaultSettings = () => {
this.setState(this.getDefaultStateObject());
}

saveSettings = () => {
this.props.sendSettingsData(this.props.section, this.state.settings);
this.detectIsSettingsDefault(true);
=======
clearSettings = () => {
this.setState(this.getDefaultStateObject());
>>>>>>> [Settings][Filter] Refactoring
}

getDefaultStateObject = (): SettingsFilterState => ({
names: [...this.props.defaultSettings[this.props.section].names],
settings: [...this.props.defaultSettings[this.props.section].filter_settings].sort((firstItem: SettingsFilterData, secondItem: SettingsFilterData)=>firstItem.name.toLowerCase().localeCompare(secondItem.name.toLowerCase())),
status: this.props.defaultSettings[this.props.section].filter_settings.map((_:any,index:number)=>this.getTableRowParity(index)),
dataInput: {
name:"",
filtration_type:"",
},
dataEdit:{
name:"",
filtration_type:"",
},
isSettingsDefault: true,
})

getTableRowParity = (numb: number) => numb%2===1? FilterElementType.odd: FilterElementType.even;

detectIsSettingsDefault = (isSettingsDefault: boolean = false) => this.setState({isSettingsDefault});

isPositionAcceptButtonValid = (field: "dataInput" | "dataEdit") => {
let data: SettingsFilterData = this.state[field];
return !(data.name && data.filtration_type);
}

getDefaultStateObject = (): SettingsFilterState => ({
Expand All @@ -191,29 +154,6 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
return !(data.name && data.filtration_type);
}

getDefaultStateObject = (): SettingsFilterState => ({
settings: [...this.props.defaultSettings[this.props.section]],
status: this.props.defaultSettings[this.props.section].map((_:any,index:number)=>this.getTableRowParity(index)),
dataInput: {
name:"",
filtration_type:"",
},
dataEdit:{
name:"",
filtration_type:"",
},
isSettingsDefault: true,
})

getTableRowParity = (numb: number) => numb%2===1? FilterElementType.odd: FilterElementType.even;

detectIsSettingsDefault = (isSettingsDefault: boolean = false) => this.setState({isSettingsDefault});

isPositionAcceptButtonValid = (field: "dataInput" | "dataEdit") => {
let data: SettingsFilterData = this.state[field];
return !(data.name && data.filtration_type);
}

render(){
let excludeNames = this.state.settings.map(item=>item.name);

Expand All @@ -225,19 +165,12 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{

<div className="settings-filter-name">
<p className="settings-filter-header__title">Name</p>
<<<<<<< HEAD
<DropdownElement onChange={this.setFieldData("dataInput", "name")}
onClear={this.clearFieldData("dataInput", "name")}
style={{width:"90%"}}
value={this.state.dataInput.name}
dropDownValues={this.state.names}
excludeValues={excludeNames}/>
=======
<InputElement onChange={this.setFieldData("dataInput", "name")}
onClear={this.clearFieldData("dataInput", "name")}
style={{width:"90%"}}
value={this.state.dataInput.name}/>
>>>>>>> [Settings][Filter] Refactoring
</div>

<div className="settings-filter-type">
Expand All @@ -251,11 +184,7 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
writable={false}/>

<button className={cn("settings-filter-header__add-position", "settings-filter__button")}
<<<<<<< HEAD
onClick={this.addTableRow}
=======
onClick={this.addPosition}
>>>>>>> [Settings][Filter] Refactoring
disabled={this.isPositionAcceptButtonValid("dataInput")}>
<Icon size={IconSize.small} type={IconType.close}/>
</button>
Expand All @@ -271,7 +200,6 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
this.state.settings.map(({name,filtration_type},index)=>(
<div key={index}
className="settings-filter-main__section"
<<<<<<< HEAD
onMouseEnter={this.changeTableRowHoverStatus(index)}
onMouseLeave={this.changeTableRowHoverStatus(index)}>

Expand All @@ -282,16 +210,6 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
onChange={this.setFieldData("dataEdit", "name")}
dropDownValues={this.state.names}
excludeValues={excludeNames.filter(exName=>exName!==name)}/>
=======
onMouseEnter={this.changeHoverStatus(index)}
onMouseLeave={this.changeHoverStatus(index)}>

<div className={cn("settings-filter-name", "settings-filter-name_tabled")}>
<InputElement type={this.state.status[index]}
value={this.state.status[index]===FilterElementType.edited? this.state.dataEdit.name: name}
onClear={this.clearFieldData("dataEdit", "name")}
onChange={this.setFieldData("dataEdit", "name")}/>
>>>>>>> [Settings][Filter] Refactoring
</div>

<div className="settings-filter-type">
Expand All @@ -306,11 +224,7 @@ class SettingsFilter extends Component<Props, SettingsFilterState>{
{
this.state.status[index] === FilterElementType.edited &&
<button className={cn("settings-filter-type__accept-button", "settings-filter__button")}
<<<<<<< HEAD
onClick={this.acceptTableRowEditing(index)}
=======
onClick={this.acceptPositionEditing(index)}
>>>>>>> [Settings][Filter] Refactoring
disabled={this.isPositionAcceptButtonValid("dataEdit")}>
<Icon type={IconType.check} size={IconSize.normal}/>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ class SettingsTraining extends Component<Props, SettingsTrainingState>{
data.entities.splice(index,1);
this.setState({[keyField]:data});
}


setSourceFieldData = (name: string, isAllowedEntitiesEditing: boolean = false) => {
let {source_field} = this.state;
source_field.source_field=name;
this.setState({source_field, isAllowedEntitiesEditing});
this.detectIsSettingsDefault();
}
}

setMarkUpSource = (name: string) => {
this.setSourceFieldData(name);
Expand All @@ -70,18 +69,6 @@ class SettingsTraining extends Component<Props, SettingsTrainingState>{
}),1000);
}

setMarkUpSource = (name: string) => {
this.setSourceFieldData(name);
setTimeout(()=>this.props.sendTrainingData({source_field:name}, TrainingSubSection.source_field)
.then(isAllowedEntitiesEditing=>{
if(isAllowedEntitiesEditing) {
this.setState({isAllowedEntitiesEditing});
this.props.getTrainingDataSubField(TrainingSubSection.markup_entities).then(markup_entities=> markup_entities? this.setState({markup_entities}): this.setState({isAllowedEntitiesEditing:false}))
}

}),1000);
}

clearMarkUpSource = () => {
this.setSourceFieldData("");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AnalysisAndTrainingApi } from 'app/common/api/analysis-and-training.api';
import { TagCloud } from 'app/common/components/charts/tag-cloud/tag-cloud';
import CircleSpinner from 'app/common/components/circle-spinner/circle-spinner';
import Icon, { IconType } from 'app/common/components/icon/icon';
Expand Down

0 comments on commit f381758

Please sign in to comment.