mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-23 20:21:53 +00:00
Updated mercure integration so that the hook accepts a list of topics to subscribe
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { RouteComponentProps } from 'react-router';
|
||||
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
|
||||
import { ShlinkVisitsParams } from '../api/types';
|
||||
import { Topics } from '../mercure/helpers/Topics';
|
||||
import { TagVisits as TagVisitsState } from './reducers/tagVisits';
|
||||
import VisitsStats from './VisitsStats';
|
||||
import { OrphanVisitsHeader } from './OrphanVisitsHeader';
|
||||
@@ -26,4 +27,4 @@ export const OrphanVisits = boundToMercureHub(({
|
||||
>
|
||||
<OrphanVisitsHeader orphanVisits={orphanVisits} goBack={goBack} />
|
||||
</VisitsStats>
|
||||
), () => 'https://shlink.io/new-orphan-visit');
|
||||
), () => [ Topics.orphanVisits() ]);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { RouteComponentProps } from 'react-router';
|
||||
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
|
||||
import { ShlinkVisitsParams } from '../api/types';
|
||||
import { parseQuery } from '../utils/helpers/query';
|
||||
import { Topics } from '../mercure/helpers/Topics';
|
||||
import { ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits';
|
||||
import ShortUrlVisitsHeader from './ShortUrlVisitsHeader';
|
||||
import { ShortUrlDetail } from './reducers/shortUrlDetail';
|
||||
@@ -45,6 +46,6 @@ const ShortUrlVisits = boundToMercureHub(({
|
||||
<ShortUrlVisitsHeader shortUrlDetail={shortUrlDetail} shortUrlVisits={shortUrlVisits} goBack={goBack} />
|
||||
</VisitsStats>
|
||||
);
|
||||
}, ({ match }) => `https://shlink.io/new-visit/${match.params.shortCode}`);
|
||||
}, ({ match }) => [ Topics.shortUrlVisits(match.params.shortCode) ]);
|
||||
|
||||
export default ShortUrlVisits;
|
||||
|
||||
@@ -2,6 +2,7 @@ import { RouteComponentProps } from 'react-router';
|
||||
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
|
||||
import ColorGenerator from '../utils/services/ColorGenerator';
|
||||
import { ShlinkVisitsParams } from '../api/types';
|
||||
import { Topics } from '../mercure/helpers/Topics';
|
||||
import { TagVisits as TagVisitsState } from './reducers/tagVisits';
|
||||
import TagVisitsHeader from './TagVisitsHeader';
|
||||
import VisitsStats from './VisitsStats';
|
||||
@@ -27,6 +28,6 @@ const TagVisits = (colorGenerator: ColorGenerator) => boundToMercureHub(({
|
||||
<TagVisitsHeader tagVisits={tagVisits} goBack={goBack} colorGenerator={colorGenerator} />
|
||||
</VisitsStats>
|
||||
);
|
||||
}, () => 'https://shlink.io/new-visit');
|
||||
}, () => [ Topics.visits() ]);
|
||||
|
||||
export default TagVisits;
|
||||
|
||||
Reference in New Issue
Block a user