-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity type #243
Entity type #243
Conversation
Working backend
Now it's possible to add synonyms of regex entities that will follow this behavior : if a synonym of a regex entity is matched, the corresponding slot.regexEntity.value is filled with the value of the entity (not the synonym) and the original with the original value which can be a synonym. |
Working pretty well for me. I am having some weird alignment and console errors, but I'm going to rebuild my Docker images tomorrow to see if the problem isn't on my side. @dcalvom would we want tests for the API side of things? I'm assuming yes. |
Well nothing on my side except the But I think that was here before. Maybe we should highlight multiple different occurrences when isList (and only the last one as this is the one added in last in the entities list and will override the other) is selected and loop over multiple different occurences on the backend side to allow matching several times different values of the same entities, let me know if this suits you and I could implement this.
|
…inal to the resolved regex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the import endpoint to accept the new type attribute in entities and run the unit tests npm run test
in the api folder
{
"statusCode": 400,
"error": "Bad Request",
"message": "child \"entities\" fails because [\"entities\" at position 0 fails because [\"type\" is not allowed]]",
"validation": {
"source": "payload",
"keys": [
"entities.0.type"
]
}
}
@@ -188,6 +195,12 @@ export class EntityPage extends React.PureComponent { // eslint-disable-line rea | |||
displayColorPicker, | |||
}; | |||
|
|||
let typeSelect = []; | |||
const defaultOptionType = { value: 'learned', text: 'learned', disabled: 'disabled' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the first letter of the value to a caps "Learned" and "Regex"
Also given that these values affect the table for examples, it would be nice to edit the tooltips for help to let the user understand the meaning of the values he is going to enter
The functionality works correctly! Nice job @BreadAndRoses95 there is just fix the small observations I did and we are good to merge. |
All right all tests passed and I included what I described before, have a look on the tooltip message, I do not think this is very clear but had no imagination to fill it properly ... |
Made regex entity not highlightabled in the user says rows. We may still need to color them automatically in the user says when someone add regex entity in the slot part. I've seen @dcalvom speaking of making an api endpoint to highlight entities in user says part, this could be a solution.
Plus, I think I should change entity creation page when regex is selected to only allow users to add a list of regexs (that will be saved inside the examples part of the entity object)? Maybe we could keep the synonyms to allow value and original regex as slots found?