Live: remove the 'canPublish' check from the UI (#39016)

pull/39060/head
Ryan McKinley 4 years ago committed by GitHub
parent 06a616e630
commit be2e9d3501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      public/app/plugins/panel/live/LivePanel.tsx

@ -15,7 +15,6 @@ import {
applyFieldOverrides, applyFieldOverrides,
StreamingDataFrame, StreamingDataFrame,
LiveChannelAddress, LiveChannelAddress,
LiveChannelConfig,
} from '@grafana/data'; } from '@grafana/data';
import { TablePanel } from '../table/TablePanel'; import { TablePanel } from '../table/TablePanel';
import { LivePanelOptions, MessageDisplayMode } from './types'; import { LivePanelOptions, MessageDisplayMode } from './types';
@ -28,7 +27,6 @@ interface Props extends PanelProps<LivePanelOptions> {}
interface State { interface State {
error?: any; error?: any;
addr?: LiveChannelAddress; addr?: LiveChannelAddress;
info?: LiveChannelConfig;
status?: LiveChannelStatusEvent; status?: LiveChannelStatusEvent;
message?: any; message?: any;
changed: number; changed: number;
@ -88,7 +86,6 @@ export class LivePanel extends PureComponent<Props, State> {
this.unsubscribe(); this.unsubscribe();
this.setState({ this.setState({
addr: undefined, addr: undefined,
info: undefined,
}); });
return; return;
} }
@ -104,7 +101,6 @@ export class LivePanel extends PureComponent<Props, State> {
this.unsubscribe(); this.unsubscribe();
this.setState({ this.setState({
addr: undefined, addr: undefined,
info: undefined,
}); });
return; return;
} }
@ -146,9 +142,9 @@ export class LivePanel extends PureComponent<Props, State> {
}; };
onPublishClicked = async () => { onPublishClicked = async () => {
const { addr, info } = this.state; const { addr } = this.state;
if (!info?.canPublish || !addr) { if (!addr) {
console.log('channel does not support publishing'); console.log('invalid address');
return; return;
} }
@ -205,16 +201,7 @@ export class LivePanel extends PureComponent<Props, State> {
} }
renderPublish(height: number) { renderPublish(height: number) {
const { info } = this.state;
if (!info) {
return <div>No info</div>;
}
if (!info.canPublish) {
return <div>This channel does not support publishing</div>;
}
const { options } = this.props; const { options } = this.props;
return ( return (
<> <>
<CodeEditor <CodeEditor

Loading…
Cancel
Save