1 line
22 KiB
JSON
1 line
22 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/user-management/user-management.tsx","dependencies":[{"path":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/user-management/user-management.tsx","mtime":1533613272953},{"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 { Link } from 'react-router-dom';\nimport { Button, Table, Row, Badge } from 'reactstrap';\nimport { TextFormat, JhiPagination, getPaginationItemsNumber, getSortState } from 'react-jhipster';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { APP_DATE_FORMAT } from 'app/config/constants';\nimport { ITEMS_PER_PAGE } from 'app/shared/util/pagination.constants';\nimport { getUsers, updateUser } from './user-management.reducer';\nvar UserManagement = /** @class */ (function (_super) {\n tslib_1.__extends(UserManagement, _super);\n function UserManagement() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = tslib_1.__assign({}, getSortState(_this.props.location, ITEMS_PER_PAGE));\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.sortUsers(); });\n }; };\n _this.handlePagination = function (activePage) { return _this.setState({ activePage: activePage }, function () { return _this.sortUsers(); }); };\n _this.getUsers = function () {\n var _a = _this.state, activePage = _a.activePage, itemsPerPage = _a.itemsPerPage, sort = _a.sort, order = _a.order;\n _this.props.getUsers(activePage - 1, itemsPerPage, sort + \",\" + order);\n };\n _this.toggleActive = function (user) { return function () {\n _this.props.updateUser(tslib_1.__assign({}, user, { activated: !user.activated }));\n }; };\n return _this;\n }\n UserManagement.prototype.componentDidMount = function () {\n this.getUsers();\n };\n UserManagement.prototype.sortUsers = function () {\n this.getUsers();\n this.props.history.push(this.props.location.pathname + \"?page=\" + this.state.activePage + \"&sort=\" + this.state.sort + \",\" + this.state.order);\n };\n UserManagement.prototype.render = function () {\n var _this = this;\n var _a = this.props, users = _a.users, account = _a.account, match = _a.match, totalItems = _a.totalItems;\n return (React.createElement(\"div\", null,\n React.createElement(\"h2\", { className: \"userManagement-page-heading\" },\n \"Users\",\n React.createElement(Link, { to: match.url + \"/new\", className: \"btn btn-primary float-right jh-create-entity\" },\n React.createElement(FontAwesomeIcon, { icon: \"plus\" }),\n \" Create a new user\")),\n React.createElement(Table, { responsive: true, striped: true },\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", { className: \"hand\", onClick: this.sort('id') },\n \"ID\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", { className: \"hand\", onClick: this.sort('login') },\n \"Login\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", { className: \"hand\", onClick: this.sort('email') },\n \"Email\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", null),\n React.createElement(\"th\", null, \"Profiles\"),\n React.createElement(\"th\", { className: \"hand\", onClick: this.sort('createdDate') },\n \"Created Date\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", { className: \"hand\", onClick: this.sort('lastModifiedBy') },\n \"Last Modified By\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", { className: \"hand\", onClick: this.sort('lastModifiedDate') },\n \"Last Modified Date\",\n React.createElement(FontAwesomeIcon, { icon: \"sort\" })),\n React.createElement(\"th\", null))),\n React.createElement(\"tbody\", null, users.map(function (user, i) { return (React.createElement(\"tr\", { id: user.login, key: \"user-\" + i },\n React.createElement(\"td\", null,\n React.createElement(Button, { tag: Link, to: match.url + \"/\" + user.login, color: \"link\", size: \"sm\" }, user.id)),\n React.createElement(\"td\", null, user.login),\n React.createElement(\"td\", null, user.email),\n React.createElement(\"td\", null, user.activated ? (React.createElement(Button, { color: \"success\", onClick: _this.toggleActive(user) }, \"Activated\")) : (React.createElement(Button, { color: \"danger\", onClick: _this.toggleActive(user) }, \"Deactivated\"))),\n React.createElement(\"td\", null, user.authorities\n ? user.authorities.map(function (authority, j) { return (React.createElement(\"div\", { key: \"user-auth-\" + i + \"-\" + j },\n React.createElement(Badge, { color: \"info\" }, authority))); })\n : null),\n React.createElement(\"td\", null,\n React.createElement(TextFormat, { value: user.createdDate, type: \"date\", format: APP_DATE_FORMAT, blankOnInvalid: true })),\n React.createElement(\"td\", null, user.lastModifiedBy),\n React.createElement(\"td\", null,\n React.createElement(TextFormat, { value: user.lastModifiedDate, type: \"date\", format: APP_DATE_FORMAT, blankOnInvalid: true })),\n React.createElement(\"td\", { className: \"text-right\" },\n React.createElement(\"div\", { className: \"btn-group flex-btn-group-container\" },\n React.createElement(Button, { tag: Link, to: match.url + \"/\" + user.login, color: \"info\", size: \"sm\" },\n React.createElement(FontAwesomeIcon, { icon: \"eye\" }),\n \" \",\n React.createElement(\"span\", { className: \"d-none d-md-inline\" }, \"View\")),\n React.createElement(Button, { tag: Link, to: match.url + \"/\" + user.login + \"/edit\", color: \"primary\", size: \"sm\" },\n React.createElement(FontAwesomeIcon, { icon: \"pencil-alt\" }),\n \" \",\n React.createElement(\"span\", { className: \"d-none d-md-inline\" }, \"Edit\")),\n React.createElement(Button, { tag: Link, to: match.url + \"/\" + user.login + \"/delete\", color: \"danger\", size: \"sm\", disabled: account.login === user.login },\n React.createElement(FontAwesomeIcon, { icon: \"trash\" }),\n \" \",\n React.createElement(\"span\", { className: \"d-none d-md-inline\" }, \"Delete\")))))); }))),\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 UserManagement;\n}(React.Component));\nexport { UserManagement };\nvar mapStateToProps = function (storeState) { return ({\n users: storeState.userManagement.users,\n totalItems: storeState.userManagement.totalItems,\n account: storeState.authentication.account\n}); };\nvar mapDispatchToProps = { getUsers: getUsers, updateUser: updateUser };\nexport default connect(mapStateToProps, mapDispatchToProps)(UserManagement);\n",{"version":3,"file":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/user-management/user-management.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/user-management/user-management.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,IAAI,EAAuB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAGL,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,YAAY,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKjE;IAAoC,0CAA2D;IA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,GAAG,IAAC,SAAS,EAAC,wBAAwB;gBACrC,oBAAC,aAAa,IACZ,KAAK,EAAE,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EACpE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAC/B,UAAU,EAAE,CAAC,GACb,CACE,CACF,CACP,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AAjJD,CAAoC,KAAK,CAAC,SAAS,GAiJlD;;AAED,IAAM,eAAe,GAAG,UAAC,UAAsB,IAAK,OAAA,CAAC;IACnD,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK;IACtC,UAAU,EAAE,UAAU,CAAC,cAAc,CAAC,UAAU;IAChD,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,OAAO;CAC3C,CAAC,EAJkD,CAIlD,CAAC;AAEH,IAAM,kBAAkB,GAAG,EAAE,QAAQ,UAAA,EAAE,UAAU,YAAA,EAAE,CAAC;AAKpD,eAAe,OAAO,CACpB,eAAe,EACf,kBAAkB,CACnB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport { Link, RouteComponentProps } from 'react-router-dom';\nimport { Button, Table, Row, Badge } from 'reactstrap';\nimport {\n ICrudGetAllAction,\n ICrudPutAction,\n TextFormat,\n JhiPagination,\n getPaginationItemsNumber,\n getSortState,\n IPaginationBaseState\n} from 'react-jhipster';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { APP_DATE_FORMAT } from 'app/config/constants';\nimport { ITEMS_PER_PAGE } from 'app/shared/util/pagination.constants';\nimport { getUsers, updateUser } from './user-management.reducer';\nimport { IRootState } from 'app/shared/reducers';\n\nexport interface IUserManagementProps extends StateProps, DispatchProps, RouteComponentProps<{}> {}\n\nexport class UserManagement extends React.Component<IUserManagementProps, IPaginationBaseState> {\n state: IPaginationBaseState = {\n ...getSortState(this.props.location, ITEMS_PER_PAGE)\n };\n\n componentDidMount() {\n this.getUsers();\n }\n\n sort = prop => () => {\n this.setState(\n {\n order: this.state.order === 'asc' ? 'desc' : 'asc',\n sort: prop\n },\n () => this.sortUsers()\n );\n };\n\n sortUsers() {\n this.getUsers();\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.sortUsers());\n\n getUsers = () => {\n const { activePage, itemsPerPage, sort, order } = this.state;\n this.props.getUsers(activePage - 1, itemsPerPage, `${sort},${order}`);\n };\n\n toggleActive = user => () => {\n this.props.updateUser({\n ...user,\n activated: !user.activated\n });\n };\n\n render() {\n const { users, account, match, totalItems } = this.props;\n return (\n <div>\n <h2 className=\"userManagement-page-heading\">\n Users\n <Link to={`${match.url}/new`} className=\"btn btn-primary float-right jh-create-entity\">\n <FontAwesomeIcon icon=\"plus\" /> Create a new user\n </Link>\n </h2>\n <Table responsive striped>\n <thead>\n <tr>\n <th className=\"hand\" onClick={this.sort('id')}>\n ID<FontAwesomeIcon icon=\"sort\" />\n </th>\n <th className=\"hand\" onClick={this.sort('login')}>\n Login<FontAwesomeIcon icon=\"sort\" />\n </th>\n <th className=\"hand\" onClick={this.sort('email')}>\n Email<FontAwesomeIcon icon=\"sort\" />\n </th>\n <th />\n <th>Profiles</th>\n <th className=\"hand\" onClick={this.sort('createdDate')}>\n Created Date<FontAwesomeIcon icon=\"sort\" />\n </th>\n <th className=\"hand\" onClick={this.sort('lastModifiedBy')}>\n Last Modified By<FontAwesomeIcon icon=\"sort\" />\n </th>\n <th className=\"hand\" onClick={this.sort('lastModifiedDate')}>\n Last Modified Date<FontAwesomeIcon icon=\"sort\" />\n </th>\n <th />\n </tr>\n </thead>\n <tbody>\n {users.map((user, i) => (\n <tr id={user.login} key={`user-${i}`}>\n <td>\n <Button tag={Link} to={`${match.url}/${user.login}`} color=\"link\" size=\"sm\">\n {user.id}\n </Button>\n </td>\n <td>{user.login}</td>\n <td>{user.email}</td>\n <td>\n {user.activated ? (\n <Button color=\"success\" onClick={this.toggleActive(user)}>\n Activated\n </Button>\n ) : (\n <Button color=\"danger\" onClick={this.toggleActive(user)}>\n Deactivated\n </Button>\n )}\n </td>\n <td>\n {user.authorities\n ? user.authorities.map((authority, j) => (\n <div key={`user-auth-${i}-${j}`}>\n <Badge color=\"info\">{authority}</Badge>\n </div>\n ))\n : null}\n </td>\n <td>\n <TextFormat value={user.createdDate} type=\"date\" format={APP_DATE_FORMAT} blankOnInvalid />\n </td>\n <td>{user.lastModifiedBy}</td>\n <td>\n <TextFormat value={user.lastModifiedDate} type=\"date\" format={APP_DATE_FORMAT} blankOnInvalid />\n </td>\n <td className=\"text-right\">\n <div className=\"btn-group flex-btn-group-container\">\n <Button tag={Link} to={`${match.url}/${user.login}`} color=\"info\" size=\"sm\">\n <FontAwesomeIcon icon=\"eye\" /> <span className=\"d-none d-md-inline\">View</span>\n </Button>\n <Button tag={Link} to={`${match.url}/${user.login}/edit`} color=\"primary\" size=\"sm\">\n <FontAwesomeIcon icon=\"pencil-alt\" /> <span className=\"d-none d-md-inline\">Edit</span>\n </Button>\n <Button\n tag={Link}\n to={`${match.url}/${user.login}/delete`}\n color=\"danger\"\n size=\"sm\"\n disabled={account.login === user.login}\n >\n <FontAwesomeIcon icon=\"trash\" /> <span className=\"d-none d-md-inline\">Delete</span>\n </Button>\n </div>\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 users: storeState.userManagement.users,\n totalItems: storeState.userManagement.totalItems,\n account: storeState.authentication.account\n});\n\nconst mapDispatchToProps = { getUsers, updateUser };\n\ntype StateProps = ReturnType<typeof mapStateToProps>;\ntype DispatchProps = typeof mapDispatchToProps;\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps\n)(UserManagement);\n"]}]} |