From 6134c1b49f919dd2c578bc490829d68e4d210f4e Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 18 Mar 2019 03:28:03 -0700 Subject: Release/5.0.1 beta.1 (#1344) * Add lerna * Add theme * Add forms * Add misty config to build theme & forms * reset packages version * Publish - @meetfranz/forms@1.0.0 - @meetfranz/theme@1.0.0 * Reset package version * restructure packages * try ci with lerna * Fix missing packages in build * move storybook to root + typescript TODO: fix modules * Add lerna instructions * Merge * wip * Make packages work in electron, node and web * Finalize packages & replace storybook with homegrown `uidev` * Bring package-lock back in sync * Publish - @meetfranz/forms@1.0.1 - @meetfranz/theme@1.0.1 * fix webpack issue * expose legacy styles * Add toggle element to @meetfranz/forms * start typings package * Update package.json * Add buttons * Update theme * add types * Add mdi icons to buttons * Publish - @meetfranz/forms@1.0.2 - @meetfranz/theme@1.0.2 - @meetfranz/typings@0.0.1 * Button, add missing success state * Update lerna packages * Try to disable automatic npm ci * Try to get a working bundle * Add href and type to button component * Update packages * update versions * cleanup * Update package versions [ci skip] * Update versions * Add withTheme context to button * Update & reuse electron-rebuild * feat(Windows): Add option to quit Franz from Taskbar icon * Add missing withTheme * Fix package versions * Update versions * Add pageview event * Simplify analytics calls * Pin gulp-sass-variables to 1.1.1 * Add onFocus event * Add modal overlay color * remove legacy theme files * remove code * Add dialog to share franz on social media * Fix service count * remove ping * replace ms time strings with ms module * remove unused packages * fix value setter * new payment flow * fix module reference * feat(Spell check): Add en-gb spell check languages (#1306) * move devmode info * fix(Windows): Fix losing window when "Keep Franz in background" is enabled * fix(Service): Fix service zoom (cmd/ctrl+ & cmd/ctrl-) * fixes appveyor build issue * feat(App): Update electron to 4.0.7 * ignore intellij idea project files * Automatic i18n update (i18n.meetfranz.com) * feat(App): Add security checks for external URLs * setup react-intl translations managing script * use same zooming logic for all os * feat(Linux): Add auto updater for Linux AppImage builds * Add ctrl+ for zoom in on Windows * move translation scripts into src/i18n folder * only manage en-US translations * manage translations before git pushes * Fix unused i18n strings * Bump version to 5.0.1-beta.1 * fix(Service) shortcuts for activating prev/next service fixes #1298 * fix(Service): Fix shortcut for (un)muting notifications & audio * add missing react-intl files * correctly update services submenu on language change * fix(Windows): Fix copy & paste in service context menus Closes #1316 * fix(Linux): Fix minimized window focusing (#1304) (@skoruppa) * trigger build * Check if window is minimized before restoring it * restore() should be executed only when window is minimized * fix(Notifications): Fix notifications & notification click when icon is blob * Fix/service webview unmounting (#1328) * detach service when underlying webview unmounts * disable no-param-reassign eslint rule * Add notification debug events * Update electron to 4.0.8 Update required in order to fix performance degradation due to memory leak issue https://github.com/electron/electron/pull/16772. * Automatic i18n update (i18n.meetfranz.com) * Automatic i18n update (i18n.meetfranz.com) * 5.0.1-beta.1 --- src/components/services/content/ServiceView.js | 136 +++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 src/components/services/content/ServiceView.js (limited to 'src/components/services/content/ServiceView.js') diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js new file mode 100644 index 000000000..5afc54f9d --- /dev/null +++ b/src/components/services/content/ServiceView.js @@ -0,0 +1,136 @@ +import React, { Component, Fragment } from 'react'; +import PropTypes from 'prop-types'; +import { autorun } from 'mobx'; +import { observer } from 'mobx-react'; +import classnames from 'classnames'; + +import ServiceModel from '../../../models/Service'; +import StatusBarTargetUrl from '../../ui/StatusBarTargetUrl'; +import WebviewLoader from '../../ui/WebviewLoader'; +import WebviewCrashHandler from './WebviewCrashHandler'; +import WebviewErrorHandler from './ErrorHandlers/WebviewErrorHandler'; +import ServiceDisabled from './ServiceDisabled'; +import ServiceWebview from './ServiceWebview'; + +export default @observer class ServiceView extends Component { + static propTypes = { + service: PropTypes.instanceOf(ServiceModel).isRequired, + setWebviewReference: PropTypes.func.isRequired, + detachService: PropTypes.func.isRequired, + reload: PropTypes.func.isRequired, + edit: PropTypes.func.isRequired, + enable: PropTypes.func.isRequired, + isActive: PropTypes.bool, + }; + + static defaultProps = { + isActive: false, + }; + + state = { + forceRepaint: false, + targetUrl: '', + statusBarVisible: false, + }; + + autorunDisposer = null; + + componentDidMount() { + this.autorunDisposer = autorun(() => { + if (this.props.service.isActive) { + this.setState({ forceRepaint: true }); + setTimeout(() => { + this.setState({ forceRepaint: false }); + }, 100); + } + }); + } + + componentWillUnmount() { + this.autorunDisposer(); + } + + updateTargetUrl = (event) => { + let visible = true; + if (event.url === '' || event.url === '#') { + visible = false; + } + this.setState({ + targetUrl: event.url, + statusBarVisible: visible, + }); + }; + + render() { + const { + detachService, + service, + setWebviewReference, + reload, + edit, + enable, + } = this.props; + + const webviewClasses = classnames({ + services__webview: true, + 'services__webview-wrapper': true, + 'is-active': service.isActive, + 'services__webview--force-repaint': this.state.forceRepaint, + }); + + let statusBar = null; + if (this.state.statusBarVisible) { + statusBar = ( + + ); + } + + return ( +
+ {service.isActive && service.isEnabled && ( + + {service.hasCrashed && ( + + )} + {service.isEnabled && service.isLoading && service.isFirstLoad && ( + + )} + {service.isError && ( + + )} + + )} + {!service.isEnabled ? ( + + {service.isActive && ( + + )} + + ) : ( + + )} + {statusBar} +
+ ); + } +} -- cgit v1.2.3-70-g09d2