mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Simplify "add to campaign" dialog
Talked to @clarkepaul and simplified to avoid title duplication
This commit is contained in:
parent
a9bdf33ca8
commit
84cdb15a5f
@ -2,7 +2,6 @@ import React from 'react';
|
||||
import { Modal } from 'react-bootstrap-4';
|
||||
import SilverStripeComponent from 'lib/SilverStripeComponent';
|
||||
import FormBuilder from 'components/FormBuilder/FormBuilder';
|
||||
import i18n from 'i18n';
|
||||
|
||||
class AddToCampaignModal extends SilverStripeComponent {
|
||||
constructor(props) {
|
||||
@ -96,9 +95,9 @@ class AddToCampaignModal extends SilverStripeComponent {
|
||||
show={this.props.show}
|
||||
onHide={this.props.handleHide}
|
||||
>
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>{this.props.title}</Modal.Title>
|
||||
</Modal.Header>
|
||||
{this.props.title !== false &&
|
||||
<Modal.Header closeButton><Modal.Title>{this.props.title}</Modal.Title></Modal.Header>
|
||||
}
|
||||
<Modal.Body>
|
||||
{body}
|
||||
{response}
|
||||
@ -118,7 +117,7 @@ AddToCampaignModal.propTypes = {
|
||||
|
||||
AddToCampaignModal.defaultProps = {
|
||||
show: false,
|
||||
title: i18n._t('Campaigns.AddToCampaign', 'Add to campaign'),
|
||||
title: null,
|
||||
};
|
||||
|
||||
export default AddToCampaignModal;
|
||||
|
@ -176,8 +176,8 @@ class AddToCampaignHandler {
|
||||
$inChangeSets = array_unique(ChangeSetItem::get_for_object($object)->column('ChangeSetID'));
|
||||
$changeSets = $this->getAvailableChangeSets()->map();
|
||||
|
||||
$campaignDropdown = DropdownField::create('Campaign', _t('Campaigns.CampaignTitle', 'Campaigns'), $changeSets);
|
||||
$campaignDropdown->setEmptyString(_t('Campaigns.AddToCampaign', 'Select a Campaign'));
|
||||
$campaignDropdown = DropdownField::create('Campaign', '', $changeSets);
|
||||
$campaignDropdown->setEmptyString(_t('Campaigns.AddToCampaignFormFieldLabel', 'Select a Campaign'));
|
||||
$campaignDropdown->addExtraClass('noborder');
|
||||
$campaignDropdown->setDisabledItems($inChangeSets);
|
||||
|
||||
@ -216,7 +216,7 @@ class AddToCampaignHandler {
|
||||
|
||||
$form->unsetValidator();
|
||||
$form->loadDataFrom($this->data);
|
||||
$form->addExtraClass('add-to-campaign__form');
|
||||
$form->addExtraClass('form--no-dividers add-to-campaign__form');
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
@ -20,7 +20,8 @@ class AddToCampaignHandler_FormAction extends FormAction
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct('addtocampaign', _t('CAMPAIGNS.ADDTOCAMPAIGN', 'Add to campaign'));
|
||||
parent::__construct('addtocampaign', _t('CAMPAIGNS.ADDTOCAMPAIGN', 'Add to Campaign'));
|
||||
|
||||
$this->setUseButtonTag(false);
|
||||
$this->addExtraClass('add-to-campaign-action');
|
||||
$this->setValidationExempt(true);
|
||||
|
@ -75,7 +75,7 @@ en:
|
||||
NOANSWER: 'No'
|
||||
YESANSWER: 'Yes'
|
||||
CAMPAIGNS:
|
||||
ADDTOCAMPAIGN: 'Add to campaign'
|
||||
ADDTOCAMPAIGN: 'Add to Campaign'
|
||||
CMSLoadingScreen_ss:
|
||||
LOADING: Loading...
|
||||
REQUIREJS: 'The CMS requires that you have JavaScript enabled.'
|
||||
@ -106,6 +106,7 @@ en:
|
||||
MENUTITLE: Campaigns
|
||||
Campaigns:
|
||||
AddToCampaign: 'Add To Campaign'
|
||||
AddToCampaignFormFieldLabel: 'Select a Campaign'
|
||||
CampaignTitle: 'Campaign'
|
||||
ChangePasswordEmail_ss:
|
||||
CHANGEPASSWORDFOREMAIL: 'The password for account with email address {email} has been changed. If you didn\''t change your password please change your password using the link below'
|
||||
|
Loading…
x
Reference in New Issue
Block a user