-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Service): Add option to display disabled services in tabs
- Loading branch information
Showing
16 changed files
with
172 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { observer } from 'mobx-react'; | ||
import { defineMessages, intlShape } from 'react-intl'; | ||
|
||
import Button from '../../ui/Button'; | ||
|
||
const messages = defineMessages({ | ||
headline: { | ||
id: 'service.disabledHandler.headline', | ||
defaultMessage: '!!!{name} is disabled', | ||
}, | ||
action: { | ||
id: 'service.disabledHandler.action', | ||
defaultMessage: '!!!Enable {name}', | ||
}, | ||
}); | ||
|
||
@observer | ||
export default class ServiceDisabled extends Component { | ||
static propTypes = { | ||
name: PropTypes.string.isRequired, | ||
enable: PropTypes.func.isRequired, | ||
}; | ||
|
||
static contextTypes = { | ||
intl: intlShape, | ||
}; | ||
|
||
countdownInterval = null; | ||
countdownIntervalTimeout = 1000; | ||
|
||
render() { | ||
const { name, enable } = this.props; | ||
const { intl } = this.context; | ||
|
||
return ( | ||
<div className="services__crash-handler"> | ||
<h1>{intl.formatMessage(messages.headline, { name })}</h1> | ||
<Button | ||
label={intl.formatMessage(messages.action, { name })} | ||
buttonType="inverted" | ||
onClick={() => enable()} | ||
/> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.