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

feat(ui): Add redux context ui #19807

Merged
merged 3 commits into from Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,6 +15,7 @@ const CONTEXT_TYPES = {
user: require('app/components/events/contexts/user/user').default,
gpu: require('app/components/events/contexts/gpu/gpu').default,
trace: require('app/components/events/contexts/trace/trace').default,
'redux.state': require('app/components/events/contexts/redux').default,
};

function getContextComponent(type) {
Expand Down
33 changes: 33 additions & 0 deletions src/sentry/static/sentry/app/components/events/contexts/redux.tsx
@@ -0,0 +1,33 @@
import React from 'react';

import {t} from 'app/locale';
import ContextBlock from 'app/components/events/contexts/contextBlock';
import {KeyValueListData} from 'app/components/events/interfaces/keyValueList/types';
import ClippedBox from 'app/components/clippedBox';

type Props = {
alias: string;
data: Record<string, any>;
};

class ReduxContextType extends React.Component<Props> {
getKnownData(): KeyValueListData[] {
return [
{
key: 'value',
subject: t('Latest State'),
value: this.props.data,
},
];
}

render() {
return (
<ClippedBox clipHeight={250}>
<ContextBlock knownData={this.getKnownData()} />
</ClippedBox>
);
}
}

export default ReduxContextType;