Skip to content

Commit

Permalink
add: commits from another branch that was done (#197)
Browse files Browse the repository at this point in the history
* add: commits from another branch that was done

* fix: remove consoles

* fix(docu): two typos errors and two broken links

* refactor: reduction code with same functionality && area of the button bigger

* chore(deps): bump node-nlp from 3.4.0 to 3.6.0 (#200)

Bumps [node-nlp](https://github.com/axa-group/nlp.js) from 3.4.0 to 3.6.0.
- [Release notes](https://github.com/axa-group/nlp.js/releases)
- [Commits](https://github.com/axa-group/nlp.js/commits)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore(deps): bump aws-sdk from 2.513.0 to 2.517.0 (#201)

Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.513.0 to 2.517.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.513.0...v2.517.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore(deps-dev): bump eslint-plugin-jest from 22.15.0 to 22.15.2 (#195)

Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 22.15.0 to 22.15.2.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](jest-community/eslint-plugin-jest@v22.15.0...v22.15.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore(deps): bump @types/jest from 24.0.17 to 24.0.18 (#193)

Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 24.0.17 to 24.0.18.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore(deps-dev): bump @types/node from 12.7.1 to 12.7.2 (#185)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.7.1 to 12.7.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore(deps-dev): bump core-js from 3.2.0 to 3.2.1 (#179)

Bumps [core-js](https://github.com/zloirock/core-js) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](zloirock/core-js@v3.2.0...v3.2.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore(deps-dev): bump react-hot-loader from 4.12.10 to 4.12.11 (#176)

Bumps [react-hot-loader](https://github.com/gaearon/react-hot-loader) from 4.12.10 to 4.12.11.
- [Release notes](https://github.com/gaearon/react-hot-loader/releases)
- [Changelog](https://github.com/gaearon/react-hot-loader/blob/master/CHANGELOG.md)
- [Commits](gaearon/react-hot-loader@v4.12.10...v4.12.11)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Contentful/fix reply buttons (#149)

* fix(contentful): replies format was different than expected by botonic react

* chore(contentful): improvements in eslint config

* chore(core/react): improve typing for CoreBot and add for NodeApp

* chore(core/react) bump to 0.9.0-alpha.7

* chore(contentful): release 0.9.13 with sdk-capabilities

lint fixes

* chore(dynamo): release 0.9.11 with sdk-capabilities

* feature(contenful): 0.9.14 support keywords with only 1 stopword

* chore(contenful): prepare for using Spanish snowball stemmer

* chore(contenful): hola/hi added as stopword

* chore(contenful): 0.9.15 test search when 2 contents share the same keyword

* refactor: sendInput function refactorized for not repeating code

* feat: change variable name of the map

* feat: change persistent menu on render in dev-app

* fix: second parameter of map deleted

* add: commits from another branch that was done

* fix: remove consoles

* refactor: reduction code with same functionality && area of the button bigger

* fix: remove isRegex variable, never used

* fix: remove function that was created only for testing

* add: commits from another branch that was done

* fix: remove consoles

* refactor: reduction code with same functionality && area of the button bigger

* add: commits from another branch that was done

* fix: remove consoles

* add: commits from another branch that was done

* fix: remove consoles

* refactor: reduction code with same functionality && area of the button bigger

* add: commits from another branch that was done

* fix: remove consoles

* fix: remove isRegex variable, never used

* add: commits from another branch that was done

* add: commits from another branch that was done

* fix: remove consoles

* fix: remove consoles
  • Loading branch information
imOscarCrespo authored Aug 26, 2019
1 parent 73e2e4a commit 27c5ea9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 44 deletions.
1 change: 1 addition & 0 deletions packages/botonic-react/src/components/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const Button = props => {
else if (props.path) sendPayload(`__PATH_PAYLOAD__${props.path}`)
else if (props.payload) sendPayload(props.payload)
else if (props.url) window.open(props.url)
else if (props.onClick) props.onClick()
}

const renderBrowser = () => {
Expand Down
11 changes: 3 additions & 8 deletions packages/botonic-react/src/components/persistentMenu.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import React from 'react'
import { isBrowser } from '@botonic/core'
import { Message } from './message'
export const PersistentMenu = props => {
return (
<div
style={{
position: 'absolute',
width: '120px',
top: '288px',
backgroundColor: 'red',
textAlign: 'center',
left: '10px',
borderRadius: '20px'
width: '100%',
bottom: 0,
textAlign: 'center'
}}
>
{props.children}
Expand Down
62 changes: 26 additions & 36 deletions packages/botonic-react/src/webchat/webchat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { isDev, msgToBotonic } from '../utils'
import Logo from './botonic_react_logo100x100.png'
import EmojiPicker from 'emoji-picker-react'
import LogoMenu from './menuButton.svg'
import { Button } from '../components/button'

const getScriptBaseURL = () => {
let scriptBaseURL = document
Expand Down Expand Up @@ -172,6 +173,9 @@ export const Webchat = forwardRef((props, ref) => {
}
}
}
const closeMenu = () => {
setMenuIsOpened(false)
}

const sendInput = async input => {
let inputMessage = null
Expand Down Expand Up @@ -397,59 +401,44 @@ export const Webchat = forwardRef((props, ref) => {
<PersistentMenu>
{Object.values(props.persistentMenu).map((e, i) => {
return (
<p key={i} onClick={() => sendPayload(e.payload)}>
<Button payload={e.payload} key={i}>
{Object.values(e.label)}
</p>
</Button>
)
})}
<Button onClick={closeMenu}>Cancel</Button>
</PersistentMenu>
)}
{!webchatState.handoff &&
Object.keys(props.persistentMenu).length != 0 && (
<>
{!webchatState.handoff && (
<div
style={{
display: 'flex',
borderTop: '1px solid rgba(0, 0, 0, 0.4)'
}}
>
{Object.keys(props.persistentMenu).length != 0 && (
<div
style={{
display: 'flex',

borderTop: '1px solid rgba(0, 0, 0, 0.4)'
flex: 'none',
width: 50
}}
>
<div style={{ width: 50 }}>
<img
style={{
paddingTop: '14px',
paddingTop: '20px',
paddingBottom: '15px',
marginLeft: '18px',
marginRight: '8px'
marginRight: '8px',
cursor: 'pointer'
}}
src={LogoMenu}
onClick={() => handleMenu()}
/>
</div>
<Textarea
name='text'
minRows={2}
maxRows={4}
wrap='soft'
maxLength='1000'
placeholder={webchatState.theme.textPlaceholder}
autoFocus={location.hostname === 'localhost'}
inputRef={textArea}
onKeyDown={e => onKeyDown(e)}
style={{
display: 'flex',
padding: '8px 10px',
fontSize: 14,
border: 'none',
resize: 'none',
overflow: 'auto',
outline: 'none'
}}
/>
</div>
</>
)}
{!webchatState.handoff &&
Object.keys(props.persistentMenu).length === 0 && (
)}
<Textarea
name='text'
minRows={2}
Expand All @@ -462,16 +451,17 @@ export const Webchat = forwardRef((props, ref) => {
onKeyDown={e => onKeyDown(e)}
style={{
display: 'flex',
padding: '8px 10px',
paddingLeft: '10px',
fontSize: 14,
border: 'none',
resize: 'none',
overflow: 'auto',
outline: 'none',
borderTop: '1px solid rgba(0, 0, 0, 0.4)'
marginTop: '13px'
}}
/>
)}
</div>
)}
{webchatState.webview && (
<RequestContext.Provider value={webviewRequestContext}>
<WebviewContainer
Expand Down

0 comments on commit 27c5ea9

Please sign in to comment.