some fixes after issues store
This commit is contained in:
parent
ef318318d8
commit
3f9b485be6
5 changed files with 20 additions and 15 deletions
|
|
@ -9,11 +9,9 @@ import { Tag } from 'antd'
|
|||
import { ShareAltOutlined } from '@ant-design/icons';
|
||||
import { Button as AntButton, Popover } from 'antd';
|
||||
import SharePopup from 'Components/shared/SharePopup/SharePopup';
|
||||
import { useStore } from "App/mstore";
|
||||
|
||||
function SubHeader(props: any) {
|
||||
const { issueReportingStore } = useStore()
|
||||
const integrations = issueReportingStore.list
|
||||
const integrations = props.integrations;
|
||||
|
||||
const enabledIntegration = useMemo(() => {
|
||||
if (!integrations || !integrations.length) {
|
||||
|
|
@ -60,5 +58,6 @@ function SubHeader(props: any) {
|
|||
export default connect((state: any) => ({
|
||||
siteId: state.getIn(['site', 'siteId']),
|
||||
modules: state.getIn(['user', 'account', 'modules']) || [],
|
||||
integrations: state.getIn(['issues', 'list']),
|
||||
isIOS: state.getIn(['sessions', 'current']).platform === 'ios',
|
||||
}))(observer(SubHeader));
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ function PlayerBlock(props: IProps) {
|
|||
activeTab,
|
||||
fullView = false,
|
||||
setActiveTab,
|
||||
jiraConfig,
|
||||
} = props;
|
||||
const { uiPlayerStore, issueReportingStore } = useStore();
|
||||
const jiraConfig = issueReportingStore.list[0]
|
||||
const { uiPlayerStore } = useStore();
|
||||
const fullscreen = uiPlayerStore.fullscreen;
|
||||
const shouldShowSubHeader = !fullscreen && !fullView
|
||||
return (
|
||||
|
|
@ -45,4 +45,5 @@ function PlayerBlock(props: IProps) {
|
|||
|
||||
export default connect((state: any) => ({
|
||||
sessionId: state.getIn(['sessions', 'current']).sessionId,
|
||||
jiraConfig: state.getIn(['issues', 'list'])[0],
|
||||
}))(observer(PlayerBlock))
|
||||
|
|
@ -23,9 +23,9 @@ function PlayerBlock(props: IProps) {
|
|||
activeTab,
|
||||
fullView = false,
|
||||
setActiveTab,
|
||||
jiraConfig
|
||||
} = props;
|
||||
const { uiPlayerStore, issueReportingStore } = useStore();
|
||||
const jiraConfig = issueReportingStore.list[0]
|
||||
const { uiPlayerStore, } = useStore();
|
||||
const fullscreen = uiPlayerStore.fullscreen;
|
||||
const shouldShowSubHeader = !fullscreen && !fullView;
|
||||
return (
|
||||
|
|
@ -46,4 +46,5 @@ function PlayerBlock(props: IProps) {
|
|||
|
||||
export default connect((state: Record<string, any>) => ({
|
||||
sessionId: state.getIn(['sessions', 'current']).sessionId,
|
||||
jiraConfig: state.getIn(['issues', 'list'])[0]
|
||||
}))(observer(PlayerBlock));
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Button, Tooltip } from 'antd';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { connect } from 'react-redux';
|
||||
import React from 'react';
|
||||
import { useStore } from 'App/mstore';
|
||||
import { Icon, Popover } from 'UI';
|
||||
|
|
@ -7,7 +7,6 @@ import IssuesModal from './IssuesModal';
|
|||
|
||||
function Issues(props) {
|
||||
const { issueReportingStore } = useStore();
|
||||
const issuesIntegration = issueReportingStore.list
|
||||
|
||||
const handleOpen = () => {
|
||||
issueReportingStore.init();
|
||||
|
|
@ -20,8 +19,9 @@ function Issues(props) {
|
|||
}
|
||||
};
|
||||
|
||||
const { sessionId } = props;
|
||||
const provider = issuesIntegration[0]?.provider || '';
|
||||
const { sessionId, issuesIntegration } = props;
|
||||
const provider = issuesIntegration?.first().provider || '';
|
||||
|
||||
return (
|
||||
<Popover
|
||||
onOpen={handleOpen}
|
||||
|
|
@ -39,7 +39,7 @@ function Issues(props) {
|
|||
<Tooltip title={'Create Issue'} placement="bottom">
|
||||
<Button size={'small'} className={'flex items-center justify-center'}>
|
||||
<Icon
|
||||
name={`integrations/${provider === 'jira' ? 'jira' : 'github'}`}
|
||||
name={`integrations/${provider ?? 'github'}`}
|
||||
/>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
|
@ -48,4 +48,7 @@ function Issues(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default observer(Issues);
|
||||
export default connect((state) => ({
|
||||
issuesIntegration: state.getIn(['issues', 'list']) || {},
|
||||
issuesFetched: state.getIn(['issues', 'issuesFetched']),
|
||||
}))(Issues);
|
||||
|
|
@ -28,9 +28,8 @@ function SubHeader(props) {
|
|||
const { store } = React.useContext(PlayerContext);
|
||||
const { location: currentLocation = 'loading...' } = store.get();
|
||||
const hasIframe = localStorage.getItem(IFRAME) === 'true';
|
||||
const { uxtestingStore, issueReportingStore } = useStore();
|
||||
const { uxtestingStore } = useStore();
|
||||
const [hideTools, setHideTools] = React.useState(false);
|
||||
const integrations = issueReportingStore.list;
|
||||
React.useEffect(() => {
|
||||
const hideDevtools = checkParam('hideTools');
|
||||
if (hideDevtools) {
|
||||
|
|
@ -39,6 +38,7 @@ function SubHeader(props) {
|
|||
}, []);
|
||||
|
||||
const enabledIntegration = useMemo(() => {
|
||||
const { integrations } = props;
|
||||
if (!integrations || !integrations.size) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -156,5 +156,6 @@ function SubHeader(props) {
|
|||
|
||||
export default connect((state) => ({
|
||||
siteId: state.getIn(['site', 'siteId']),
|
||||
integrations: state.getIn(['issues', 'list']),
|
||||
modules: state.getIn(['user', 'account', 'modules']) || []
|
||||
}))(observer(SubHeader));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue