From 3f1473e6537a88ba498cb3af2e674e61955f3482 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 4 Jul 2023 09:14:56 +0200 Subject: [PATCH 1/3] change(ui): integration changes --- api/chalicelib/core/feature_flags.py | 2 +- api/schemas.py | 2 +- .../Client/{Client.js => Client.tsx} | 51 ++- .../Integrations/IntegrationFilters.tsx | 53 ++++ .../Client/Integrations/IntegrationItem.tsx | 55 ++-- .../Client/Integrations/Integrations.tsx | 295 +++++++++++------- frontend/app/components/ui/Button/Button.tsx | 5 +- frontend/app/styles/global.scss | 10 +- frontend/tailwind.config.js | 5 +- 9 files changed, 310 insertions(+), 168 deletions(-) rename frontend/app/components/Client/{Client.js => Client.tsx} (68%) create mode 100644 frontend/app/components/Client/Integrations/IntegrationFilters.tsx diff --git a/api/chalicelib/core/feature_flags.py b/api/chalicelib/core/feature_flags.py index 520fb3cf5..6276bd91d 100644 --- a/api/chalicelib/core/feature_flags.py +++ b/api/chalicelib/core/feature_flags.py @@ -157,7 +157,7 @@ def create_feature_flag(project_id: int, user_id: int, feature_flag_data: schema """ if variants_len > 0: - variants_query = f""", + variants_query = f"""{conditions_len > 0 and "," or ""} inserted_variants AS ( INSERT INTO feature_flags_variants(feature_flag_id, value, description, rollout_percentage, payload) VALUES {",".join([f"((SELECT feature_flag_id FROM inserted_flag)," diff --git a/api/schemas.py b/api/schemas.py index 2304f1b32..926202ab0 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -1433,7 +1433,7 @@ class FeatureFlagSchema(BaseModel): flag_type: FeatureFlagType = Field(default=FeatureFlagType.single_variant) is_persist: Optional[bool] = Field(default=False) is_active: Optional[bool] = Field(default=True) - conditions: List[FeatureFlagCondition] = Field(default=[], min_items=1) + conditions: List[FeatureFlagCondition] = Field(default=[]) variants: List[FeatureFlagVariant] = Field(default=[]) class Config: diff --git a/frontend/app/components/Client/Client.js b/frontend/app/components/Client/Client.tsx similarity index 68% rename from frontend/app/components/Client/Client.js rename to frontend/app/components/Client/Client.tsx index ebf9db834..44722153f 100644 --- a/frontend/app/components/Client/Client.js +++ b/frontend/app/components/Client/Client.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { withRouter } from 'react-router-dom'; +import { withRouter, RouteComponentProps } from 'react-router-dom'; import { Switch, Route, Redirect } from 'react-router'; import { CLIENT_TABS, client as clientRoute } from 'App/routes'; @@ -17,17 +17,15 @@ import Notifications from './Notifications'; import Roles from './Roles'; import SessionsListingSettings from 'Components/Client/SessionsListingSettings'; -@withRouter -export default class Client extends React.PureComponent { - constructor(props) { - super(props); - } +interface MatchParams { + activeTab?: string; +} - setTab = (tab) => { - this.props.history.push(clientRoute(tab)); - }; +const Client: React.FC> = ({ match }) => { + const { activeTab } = match.params; + const isIntegrations = activeTab === CLIENT_TABS.INTEGRATIONS; - renderActiveTab = () => ( + const renderActiveTab = () => ( @@ -43,23 +41,18 @@ export default class Client extends React.PureComponent { ); - render() { - const { - match: { - params: { activeTab }, - }, - } = this.props; - return ( -
-
- -
-
-
- {activeTab && this.renderActiveTab()} -
-
+ return ( +
+
+
- ); - } -} +
+
+ {activeTab && renderActiveTab()} +
+
+
+ ); +}; + +export default withRouter(Client); diff --git a/frontend/app/components/Client/Integrations/IntegrationFilters.tsx b/frontend/app/components/Client/Integrations/IntegrationFilters.tsx new file mode 100644 index 000000000..51edb90bf --- /dev/null +++ b/frontend/app/components/Client/Integrations/IntegrationFilters.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { Icon } from 'UI'; +import cn from 'classnames'; + + +// const FILTERS = [ +// { key: 'all', name: 'All', icon: 'play' }, +// { key: 'issue-reporting', name: 'Issue Reporting', icon: 'play' }, +// { key: 'backend-logging', name: 'Backend Logging', icon: 'play' }, +// { key: 'stack-tracing', name: 'Stack Tracing', icon: 'play' }, +// { key: 'state-management', name: 'State Management', icon: 'play' }, +// { key: 'collaboration', name: 'Collaboration', icon: 'play' }, +// { key: 'plugins', name: 'Plugins', icon: 'play' } +// ]; + +interface Props { + onChange: any; + activeItem: string; + filters: any; +} + +const allItem = { key: 'all', title: 'All', icon: 'play' }; + +function FilterButton(props: { activeItem: string, item: any, onClick: () => any }) { + return
+ {props.item.icon && } + {props.item.title} +
; +} + +function IntegrationFilters(props: Props) { + + return ( +
+ props.onChange(allItem.key)} + /> + {props.filters.map((item: any) => ( + props.onChange(item.key)} /> + ))} +
+ ); +} + +export default IntegrationFilters; \ No newline at end of file diff --git a/frontend/app/components/Client/Integrations/IntegrationItem.tsx b/frontend/app/components/Client/Integrations/IntegrationItem.tsx index efcdefd8a..cd8b5f005 100644 --- a/frontend/app/components/Client/Integrations/IntegrationItem.tsx +++ b/frontend/app/components/Client/Integrations/IntegrationItem.tsx @@ -1,35 +1,44 @@ import React from 'react'; import cn from 'classnames'; -import { Icon, Tooltip } from 'UI'; +import { Icon } from 'UI'; import stl from './integrationItem.module.css'; +import { Tooltip } from 'antd'; interface Props { - integration: any; - onClick?: (e: React.MouseEvent) => void; - integrated?: boolean; - hide?: boolean; + integration: any; + onClick?: (e: React.MouseEvent) => void; + integrated?: boolean; + hide?: boolean; } const IntegrationItem = (props: Props) => { - const { integration, integrated, hide = false } = props; - return hide ? <> : ( -
props.onClick(e)}> - {integrated && ( -
- - - -
- )} - {integration.icon.length ? integration : ( - {integration.header} - )} -
-

{integration.title}

- {/*

{integration.subtitle && integration.subtitle}

*/} -
+ const { integration, integrated, hide = false } = props; + return hide ? <> : ( +
props.onClick(e)} + style={{ height: '126px' }} + > +
+ {integration.icon.length ? + integration : + ({integration.header})} +
+

{integration.title}

+

{integration.subtitle && integration.subtitle}

- ); +
+ + {integrated && ( + +
+ + Installed +
+
+ )} +
+ ); }; export default IntegrationItem; diff --git a/frontend/app/components/Client/Integrations/Integrations.tsx b/frontend/app/components/Client/Integrations/Integrations.tsx index 98cbf4f0a..411bbe2af 100644 --- a/frontend/app/components/Client/Integrations/Integrations.tsx +++ b/frontend/app/components/Client/Integrations/Integrations.tsx @@ -1,5 +1,25 @@ +import React, { useEffect, useState } from 'react'; +import { connect } from 'react-redux'; import { useModal } from 'App/components/Modal'; -import React, { useEffect } from 'react'; +import cn from 'classnames'; + +import { fetch, init } from 'Duck/integrations/actions'; +import { fetchIntegrationList, setSiteId } from 'Duck/integrations/integrations'; +import SiteDropdown from 'Shared/SiteDropdown'; +import ReduxDoc from './ReduxDoc'; +import VueDoc from './VueDoc'; +import GraphQLDoc from './GraphQLDoc'; +import NgRxDoc from './NgRxDoc'; +import MobxDoc from './MobxDoc'; +import ProfilerDoc from './ProfilerDoc'; +import AssistDoc from './AssistDoc'; +import PiniaDoc from './PiniaDoc'; +import ZustandDoc from './ZustandDoc'; +import MSTeams from './Teams'; +import DocCard from 'Shared/DocCard/DocCard'; +import { PageTitle, Tooltip } from 'UI'; +import withPageTitle from 'HOCs/withPageTitle'; + import BugsnagForm from './BugsnagForm'; import CloudwatchForm from './CloudwatchForm'; import DatadogForm from './DatadogForm'; @@ -13,25 +33,7 @@ import SentryForm from './SentryForm'; import SlackForm from './SlackForm'; import StackdriverForm from './StackdriverForm'; import SumoLogicForm from './SumoLogicForm'; -import { fetch, init } from 'Duck/integrations/actions'; -import { fetchIntegrationList, setSiteId } from 'Duck/integrations/integrations'; -import { connect } from 'react-redux'; -import SiteDropdown from 'Shared/SiteDropdown'; -import ReduxDoc from './ReduxDoc'; -import VueDoc from './VueDoc'; -import GraphQLDoc from './GraphQLDoc'; -import NgRxDoc from './NgRxDoc'; -import MobxDoc from './MobxDoc'; -import ProfilerDoc from './ProfilerDoc'; -import AssistDoc from './AssistDoc'; -import { PageTitle, Tooltip } from 'UI'; -import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; -import withPageTitle from 'HOCs/withPageTitle'; -import PiniaDoc from './PiniaDoc'; -import ZustandDoc from './ZustandDoc'; -import MSTeams from './Teams'; -import DocCard from 'Shared/DocCard/DocCard'; -import cn from 'classnames'; +import IntegrationFilters from 'Components/Client/Integrations/IntegrationFilters'; interface Props { fetch: (name: string, siteId: string) => void; @@ -44,10 +46,12 @@ interface Props { hideHeader?: boolean; loading?: boolean; } + function Integrations(props: Props) { const { initialSiteId, hideHeader = false, loading = false } = props; const { showModal } = useModal(); - const [integratedList, setIntegratedList] = React.useState([]); + const [integratedList, setIntegratedList] = useState([]); + const [activeFilter, setActiveFilter] = useState('all'); useEffect(() => { const list = props.integratedList @@ -68,7 +72,7 @@ function Integrations(props: Props) { showModal( React.cloneElement(integration.component, { - integrated: integratedList.includes(integration.slug), + integrated: integratedList.includes(integration.slug) }), { right: true, width } ); @@ -79,55 +83,55 @@ function Integrations(props: Props) { props.fetchIntegrationList(value.value); }; - return ( -
- {!hideHeader && Integrations
} />} - {integrations.map((cat: any) => ( -
-
-
-

{cat.title}

- {cat.isProject && ( -
-
- -
- {loading && cat.isProject && } -
- )} -
-
{cat.description}
+ const onChange = (key: string) => { + setActiveFilter(key); + }; -
- {cat.integrations.map((integration: any) => ( - - - onClick(integration, cat.title === 'Plugins' ? 500 : 350)} - hide={ - (integration.slug === 'github' && integratedList.includes('jira')) || - (integration.slug === 'jira' && integratedList.includes('github')) - } - /> - - - ))} -
-
- {cat.docs &&
{cat.docs()}
} + const filteredIntegrations = integrations.filter((cat: any) => { + if (activeFilter === 'all') { + return true; + } + + return cat.key === activeFilter; + }); + + const filters = integrations.map((cat: any) => ({ + key: cat.key, + title: cat.title, + icon: cat.icon, + })); + + + return ( + <> +
+ {!hideHeader && Integrations
} />} + + +
+ +
+ + {filteredIntegrations.map((cat: any) => ( +
+ {cat.integrations.map((integration: any) => ( + + onClick(integration, cat.title === 'Plugins' ? 500 : 350) + } + hide={ + (integration.slug === 'github' && + integratedList.includes('jira')) || + (integration.slug === 'jira' && + integratedList.includes('github')) + } + /> + ))}
))} -
+ ); } @@ -136,62 +140,68 @@ export default connect( initialSiteId: state.getIn(['site', 'siteId']), integratedList: state.getIn(['integrations', 'list']) || [], loading: state.getIn(['integrations', 'fetchRequest', 'loading']), - siteId: state.getIn(['integrations', 'siteId']), + siteId: state.getIn(['integrations', 'siteId']) }), { fetch, init, fetchIntegrationList, setSiteId } )(withPageTitle('Integrations - OpenReplay Preferences')(Integrations)); + const integrations = [ { - title: 'Issue Reporting and Collaborations', - key: 1, + title: 'Issue Reporting', + key: 'issue-reporting', description: 'Seamlessly report issues or share issues with your team right from OpenReplay.', isProject: false, + icon: 'integrations/issue-reporting', integrations: [ { title: 'Jira', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'jira', category: 'Errors', icon: 'integrations/jira', - component: , + component: }, { title: 'Github', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'github', category: 'Errors', icon: 'integrations/github', - component: , + component: }, { title: 'Slack', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'slack', category: 'Errors', icon: 'integrations/slack', component: , - shared: true, + shared: true }, { title: 'MS Teams', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'msteams', category: 'Errors', icon: 'integrations/teams', component: , - shared: true, - }, - ], + shared: true + } + ] }, { title: 'Backend Logging', - key: 2, + key: 'backend-logging', isProject: true, description: 'Sync your backend errors with sessions replays and see what happened front-to-back.', docs: () => ( Sync your backend errors with sessions replays and see what happened front-to-back. @@ -200,81 +210,148 @@ const integrations = [ { title: 'Sentry', slug: 'sentry', icon: 'integrations/sentry', component: }, { title: 'Bugsnag', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'bugsnag', icon: 'integrations/bugsnag', - component: , + component: }, { title: 'Rollbar', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'rollbar', icon: 'integrations/rollbar', - component: , + component: }, { title: 'Elasticsearch', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'elasticsearch', icon: 'integrations/elasticsearch', - component: , + component: }, { title: 'Datadog', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'datadog', icon: 'integrations/datadog', - component: , + component: }, { title: 'Sumo Logic', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'sumologic', icon: 'integrations/sumologic', - component: , + component: }, { title: 'Stackdriver', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'stackdriver', icon: 'integrations/google-cloud', - component: , + component: }, { title: 'CloudWatch', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'cloudwatch', icon: 'integrations/aws', - component: , + component: }, { title: 'Newrelic', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', slug: 'newrelic', icon: 'integrations/newrelic', - component: , - }, - ], + component: + } + ] + }, + { + title: 'Collaboration', + key: 'collaboration', + isProject: false, + description: 'Share your sessions with your team and collaborate on issues.', + integrations: [] + }, + { + title: 'State Management', + key: 'state-management', + isProject: true, + description: 'Sync your Redux or VueX store with sessions replays and see what happened front-to-back.', + integrations: [] }, { title: 'Plugins', - key: 3, + key: 'plugins', isProject: true, docs: () => ( Plugins capture your application’s store, monitor queries, track performance issues and even assist your end user through live sessions. ), description: - "Reproduce issues as if they happened in your own browser. Plugins help capture your application's store, HTTP requeets, GraphQL queries, and more.", + 'Reproduce issues as if they happened in your own browser. Plugins help capture your application\'s store, HTTP requeets, GraphQL queries, and more.', integrations: [ - { title: 'Redux', icon: 'integrations/redux', component: }, - { title: 'VueX', icon: 'integrations/vuejs', component: }, - { title: 'Pinia', icon: 'integrations/pinia', component: }, - { title: 'GraphQL', icon: 'integrations/graphql', component: }, - { title: 'NgRx', icon: 'integrations/ngrx', component: }, - { title: 'MobX', icon: 'integrations/mobx', component: }, - { title: 'Profiler', icon: 'integrations/openreplay', component: }, - { title: 'Assist', icon: 'integrations/openreplay', component: }, - { title: 'Zustand', icon: '', header: '🐻', component: }, - ], - }, + { + title: 'Redux', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/redux', component: + }, + { + title: 'VueX', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/vuejs', + component: + }, + { + title: 'Pinia', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/pinia', + component: + }, + { + title: 'GraphQL', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/graphql', + component: + }, + { + title: 'NgRx', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/ngrx', + component: + }, + { + title: 'MobX', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/mobx', + component: + }, + { + title: 'Profiler', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/openreplay', + component: + }, + { + title: 'Assist', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: 'integrations/openreplay', + component: + }, + { + title: 'Zustand', + subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + icon: '', + header: '🐻', + component: + } + ] + } ]; diff --git a/frontend/app/components/ui/Button/Button.tsx b/frontend/app/components/ui/Button/Button.tsx index b4c6c6b61..2b0514c87 100644 --- a/frontend/app/components/ui/Button/Button.tsx +++ b/frontend/app/components/ui/Button/Button.tsx @@ -35,7 +35,7 @@ export default (props: Props) => { let iconColor = variant === 'text' || variant === 'default' ? 'gray-dark' : 'teal'; const variantClasses = { - default: 'bg-white hover:bg-gray-light border border-gray-light', + default: 'bg-white hover:!bg-gray-light border border-gray-light', primary: 'bg-teal color-white hover:bg-teal-dark', green: 'bg-green color-white hover:bg-green-dark', text: 'bg-transparent text-black hover:bg-active-blue hover:!text-teal hover-fill-teal', @@ -49,7 +49,8 @@ export default (props: Props) => { variantClasses[variant], { 'opacity-40 pointer-events-none': disabled }, { '!rounded-full h-10 w-10 justify-center': rounded }, - className + className, + 'btn' ); if (variant === 'primary') { diff --git a/frontend/app/styles/global.scss b/frontend/app/styles/global.scss index b8df873a9..42d7a063e 100644 --- a/frontend/app/styles/global.scss +++ b/frontend/app/styles/global.scss @@ -23,6 +23,12 @@ input.no-focus:focus { } } -.border-b { - border-bottom: 1px solid #eee; + +button, +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; /* 1 */ + background-color: none; /* 2 */ + background-image: none; /* 2 */ } diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 6839bc5ee..871f7d36b 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -35,6 +35,9 @@ module.exports = { 'border-main': `0 0 0 1px ${colors['main']}`, 'border-gray': '0 0 0 1px #999' }, + button: { + 'background-color': 'red' + } } }, variants: { @@ -42,6 +45,6 @@ module.exports = { }, plugins: [], corePlugins: { - preflight: false + // preflight: false } }; From 595fcd41be78bb6d81f9fa41a080334ab7649c29 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 26 Jul 2023 16:04:15 +0200 Subject: [PATCH 2/3] change(ui): integrations card description --- .../Integrations/IntegrationFilters.tsx | 13 +----- .../Client/Integrations/Integrations.tsx | 40 ++++++++++++------- frontend/app/components/ui/SVG.tsx | 6 ++- frontend/app/svg/icons/chat-left-text.svg | 4 ++ .../app/svg/icons/exclamation-triangle.svg | 4 ++ frontend/app/svg/icons/layers-half.svg | 3 ++ frontend/app/svg/icons/terminal.svg | 4 ++ 7 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 frontend/app/svg/icons/chat-left-text.svg create mode 100644 frontend/app/svg/icons/exclamation-triangle.svg create mode 100644 frontend/app/svg/icons/layers-half.svg create mode 100644 frontend/app/svg/icons/terminal.svg diff --git a/frontend/app/components/Client/Integrations/IntegrationFilters.tsx b/frontend/app/components/Client/Integrations/IntegrationFilters.tsx index 51edb90bf..5e8d8f7b3 100644 --- a/frontend/app/components/Client/Integrations/IntegrationFilters.tsx +++ b/frontend/app/components/Client/Integrations/IntegrationFilters.tsx @@ -2,24 +2,13 @@ import React from 'react'; import { Icon } from 'UI'; import cn from 'classnames'; - -// const FILTERS = [ -// { key: 'all', name: 'All', icon: 'play' }, -// { key: 'issue-reporting', name: 'Issue Reporting', icon: 'play' }, -// { key: 'backend-logging', name: 'Backend Logging', icon: 'play' }, -// { key: 'stack-tracing', name: 'Stack Tracing', icon: 'play' }, -// { key: 'state-management', name: 'State Management', icon: 'play' }, -// { key: 'collaboration', name: 'Collaboration', icon: 'play' }, -// { key: 'plugins', name: 'Plugins', icon: 'play' } -// ]; - interface Props { onChange: any; activeItem: string; filters: any; } -const allItem = { key: 'all', title: 'All', icon: 'play' }; +const allItem = { key: 'all', title: 'All' }; function FilterButton(props: { activeItem: string, item: any, onClick: () => any }) { return
({ key: cat.key, title: cat.title, - icon: cat.icon, + icon: cat.icon })); @@ -107,7 +107,7 @@ function Integrations(props: Props) {
{!hideHeader && Integrations
} />} - +
@@ -152,11 +152,11 @@ const integrations = [ key: 'issue-reporting', description: 'Seamlessly report issues or share issues with your team right from OpenReplay.', isProject: false, - icon: 'integrations/issue-reporting', + icon: 'exclamation-triangle', integrations: [ { title: 'Jira', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Jira with OpenReplay to enable the creation of a new ticket directly from a session.', slug: 'jira', category: 'Errors', icon: 'integrations/jira', @@ -164,7 +164,7 @@ const integrations = [ }, { title: 'Github', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate GitHub with OpenReplay to enable the direct creation of a new issue from a session.', slug: 'github', category: 'Errors', icon: 'integrations/github', @@ -172,7 +172,7 @@ const integrations = [ }, { title: 'Slack', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Slack to empower every user in your org with the ability to send sessions to any Slack channel.', slug: 'slack', category: 'Errors', icon: 'integrations/slack', @@ -194,6 +194,7 @@ const integrations = [ title: 'Backend Logging', key: 'backend-logging', isProject: true, + icon: 'terminal', description: 'Sync your backend errors with sessions replays and see what happened front-to-back.', docs: () => ( @@ -207,59 +208,65 @@ const integrations = [ ), integrations: [ - { title: 'Sentry', slug: 'sentry', icon: 'integrations/sentry', component: }, + { + title: 'Sentry', + subtitle: 'Integrate Sentry with session replays to seamlessly observe backend errors.', + slug: 'sentry', + icon: 'integrations/sentry', + component: + }, { title: 'Bugsnag', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Bugsnag to access the OpenReplay session linked to the JS exception within its interface.', slug: 'bugsnag', icon: 'integrations/bugsnag', component: }, { title: 'Rollbar', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Rollbar with session replays to seamlessly observe backend errors.', slug: 'rollbar', icon: 'integrations/rollbar', component: }, { title: 'Elasticsearch', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Elasticsearch with session replays to seamlessly observe backend errors.', slug: 'elasticsearch', icon: 'integrations/elasticsearch', component: }, { title: 'Datadog', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Incorporate DataDog to visualize backend errors alongside session replay, for easy troubleshooting.', slug: 'datadog', icon: 'integrations/datadog', component: }, { title: 'Sumo Logic', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Sumo Logic with session replays to seamlessly observe backend errors.', slug: 'sumologic', icon: 'integrations/sumologic', component: }, { title: 'Stackdriver', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate Google Cloud to view backend logs and errors in conjunction with session replay', slug: 'stackdriver', icon: 'integrations/google-cloud', component: }, { title: 'CloudWatch', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate CloudWatch to see backend logs and errors alongside session replay.', slug: 'cloudwatch', icon: 'integrations/aws', component: }, { title: 'Newrelic', - subtitle: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + subtitle: 'Integrate NewRelic with session replays to seamlessly observe backend errors.', slug: 'newrelic', icon: 'integrations/newrelic', component: @@ -270,6 +277,7 @@ const integrations = [ title: 'Collaboration', key: 'collaboration', isProject: false, + icon: 'file-code', description: 'Share your sessions with your team and collaborate on issues.', integrations: [] }, @@ -277,6 +285,7 @@ const integrations = [ title: 'State Management', key: 'state-management', isProject: true, + icon: 'layers-half', description: 'Sync your Redux or VueX store with sessions replays and see what happened front-to-back.', integrations: [] }, @@ -284,6 +293,7 @@ const integrations = [ title: 'Plugins', key: 'plugins', isProject: true, + icon: 'chat-left-text', docs: () => ( { case 'caret-right-fill': return ; case 'caret-up-fill': return ; case 'chat-dots': return ; + case 'chat-left-text': return ; case 'chat-right-text': return ; case 'chat-square-quote': return ; case 'check-circle-fill': return ; @@ -176,6 +177,7 @@ const SVG = (props: Props) => { case 'event/view': return ; case 'exclamation-circle-fill': return ; case 'exclamation-circle': return ; + case 'exclamation-triangle': return ; case 'expand-wide': return ; case 'explosion': return ; case 'external-link-alt': return ; @@ -321,6 +323,7 @@ const SVG = (props: Props) => { case 'journal-code': return ; case 'key': return ; case 'layer-group': return ; + case 'layers-half': return ; case 'lightbulb-on': return ; case 'lightbulb': return ; case 'link-45deg': return ; @@ -431,6 +434,7 @@ const SVG = (props: Props) => { case 'team-funnel': return ; case 'telephone-fill': return ; case 'telephone': return ; + case 'terminal': return ; case 'text-paragraph': return ; case 'toggles': return ; case 'tools': return ; diff --git a/frontend/app/svg/icons/chat-left-text.svg b/frontend/app/svg/icons/chat-left-text.svg new file mode 100644 index 000000000..fe60b0c68 --- /dev/null +++ b/frontend/app/svg/icons/chat-left-text.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/app/svg/icons/exclamation-triangle.svg b/frontend/app/svg/icons/exclamation-triangle.svg new file mode 100644 index 000000000..84b3ce962 --- /dev/null +++ b/frontend/app/svg/icons/exclamation-triangle.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/app/svg/icons/layers-half.svg b/frontend/app/svg/icons/layers-half.svg new file mode 100644 index 000000000..c7dc94531 --- /dev/null +++ b/frontend/app/svg/icons/layers-half.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/app/svg/icons/terminal.svg b/frontend/app/svg/icons/terminal.svg new file mode 100644 index 000000000..db057fd26 --- /dev/null +++ b/frontend/app/svg/icons/terminal.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 18d1e1edef0a3fbc8090c1f9ea55d6b126424561 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 26 Jul 2023 18:53:09 +0200 Subject: [PATCH 3/3] change(ui): integrations - modal docs text --- .../Integrations/BugsnagForm/BugsnagForm.js | 52 +++--- .../CloudwatchForm/CloudwatchForm.js | 76 +++++---- .../Client/Integrations/DatadogForm.js | 49 +++--- .../Client/Integrations/ElasticsearchForm.js | 153 +++++++++--------- .../Client/Integrations/GithubForm.js | 42 ++--- .../Client/Integrations/IntegrationItem.tsx | 11 +- .../Integrations/IntegrationModalCard.tsx | 26 +++ .../Client/Integrations/Integrations.tsx | 2 +- .../Client/Integrations/JiraForm/JiraForm.js | 80 +++++---- .../Integrations/NewrelicForm/NewrelicForm.js | 57 ++++--- .../Client/Integrations/RollbarForm.js | 39 +++-- .../Client/Integrations/SentryForm.js | 55 ++++--- .../Client/Integrations/StackdriverForm.js | 50 +++--- .../SumoLogicForm/SumoLogicForm.js | 57 ++++--- .../app/components/shared/DocLink/DocLink.js | 2 +- 15 files changed, 431 insertions(+), 320 deletions(-) create mode 100644 frontend/app/components/Client/Integrations/IntegrationModalCard.tsx diff --git a/frontend/app/components/Client/Integrations/BugsnagForm/BugsnagForm.js b/frontend/app/components/Client/Integrations/BugsnagForm/BugsnagForm.js index 15d8ddef1..f58154f91 100644 --- a/frontend/app/components/Client/Integrations/BugsnagForm/BugsnagForm.js +++ b/frontend/app/components/Client/Integrations/BugsnagForm/BugsnagForm.js @@ -3,31 +3,39 @@ import { tokenRE } from 'Types/integrations/bugsnagConfig'; import IntegrationForm from '../IntegrationForm'; import ProjectListDropdown from './ProjectListDropdown'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const BugsnagForm = (props) => ( -
-

Bugsnag

-
-
How to integrate Bugsnag with OpenReplay and see backend errors alongside session recordings.
- -
- tokenRE.test(config.authorizationToken), - component: ProjectListDropdown, - }, - ]} - /> +
+ + +
+
How it works?
+
    +
  1. Generate Bugsnag Auth Token
  2. +
  3. Enter the token below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ tokenRE.test(config.authorizationToken), + component: ProjectListDropdown + } + ]} + /> +
); BugsnagForm.displayName = 'BugsnagForm'; diff --git a/frontend/app/components/Client/Integrations/CloudwatchForm/CloudwatchForm.js b/frontend/app/components/Client/Integrations/CloudwatchForm/CloudwatchForm.js index bd9604b01..ca4e6ae3b 100644 --- a/frontend/app/components/Client/Integrations/CloudwatchForm/CloudwatchForm.js +++ b/frontend/app/components/Client/Integrations/CloudwatchForm/CloudwatchForm.js @@ -4,43 +4,51 @@ import IntegrationForm from '../IntegrationForm'; import LogGroupDropdown from './LogGroupDropdown'; import RegionDropdown from './RegionDropdown'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const CloudwatchForm = (props) => ( -
-

Cloud Watch

-
-
How to integrate CloudWatch with OpenReplay and see backend errors alongside session replays.
- -
- - config.awsSecretAccessKey.length === SECRET_ACCESS_KEY_LENGTH && - config.region !== '' && - config.awsAccessKeyId.length === ACCESS_KEY_ID_LENGTH, - }, - ]} - /> +
+ +
+
How it works?
+
    +
  1. Create a Service Account
  2. +
  3. Enter the details below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ + config.awsSecretAccessKey.length === SECRET_ACCESS_KEY_LENGTH && + config.region !== '' && + config.awsAccessKeyId.length === ACCESS_KEY_ID_LENGTH + } + ]} + /> +
); CloudwatchForm.displayName = 'CloudwatchForm'; diff --git a/frontend/app/components/Client/Integrations/DatadogForm.js b/frontend/app/components/Client/Integrations/DatadogForm.js index 46360259c..0835d135e 100644 --- a/frontend/app/components/Client/Integrations/DatadogForm.js +++ b/frontend/app/components/Client/Integrations/DatadogForm.js @@ -1,30 +1,37 @@ import React from 'react'; import IntegrationForm from './IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const DatadogForm = (props) => ( -
-

Datadog

-
-
How to integrate Datadog with OpenReplay and see backend errors alongside session recordings.
- -
- +
+ +
+
How it works?
+
    +
  1. Generate Datadog API Key & Application Key
  2. +
  3. Enter the API key below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ +
); DatadogForm.displayName = 'DatadogForm'; diff --git a/frontend/app/components/Client/Integrations/ElasticsearchForm.js b/frontend/app/components/Client/Integrations/ElasticsearchForm.js index ad33b6302..2c30cea47 100644 --- a/frontend/app/components/Client/Integrations/ElasticsearchForm.js +++ b/frontend/app/components/Client/Integrations/ElasticsearchForm.js @@ -4,85 +4,94 @@ import IntegrationForm from './IntegrationForm'; import { withRequest } from 'HOCs'; import { edit } from 'Duck/integrations/actions'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; @connect( - (state) => ({ - config: state.getIn(['elasticsearch', 'instance']), - }), - { edit } + (state) => ({ + config: state.getIn(['elasticsearch', 'instance']) + }), + { edit } ) @withRequest({ - dataName: 'isValid', - initialData: false, - dataWrapper: (data) => data.state, - requestName: 'validateConfig', - endpoint: '/integrations/elasticsearch/test', - method: 'POST', + dataName: 'isValid', + initialData: false, + dataWrapper: (data) => data.state, + requestName: 'validateConfig', + endpoint: '/integrations/elasticsearch/test', + method: 'POST' }) export default class ElasticsearchForm extends React.PureComponent { - componentWillReceiveProps(newProps) { - const { - config: { host, port, apiKeyId, apiKey }, - } = this.props; - const { loading, config } = newProps; - const valuesChanged = host !== config.host || port !== config.port || apiKeyId !== config.apiKeyId || apiKey !== config.apiKey; - if (!loading && valuesChanged && newProps.config.validateKeys() && newProps) { - this.validateConfig(newProps); - } + componentWillReceiveProps(newProps) { + const { + config: { host, port, apiKeyId, apiKey } + } = this.props; + const { loading, config } = newProps; + const valuesChanged = host !== config.host || port !== config.port || apiKeyId !== config.apiKeyId || apiKey !== config.apiKey; + if (!loading && valuesChanged && newProps.config.validateKeys() && newProps) { + this.validateConfig(newProps); } + } - validateConfig = (newProps) => { - const { config } = newProps; - this.props - .validateConfig({ - host: config.host, - port: config.port, - apiKeyId: config.apiKeyId, - apiKey: config.apiKey, - }) - .then((res) => { - const { isValid } = this.props; - this.props.edit('elasticsearch', { isValid: isValid }); - }); - }; + validateConfig = (newProps) => { + const { config } = newProps; + this.props + .validateConfig({ + host: config.host, + port: config.port, + apiKeyId: config.apiKeyId, + apiKey: config.apiKey + }) + .then((res) => { + const { isValid } = this.props; + this.props.edit('elasticsearch', { isValid: isValid }); + }); + }; - render() { - const props = this.props; - return ( -
-

Elasticsearch

-
-
How to integrate Elasticsearch with OpenReplay and see backend errors alongside session recordings.
- -
- -
- ); - } + render() { + const props = this.props; + return ( +
+ + +
+
How it works?
+
    +
  1. Create a new Elastic API key
  2. +
  3. Enter the API key below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+ +
+ +
+ ); + } } diff --git a/frontend/app/components/Client/Integrations/GithubForm.js b/frontend/app/components/Client/Integrations/GithubForm.js index 7d140732b..b54343c5f 100644 --- a/frontend/app/components/Client/Integrations/GithubForm.js +++ b/frontend/app/components/Client/Integrations/GithubForm.js @@ -1,29 +1,31 @@ import React from 'react'; import IntegrationForm from './IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const GithubForm = (props) => ( -
-

Github

-
-
Integrate GitHub with OpenReplay and create issues directly from the recording page.
-
- -
-
- +
+ +
+
Integrate GitHub with OpenReplay and create issues directly from the recording page.
+
+ +
+ +
); GithubForm.displayName = 'GithubForm'; diff --git a/frontend/app/components/Client/Integrations/IntegrationItem.tsx b/frontend/app/components/Client/Integrations/IntegrationItem.tsx index cd8b5f005..27f518c5c 100644 --- a/frontend/app/components/Client/Integrations/IntegrationItem.tsx +++ b/frontend/app/components/Client/Integrations/IntegrationItem.tsx @@ -15,14 +15,17 @@ const IntegrationItem = (props: Props) => { const { integration, integrated, hide = false } = props; return hide ? <> : (
props.onClick(e)} style={{ height: '126px' }} >
- {integration.icon.length ? - integration : - ({integration.header})} + {/*{integration.icon.length ?*/} + {/* integration :*/} + {/* ({integration.header})}*/} +
+ integration +

{integration.title}

{integration.subtitle && integration.subtitle}

diff --git a/frontend/app/components/Client/Integrations/IntegrationModalCard.tsx b/frontend/app/components/Client/Integrations/IntegrationModalCard.tsx new file mode 100644 index 000000000..4864b092b --- /dev/null +++ b/frontend/app/components/Client/Integrations/IntegrationModalCard.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import { Icon } from 'UI'; +import DocLink from 'Shared/DocLink'; + +interface Props { + title: string; + icon: string; + description: string; +} + +function IntegrationModalCard(props: Props) { + const { title, icon, description } = props; + return ( +
+
+ integration +
+
+

{title}

+
{description}
+
+
+ ); +} + +export default IntegrationModalCard; \ No newline at end of file diff --git a/frontend/app/components/Client/Integrations/Integrations.tsx b/frontend/app/components/Client/Integrations/Integrations.tsx index 444c77da3..1c6d0f58a 100644 --- a/frontend/app/components/Client/Integrations/Integrations.tsx +++ b/frontend/app/components/Client/Integrations/Integrations.tsx @@ -251,7 +251,7 @@ const integrations = [ component: }, { - title: 'Stackdriver', + title: 'Google Cloud', subtitle: 'Integrate Google Cloud to view backend logs and errors in conjunction with session replay', slug: 'stackdriver', icon: 'integrations/google-cloud', diff --git a/frontend/app/components/Client/Integrations/JiraForm/JiraForm.js b/frontend/app/components/Client/Integrations/JiraForm/JiraForm.js index 906794155..c417f0626 100644 --- a/frontend/app/components/Client/Integrations/JiraForm/JiraForm.js +++ b/frontend/app/components/Client/Integrations/JiraForm/JiraForm.js @@ -2,43 +2,55 @@ import React from 'react'; import IntegrationForm from '../IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; import { useModal } from 'App/components/Modal'; +import { Icon } from 'UI'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const JiraForm = (props) => { - const { hideModal } = useModal(); - return ( -
-

Jira

-
-
How to integrate Jira Cloud with OpenReplay.
-
- -
-
- + const { hideModal } = useModal(); + return ( +
+ + + +
+
How it works?
+
    +
  1. Create a new API token
  2. +
  3. Enter the token below
  4. +
+
+
- ) +
+ + + +
+ ); }; JiraForm.displayName = 'JiraForm'; diff --git a/frontend/app/components/Client/Integrations/NewrelicForm/NewrelicForm.js b/frontend/app/components/Client/Integrations/NewrelicForm/NewrelicForm.js index 670656583..3d3d829b1 100644 --- a/frontend/app/components/Client/Integrations/NewrelicForm/NewrelicForm.js +++ b/frontend/app/components/Client/Integrations/NewrelicForm/NewrelicForm.js @@ -1,34 +1,41 @@ import React from 'react'; import IntegrationForm from '../IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const NewrelicForm = (props) => ( -
-

New Relic

-
-
How to integrate NewRelic with OpenReplay and see backend errors alongside session recordings.
- -
- +
+ +
+
How it works?
+
    +
  1. Create Query Key
  2. +
  3. Enter the details below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ +
); NewrelicForm.displayName = 'NewrelicForm'; diff --git a/frontend/app/components/Client/Integrations/RollbarForm.js b/frontend/app/components/Client/Integrations/RollbarForm.js index 441819323..624ec9bf2 100644 --- a/frontend/app/components/Client/Integrations/RollbarForm.js +++ b/frontend/app/components/Client/Integrations/RollbarForm.js @@ -1,25 +1,32 @@ import React from 'react'; import IntegrationForm from './IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const RollbarForm = (props) => ( -
-

Rollbar

-
-
How to integrate Rollbar with OpenReplay and see backend errors alongside session replays.
- -
- +
+ +
+
How it works?
+
    +
  1. Create Rollbar Access Tokens
  2. +
  3. Enter the token below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ +
); RollbarForm.displayName = 'RollbarForm'; diff --git a/frontend/app/components/Client/Integrations/SentryForm.js b/frontend/app/components/Client/Integrations/SentryForm.js index bd119ba31..506aec48c 100644 --- a/frontend/app/components/Client/Integrations/SentryForm.js +++ b/frontend/app/components/Client/Integrations/SentryForm.js @@ -1,33 +1,40 @@ import React from 'react'; import IntegrationForm from './IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const SentryForm = (props) => ( -
-

Sentry

-
-
How to integrate Sentry with OpenReplay and see backend errors alongside session recordings.
- -
- +
+ +
+
How it works?
+
    +
  1. Generate Sentry Auth Token
  2. +
  3. Enter the token below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ +
); SentryForm.displayName = 'SentryForm'; diff --git a/frontend/app/components/Client/Integrations/StackdriverForm.js b/frontend/app/components/Client/Integrations/StackdriverForm.js index ce137bd99..92935e67b 100644 --- a/frontend/app/components/Client/Integrations/StackdriverForm.js +++ b/frontend/app/components/Client/Integrations/StackdriverForm.js @@ -1,30 +1,38 @@ import React from 'react'; import IntegrationForm from './IntegrationForm'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const StackdriverForm = (props) => ( -
-

Stackdriver

-
-
How to integrate Stackdriver with OpenReplay and see backend errors alongside session recordings.
- -
- +
+ +
+
How it works?
+
    +
  1. Create Google Cloud Service Account
  2. +
  3. Enter the details below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ +
); StackdriverForm.displayName = 'StackdriverForm'; diff --git a/frontend/app/components/Client/Integrations/SumoLogicForm/SumoLogicForm.js b/frontend/app/components/Client/Integrations/SumoLogicForm/SumoLogicForm.js index 6aea9fe6e..af72ccbcf 100644 --- a/frontend/app/components/Client/Integrations/SumoLogicForm/SumoLogicForm.js +++ b/frontend/app/components/Client/Integrations/SumoLogicForm/SumoLogicForm.js @@ -2,34 +2,41 @@ import React from 'react'; import IntegrationForm from '../IntegrationForm'; import RegionDropdown from './RegionDropdown'; import DocLink from 'Shared/DocLink/DocLink'; +import IntegrationModalCard from 'Components/Client/Integrations/IntegrationModalCard'; const SumoLogicForm = (props) => ( -
-

Sumologic

-
-
How to integrate SumoLogic with OpenReplay and see backend errors alongside session recordings.
- -
- +
+ +
+
How it works?
+
    +
  1. Create a new Access ID and Access Key
  2. +
  3. Enter the details below
  4. +
  5. Propagate openReplaySessionToken
  6. +
+
+ +
); SumoLogicForm.displayName = 'SumoLogicForm'; diff --git a/frontend/app/components/shared/DocLink/DocLink.js b/frontend/app/components/shared/DocLink/DocLink.js index 004f154ef..3647e79e5 100644 --- a/frontend/app/components/shared/DocLink/DocLink.js +++ b/frontend/app/components/shared/DocLink/DocLink.js @@ -8,7 +8,7 @@ export default function DocLink({ className = '', url, label }) { return (
-