Skip to content
Snippets Groups Projects
Unverified Commit fa1f957f authored by Kyle Doherty's avatar Kyle Doherty Committed by GitHub
Browse files

require recipient for test email in pulses (#8291)

* require recipient for test email

* only apply recipient requirement to channel test button
parent 3c6410a3
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ export function channelIsValid(channel, channelSpec) {
return false;
}
if (channelSpec.recipients) {
if (!channel.recipients /* || channel.recipients.length === 0*/) {
if (!channel.recipients) {
return false;
}
}
......
......@@ -18,8 +18,6 @@ import MetabaseAnalytics from "metabase/lib/analytics";
import { channelIsValid, createChannel } from "metabase/lib/pulse";
import cx from "classnames";
export const CHANNEL_ICONS = {
email: "mail",
slack: "slack",
......@@ -231,7 +229,12 @@ export default class PulseEditChannels extends Component {
<div className="pt2">
<ActionButton
actionFn={this.onTestPulseChannel.bind(this, channel)}
className={cx("Button", { disabled: !isValid })}
disabled={
!isValid ||
/* require at least one email recipient to allow email pulse testing */
(channelSpec.type === "email" &&
channel.recipients.length === 0)
}
normalText={
channelSpec.type === "email"
? t`Send email now`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment