Skip to content
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

Srravich/bugfix/1929 attachment #2068

Merged
merged 4 commits into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

:export { bubbleContentColor: var(--bubble-text-color); }

.chat {
background-color: white;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This is a generated file. Changes are likely to result in being overwritten
export const bubbleContentColor: string;
export const chat: string;
export const disconnected: string;
export const chatActivity: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ import webChatStyleOptions from './webChatTheme';
import { ChatContainer } from './chatContainer';
import { ChatProps, Chat } from './chat';

jest.mock('./chat.scss', () => ({
get bubbleContentColor() {
return '#fff';
},
}));

jest.mock('electron', () => ({
ipcMain: new Proxy(
{},
Expand Down Expand Up @@ -155,6 +161,13 @@ describe('<ChatContainer />', () => {
padding: '1px',
};

styleSet.uploadAttachment = {
...styleSet.uploadAttachment,
'& > .name, & > .size': {
color: '#fff',
},
};

expect(webChat.exists()).toBe(true);
const wcProps = webChat.props();
expect(wcProps.bot).toEqual({ id: defaultDocument.botId, name: 'Bot' });
Expand Down
16 changes: 16 additions & 0 deletions packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ export class Chat extends PureComponent<ChatProps, ChatState> {
padding: '1px',
};

styleSet.uploadAttachment = {
...styleSet.uploadAttachment,
'& > .name, & > .size': {
color: styles.bubbleContentColor,
},
};

if (directLine) {
const bot = {
id: botId || 'bot',
Expand Down Expand Up @@ -146,10 +153,19 @@ export class Chat extends PureComponent<ChatProps, ChatState> {
popup.location.href = url;
break;
}

case 'downloadFile':
//Fall through

case 'playAudio':
//Fall through

case 'playVideo':
//Fall through

case 'showImage':
//Fall through

case 'openUrl':
if (value) {
this.props.showOpenUrlDialog(value).then(result => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
primaryFont: 'var(--default-font-family)',

bubbleBackground: 'var(--webchat-bubble-bg)',
bubbleFromUserBackground: 'var(--webchat-user-bubble-bg)',
bubbleFromUserTextColor: 'var(--webchat-user-bubble-text)',
bubbleTextColor: 'var(--webchat-bubble-text)',
bubbleMinHeight: 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%common-tunnel-indicator {
margin-right: 3px;
padding: 5px;
color: var(--focused-list-item);
color: var(--ngrok-text-color);
}

.tunnel-details-list {
Expand Down
4 changes: 4 additions & 0 deletions packages/app/client/src/ui/styles/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ html {
--ngrok-active: #47B07F;
--ngrok-error: #BE1100;
--ngrok-error-outline: #F5B1B1;
--ngrok-text-color: #fff;

/* Webchat style overrides */
--bubble-text-color: #fff;
}

.dialog {
Expand Down
4 changes: 4 additions & 0 deletions packages/app/client/src/ui/styles/themes/high-contrast.css
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ html {
--ngrok-active: #47B07F;
--ngrok-error: #BE1100;
--ngrok-error-outline: #F5B1B1;
--ngrok-text-color: #000000;

/* Webchat style overrides */
--bubble-text-color: #000000;
}

.dialog .ms-Button-label {
Expand Down
4 changes: 4 additions & 0 deletions packages/app/client/src/ui/styles/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,8 @@ html {
--ngrok-active: #47B07F;
--ngrok-error: #BE1100;
--ngrok-error-outline: #F5B1B1;
--ngrok-text-color: #fff;

/* Webchat style overrides */
--bubble-text-color: #fff;
}