diff --git a/app/embeds/Mindmeister.js b/app/embeds/Mindmeister.js index e4b87ca1e..3e4e963f5 100644 --- a/app/embeds/Mindmeister.js +++ b/app/embeds/Mindmeister.js @@ -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 { static ENABLED = [URL_REGEX]; render() { - const chartId = this.props.matches[3]; + const chartId = this.props.matches[4] + this.props.matches[6]; return ( { 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( diff --git a/app/embeds/ModeAnalytics.js b/app/embeds/ModeAnalytics.js index 7ba701d1a..0d9cf87ff 100644 --- a/app/embeds/ModeAnalytics.js +++ b/app/embeds/ModeAnalytics.js @@ -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 = {