Fixed sandbox. Multiple tabs work now.

WiP on selectable mosaico templates.

TODO: Make files always point to trusted URL, such that we don't have to rebase them. They are public anyway. The same goes for mosaico endpoints: /mosaico/templates and /mosaico/img
This commit is contained in:
Tomas Bures 2018-05-09 04:07:01 +02:00
parent a4ee1534cc
commit 7788b0bc67
79 changed files with 724 additions and 390 deletions

View file

@ -132,10 +132,10 @@ export default class CUD extends Component {
let sendMethod, url;
if (this.props.entity) {
sendMethod = FormSendMethod.PUT;
url = `/rest/send-configurations/${this.props.entity.id}`
url = `rest/send-configurations/${this.props.entity.id}`
} else {
sendMethod = FormSendMethod.POST;
url = '/rest/send-configurations'
url = 'rest/send-configurations'
}
this.disableForm();
@ -175,7 +175,7 @@ export default class CUD extends Component {
<DeleteModalDialog
stateOwner={this}
visible={this.props.action === 'delete'}
deleteUrl={`/rest/send-configurations/${this.props.entity.id}`}
deleteUrl={`rest/send-configurations/${this.props.entity.id}`}
cudUrl={`/send-configurations/${this.props.entity.id}/edit`}
listUrl="/send-configurations"
deletingMsg={t('Deleting send configuration ...')}

View file

@ -18,6 +18,7 @@ import {Table} from '../lib/table';
import axios from '../lib/axios';
import moment from 'moment';
import {getMailerTypes} from './helpers';
import {checkPermissions} from "../lib/permissions";
@translate()
@ -35,14 +36,12 @@ export default class List extends Component {
@withAsyncErrorHandler
async fetchPermissions() {
const request = {
const result = await checkPermissions({
createSendConfiguration: {
entityTypeId: 'namespace',
requiredOperations: ['createSendConfiguration']
}
};
const result = await axios.post('/rest/permissions-check', request);
});
this.setState({
createPermitted: result.data.createSendConfiguration
@ -96,7 +95,7 @@ export default class List extends Component {
<Title>{t('Send Configurations')}</Title>
<Table withHeader dataUrl="/rest/send-configurations-table" columns={columns} />
<Table withHeader dataUrl="rest/send-configurations-table" columns={columns} />
</div>
);
}

View file

@ -49,7 +49,6 @@ export function getMailerTypes(t) {
} else {
state.setIn([field, 'error'], null);
}
}
function getInitCommon() {

View file

@ -17,7 +17,7 @@ function getMenus(t) {
':sendConfigurationId([0-9]+)': {
title: resolved => t('Template "{{name}}"', {name: resolved.sendConfiguration.name}),
resolve: {
sendConfiguration: params => `/rest/send-configurations/${params.sendConfigurationId}`
sendConfiguration: params => `rest/send-configurations/${params.sendConfigurationId}`
},
link: params => `/send-configurations/${params.sendConfigurationId}/edit`,
navs: {