()
| 198 | } |
| 199 | |
| 200 | render() { |
| 201 | let shortcut: string; |
| 202 | if (this.props.dataSource.dataSourceType !== 'local' && this.state.url && !invalidUrlError(this.state.url) && !this.state.urlError) { |
| 203 | shortcut = this.getUrlShortcut(); |
| 204 | } |
| 205 | return ( |
| 206 | <div> |
| 207 | <controls.Dialog |
| 208 | hidden={false} |
| 209 | onDismiss={this.props.onDismiss} |
| 210 | dialogContentProps={{ |
| 211 | className: `sanddance-dialog ${this.props.theme}`, |
| 212 | type: base.fluentUI.DialogType.normal, |
| 213 | title: strings.dialogTitleSnapshotsUrl, |
| 214 | }} |
| 215 | buttons={[ |
| 216 | ( |
| 217 | <base.fluentUI.PrimaryButton |
| 218 | disabled={!this.state.url || !!this.state.urlError} |
| 219 | key={0} |
| 220 | onClick={e => this.loadUrl()} |
| 221 | iconProps={{ iconName: 'CloudDownload' }} |
| 222 | text={strings.dialogLoadButton} |
| 223 | /> |
| 224 | ), |
| 225 | ]} |
| 226 | > |
| 227 | <section> |
| 228 | <base.fluentUI.TextField |
| 229 | label={strings.labelUrl} |
| 230 | placeholder={strings.urlInputPlaceholder} |
| 231 | onKeyUp={e => e.keyCode === 13 && this.loadUrl()} |
| 232 | onChange={(e, url) => |
| 233 | this.setState({ url, urlError: '' }) |
| 234 | } |
| 235 | value={this.state.url} |
| 236 | disabled={this.state.working} |
| 237 | /> |
| 238 | {this.state.urlError && ( |
| 239 | <div className="error">{this.state.urlError}</div> |
| 240 | )} |
| 241 | </section> |
| 242 | {this.props.dataSource.dataSourceType !== 'local' |
| 243 | && ( |
| 244 | <section className='tip' style={{ visibility: !invalidUrlError(this.state.url) && !this.state.urlError ? 'visible' : 'hidden' }} > |
| 245 | {strings.labelSnapshotsShortcut} <a |
| 246 | href={shortcut} |
| 247 | title={strings.labelLinkDescription} |
| 248 | aria-label={strings.labelLinkDescription} |
| 249 | >{strings.labelShare}</a> |
| 250 | </section> |
| 251 | ) |
| 252 | } |
| 253 | </controls.Dialog> |
| 254 | </div> |
| 255 | ); |
| 256 | } |
| 257 | } |
nothing calls this directly
no test coverage detected