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

Loading…
Cancel
Save