change(ui): add project key to all integration plugins

This commit is contained in:
sylenien 2022-08-30 12:46:09 +02:00
parent 7b5b9c7b1a
commit 73ea3e6556
11 changed files with 20 additions and 13 deletions

View file

@ -5,6 +5,7 @@ import AssistScript from './AssistScript';
import AssistNpm from './AssistNpm';
import { Tabs } from 'UI';
import { useState } from 'react';
import { connect } from 'react-redux';
const NPM = 'NPM';
const SCRIPT = 'SCRIPT';
@ -53,4 +54,4 @@ const AssistDoc = (props) => {
AssistDoc.displayName = 'AssistDoc';
export default AssistDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(AssistDoc)

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from 'Shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const AxiosDoc = (props) => {
const { projectKey } = props;
@ -65,4 +66,4 @@ function MyApp() {
AxiosDoc.displayName = 'AxiosDoc';
export default AxiosDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(AxiosDoc)

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from 'Shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const FetchDoc = (props) => {
const { projectKey } = props;
@ -69,4 +70,4 @@ fetch('https://api.openreplay.com/').then(response => console.log(response.json(
FetchDoc.displayName = 'FetchDoc';
export default FetchDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(FetchDoc)

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import DocLink from 'Shared/DocLink/DocLink';
import ToggleContent from 'Shared/ToggleContent';
import { connect } from 'react-redux';
const GraphQLDoc = (props) => {
const { projectKey } = props;
@ -69,4 +70,4 @@ export const recordGraphQL = tracker.use(trackerGraphQL());`}
GraphQLDoc.displayName = 'GraphQLDoc';
export default GraphQLDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(GraphQLDoc)

View file

@ -156,7 +156,7 @@ const integrations = [
},
{
title: 'Plugins',
isProject: false,
isProject: true,
description:
"Reproduce issues as if they happened in your own browser. Plugins help capture your application's store, HTTP requeets, GraphQL queries, and more.",
integrations: [

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from 'Shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const MobxDoc = (props) => {
const { projectKey } = props;
@ -66,4 +67,4 @@ function SomeFunctionalComponent() {
MobxDoc.displayName = 'MobxDoc';
export default MobxDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(MobxDoc)

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from 'Shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const NgRxDoc = (props) => {
const { projectKey } = props;
@ -79,4 +80,4 @@ const metaReducers = [tracker.use(trackerNgRx(<options>))]; // check list of ava
NgRxDoc.displayName = 'NgRxDoc';
export default NgRxDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(NgRxDoc)

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from 'Shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const ProfilerDoc = (props) => {
const { projectKey } = props;
@ -73,4 +74,4 @@ const fn = profiler('call_name')(() => {
ProfilerDoc.displayName = 'ProfilerDoc';
export default ProfilerDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(ProfilerDoc)

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from '../../../shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const ReduxDoc = (props) => {
const { projectKey } = props;
@ -72,4 +73,4 @@ const store = createStore(
ReduxDoc.displayName = 'ReduxDoc';
export default ReduxDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(ReduxDoc)

View file

@ -7,14 +7,12 @@ import { useModal } from 'App/components/Modal';
import { Button } from 'UI';
interface Props {
onEdit: (integration: any) => void;
onEdit?: (integration: any) => void;
istance: any;
fetchList: any;
init: any;
}
const SlackForm = (props: Props) => {
const { istance } = props;
const { hideModal } = useModal();
const [active, setActive] = React.useState(false);
const onEdit = () => {

View file

@ -2,6 +2,7 @@ import React from 'react';
import Highlight from 'react-highlight';
import ToggleContent from '../../../shared/ToggleContent';
import DocLink from 'Shared/DocLink/DocLink';
import { connect } from 'react-redux';
const VueDoc = (props) => {
const { projectKey } = props;
@ -75,4 +76,4 @@ const store = new Vuex.Store({
VueDoc.displayName = 'VueDoc';
export default VueDoc;
export default connect((state) => ({ projectKey: state.getIn(['site', 'instance', 'projectKey'])}) )(VueDoc)