payroll_manager/front-end/build/cache-loader/9345fdb28f24fe52dee163990004c2aa.json

1 line
17 KiB
JSON

{"remainingRequest":"/var/www/html/payroll_manager/front-end/node_modules/thread-loader/dist/cjs.js??ref--4-2!/var/www/html/payroll_manager/front-end/node_modules/ts-loader/index.js??ref--4-3!/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js!/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/audits/audits.tsx","dependencies":[{"path":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/audits/audits.tsx","mtime":1533613272229},{"path":"/var/www/html/payroll_manager/front-end/node_modules/react-hot-loader/webpack.js","mtime":1505850161000},{"path":"/var/www/html/payroll_manager/front-end/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/var/www/html/payroll_manager/front-end/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/var/www/html/payroll_manager/front-end/node_modules/ts-loader/index.js","mtime":1530127508000},{"path":"/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js","mtime":1519899048000}],"contextDependencies":[],"result":["import * as tslib_1 from \"tslib\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Input, Row, Table } from 'reactstrap';\nimport { TextFormat, JhiPagination, getPaginationItemsNumber, getSortState } from 'react-jhipster';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { APP_TIMESTAMP_FORMAT } from 'app/config/constants';\nimport { ITEMS_PER_PAGE } from 'app/shared/util/pagination.constants';\nimport { getAudits } from '../administration.reducer';\nvar previousMonth = function () {\n var now = new Date();\n var fromDate = now.getMonth() === 0\n ? new Date(now.getFullYear() - 1, 11, now.getDate())\n : new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());\n return fromDate.toISOString().slice(0, 10);\n};\nvar today = function () {\n // Today + 1 day - needed if the current day must be included\n var day = new Date();\n day.setDate(day.getDate() + 1);\n var toDate = new Date(day.getFullYear(), day.getMonth(), day.getDate());\n return toDate.toISOString().slice(0, 10);\n};\nvar AuditsPage = /** @class */ (function (_super) {\n tslib_1.__extends(AuditsPage, _super);\n function AuditsPage() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = tslib_1.__assign({}, getSortState(_this.props.location, ITEMS_PER_PAGE), { fromDate: previousMonth(), toDate: today() });\n _this.onChangeFromDate = function (evt) {\n _this.setState({\n fromDate: evt.target.value\n }, function () { return _this.getAudits(); });\n };\n _this.onChangeToDate = function (evt) {\n _this.setState({\n toDate: evt.target.value\n }, function () { return _this.getAudits(); });\n };\n _this.sort = function (prop) { return function () {\n _this.setState({\n order: _this.state.order === 'asc' ? 'desc' : 'asc',\n sort: prop\n }, function () { return _this.transition(); });\n }; };\n _this.transition = function () {\n _this.getAudits();\n _this.props.history.push(_this.props.location.pathname + \"?page=\" + _this.state.activePage + \"&sort=\" + _this.state.sort + \",\" + _this.state.order);\n };\n _this.handlePagination = function (activePage) { return _this.setState({ activePage: activePage }, function () { return _this.transition(); }); };\n _this.getAudits = function () {\n var _a = _this.state, activePage = _a.activePage, itemsPerPage = _a.itemsPerPage, sort = _a.sort, order = _a.order, fromDate = _a.fromDate, toDate = _a.toDate;\n _this.props.getAudits(activePage - 1, itemsPerPage, sort + \",\" + order, fromDate, toDate);\n };\n return _this;\n }\n AuditsPage.prototype.componentDidMount = function () {\n this.getAudits();\n };\n AuditsPage.prototype.render = function () {\n var _a = this.props, audits = _a.audits, totalItems = _a.totalItems;\n var _b = this.state, fromDate = _b.fromDate, toDate = _b.toDate;\n return (React.createElement(\"div\", null,\n React.createElement(\"h2\", { className: \"audits-page-heading\" }, \"Audits\"),\n React.createElement(\"span\", null, \"from\"),\n React.createElement(Input, { type: \"date\", value: fromDate, onChange: this.onChangeFromDate, name: \"fromDate\", id: \"fromDate\" }),\n React.createElement(\"span\", null, \"to\"),\n React.createElement(Input, { type: \"date\", value: toDate, onChange: this.onChangeToDate, name: \"toDate\", id: \"toDate\" }),\n React.createElement(Table, { striped: true, responsive: true },\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", { onClick: this.sort('auditEventDate') },\n \"Date\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", { onClick: this.sort('principal') },\n \"User\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", { onClick: this.sort('auditEventType') },\n \"State\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", null, \"Extra data\"))),\n React.createElement(\"tbody\", null, audits.map(function (audit, i) { return (React.createElement(\"tr\", { key: \"audit-\" + i },\n React.createElement(\"td\", null, React.createElement(TextFormat, { value: audit.timestamp, type: \"date\", format: APP_TIMESTAMP_FORMAT })),\n React.createElement(\"td\", null, audit.principal),\n React.createElement(\"td\", null, audit.type),\n React.createElement(\"td\", null,\n audit.data ? audit.data.message : null,\n audit.data ? audit.data.remoteAddress : null))); }))),\n React.createElement(Row, { className: \"justify-content-center\" },\n React.createElement(JhiPagination, { items: getPaginationItemsNumber(totalItems, this.state.itemsPerPage), activePage: this.state.activePage, onSelect: this.handlePagination, maxButtons: 5 }))));\n };\n return AuditsPage;\n}(React.Component));\nexport { AuditsPage };\nvar mapStateToProps = function (storeState) { return ({\n audits: storeState.administration.audits,\n totalItems: storeState.administration.totalItems\n}); };\nvar mapDispatchToProps = { getAudits: getAudits };\nexport default connect(mapStateToProps, mapDispatchToProps)(AuditsPage);\n",{"version":3,"file":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/audits/audits.tsx","sourceRoot":"","sources":["/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js!/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/audits/audits.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;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AAM,EAAE,UAAU,CAAC,cAAc,CAAC,MAAM;IACxC,UAAU,EAAE,UAAU,CAAC,cAAc,CAAC,UAAU;CACjD,CAAC,EAHkD,CAGlD,CAAC;AAEH,IAAM,kBAAkB,GAAG,EAAE,SAAS,WAAA,EAAE,CAAC;AAKzC,eAAe,OAAO,CACpB,eAAe,EACf,kBAAkB,CACnB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport { RouteComponentProps } from 'react-router';\nimport { Input, Row, Table } from 'reactstrap';\nimport { TextFormat, JhiPagination, getPaginationItemsNumber, getSortState, IPaginationBaseState } from 'react-jhipster';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { APP_TIMESTAMP_FORMAT } from 'app/config/constants';\nimport { ITEMS_PER_PAGE } from 'app/shared/util/pagination.constants';\n\nimport { IRootState } from 'app/shared/reducers';\nimport { getAudits } from '../administration.reducer';\n\nexport interface IAuditsPageProps extends StateProps, DispatchProps, RouteComponentProps<{}> {}\n\nexport interface IAuditsPageState extends IPaginationBaseState {\n fromDate: string;\n toDate: string;\n}\n\nconst previousMonth = (): string => {\n const now: Date = new Date();\n const fromDate =\n now.getMonth() === 0\n ? new Date(now.getFullYear() - 1, 11, now.getDate())\n : new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());\n return fromDate.toISOString().slice(0, 10);\n};\n\nconst today = (): string => {\n // Today + 1 day - needed if the current day must be included\n const day: Date = new Date();\n day.setDate(day.getDate() + 1);\n const toDate = new Date(day.getFullYear(), day.getMonth(), day.getDate());\n return toDate.toISOString().slice(0, 10);\n};\n\nexport class AuditsPage extends React.Component<IAuditsPageProps, IAuditsPageState> {\n state: IAuditsPageState = {\n ...getSortState(this.props.location, ITEMS_PER_PAGE),\n fromDate: previousMonth(),\n toDate: today()\n };\n\n componentDidMount() {\n this.getAudits();\n }\n\n onChangeFromDate = evt => {\n this.setState(\n {\n fromDate: evt.target.value\n },\n () => this.getAudits()\n );\n };\n onChangeToDate = evt => {\n this.setState(\n {\n toDate: evt.target.value\n },\n () => this.getAudits()\n );\n };\n\n sort = prop => () => {\n this.setState(\n {\n order: this.state.order === 'asc' ? 'desc' : 'asc',\n sort: prop\n },\n () => this.transition()\n );\n };\n\n transition = () => {\n this.getAudits();\n this.props.history.push(`${this.props.location.pathname}?page=${this.state.activePage}&sort=${this.state.sort},${this.state.order}`);\n };\n\n handlePagination = activePage => this.setState({ activePage }, () => this.transition());\n\n getAudits = () => {\n const { activePage, itemsPerPage, sort, order, fromDate, toDate } = this.state;\n this.props.getAudits(activePage - 1, itemsPerPage, `${sort},${order}`, fromDate, toDate);\n };\n\n render() {\n const { audits, totalItems } = this.props;\n const { fromDate, toDate } = this.state;\n return (\n <div>\n <h2 className=\"audits-page-heading\">Audits</h2>\n <span>from</span>\n <Input type=\"date\" value={fromDate} onChange={this.onChangeFromDate} name=\"fromDate\" id=\"fromDate\" />\n <span>to</span>\n <Input type=\"date\" value={toDate} onChange={this.onChangeToDate} name=\"toDate\" id=\"toDate\" />\n <Table striped responsive>\n <thead>\n <tr>\n <th onClick={this.sort('auditEventDate')}>\n Date\n <FontAwesomeIcon icon=\"sort\" />\n </th>\n <th onClick={this.sort('principal')}>\n User\n <FontAwesomeIcon icon=\"sort\" />\n </th>\n <th onClick={this.sort('auditEventType')}>\n State\n <FontAwesomeIcon icon=\"sort\" />\n </th>\n <th>Extra data</th>\n </tr>\n </thead>\n <tbody>\n {audits.map((audit, i) => (\n <tr key={`audit-${i}`}>\n <td>{<TextFormat value={audit.timestamp} type=\"date\" format={APP_TIMESTAMP_FORMAT} />}</td>\n <td>{audit.principal}</td>\n <td>{audit.type}</td>\n <td>\n {audit.data ? audit.data.message : null}\n {audit.data ? audit.data.remoteAddress : null}\n </td>\n </tr>\n ))}\n </tbody>\n </Table>\n <Row className=\"justify-content-center\">\n <JhiPagination\n items={getPaginationItemsNumber(totalItems, this.state.itemsPerPage)}\n activePage={this.state.activePage}\n onSelect={this.handlePagination}\n maxButtons={5}\n />\n </Row>\n </div>\n );\n }\n}\n\nconst mapStateToProps = (storeState: IRootState) => ({\n audits: storeState.administration.audits,\n totalItems: storeState.administration.totalItems\n});\n\nconst mapDispatchToProps = { getAudits };\n\ntype StateProps = ReturnType<typeof mapStateToProps>;\ntype DispatchProps = typeof mapDispatchToProps;\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps\n)(AuditsPage);\n"]}]}