Campaign status show send settings Bug
This commit is contained in:
parent
4b1b1a380d
commit
1a61067ff9
9 changed files with 119 additions and 26 deletions
|
@ -12,7 +12,8 @@ import {
|
|||
requiresAuthenticatedUser,
|
||||
Title,
|
||||
Toolbar,
|
||||
withPageHelpers
|
||||
withPageHelpers,
|
||||
getNamespaceChooser
|
||||
} from '../lib/page';
|
||||
import {
|
||||
withAsyncErrorHandler,
|
||||
|
@ -75,8 +76,12 @@ export default class List extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
|
||||
const t = this.props.t;
|
||||
|
||||
var pathname = window.location.href;
|
||||
var url = new URL(pathname);
|
||||
var namespace = url.searchParams.get("namespace");
|
||||
|
||||
const columns = [
|
||||
{ data: 1, title: t('name') },
|
||||
{ data: 2, title: t('id'), render: data => <code>{data}</code> },
|
||||
|
@ -108,6 +113,7 @@ export default class List extends Component {
|
|||
const status = data[5];
|
||||
const campaignSource = data[7];
|
||||
|
||||
|
||||
if (perms.includes('viewStats')) {
|
||||
actions.push({
|
||||
label: <Icon icon="envelope" title={t('status')}/>,
|
||||
|
@ -172,6 +178,7 @@ export default class List extends Component {
|
|||
return (
|
||||
<div>
|
||||
{tableRestActionDialogRender(this)}
|
||||
|
||||
<Toolbar>
|
||||
{this.state.createPermitted &&
|
||||
<ButtonDropdown buttonClassName="btn-primary" menuClassName="dropdown-menu-right" label={t('createCampaign')}>
|
||||
|
@ -182,10 +189,19 @@ export default class List extends Component {
|
|||
}
|
||||
</Toolbar>
|
||||
|
||||
<Title>{t('campaigns')}</Title>
|
||||
<Toolbar>
|
||||
{getNamespaceChooser(t)}
|
||||
</Toolbar>
|
||||
|
||||
<Table ref={node => this.table = node} withHeader dataUrl="rest/campaigns-table" columns={columns} />
|
||||
<Title>{t('campaigns')}</Title>
|
||||
{!namespace &&
|
||||
<Table ref={node => this.table = node} withHeader dataUrl="rest/campaigns-table" columns={columns} />
|
||||
}
|
||||
{!!namespace &&
|
||||
<Table ref={node => this.table = node} withHeader dataUrl={`rest/campaigns-namespace/${namespace}`} columns={columns} />
|
||||
}
|
||||
</div>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
|
@ -443,11 +443,17 @@ export default class Status extends Component {
|
|||
let sendSettings;
|
||||
if (this.state.sendConfiguration) {
|
||||
sendSettings = [];
|
||||
|
||||
|
||||
const addOverridable = (id, label) => {
|
||||
sendSettings.push(<AlignedRow key={id} label={label}>{entity[id + '_override'] === null ? this.state.sendConfiguration[id] : entity[id + '_override']}</AlignedRow>);
|
||||
if(this.state.sendConfiguration[id + '_overridable'] == 1){
|
||||
sendSettings.push(<AlignedRow key={id} label={label}>{entity[id + '_override']}</AlignedRow>);
|
||||
}
|
||||
else{
|
||||
sendSettings.push(<AlignedRow key={id} label={label}>{this.state.sendConfiguration[id]}</AlignedRow>);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
addOverridable('from_name', t('fromName'));
|
||||
addOverridable('from_email', t('fromEmailAddress'));
|
||||
addOverridable('reply_to', t('replytoEmailAddress'));
|
||||
|
|
|
@ -23,6 +23,7 @@ import {
|
|||
Button,
|
||||
DismissibleAlert,
|
||||
DropdownActionLink,
|
||||
ButtonDropdown,
|
||||
Icon
|
||||
} from "./bootstrap-components";
|
||||
import mailtrainConfig
|
||||
|
@ -696,4 +697,22 @@ export function getLanguageChooser(t) {
|
|||
);
|
||||
|
||||
return languageChooser;
|
||||
}
|
||||
|
||||
export function getNamespaceChooser(t) {
|
||||
|
||||
const namespaceOptions = [];
|
||||
namespaceOptions.push(
|
||||
<DropdownLink to={`/campaigns`}>{t('All')}</DropdownLink>,
|
||||
<DropdownLink to={`/campaigns?namespace=1`}>{t('Root')}</DropdownLink>
|
||||
)
|
||||
|
||||
|
||||
const namespaceChooser = (
|
||||
<ButtonDropdown buttonClassName="btn-primary" menuClassName="dropdown-menu-right" label={t('namespaceFilter')}>
|
||||
{namespaceOptions}
|
||||
</ButtonDropdown>
|
||||
);
|
||||
|
||||
return namespaceChooser;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue