From 2bbedd9def2a782f370fb5280994ea0ecbf8a7c7 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 18 May 2017 09:28:18 -0400 Subject: Updating client dependencies. Switching to yarn. (#6433) * Updating client dependancies. Switching to using yarn. * Updating React * Moving pure components to using function syntax (performance gains with newer react version) * Updating client dependancies. * Ignore .yarninstall * Enabling pre-lockfile because it's the entire point of using yarn. * Removing old webpack config * Moving to new prop-types * Fixing ESLint Errors * Updating jest snapshots. * Cleaning up package.json --- webapp/components/audit_table.jsx | 208 +++++++++++++++++++------------------- 1 file changed, 104 insertions(+), 104 deletions(-) (limited to 'webapp/components/audit_table.jsx') diff --git a/webapp/components/audit_table.jsx b/webapp/components/audit_table.jsx index e07d6ca12..1f005e7e5 100644 --- a/webapp/components/audit_table.jsx +++ b/webapp/components/audit_table.jsx @@ -206,129 +206,129 @@ const holders = defineMessages({ } }); -import React from 'react'; +import PropTypes from 'prop-types'; -class AuditTable extends React.Component { - render() { - var accessList = []; - - const {formatMessage} = this.props.intl; - for (var i = 0; i < this.props.audits.length; i++) { - const audit = this.props.audits[i]; - const auditInfo = formatAuditInfo(audit, formatMessage); - - let uContent; - if (this.props.showUserId) { - var profile = UserStore.getProfile(auditInfo.userId); - if (profile) { - uContent = {profile.email}; - } else { - uContent = {auditInfo.userId}; - } - } +import React from 'react'; - let iContent; - if (this.props.showIp) { - iContent = {auditInfo.ip}; - } +function AuditTable(props) { + var accessList = []; - let sContent; - if (this.props.showSession) { - sContent = {auditInfo.sessionId}; - } + const {formatMessage} = props.intl; + for (var i = 0; i < props.audits.length; i++) { + const audit = props.audits[i]; + const auditInfo = formatAuditInfo(audit, formatMessage); - const descStyle = {}; - if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) { - descStyle.color = 'red'; + let uContent; + if (props.showUserId) { + var profile = UserStore.getProfile(auditInfo.userId); + if (profile) { + uContent = {profile.email}; + } else { + uContent = {auditInfo.userId}; } - - accessList[i] = ( - - {auditInfo.timestamp} - {uContent} - - {auditInfo.desc} - - {iContent} - {sContent} - - ); } - let userIdContent; - if (this.props.showUserId) { - userIdContent = ( - - - - ); + let iContent; + if (props.showIp) { + iContent = {auditInfo.ip}; } - let ipContent; - if (this.props.showIp) { - ipContent = ( - - - - ); + let sContent; + if (props.showSession) { + sContent = {auditInfo.sessionId}; } - let sessionContent; - if (this.props.showSession) { - sessionContent = ( - - - - ); + const descStyle = {}; + if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) { + descStyle.color = 'red'; } - return ( - - - - - {userIdContent} - - {ipContent} - {sessionContent} - - - - {accessList} - -
- - - -
+ accessList[i] = ( + + {auditInfo.timestamp} + {uContent} + + {auditInfo.desc} + + {iContent} + {sContent} + + ); + } + + let userIdContent; + if (props.showUserId) { + userIdContent = ( + + + + ); + } + + let ipContent; + if (props.showIp) { + ipContent = ( + + + + ); + } + + let sessionContent; + if (props.showSession) { + sessionContent = ( + + + ); } + + return ( + + + + + {userIdContent} + + {ipContent} + {sessionContent} + + + + {accessList} + +
+ + + +
+ ); } AuditTable.propTypes = { intl: intlShape.isRequired, - audits: React.PropTypes.array.isRequired, - showUserId: React.PropTypes.bool, - showIp: React.PropTypes.bool, - showSession: React.PropTypes.bool + audits: PropTypes.array.isRequired, + showUserId: PropTypes.bool, + showIp: PropTypes.bool, + showSession: PropTypes.bool }; export default injectIntl(AuditTable); -- cgit v1.2.3-1-g7c22