1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-31 01:16:01 +02:00

fix(util): remove unused function

This commit is contained in:
Corinne Krych 2018-02-08 11:23:07 +01:00
parent 920872512c
commit 4f49f8421c
4 changed files with 10 additions and 7 deletions

View File

@ -21,7 +21,7 @@ import {
Switch, Switch,
} from 'react-mdl'; } from 'react-mdl';
import { IconLink, shorten, styles as commonStyles } from '../common'; import { IconLink, shorten, styles as commonStyles } from '../common';
import { formatFullDateTime } from '../common/util'; import { formatFullDateTimeWithLocale } from '../common/util';
class StatefulTextfield extends Component { class StatefulTextfield extends Component {
static propTypes = { static propTypes = {
@ -59,6 +59,7 @@ class ClientApplications extends PureComponent {
fetchApplication: PropTypes.func.isRequired, fetchApplication: PropTypes.func.isRequired,
appName: PropTypes.string, appName: PropTypes.string,
application: PropTypes.object, application: PropTypes.object,
location: PropTypes.object,
storeApplicationMetaData: PropTypes.func.isRequired, storeApplicationMetaData: PropTypes.func.isRequired,
}; };
@ -70,7 +71,9 @@ class ClientApplications extends PureComponent {
componentDidMount() { componentDidMount() {
this.props.fetchApplication(this.props.appName); this.props.fetchApplication(this.props.appName);
} }
formatFullDateTime(v) {
return formatFullDateTimeWithLocale(v, this.props.location.locale);
}
render() { render() {
if (!this.props.application) { if (!this.props.application) {
return <ProgressBar indeterminate />; return <ProgressBar indeterminate />;
@ -142,7 +145,7 @@ class ClientApplications extends PureComponent {
icon="timeline" icon="timeline"
subtitle={ subtitle={
<span> <span>
{clientIp} last seen at <small>{formatFullDateTime(lastSeen)}</small> {clientIp} last seen at <small>{this.formatFullDateTime(lastSeen)}</small>
</span> </span>
} }
> >

View File

@ -4,11 +4,13 @@ import { fetchApplication, storeApplicationMetaData } from '../../store/applicat
const mapStateToProps = (state, props) => { const mapStateToProps = (state, props) => {
let application = state.applications.getIn(['apps', props.appName]); let application = state.applications.getIn(['apps', props.appName]);
const location = state.settings.toJS().location || {};
if (application) { if (application) {
application = application.toJS(); application = application.toJS();
} }
return { return {
application, application,
location,
}; };
}; };

View File

@ -26,5 +26,3 @@ export const formatFullDateTimeWithLocale = (v, locale) => {
dateTimeOptions.timeZone = found ? found.timezone : 'UTC'; dateTimeOptions.timeZone = found ? found.timezone : 'UTC';
return new Date(v).toLocaleString(locale, dateTimeOptions); return new Date(v).toLocaleString(locale, dateTimeOptions);
}; };
export const formatFullDateTime = v => formatFullDateTimeWithLocale(v, 'nb-NO');

View File

@ -45,7 +45,7 @@ export default class MetricComponent extends React.Component {
this.props.fetchSeenApps(); this.props.fetchSeenApps();
this.props.fetchFeatureMetrics(); this.props.fetchFeatureMetrics();
} }
formatFulldateTime(v) { formatFullDateTime(v) {
return formatFullDateTimeWithLocale(v, this.props.location.locale); return formatFullDateTimeWithLocale(v, this.props.location.locale);
} }
render() { render() {
@ -110,7 +110,7 @@ export default class MetricComponent extends React.Component {
</div> </div>
)} )}
<AppsLinkList apps={seenApps} /> <AppsLinkList apps={seenApps} />
<span>Created {this.formatFulldateTime(featureToggle.createdAt)}</span> <span>Created {this.formatFullDateTime(featureToggle.createdAt)}</span>
</Cell> </Cell>
</Grid> </Grid>
<hr /> <hr />