()
| 51807 | } |
| 51808 | } |
| 51809 | loadUrl() { |
| 51810 | if (!this.state.url) return this.setState({ |
| 51811 | urlError: (0, _language.strings).errorNoUrl |
| 51812 | }); |
| 51813 | if (this.state.url.toLocaleLowerCase().substr(0, 4) !== "http") return this.setState({ |
| 51814 | urlError: (0, _language.strings).errorUrlHttp |
| 51815 | }); |
| 51816 | //TODO: check url |
| 51817 | const { url } = this.state; |
| 51818 | const ds = { |
| 51819 | dataSourceType: "url", |
| 51820 | displayName: url, |
| 51821 | id: url, |
| 51822 | dataUrl: url, |
| 51823 | type: this.state.urlType |
| 51824 | }; |
| 51825 | this.changeDataSource(ds).catch((e)=>{ |
| 51826 | this.setState({ |
| 51827 | urlError: e.message |
| 51828 | }); |
| 51829 | }); |
| 51830 | } |
| 51831 | getUrlShortcut(dataUrl, type) { |
| 51832 | const dss = { |
| 51833 | dataSource: { |
no test coverage detected