fix: Add support for mm.tt mindmeister links

This commit is contained in:
Tom Moor
2019-07-25 22:42:23 -07:00
parent a8d8fecd15
commit 5ec2c3c7a0
3 changed files with 12 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ import * as React from 'react';
import Frame from './components/Frame';
const URL_REGEX = new RegExp(
'^https://([w.-]+.)?mindmeister.com(/maps/public_map_shell)?/(\\d+)(/.*)?$'
'^https://([w.-]+.)?(mindmeister.com|mm.tt)(/maps/public_map_shell)?/(\\d+)(\\?t=.*)?(/.*)?$'
);
type Props = {
@@ -15,7 +15,7 @@ export default class Mindmeister extends React.Component<Props> {
static ENABLED = [URL_REGEX];
render() {
const chartId = this.props.matches[3];
const chartId = this.props.matches[4] + this.props.matches[6];
return (
<Frame

View File

@@ -5,6 +5,15 @@ const { Mindmeister } = embeds;
describe('Mindmeister', () => {
const match = Mindmeister.ENABLED[0];
test('to be enabled on mm.tt link', () => {
expect('https://mm.tt/326377934'.match(match)).toBeTruthy();
});
test('to be enabled on mm.tt link with token parameter', () => {
expect('https://mm.tt/326377934?t=r9NcnTRr18'.match(match)).toBeTruthy();
});
test('to be enabled on embed link', () => {
expect(
'https://www.mindmeister.com/maps/public_map_shell/326377934/paper-digital-or-online-mind-mapping'.match(

View File

@@ -3,7 +3,7 @@ import * as React from 'react';
import Frame from './components/Frame';
const URL_REGEX = new RegExp(
'https://([w.-]+.)?modeanalytics.com/(.*)/reports/(.*)$'
'^https://([w.-]+.)?modeanalytics.com/(.*)/reports/(.*)$'
);
type Props = {