Fixes in migration of templates and campaigns from Mailtrain ver 1

This commit is contained in:
Tomas Bures 2018-07-22 15:02:43 +05:30
parent 189638364c
commit ee786bc8ad
10 changed files with 89 additions and 18 deletions

View file

@ -37,7 +37,7 @@ export class MosaicoEditor extends Component {
entity: PropTypes.object,
title: PropTypes.string,
onFullscreenAsync: PropTypes.func,
templateId: PropTypes.number,
templatePath: PropTypes.string,
initialModel: PropTypes.string,
initialMetadata: PropTypes.string
}
@ -60,7 +60,7 @@ export class MosaicoEditor extends Component {
const mosaicoData = {
entityTypeId: this.props.entityTypeId,
entityId: this.props.entity.id,
templateId: this.props.templateId,
templatePath: this.props.templatePath,
initialModel: this.props.initialModel,
initialMetadata: this.props.initialMetadata
};
@ -96,7 +96,7 @@ export class MosaicoSandbox extends Component {
static propTypes = {
entityTypeId: PropTypes.string,
entityId: PropTypes.number,
templateId: PropTypes.number,
templatePath: PropTypes.string,
initialModel: PropTypes.string,
initialMetadata: PropTypes.string
}
@ -156,7 +156,7 @@ export class MosaicoSandbox extends Component {
const trustedUrlBase = getTrustedUrl();
const metadata = this.props.initialMetadata && JSON.parse(base(this.props.initialMetadata, trustedUrlBase, sandboxUrlBase));
const model = this.props.initialModel && JSON.parse(base(this.props.initialModel, trustedUrlBase, sandboxUrlBase));
const template = getSandboxUrl(`mosaico/templates/${this.props.templateId}/index.html`);
const template = this.props.templatePath;
const allPlugins = plugins.concat(window.mosaicoPlugins);