-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[cloud] Create IFRAME chat component; add to Unified Integrations #123772
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
75ba747
[cloud] Create IFRAME chat component; add to Unified Integrations
clintandrewhall e380174
Provide chat user data from endpoint
SergeyPoluektov 92720ac
Apply suggestions from code review
clintandrewhall 4cd7d5a
Addressing feedback
clintandrewhall 9b8ca41
Addressing feedback
clintandrewhall 1d50335
Merge branch 'main' into cloud/chat
kibanamachine c5a5059
Fixing package.json
clintandrewhall 85f9504
Merge branch 'main' into cloud/chat
kibanamachine 4b56959
Addressing feedback
clintandrewhall a9e65a4
Wrap chat config in an observable
clintandrewhall 7e078f5
Add tests
clintandrewhall a556ecd
Merge branch 'main' into cloud/chat
kibanamachine 3743c5c
Add integration tests, docs
clintandrewhall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { DecoratorFn } from '@storybook/react'; | ||
| import { ServicesProvider, CloudServices } from '../public/services'; | ||
|
|
||
| // TODO: move to a storybook implementation of the service using parameters. | ||
| const services: CloudServices = { | ||
| chat: { | ||
| enabled: true, | ||
| chatURL: 'https://elasticcloud-production-chat-us-east-1.s3.amazonaws.com/drift-iframe.html', | ||
| user: { | ||
| id: 'user-id', | ||
| email: '[email protected]', | ||
| // this doesn't affect chat appearance, | ||
| // but a user identity in Drift only | ||
| jwt: 'identity-jwt', | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export const getCloudContextProvider: () => React.FC = | ||
| () => | ||
| ({ children }) => | ||
| <ServicesProvider {...services}>{children}</ServicesProvider>; | ||
|
|
||
| export const getCloudContextDecorator: DecoratorFn = (storyFn) => { | ||
| const CloudContextProvider = getCloudContextProvider(); | ||
| return <CloudContextProvider>{storyFn()}</CloudContextProvider>; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| export { getCloudContextDecorator, getCloudContextProvider } from './decorator'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { defaultConfig } from '@kbn/storybook'; | ||
|
|
||
| module.exports = defaultConfig; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { addons } from '@storybook/addons'; | ||
| import { create } from '@storybook/theming'; | ||
| import { PANEL_ID } from '@storybook/addon-actions'; | ||
|
|
||
| addons.setConfig({ | ||
| theme: create({ | ||
| base: 'light', | ||
| brandTitle: 'Cloud Storybook', | ||
| brandUrl: 'https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud', | ||
| }), | ||
| showPanel: true.valueOf, | ||
| selectedPanel: PANEL_ID, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { addDecorator } from '@storybook/react'; | ||
| import { getCloudContextDecorator } from './decorator'; | ||
|
|
||
| addDecorator(getCloudContextDecorator); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit
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.
FFR: Storybook crashes if you do this.
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.
really? interesting