diff --git a/angular.json b/angular.json index 08469f65d..aa8774357 100644 --- a/angular.json +++ b/angular.json @@ -22,6 +22,8 @@ "tsConfig": "projects/admin/tsconfig.app.json", "assets": ["projects/admin/src/assets"], "styles": [ + "node_modules/primeng/resources/themes/lara-light-blue/theme.css", + "node_modules/primeng/resources/primeng.min.css", "projects/admin/src/app/scss/styles.scss", "node_modules/ngx-bootstrap/datepicker/bs-datepicker.css" ], diff --git a/package-lock.json b/package-lock.json index 9c99b645a..dbb0ddb28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "license": "AGPL-3.0-only", "dependencies": { "@angular/animations": "^14.2.6", + "@angular/cdk": "^14.2.7", "@angular/common": "^14.2.6", "@angular/compiler": "^14.2.6", "@angular/core": "^14.2.6", @@ -28,7 +29,8 @@ "@ngx-loading-bar/http-client": "^6.0.0", "@ngx-loading-bar/router": "^6.0.0", "@ngx-translate/core": "^14.0.0", - "@rero/ng-core": "^14.0.0", + "@rero/ng-core": "^14.1.0", + "@swimlane/ngx-charts": "^20.1.2", "bootstrap": "^4.6.2", "crypto-js": "^4.1.1", "easymde": "^2.18.0", @@ -41,6 +43,7 @@ "ngx-build-plus": "^14.0.0", "ngx-spinner": "^14.0.0", "ngx-toastr": "^15.2.0", + "primeng": "^14.1.2", "rxjs": "~6.6.7", "simple-isbn": "^1.1.5", "tslib": "^2.4.0", @@ -506,6 +509,28 @@ "@angular/core": "14.2.6" } }, + "node_modules/@angular/cdk": { + "version": "14.2.7", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-14.2.7.tgz", + "integrity": "sha512-/tEsYaUbDSnfEmKVvAMramIptmhI67O+9STjOV0i+74XR2NospeK0fkbywIANu1n3w6AHGMotvRWJrjmbCElFg==", + "dependencies": { + "tslib": "^2.3.0" + }, + "optionalDependencies": { + "parse5": "^5.0.0" + }, + "peerDependencies": { + "@angular/common": "^14.0.0 || ^15.0.0", + "@angular/core": "^14.0.0 || ^15.0.0", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/cdk/node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "optional": true + }, "node_modules/@angular/cli": { "version": "14.2.6", "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-14.2.6.tgz", @@ -3278,9 +3303,9 @@ } }, "node_modules/@rero/ng-core": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@rero/ng-core/-/ng-core-14.0.0.tgz", - "integrity": "sha512-+9brli9QHJBDaXM2K/LHrQ92QhYEJnwQIyrfbXUg9EAePDc+jd4gq1b394FvysIzE73R2PyvVKE3uRAXunhSxw==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@rero/ng-core/-/ng-core-14.1.0.tgz", + "integrity": "sha512-kwzguaSwEROqS37OQABNIkO6Y6BJBkq51LVzxdNLnvk5R2uCLNbdZKZTxlnNCYn6Z5snvXVWUP0HTJklpj89pg==", "dependencies": { "tslib": "^2.3.0" }, @@ -3371,6 +3396,36 @@ "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", "devOptional": true }, + "node_modules/@swimlane/ngx-charts": { + "version": "20.1.2", + "resolved": "https://registry.npmjs.org/@swimlane/ngx-charts/-/ngx-charts-20.1.2.tgz", + "integrity": "sha512-9uetDtBg++v96R9Nwgf8mvSu+6149FMQEm/jlpbcquUozfC5l+hO9i88tG3REOxnkGS10snGOCVUcPPY03nbxQ==", + "dependencies": { + "d3-array": "^2.9.1", + "d3-brush": "^2.1.0", + "d3-color": "^3.1.0", + "d3-format": "^2.0.0", + "d3-hierarchy": "^2.0.0", + "d3-interpolate": "^2.0.1", + "d3-scale": "^3.2.3", + "d3-selection": "^2.0.0", + "d3-shape": "^2.0.0", + "d3-time-format": "^3.0.0", + "d3-transition": "^2.0.0", + "rfdc": "^1.3.0", + "tslib": "^2.0.0" + }, + "peerDependencies": { + "@angular/animations": ">=12.0.0", + "@angular/cdk": ">=12.0.0", + "@angular/common": ">=12.0.0", + "@angular/core": ">=12.0.0", + "@angular/forms": ">=12.0.0", + "@angular/platform-browser": ">=12.0.0", + "@angular/platform-browser-dynamic": ">=12.0.0", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -5930,6 +5985,147 @@ "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", "devOptional": true }, + "node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "node_modules/d3-brush": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-2.1.0.tgz", + "integrity": "sha512-cHLLAFatBATyIKqZOkk/mDHUbzne2B3ZwxkzMHvFTCZCmLaXDpZRihQSn8UNXTkGD/3lb/W2sQz0etAftmHMJQ==", + "dependencies": { + "d3-dispatch": "1 - 2", + "d3-drag": "2", + "d3-interpolate": "1 - 2", + "d3-selection": "2", + "d3-transition": "2" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-2.0.0.tgz", + "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" + }, + "node_modules/d3-drag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-2.0.0.tgz", + "integrity": "sha512-g9y9WbMnF5uqB9qKqwIIa/921RYWzlUDv9Jl1/yONQwxbOfszAWTCm8u7HOTgJgRDXiRZN56cHT9pd24dmXs8w==", + "dependencies": { + "d3-dispatch": "1 - 2", + "d3-selection": "2" + } + }, + "node_modules/d3-ease": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", + "integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" + }, + "node_modules/d3-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", + "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==" + }, + "node_modules/d3-hierarchy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-2.0.0.tgz", + "integrity": "sha512-SwIdqM3HxQX2214EG9GTjgmCc/mbSx4mQBn+DuEETubhOw6/U3fmnji4uCVrmzOydMHSO1nZle5gh6HB/wdOzw==" + }, + "node_modules/d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", + "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", + "dependencies": { + "d3-color": "1 - 2" + } + }, + "node_modules/d3-interpolate/node_modules/d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" + }, + "node_modules/d3-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-2.0.0.tgz", + "integrity": "sha512-ZwZQxKhBnv9yHaiWd6ZU4x5BtCQ7pXszEV9CU6kRgwIQVQGLMv1oiL4M+MK/n79sYzsj+gcgpPQSctJUsLN7fA==" + }, + "node_modules/d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "dependencies": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "node_modules/d3-selection": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", + "integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" + }, + "node_modules/d3-shape": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-2.1.0.tgz", + "integrity": "sha512-PnjUqfM2PpskbSLTJvAzp2Wv4CZsnAgTfcVRTwW03QR3MkXF8Uo7B1y/lWkAsmbKwuecto++4NlsYcvYpXpTHA==", + "dependencies": { + "d3-path": "1 - 2" + } + }, + "node_modules/d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "dependencies": { + "d3-array": "2" + } + }, + "node_modules/d3-time-format": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", + "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", + "dependencies": { + "d3-time": "1 - 2" + } + }, + "node_modules/d3-timer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", + "integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" + }, + "node_modules/d3-transition": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", + "integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", + "dependencies": { + "d3-color": "1 - 2", + "d3-dispatch": "1 - 2", + "d3-ease": "1 - 2", + "d3-interpolate": "1 - 2", + "d3-timer": "1 - 2" + }, + "peerDependencies": { + "d3-selection": "2" + } + }, + "node_modules/d3-transition/node_modules/d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" + }, "node_modules/date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", @@ -8381,6 +8577,11 @@ "node": ">=8" } }, + "node_modules/internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==" + }, "node_modules/ipaddr.js": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", @@ -11410,6 +11611,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/primeicons": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-6.0.1.tgz", + "integrity": "sha512-KDeO94CbWI4pKsPnYpA1FPjo79EsY9I+M8ywoPBSf9XMXoe/0crjbUK7jcQEDHuc0ZMRIZsxH3TYLv4TUtHmAA==", + "peer": true + }, + "node_modules/primeng": { + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/primeng/-/primeng-14.2.2.tgz", + "integrity": "sha512-CV7dWwpBYqMgKliryJ6+CJZgdawl04V1Cp5mQmziEedJVhMGPg/QwU2Fi0v7AS9i1uXQRI9c420BDn+yZ+GrDQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": "^14.0.0", + "@angular/core": "^14.0.0", + "@angular/forms": "^14.0.0", + "primeicons": "^6.0.1", + "rxjs": "^6.0.0 || ^7.0.0", + "zone.js": "^0.10.2 || ^0.11.0 || ^0.12.0" + } + }, "node_modules/proc-log": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", @@ -11886,8 +12109,7 @@ "node_modules/rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "devOptional": true + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" }, "node_modules/rimraf": { "version": "3.0.2", @@ -14149,6 +14371,23 @@ "tslib": "^2.3.0" } }, + "@angular/cdk": { + "version": "14.2.7", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-14.2.7.tgz", + "integrity": "sha512-/tEsYaUbDSnfEmKVvAMramIptmhI67O+9STjOV0i+74XR2NospeK0fkbywIANu1n3w6AHGMotvRWJrjmbCElFg==", + "requires": { + "parse5": "^5.0.0", + "tslib": "^2.3.0" + }, + "dependencies": { + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "optional": true + } + } + }, "@angular/cli": { "version": "14.2.6", "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-14.2.6.tgz", @@ -16006,9 +16245,9 @@ } }, "@rero/ng-core": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@rero/ng-core/-/ng-core-14.0.0.tgz", - "integrity": "sha512-+9brli9QHJBDaXM2K/LHrQ92QhYEJnwQIyrfbXUg9EAePDc+jd4gq1b394FvysIzE73R2PyvVKE3uRAXunhSxw==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@rero/ng-core/-/ng-core-14.1.0.tgz", + "integrity": "sha512-kwzguaSwEROqS37OQABNIkO6Y6BJBkq51LVzxdNLnvk5R2uCLNbdZKZTxlnNCYn6Z5snvXVWUP0HTJklpj89pg==", "requires": { "tslib": "^2.3.0" } @@ -16063,6 +16302,26 @@ "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", "devOptional": true }, + "@swimlane/ngx-charts": { + "version": "20.1.2", + "resolved": "https://registry.npmjs.org/@swimlane/ngx-charts/-/ngx-charts-20.1.2.tgz", + "integrity": "sha512-9uetDtBg++v96R9Nwgf8mvSu+6149FMQEm/jlpbcquUozfC5l+hO9i88tG3REOxnkGS10snGOCVUcPPY03nbxQ==", + "requires": { + "d3-array": "^2.9.1", + "d3-brush": "^2.1.0", + "d3-color": "^3.1.0", + "d3-format": "^2.0.0", + "d3-hierarchy": "^2.0.0", + "d3-interpolate": "^2.0.1", + "d3-scale": "^3.2.3", + "d3-selection": "^2.0.0", + "d3-shape": "^2.0.0", + "d3-time-format": "^3.0.0", + "d3-transition": "^2.0.0", + "rfdc": "^1.3.0", + "tslib": "^2.0.0" + } + }, "@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -17913,6 +18172,145 @@ "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", "devOptional": true }, + "d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "requires": { + "internmap": "^1.0.0" + } + }, + "d3-brush": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-2.1.0.tgz", + "integrity": "sha512-cHLLAFatBATyIKqZOkk/mDHUbzne2B3ZwxkzMHvFTCZCmLaXDpZRihQSn8UNXTkGD/3lb/W2sQz0etAftmHMJQ==", + "requires": { + "d3-dispatch": "1 - 2", + "d3-drag": "2", + "d3-interpolate": "1 - 2", + "d3-selection": "2", + "d3-transition": "2" + } + }, + "d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==" + }, + "d3-dispatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-2.0.0.tgz", + "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" + }, + "d3-drag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-2.0.0.tgz", + "integrity": "sha512-g9y9WbMnF5uqB9qKqwIIa/921RYWzlUDv9Jl1/yONQwxbOfszAWTCm8u7HOTgJgRDXiRZN56cHT9pd24dmXs8w==", + "requires": { + "d3-dispatch": "1 - 2", + "d3-selection": "2" + } + }, + "d3-ease": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", + "integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" + }, + "d3-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", + "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==" + }, + "d3-hierarchy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-2.0.0.tgz", + "integrity": "sha512-SwIdqM3HxQX2214EG9GTjgmCc/mbSx4mQBn+DuEETubhOw6/U3fmnji4uCVrmzOydMHSO1nZle5gh6HB/wdOzw==" + }, + "d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", + "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", + "requires": { + "d3-color": "1 - 2" + }, + "dependencies": { + "d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" + } + } + }, + "d3-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-2.0.0.tgz", + "integrity": "sha512-ZwZQxKhBnv9yHaiWd6ZU4x5BtCQ7pXszEV9CU6kRgwIQVQGLMv1oiL4M+MK/n79sYzsj+gcgpPQSctJUsLN7fA==" + }, + "d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "requires": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "d3-selection": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", + "integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" + }, + "d3-shape": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-2.1.0.tgz", + "integrity": "sha512-PnjUqfM2PpskbSLTJvAzp2Wv4CZsnAgTfcVRTwW03QR3MkXF8Uo7B1y/lWkAsmbKwuecto++4NlsYcvYpXpTHA==", + "requires": { + "d3-path": "1 - 2" + } + }, + "d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "requires": { + "d3-array": "2" + } + }, + "d3-time-format": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", + "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", + "requires": { + "d3-time": "1 - 2" + } + }, + "d3-timer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", + "integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" + }, + "d3-transition": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", + "integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", + "requires": { + "d3-color": "1 - 2", + "d3-dispatch": "1 - 2", + "d3-ease": "1 - 2", + "d3-interpolate": "1 - 2", + "d3-timer": "1 - 2" + }, + "dependencies": { + "d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" + } + } + }, "date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", @@ -19634,6 +20032,11 @@ } } }, + "internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==" + }, "ipaddr.js": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", @@ -21727,6 +22130,20 @@ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==" }, + "primeicons": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-6.0.1.tgz", + "integrity": "sha512-KDeO94CbWI4pKsPnYpA1FPjo79EsY9I+M8ywoPBSf9XMXoe/0crjbUK7jcQEDHuc0ZMRIZsxH3TYLv4TUtHmAA==", + "peer": true + }, + "primeng": { + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/primeng/-/primeng-14.2.2.tgz", + "integrity": "sha512-CV7dWwpBYqMgKliryJ6+CJZgdawl04V1Cp5mQmziEedJVhMGPg/QwU2Fi0v7AS9i1uXQRI9c420BDn+yZ+GrDQ==", + "requires": { + "tslib": "^2.3.0" + } + }, "proc-log": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", @@ -22086,8 +22503,7 @@ "rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "devOptional": true + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" }, "rimraf": { "version": "3.0.2", diff --git a/package.json b/package.json index 5b5dccbe2..0133a985c 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ }, "dependencies": { "@angular/animations": "^14.2.6", + "@angular/cdk": "^14.2.7", "@angular/common": "^14.2.6", "@angular/compiler": "^14.2.6", "@angular/core": "^14.2.6", @@ -84,7 +85,8 @@ "@ngx-loading-bar/http-client": "^6.0.0", "@ngx-loading-bar/router": "^6.0.0", "@ngx-translate/core": "^14.0.0", - "@rero/ng-core": "^14.0.0", + "@rero/ng-core": "^14.1.0", + "@swimlane/ngx-charts": "^20.1.2", "bootstrap": "^4.6.2", "crypto-js": "^4.1.1", "easymde": "^2.18.0", @@ -97,6 +99,7 @@ "ngx-build-plus": "^14.0.0", "ngx-spinner": "^14.0.0", "ngx-toastr": "^15.2.0", + "primeng": "^14.1.2", "rxjs": "~6.6.7", "simple-isbn": "^1.1.5", "tslib": "^2.4.0", diff --git a/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts b/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts index ed0b09ac6..5fcd063be 100644 --- a/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts +++ b/projects/admin/src/app/acquisition/components/account/account-brief-view/account-brief-view.component.ts @@ -20,9 +20,9 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@rero/shared'; import { ToastrService } from 'ngx-toastr'; -import { RecordPermissions } from 'projects/admin/src/app/classes/permissions'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { RecordPermissions } from '@app/admin/classes/permissions'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; import { IAcqAccount } from '../../../classes/account'; import { AcqAccountApiService } from '../../../api/acq-account-api.service'; diff --git a/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.ts b/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.ts index e34913621..e46492619 100644 --- a/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.ts +++ b/projects/admin/src/app/acquisition/components/account/account-list/account-list.component.ts @@ -17,12 +17,12 @@ */ import { Component, OnInit } from '@angular/core'; import { UserService } from '@rero/shared'; -import { OrganisationService } from '../../../../service/organisation.service'; -import { IAcqAccount } from '../../../classes/account'; -import { AcqAccountApiService } from '../../../api/acq-account-api.service'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { IAcqAccount } from '@app/admin/acquisition/classes/account'; +import { AcqAccountApiService } from '@app/admin/acquisition/api/acq-account-api.service'; import { ApiService, RecordService } from '@rero/ng-core'; import { TranslateService } from '@ngx-translate/core'; -import { exportFormats } from '../../../routes/accounts-route'; +import { exportFormats } from '@app/admin/acquisition/routes/accounts-route'; import { HttpParams } from '@angular/common/http'; @Component({ diff --git a/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts b/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts index a6d4514e3..635d002f6 100644 --- a/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts +++ b/projects/admin/src/app/acquisition/components/account/account-transfer/account-transfer.component.ts @@ -23,7 +23,7 @@ import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@rero/shared'; import { ToastrService } from 'ngx-toastr'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; +import { OrganisationService } from '@app/admin/service/organisation.service'; import { IAcqAccount } from '../../../classes/account'; import { AcqAccountApiService } from '../../../api/acq-account-api.service'; import { orderAccountsAsTree } from '../../../utils/account'; diff --git a/projects/admin/src/app/acquisition/components/budget/budget-detail-view/budget-detail-view.component.ts b/projects/admin/src/app/acquisition/components/budget/budget-detail-view/budget-detail-view.component.ts index 355040a3b..4024950fa 100644 --- a/projects/admin/src/app/acquisition/components/budget/budget-detail-view/budget-detail-view.component.ts +++ b/projects/admin/src/app/acquisition/components/budget/budget-detail-view/budget-detail-view.component.ts @@ -17,7 +17,7 @@ */ import { Component, OnDestroy, OnInit } from '@angular/core'; import { DetailRecord } from '@rero/ng-core/lib/record/detail/view/detail-record'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; +import { OrganisationService } from '@app/admin/service/organisation.service'; import { Observable, Subscription } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { AcqBudgetApiService } from '../../../api/acq-budget-api.service'; diff --git a/projects/admin/src/app/acquisition/components/editor/widget/select-account-editor-widget/select-account-editor-widget.component.ts b/projects/admin/src/app/acquisition/components/editor/widget/select-account-editor-widget/select-account-editor-widget.component.ts index bbe085905..cd1566450 100644 --- a/projects/admin/src/app/acquisition/components/editor/widget/select-account-editor-widget/select-account-editor-widget.component.ts +++ b/projects/admin/src/app/acquisition/components/editor/widget/select-account-editor-widget/select-account-editor-widget.component.ts @@ -20,8 +20,8 @@ import { Component, OnInit } from '@angular/core'; import { FieldType } from '@ngx-formly/core'; import { ApiService } from '@rero/ng-core'; import { UserService } from '@rero/shared'; -import { IAcqAccount } from 'projects/admin/src/app/acquisition/classes/account'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; +import { IAcqAccount } from '@app/admin/acquisition/classes/account'; +import { OrganisationService } from '@app/admin/service/organisation.service'; import { AcqAccountApiService } from '../../../../api/acq-account-api.service'; import { orderAccountsAsTree } from '../../../../utils/account'; diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts index 4bb175ad7..26c403052 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-detail-view.component.ts @@ -19,9 +19,9 @@ import { ViewportScroller } from '@angular/common'; import { Component, OnDestroy, OnInit } from '@angular/core'; import { DetailRecord } from '@rero/ng-core/lib/record/detail/view/detail-record'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; -import { RecordPermissions } from 'projects/admin/src/app/classes/permissions'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; -import { CurrentLibraryPermissionValidator } from 'projects/admin/src/app/utils/permissions'; +import { RecordPermissions } from '@app/admin/classes/permissions'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; +import { CurrentLibraryPermissionValidator } from '@app/admin/utils/permissions'; import { Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { AcqOrderStatus, IAcqOrder } from '../../../classes/order'; diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.ts b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.ts index 95b06532e..d24760628 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.ts +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-line/order-line.component.ts @@ -17,9 +17,9 @@ */ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { RecordService } from '@rero/ng-core'; -import { RecordPermissions } from 'projects/admin/src/app/classes/permissions'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; -import { CurrentLibraryPermissionValidator } from 'projects/admin/src/app/utils/permissions'; +import { RecordPermissions } from '@app/admin/classes/permissions'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; +import { CurrentLibraryPermissionValidator } from '@app/admin/utils/permissions'; import { forkJoin, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { AcqOrderApiService } from '../../../../api/acq-order-api.service'; diff --git a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.ts b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.ts index 3c6ecf3fb..4b4719970 100644 --- a/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.ts +++ b/projects/admin/src/app/acquisition/components/order/order-detail-view/order-lines/order-lines.component.ts @@ -16,8 +16,8 @@ * along with this program. If not, see . */ import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; -import { RecordPermissions } from 'projects/admin/src/app/classes/permissions'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { RecordPermissions } from '@app/admin/classes/permissions'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; import { Subscription } from 'rxjs'; import { AcqOrderApiService } from '../../../../api/acq-order-api.service'; import { IAcqOrder, IAcqOrderLine } from '../../../../classes/order'; diff --git a/projects/admin/src/app/acquisition/components/order/place-order-form/place-order-form.component.ts b/projects/admin/src/app/acquisition/components/order/place-order-form/place-order-form.component.ts index cc9c48634..45cfe7b72 100644 --- a/projects/admin/src/app/acquisition/components/order/place-order-form/place-order-form.component.ts +++ b/projects/admin/src/app/acquisition/components/order/place-order-form/place-order-form.component.ts @@ -20,8 +20,8 @@ import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; import { ToastrService } from 'ngx-toastr'; -import { AcqAddressRecipient, IAcqOrder, IAcqOrderPreviewResponse } from 'projects/admin/src/app/acquisition/classes/order'; -import { Notification } from 'projects/admin/src/app/classes/notification'; +import { AcqAddressRecipient, IAcqOrder, IAcqOrderPreviewResponse } from '@app/admin/acquisition/classes/order'; +import { Notification } from '@app/admin/classes/notification'; import { finalize } from 'rxjs/operators'; import { AcqOrderApiService } from '../../../api/acq-order-api.service'; diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.ts b/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.ts index 83dd15c7c..88dce8fbf 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.ts +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-list/receipt-list.component.ts @@ -16,9 +16,9 @@ * along with this program. If not, see . */ import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; -import { RecordPermissions } from 'projects/admin/src/app/classes/permissions'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; -import { CurrentLibraryPermissionValidator } from 'projects/admin/src/app/utils/permissions'; +import { RecordPermissions } from '@app/admin/classes/permissions'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; +import { CurrentLibraryPermissionValidator } from '@app/admin/utils/permissions'; import { of, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { AcqReceiptApiService } from '../../../api/acq-receipt-api.service'; diff --git a/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.ts b/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.ts index c95f1013a..0a954dfd7 100644 --- a/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.ts +++ b/projects/admin/src/app/acquisition/components/receipt/receipt-summary/receipt-summary.component.ts @@ -17,9 +17,9 @@ */ import { Component, Input, OnInit } from '@angular/core'; import { forkJoin } from 'rxjs'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; -import { RecordPermissions } from 'projects/admin/src/app/classes/permissions'; -import { CurrentLibraryPermissionValidator } from 'projects/admin/src/app/utils/permissions'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; +import { RecordPermissions } from '@app/admin/classes/permissions'; +import { CurrentLibraryPermissionValidator } from '@app/admin/utils/permissions'; import { IAcqReceipt } from '../../../classes/receipt'; import { AcqOrderApiService } from '../../../api/acq-order-api.service'; import { AcqReceiptApiService } from '../../../api/acq-receipt-api.service'; diff --git a/projects/admin/src/app/acquisition/formly/type/select-account/select-account.component.ts b/projects/admin/src/app/acquisition/formly/type/select-account/select-account.component.ts index dd8e66d4b..cc78b1963 100644 --- a/projects/admin/src/app/acquisition/formly/type/select-account/select-account.component.ts +++ b/projects/admin/src/app/acquisition/formly/type/select-account/select-account.component.ts @@ -18,7 +18,7 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { FieldType } from '@ngx-formly/core'; import { ApiService } from '@rero/ng-core'; -import { IAcqAccount } from 'projects/admin/src/app/acquisition/classes/account'; +import { IAcqAccount } from '@app/admin/acquisition/classes/account'; @Component({ selector: 'admin-select-account', diff --git a/projects/admin/src/app/acquisition/routes/accounts-route.ts b/projects/admin/src/app/acquisition/routes/accounts-route.ts index 007765d34..878521503 100644 --- a/projects/admin/src/app/acquisition/routes/accounts-route.ts +++ b/projects/admin/src/app/acquisition/routes/accounts-route.ts @@ -19,8 +19,8 @@ import { getCurrencySymbol } from '@angular/common'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { FormlyFieldConfig } from '@ngx-formly/core'; import { DetailComponent, EditorComponent, JSONSchema7, RouteInterface } from '@rero/ng-core'; -import { CanUpdateGuard } from 'projects/admin/src/app/guard/can-update.guard'; -import { BaseRoute } from 'projects/admin/src/app/routes/base-route'; +import { CanUpdateGuard } from '@app/admin/guard/can-update.guard'; +import { BaseRoute } from '@app/admin/routes/base-route'; import { of } from 'rxjs'; import { OrganisationService } from '../../service/organisation.service'; import { AccountDetailViewComponent } from '../components/account/account-detail-view/account-detail-view.component'; diff --git a/projects/admin/src/app/acquisition/routes/budgets-route.ts b/projects/admin/src/app/acquisition/routes/budgets-route.ts index 85869e784..badb8bee2 100644 --- a/projects/admin/src/app/acquisition/routes/budgets-route.ts +++ b/projects/admin/src/app/acquisition/routes/budgets-route.ts @@ -17,7 +17,7 @@ */ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DetailComponent, RecordSearchPageComponent, RouteInterface } from '@rero/ng-core'; -import { BaseRoute } from 'projects/admin/src/app/routes/base-route'; +import { BaseRoute } from '@app/admin/routes/base-route'; import { BudgetsBriefViewComponent } from '../components/budget/budget-brief-view/budgets-brief-view.component'; import { BudgetDetailViewComponent } from '../components/budget/budget-detail-view/budget-detail-view.component'; diff --git a/projects/admin/src/app/app.module.ts b/projects/admin/src/app/app.module.ts index 2e9598649..41dd01fc5 100644 --- a/projects/admin/src/app/app.module.ts +++ b/projects/admin/src/app/app.module.ts @@ -1,6 +1,7 @@ /* * RERO ILS UI - * Copyright (C) 2019 RERO + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -30,6 +31,7 @@ import { TranslateLoader, TranslateService, TruncateTextPipe } from '@rero/ng-core'; import { ItemHoldingsCallNumberPipe, MainTitlePipe, SharedModule, UserService } from '@rero/shared'; +import { NgxChartsModule } from '@swimlane/ngx-charts'; import { AccordionModule } from 'ngx-bootstrap/accordion'; import { CollapseModule } from 'ngx-bootstrap/collapse'; import { BsDatepickerModule, BsLocaleService } from 'ngx-bootstrap/datepicker'; @@ -42,6 +44,7 @@ import { SelectAccountEditorWidgetComponent } from './acquisition/components/editor/widget/select-account-editor-widget/select-account-editor-widget.component'; import { ReceivedOrderPermissionValidator } from './acquisition/utils/permissions'; +import { PaymentsDataComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component'; import { CurrentLibraryPermissionValidator } from './utils/permissions'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @@ -144,7 +147,7 @@ import { PatronTypesDetailViewComponent } from './record/detail-view/patron-type import { RecordMaskedComponent } from './record/detail-view/record-masked/record-masked.component'; import { TemplateDetailViewComponent } from './record/detail-view/template-detail-view/template-detail-view.component'; import { VendorDetailViewComponent } from './record/detail-view/vendor-detail-view/vendor-detail-view.component'; -import { DocumentRecordSearchComponent } from './record/document-record-search/document-record-search.component'; +import { DocumentRecordSearchComponent } from './record/search-view/document-record-search/document-record-search.component'; import { IdentifiedbyValueComponent } from './record/editor/wrappers/identifiedby-value.component'; import { UserIdComponent } from './record/editor/wrappers/user-id/user-id.component'; import { CipoPatronTypeItemTypeComponent } from './record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component'; @@ -166,6 +169,13 @@ import { ExpectedIssueComponent } from './record/detail-view/holding-detail-view import { ReceivedIssueComponent } from './record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component'; import { AppInitializerService } from './service/app-initializer.service'; import { LoansBriefViewComponent } from './record/brief-view/loans-brief-view/loans-brief-view.component'; +import { PatronTransactionEventsBriefViewComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component'; +import { PatronNamePipe } from './pipe/patron-name.pipe'; +import { PatronTransactionEventOverdueComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component'; +import { PatronTransactionEventDefaultComponent } from './record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component'; +import { PatronTransactionEventSearchViewComponent } from './record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component'; +import { PaymentsDataTableComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component'; +import { PaymentDataPieComponent } from './record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component'; /** Init application factory */ export function appInitFactory(appInitializerService: AppInitializerService): () => Promise { @@ -272,7 +282,15 @@ export function appInitFactory(appInitializerService: AppInitializerService): () ItemAvailabilityPipe, ExpectedIssueComponent, ReceivedIssueComponent, - LoansBriefViewComponent + LoansBriefViewComponent, + PatronTransactionEventsBriefViewComponent, + PatronNamePipe, + PatronTransactionEventOverdueComponent, + PatronTransactionEventDefaultComponent, + PatronTransactionEventSearchViewComponent, + PaymentsDataComponent, + PaymentsDataTableComponent, + PaymentDataPieComponent ], imports: [ AppRoutingModule, @@ -281,6 +299,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): () BrowserModule, BsDatepickerModule.forRoot(), BsDropdownModule.forRoot(), + NgxChartsModule, CollapseModule.forRoot(), FormsModule, HttpClientModule, diff --git a/projects/admin/src/app/circulation/item/item.component.ts b/projects/admin/src/app/circulation/item/item.component.ts index d2bc8c61d..2979c14f5 100644 --- a/projects/admin/src/app/circulation/item/item.component.ts +++ b/projects/admin/src/app/circulation/item/item.component.ts @@ -20,10 +20,10 @@ import { RecordService } from '@rero/ng-core'; import { ItemStatus, UserService } from '@rero/shared'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Item, ItemAction, ItemNote, ItemNoteType} from 'projects/admin/src/app/classes/items'; -import { Loan, LoanState } from 'projects/admin/src/app/classes/loans'; -import { ItemsService } from 'projects/admin/src/app/service/items.service'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; +import { Item, ItemAction, ItemNote, ItemNoteType} from '@app/admin/classes/items'; +import { Loan, LoanState } from '@app/admin/classes/loans'; +import { ItemsService } from '@app/admin/service/items.service'; +import { OrganisationService } from '@app/admin/service/organisation.service'; import { Organisation } from '../../classes/core'; import { PatronTransactionService } from '../services/patron-transaction.service'; diff --git a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts index 12777a63a..c8229b278 100644 --- a/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts +++ b/projects/admin/src/app/circulation/main-request/requested-item/requested-item.component.ts @@ -17,7 +17,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { RecordService } from '@rero/ng-core'; -import { LoanState } from 'projects/admin/src/app/classes/loans'; +import { LoanState } from '@app/admin/classes/loans'; @Component({ selector: 'admin-requested-item', diff --git a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts index 0c2f497a8..0b7c79240 100644 --- a/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts +++ b/projects/admin/src/app/circulation/main-request/requested-items-list/requested-items-list.component.ts @@ -16,8 +16,8 @@ */ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; -import { Item } from 'projects/admin/src/app/classes/items'; -import { LoanState } from 'projects/admin/src/app/classes/loans'; +import { Item } from '@app/admin/classes/items'; +import { LoanState } from '@app/admin/classes/loans'; @Component({ selector: 'admin-circulation-requested-items-list', diff --git a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts index 203b6af7b..34e0b2527 100644 --- a/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts +++ b/projects/admin/src/app/circulation/patron/history/history-log/history-log.component.ts @@ -18,7 +18,7 @@ import { Component, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { ProvisionActivityType } from '@rero/shared'; -import { OperationLogsApiService } from 'projects/admin/src/app/api/operation-logs-api.service'; +import { OperationLogsApiService } from '@app/admin/api/operation-logs-api.service'; @Component({ selector: 'admin-history-log', diff --git a/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.ts b/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.ts index 2837d91b6..7865e606e 100644 --- a/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.ts +++ b/projects/admin/src/app/circulation/patron/loan/fixed-date-form/fixed-date-form.component.ts @@ -25,8 +25,8 @@ import { UserService } from '@rero/shared'; import moment from 'moment'; import { BsLocaleService } from 'ngx-bootstrap/datepicker'; import { BsModalRef } from 'ngx-bootstrap/modal'; -import { Library } from 'projects/admin/src/app/classes/library'; -import { DateValidators } from 'projects/admin/src/app/utils/validators'; +import { Library } from '@app/admin/classes/library'; +import { DateValidators } from '@app/admin/utils/validators'; import { Subscription } from 'rxjs'; import { CirculationService } from '../../../services/circulation.service'; diff --git a/projects/admin/src/app/circulation/patron/loan/loan.component.ts b/projects/admin/src/app/circulation/patron/loan/loan.component.ts index 450a7a6f9..92ac0bfd9 100644 --- a/projects/admin/src/app/circulation/patron/loan/loan.component.ts +++ b/projects/admin/src/app/circulation/patron/loan/loan.component.ts @@ -22,9 +22,9 @@ import { ItemStatus, UserService } from '@rero/shared'; import moment from 'moment'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; import { ToastrService } from 'ngx-toastr'; -import { Item, ItemAction, ItemNoteType } from 'projects/admin/src/app/classes/items'; -import { ItemsService } from 'projects/admin/src/app/service/items.service'; -import { PatronService } from 'projects/admin/src/app/service/patron.service'; +import { Item, ItemAction, ItemNoteType } from '@app/admin/classes/items'; +import { ItemsService } from '@app/admin/service/items.service'; +import { PatronService } from '@app/admin/service/patron.service'; import { forkJoin, Subscription } from 'rxjs'; import { CirculationService } from '../../services/circulation.service'; import { FixedDateFormComponent } from './fixed-date-form/fixed-date-form.component'; diff --git a/projects/admin/src/app/circulation/patron/main/main.component.ts b/projects/admin/src/app/circulation/patron/main/main.component.ts index 037845240..9ba706784 100644 --- a/projects/admin/src/app/circulation/patron/main/main.component.ts +++ b/projects/admin/src/app/circulation/patron/main/main.component.ts @@ -19,9 +19,9 @@ import { ActivatedRoute, Router } from '@angular/router'; import { HotkeysService } from '@ngneat/hotkeys'; import { TranslateService } from '@ngx-translate/core'; import { RecordService } from '@rero/ng-core'; -import { LoanState } from 'projects/admin/src/app/classes/loans'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; -import { PatronService } from 'projects/admin/src/app/service/patron.service'; +import { LoanState } from '@app/admin/classes/loans'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { PatronService } from '@app/admin/service/patron.service'; import { Subscription } from 'rxjs'; import { OperationLogsApiService } from '../../../api/operation-logs-api.service'; import { CirculationService } from '../../services/circulation.service'; diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts index 4335cc660..24dff76d9 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/overdue-transaction/overdue-transaction.component.ts @@ -17,11 +17,11 @@ import { Component, Input, OnInit } from '@angular/core'; import { RecordService } from '@rero/ng-core'; -import { Loan, LoanOverduePreview } from 'projects/admin/src/app/classes/loans'; -import { OrganisationService } from 'projects/admin/src/app/service/organisation.service'; +import { Loan, LoanOverduePreview } from '@app/admin/classes/loans'; +import { OrganisationService } from '@app/admin/service/organisation.service'; import { forkJoin } from 'rxjs'; -import { Item } from 'projects/admin/src/app/classes/items'; -import { PatronTransactionEvent, PatronTransactionEventType } from 'projects/admin/src/app/circulation/classes/patron-transaction'; +import { Item } from '@app/admin/classes/items'; +import { PatronTransactionEvent, PatronTransactionEventType } from '@app/admin/classes/patron-transaction'; @Component({ selector: 'admin-overdue-transaction', diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.spec.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.spec.ts deleted file mode 100644 index c0c48b73b..000000000 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule } from '@ngx-translate/core'; -import { BsModalRef } from 'ngx-bootstrap/modal'; -import { CirculationModule } from '../../../circulation.module'; -import { PatronTransactionEventFormComponent } from './patron-transaction-event-form.component'; - -describe('PatronTransactionEventFormComponent', () => { - let component: PatronTransactionEventFormComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - HttpClientTestingModule, - RouterTestingModule, - CirculationModule - ], - providers: [ - BsModalRef - ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PatronTransactionEventFormComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.ts index 7bfb9c26e..a145436f2 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event-form/patron-transaction-event-form.component.ts @@ -4,9 +4,9 @@ import { UntypedFormGroup } from '@angular/forms'; import { FormlyFieldConfig } from '@ngx-formly/core'; import { TranslateService } from '@ngx-translate/core'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; -import { OrganisationService } from '../../../../service/organisation.service'; -import { PatronTransaction } from '../../../classes/patron-transaction'; -import { PatronTransactionService } from '../../../services/patron-transaction.service'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { PatronTransaction } from '@app/admin/classes/patron-transaction'; +import { PatronTransactionService } from '@app/admin/circulation/services/patron-transaction.service'; @Component({ diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event/patron-transaction-event.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event/patron-transaction-event.component.ts index f07845c10..173e81e5e 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event/patron-transaction-event.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction-event/patron-transaction-event.component.ts @@ -1,7 +1,7 @@ import { Component, Input } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { OrganisationService } from '../../../../service/organisation.service'; -import { PatronTransactionEvent, PatronTransactionEventType } from '../../../classes/patron-transaction'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { PatronTransactionEvent, PatronTransactionEventType } from '@app/admin/classes/patron-transaction'; @Component({ selector: 'admin-patron-transaction-event', diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/default-transaction-detail/default-transaction-detail.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/default-transaction-detail/default-transaction-detail.component.ts index e73d38eac..780721935 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/default-transaction-detail/default-transaction-detail.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/default-transaction-detail/default-transaction-detail.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { PatronTransaction } from '../../../../classes/patron-transaction'; +import { PatronTransaction } from '../../../../../classes/patron-transaction'; @Component({ selector: 'admin-default-transaction-detail', diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/overdue-transaction-detail/overdue-transaction-detail.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/overdue-transaction-detail/overdue-transaction-detail.component.ts index 1fd5ef812..d40c67e43 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/overdue-transaction-detail/overdue-transaction-detail.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/overdue-transaction-detail/overdue-transaction-detail.component.ts @@ -1,8 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { RecordService } from '@rero/ng-core'; import { map, mergeMap } from 'rxjs/operators'; -import { Item } from 'projects/admin/src/app/classes/items'; -import { PatronTransaction } from 'projects/admin/src/app/circulation/classes/patron-transaction'; +import { Item } from '@app/admin/classes/items'; +import { PatronTransaction } from '@app/admin/classes/patron-transaction'; @Component({ selector: 'admin-overdue-transaction-detail', diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/patron-transaction.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/patron-transaction.component.ts index 099ac6efe..9ed2b0c72 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/patron-transaction.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transaction/patron-transaction.component.ts @@ -18,9 +18,9 @@ import { Component, Input, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { BsModalService } from 'ngx-bootstrap/modal'; -import { OrganisationService } from '../../../../service/organisation.service'; -import { PatronTransaction, PatronTransactionEventType, PatronTransactionStatus } from '../../../classes/patron-transaction'; -import { PatronTransactionService } from '../../../services/patron-transaction.service'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { PatronTransaction, PatronTransactionEventType, PatronTransactionStatus } from '@app/admin/classes/patron-transaction'; +import { PatronTransactionService } from '@app/admin/circulation/services/patron-transaction.service'; import { PatronTransactionEventFormComponent } from '../patron-transaction-event-form/patron-transaction-event-form.component'; diff --git a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transactions.component.ts b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transactions.component.ts index 3a67dd60b..dab9569ee 100644 --- a/projects/admin/src/app/circulation/patron/patron-transactions/patron-transactions.component.ts +++ b/projects/admin/src/app/circulation/patron/patron-transactions/patron-transactions.component.ts @@ -19,10 +19,10 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { UserService } from '@rero/shared'; import { BsModalService } from 'ngx-bootstrap/modal'; import { Subscription } from 'rxjs'; -import { Loan, LoanOverduePreview } from '../../../classes/loans'; -import { OrganisationService } from '../../../service/organisation.service'; -import { PatronService } from '../../../service/patron.service'; -import { PatronTransaction, PatronTransactionStatus } from '../../classes/patron-transaction'; +import { Loan, LoanOverduePreview } from '@app/admin/classes/loans'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { PatronService } from '@app/admin/service/patron.service'; +import { PatronTransaction, PatronTransactionStatus } from '@app/admin/classes/patron-transaction'; import { PatronTransactionService } from '../../services/patron-transaction.service'; import { PatronTransactionEventFormComponent } from './patron-transaction-event-form/patron-transaction-event-form.component'; diff --git a/projects/admin/src/app/circulation/services/patron-transaction.service.ts b/projects/admin/src/app/circulation/services/patron-transaction.service.ts index d5105da15..c310c66c4 100644 --- a/projects/admin/src/app/circulation/services/patron-transaction.service.ts +++ b/projects/admin/src/app/circulation/services/patron-transaction.service.ts @@ -22,13 +22,13 @@ import { ToastrService } from 'ngx-toastr'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { map } from 'rxjs/operators'; import { UserService } from '@rero/shared'; -import { RouteToolService } from '../../routes/route-tool.service'; +import { RouteToolService } from '@app/admin/routes/route-tool.service'; import { PatronTransaction, PatronTransactionEvent, PatronTransactionEventType, PatronTransactionStatus -} from '../classes/patron-transaction'; +} from '@app/admin/classes/patron-transaction'; @Injectable({ providedIn: 'root' diff --git a/projects/admin/src/app/circulation/classes/patron-transaction.ts b/projects/admin/src/app/classes/patron-transaction.ts similarity index 100% rename from projects/admin/src/app/circulation/classes/patron-transaction.ts rename to projects/admin/src/app/classes/patron-transaction.ts diff --git a/projects/admin/src/app/menu/service/menu-user-services.service.ts b/projects/admin/src/app/menu/service/menu-user-services.service.ts index 724d259b3..31da471e9 100644 --- a/projects/admin/src/app/menu/service/menu-user-services.service.ts +++ b/projects/admin/src/app/menu/service/menu-user-services.service.ts @@ -51,6 +51,9 @@ export class MenuUserServicesService extends MenuBase { /** Inventory menu */ private _inventoryMenu: MenuItemInterface; + /** Fees menu */ + private _feeMenu: MenuItemInterface; + /** Current loans */ private _currentLoansMenu: MenuItemInterface; @@ -264,6 +267,19 @@ export class MenuUserServicesService extends MenuBase { .setAttribute('id', 'inventory-list-menu') .setExtra('iconClass', 'fa fa-list'); this._translatedName(this._inventoryMenu, 'Inventory list'); + + // ----- FEES LIST + const tstamp = Date.now(); + const millis_in_day = tstamp % 86400000; // 86400000 millis in a day + const current_day = tstamp - millis_in_day; + + this._feeMenu = reportMenu.addChild('Fees') + .setRouterLink(['/', 'records', 'patron_transaction_events']) + .setQueryParam('transaction_library', this._userService.user.currentLibrary) + .setQueryParam('transaction_date', `${current_day}--${tstamp}`) + .setAttribute('id', 'fees-list-menu') + .setExtra('iconClass', 'fa fa-money'); + this._translatedName(this._feeMenu, 'Fees'); } /** @@ -343,19 +359,12 @@ export class MenuUserServicesService extends MenuBase { // ACQUISITION: this._ordersMenu.setQueryParam('library', user.currentLibrary); this._lateIssuesMenu.setQueryParam('library', user.currentLibrary); - // REPORT: INVENTORY LIST + // REPORT: this._inventoryMenu.setQueryParam('library', user.currentLibrary); - // ADMIN: MY ORGANISATION - this._myOrganisationMenu - .setRouterLink([ - '/', 'records', 'organisations', - 'detail', user.currentOrganisation - ]); - // ADMIN: MY LIBRARY - this._myLibraryMenu.setRouterLink([ - '/', 'records', 'libraries', - 'detail', user.currentLibrary - ]); + this._feeMenu.setQueryParam('transaction_library', user.currentLibrary); + // ADMIN: + this._myOrganisationMenu.setRouterLink(['/', 'records', 'organisations', 'detail', user.currentOrganisation]); + this._myLibraryMenu.setRouterLink(['/', 'records', 'libraries', 'detail', user.currentLibrary]); }); } } diff --git a/projects/admin/src/app/pipe/patron-name.pipe.ts b/projects/admin/src/app/pipe/patron-name.pipe.ts new file mode 100644 index 000000000..a2d264426 --- /dev/null +++ b/projects/admin/src/app/pipe/patron-name.pipe.ts @@ -0,0 +1,47 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +import { Pipe, PipeTransform } from '@angular/core'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { PatronService } from '../service/patron.service'; + +@Pipe({ + name: 'patronName' +}) +export class PatronNamePipe implements PipeTransform { + + /** + * Constructor + * @param _patronService: PatronService + */ + constructor( + private _patronService: PatronService + ) {} + + /** + * Build the usage name for a patron based on its PID + * @param patronPid - string: the patron pid + * @returns an observable returning the patron name as string if patron exists. + */ + transform(patronPid: string): Observable { + return this._patronService.getPatronByPid(patronPid).pipe( + map((metadata: any) => this._patronService.getFormattedName(metadata)) + ) + } + +} diff --git a/projects/admin/src/app/record/brief-view/loans-brief-view/loans-brief-view.component.ts b/projects/admin/src/app/record/brief-view/loans-brief-view/loans-brief-view.component.ts index 456b22bb8..c3325c762 100644 --- a/projects/admin/src/app/record/brief-view/loans-brief-view/loans-brief-view.component.ts +++ b/projects/admin/src/app/record/brief-view/loans-brief-view/loans-brief-view.component.ts @@ -31,8 +31,11 @@ import { CirculationLogsComponent } from '../../circulation-logs/circulation-log export class LoansBriefViewComponent implements ResultItem, OnInit { // COMPONENT ATTRIBUTES ===================================================== + /** Information to build the URL on the record detail view. */ @Input() detailUrl: { link: string; external: boolean }; + /** The record to perform. */ @Input() record: any; + /** The type of the record. */ @Input() type: string; /** debug mode toggle */ diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component.html b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component.html new file mode 100644 index 000000000..17c6f4008 --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component.html @@ -0,0 +1,26 @@ + +
+
{{ parent.note }}
+
+
Patron
+
+ {{ parent.patron.pid | patronName | async }} +
+
+
diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component.ts b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component.ts new file mode 100644 index 000000000..86186258e --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-default.component.ts @@ -0,0 +1,32 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Component, Input } from '@angular/core'; +import { PatronTransaction, PatronTransactionEvent } from '../../../classes/patron-transaction'; + +@Component({ + selector: 'admin-patron-transaction-event-default', + templateUrl: './patron-transaction-event-default.component.html', + styleUrls: ['./patron-transaction-events-brief-view.component.scss'] +}) +export class PatronTransactionEventDefaultComponent { + + @Input() event: PatronTransactionEvent; + @Input() parent: PatronTransaction; + +} diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component.html b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component.html new file mode 100644 index 000000000..b22e0d098 --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component.html @@ -0,0 +1,31 @@ + +
+
{{ parent.document.title | mainTitle }}
+
+
Call number
+
+ + ({{ parent.loan.item.barcode }}) +
+
Patron
+
+ {{ parent.patron.pid | patronName | async }} +
+
+
diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component.ts b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component.ts new file mode 100644 index 000000000..37665ee25 --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-event-overdue.component.ts @@ -0,0 +1,29 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Component } from '@angular/core'; +import { PatronTransactionEventDefaultComponent } from './patron-transaction-event-default.component'; + +@Component({ + selector: 'admin-patron-transaction-event-overdue', + templateUrl: './patron-transaction-event-overdue.component.html', + styleUrls: ['./patron-transaction-events-brief-view.component.scss'] +}) +export class PatronTransactionEventOverdueComponent extends PatronTransactionEventDefaultComponent { + +} diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.html b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.html new file mode 100644 index 000000000..801ba9137 --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.html @@ -0,0 +1,64 @@ + +
+
+ + + + + + + + + {{ event.amount | currency : organisation.default_currency }} + + {{ 'dispute' | translate }} + +
+
+ {{ event.operator.name }} + {{ event.library.name }} + {{ parent.type | translate }} + {{ event.creation_date | date : 'short' }} +
+
+ + + +
+
+ +
+ + + + +
+
+ +
+
+ + + +
+
diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.scss b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.scss new file mode 100644 index 000000000..e9ea62aea --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.scss @@ -0,0 +1,86 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +@import 'node_modules/bootstrap/scss/_functions'; +@import 'node_modules/bootstrap/scss/_variables'; +@import 'node_modules/bootstrap/scss/bootstrap'; +@import '../../../scss/variables'; + +:host{ + margin: 0; + display: block; + + .content{ + position: relative; + display: flex; + align-items: flex-start; + + *:nth-child(1){ + flex-grow: 2; + } + + @each $type, $badge in (fee, danger), (payment, success), (dispute, warning), (cancel, dark) { + .badge-#{$type}{ + @extend .badge-#{$badge}; + font-variant: small-caps; + } + } + } + + dt, dd{ + margin:0; + } + + .meta{ + display: flex; + margin-top: 0.5rem; + + *{ + font-size: 0.75rem; + background-color: $gray-300; + color: $gray-600; + border-radius: 0.75rem; + padding: 2px 10px; + } + + .operator:before{ + font-family: 'FontAwesome'; + content: " \f2be"; + padding-right: 0.5rem; + } + .library:before{ + font-family: 'FontAwesome'; + content: " \f19c"; + padding-right: 0.5rem; + } + .transaction-type:before{ + font-family: 'FontAwesome'; + content: " \f0ec"; + padding-right: 0.5rem; + } + .creation-date { + margin-left: auto; + &:before{ + font-family: 'FontAwesome'; + content: " \f017"; + padding-right: 0.5rem; + } + } + } + +} diff --git a/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.ts b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.ts new file mode 100644 index 000000000..ccd2c5318 --- /dev/null +++ b/projects/admin/src/app/record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component.ts @@ -0,0 +1,74 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +import { Component, Input, OnInit } from '@angular/core'; +import { ResultItem } from '@rero/ng-core'; +import { PatronTransaction, PatronTransactionEvent, PatronTransactionEventType } from '@app/admin/classes/patron-transaction'; +import { OrganisationService } from '@app/admin/service/organisation.service'; +import { Organisation } from '@app/admin/classes/core'; +import { PatronTransactionsService } from '../../../service/patron-transactions.service'; + +@Component({ + selector: 'admin-patron-transaction-events-brief-view', + templateUrl: './patron-transaction-events-brief-view.component.html', + styleUrls: ['./patron-transaction-events-brief-view.component.scss'] +}) +export class PatronTransactionEventsBriefViewComponent implements ResultItem, OnInit { + + // COMPONENT ATTRIBUTES ===================================================== + /** Information to build the URL on the record detail view. */ + @Input() detailUrl: { link: string; external: boolean }; + /** The record to perform. */ + @Input() record: any; + /** The type of the record. */ + @Input() type: string; + + /** is all data are loaded */ + loaded = false; + /** transaction object representation from record */ + event: PatronTransactionEvent; + /** Parent parent transaction */ + parent: PatronTransaction; + /** current organisation */ + organisation: Organisation; + /** reference to PatronTransactionEventType */ + eventTypes = PatronTransactionEventType; + + // CONSTRUCTOR & HOOKS ====================================================== + /** + * Constructor + * @param _organisationService - OrganisationService + * @param _patronTransactionService - PatronTransactionsService + */ + constructor( + private _organisationService: OrganisationService, + private _patronTransactionService: PatronTransactionsService + ) { } + + /** OnInit hook */ + ngOnInit(): void { + this.organisation = this._organisationService.organisation; + this.event = new PatronTransactionEvent(this.record.metadata); + this._patronTransactionService + .getPatronTransaction(this.event.parent.pid) + .subscribe((parent: PatronTransaction) => { + this.parent = parent; + this.loaded = true; + }); + } + +} diff --git a/projects/admin/src/app/record/detail-view/collection-detail-view/collection-items/collection-items.component.spec.ts b/projects/admin/src/app/record/detail-view/collection-detail-view/collection-items/collection-items.component.spec.ts index ecfcfefa1..2935907b0 100644 --- a/projects/admin/src/app/record/detail-view/collection-detail-view/collection-items/collection-items.component.spec.ts +++ b/projects/admin/src/app/record/detail-view/collection-detail-view/collection-items/collection-items.component.spec.ts @@ -20,7 +20,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { GetRecordPipe, RecordModule } from '@rero/ng-core'; -import { AppRoutingModule } from 'projects/admin/src/app/app-routing.module'; +import { AppRoutingModule } from '@app/admin/app-routing.module'; import { SharedModule } from '@rero/shared'; import { FrontpageComponent } from '../../../../widgets/frontpage/frontpage.component'; import { CollectionItemsComponent } from './collection-items.component'; diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.spec.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.spec.ts index ad1a8a922..9445c5ece 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.spec.ts +++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.spec.ts @@ -18,7 +18,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { UserService } from '@rero/shared'; -import { HoldingsApiService } from 'projects/admin/src/app/api/holdings-api.service'; +import { HoldingsApiService } from '@app/admin/api/holdings-api.service'; import { of } from 'rxjs'; import { HoldingOrganisationComponent } from './holding-organisation.component'; diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.ts index a2433cd50..815b6b081 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.ts +++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding-organisation/holding-organisation.component.ts @@ -16,7 +16,7 @@ */ import { Component, Input, OnInit } from '@angular/core'; import { UserService } from '@rero/shared'; -import { HoldingsApiService } from 'projects/admin/src/app/api/holdings-api.service'; +import { HoldingsApiService } from '@app/admin/api/holdings-api.service'; import { forkJoin } from 'rxjs'; @Component({ diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding/default-holding-item/default-holding-item.component.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holding/default-holding-item/default-holding-item.component.ts index f80fea8d3..898ba013a 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/holding/default-holding-item/default-holding-item.component.ts +++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding/default-holding-item/default-holding-item.component.ts @@ -20,8 +20,8 @@ import { TranslateService } from '@ngx-translate/core'; import { RecordUiService } from '@rero/ng-core'; import { UserService } from '@rero/shared'; import { BsModalService } from 'ngx-bootstrap/modal'; -import { ItemsService } from 'projects/admin/src/app/service/items.service'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { ItemsService } from '@app/admin/service/items.service'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; import { forkJoin } from 'rxjs'; import { first } from 'rxjs/operators'; import { ItemRequestComponent } from '../../item-request/item-request.component'; diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-note/holding-item-note.component.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-note/holding-item-note.component.ts index b68cb42f9..8da31fc87 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-note/holding-item-note.component.ts +++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding-item-note/holding-item-note.component.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ import { Component, Input } from '@angular/core'; -import { ItemNote } from 'projects/admin/src/app/classes/items'; +import { ItemNote } from '@app/admin/classes/items'; @Component({ selector: 'admin-holding-item-note', diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding.component.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding.component.ts index 98554dee2..c010611db 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding.component.ts +++ b/projects/admin/src/app/record/detail-view/document-detail-view/holding/holding.component.ts @@ -21,8 +21,8 @@ import { RecordService, RecordUiService } from '@rero/ng-core'; import { Record } from '@rero/ng-core/lib/record/record'; import { UserService } from '@rero/shared'; import { BsModalService } from 'ngx-bootstrap/modal'; -import { HoldingsService } from 'projects/admin/src/app/service/holdings.service'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { HoldingsService } from '@app/admin/service/holdings.service'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; import { forkJoin } from 'rxjs'; import { first } from 'rxjs/operators'; import { ItemRequestComponent } from '../item-request/item-request.component'; diff --git a/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.ts b/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.ts index df3510525..23ff1caa2 100644 --- a/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.ts +++ b/projects/admin/src/app/record/detail-view/document-detail-view/holdings/holdings.component.ts @@ -19,7 +19,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { RecordUiService } from '@rero/ng-core'; import { UserService } from '@rero/shared'; -import { HoldingsApiService } from 'projects/admin/src/app/api/holdings-api.service'; +import { HoldingsApiService } from '@app/admin/api/holdings-api.service'; import { forkJoin, Observable } from 'rxjs'; import { RecordPermissionService } from '../../../../service/record-permission.service'; diff --git a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/expected-issue/expected-issue.component.ts b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/expected-issue/expected-issue.component.ts index e8c6ee334..4076c299f 100644 --- a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/expected-issue/expected-issue.component.ts +++ b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/expected-issue/expected-issue.component.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ import { Component, Input } from '@angular/core'; -import { PredictionIssue } from 'projects/admin/src/app/service/holdings.service'; +import { PredictionIssue } from '@app/admin/service/holdings.service'; @Component({ selector: 'admin-expected-issue', diff --git a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts index 7c168eee5..c79011fa4 100644 --- a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts +++ b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/received-issue/received-issue.component.ts @@ -19,8 +19,8 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { RecordUiService } from '@rero/ng-core'; import { IssueItemStatus } from '@rero/shared'; -import { HoldingsService } from 'projects/admin/src/app/service/holdings.service'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { HoldingsService } from '@app/admin/service/holdings.service'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; @Component({ selector: 'admin-received-issue', diff --git a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts index f561ca7ea..51f3d6843 100644 --- a/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts +++ b/projects/admin/src/app/record/detail-view/holding-detail-view/serial-holding-detail-view/serial-holding-detail-view.component.ts @@ -20,9 +20,9 @@ import { RecordService, RecordUiService } from '@rero/ng-core'; import { Record } from '@rero/ng-core/lib/record/record'; import { IssueItemStatus, UserService } from '@rero/shared'; import { ToastrService } from 'ngx-toastr'; -import { HoldingsService, PredictionIssue } from 'projects/admin/src/app/service/holdings.service'; -import { OperationLogsService } from 'projects/admin/src/app/service/operation-logs.service'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { HoldingsService, PredictionIssue } from '@app/admin/service/holdings.service'; +import { OperationLogsService } from '@app/admin/service/operation-logs.service'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; @Component({ diff --git a/projects/admin/src/app/record/detail-view/item-detail-view/item-transaction/item-transaction.component.ts b/projects/admin/src/app/record/detail-view/item-detail-view/item-transaction/item-transaction.component.ts index 66d985311..3794d9026 100644 --- a/projects/admin/src/app/record/detail-view/item-detail-view/item-transaction/item-transaction.component.ts +++ b/projects/admin/src/app/record/detail-view/item-detail-view/item-transaction/item-transaction.component.ts @@ -19,8 +19,8 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angu import { TranslateService } from '@ngx-translate/core'; import { DialogService } from '@rero/ng-core'; import { UserService } from '@rero/shared'; -import { LoanState } from 'projects/admin/src/app/classes/loans'; -import { ItemsService } from 'projects/admin/src/app/service/items.service'; +import { LoanState } from '@app/admin/classes/loans'; +import { ItemsService } from '@app/admin/service/items.service'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; diff --git a/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts b/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts index 8f9e93b90..d0811d084 100644 --- a/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts +++ b/projects/admin/src/app/record/detail-view/item-detail-view/item-transactions/item-transactions.component.ts @@ -19,7 +19,7 @@ import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@rero/shared'; import { BsModalService } from 'ngx-bootstrap/modal'; import { ToastrService } from 'ngx-toastr'; -import { LoanService } from 'projects/admin/src/app/service/loan.service'; +import { LoanService } from '@app/admin/service/loan.service'; import { forkJoin } from 'rxjs'; import { first } from 'rxjs/operators'; import { ItemRequestComponent } from '../../document-detail-view/item-request/item-request.component'; diff --git a/projects/admin/src/app/record/detail-view/library-detail-view/exception-date/exception-date.component.ts b/projects/admin/src/app/record/detail-view/library-detail-view/exception-date/exception-date.component.ts index 26323bc08..8a2847fa3 100644 --- a/projects/admin/src/app/record/detail-view/library-detail-view/exception-date/exception-date.component.ts +++ b/projects/admin/src/app/record/detail-view/library-detail-view/exception-date/exception-date.component.ts @@ -15,7 +15,7 @@ * along with this program. If not, see . */ import { Component, Input } from '@angular/core'; -import { ExceptionDates } from 'projects/admin/src/app/classes/library'; +import { ExceptionDates } from '@app/admin/classes/library'; @Component({ selector: 'admin-exception-date', diff --git a/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.ts b/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.ts index 6ffef654b..3e4e6dcfb 100644 --- a/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.ts +++ b/projects/admin/src/app/record/detail-view/library-detail-view/location/location.component.ts @@ -16,7 +16,7 @@ */ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { RecordUiService } from '@rero/ng-core'; -import { RecordPermissionService } from 'projects/admin/src/app/service/record-permission.service'; +import { RecordPermissionService } from '@app/admin/service/record-permission.service'; @Component({ selector: 'admin-location', diff --git a/projects/admin/src/app/record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component.ts b/projects/admin/src/app/record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component.ts index ab9149047..5977a566a 100644 --- a/projects/admin/src/app/record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component.ts +++ b/projects/admin/src/app/record/formly/type/cipo-patron-type-item-type/cipo-patron-type-item-type.component.ts @@ -18,9 +18,9 @@ import { Component, OnInit } from '@angular/core'; import { FieldArrayType } from '@ngx-formly/core'; import { TranslateService } from '@ngx-translate/core'; import { ApiService } from '@rero/ng-core'; -import { CirculationPolicyApiService } from 'projects/admin/src/app/api/circulation-policy-api.service'; -import { ItemTypeApiService } from 'projects/admin/src/app/api/item-type-api.service'; -import { PatronTypeApiService } from 'projects/admin/src/app/api/patron-type-api.service'; +import { CirculationPolicyApiService } from '@app/admin/api/circulation-policy-api.service'; +import { ItemTypeApiService } from '@app/admin/api/item-type-api.service'; +import { PatronTypeApiService } from '@app/admin/api/patron-type-api.service'; import { forkJoin } from 'rxjs'; import { Settings } from './class/settings'; diff --git a/projects/admin/src/app/record/document-record-search/document-record-search.component.html b/projects/admin/src/app/record/search-view/document-record-search/document-record-search.component.html similarity index 100% rename from projects/admin/src/app/record/document-record-search/document-record-search.component.html rename to projects/admin/src/app/record/search-view/document-record-search/document-record-search.component.html diff --git a/projects/admin/src/app/record/document-record-search/document-record-search.component.spec.ts b/projects/admin/src/app/record/search-view/document-record-search/document-record-search.component.spec.ts similarity index 100% rename from projects/admin/src/app/record/document-record-search/document-record-search.component.spec.ts rename to projects/admin/src/app/record/search-view/document-record-search/document-record-search.component.spec.ts diff --git a/projects/admin/src/app/record/document-record-search/document-record-search.component.ts b/projects/admin/src/app/record/search-view/document-record-search/document-record-search.component.ts similarity index 100% rename from projects/admin/src/app/record/document-record-search/document-record-search.component.ts rename to projects/admin/src/app/record/search-view/document-record-search/document-record-search.component.ts diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/interfaces.ts b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/interfaces.ts new file mode 100644 index 000000000..eaf5715c5 --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/interfaces.ts @@ -0,0 +1,29 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/** Interface to describe payments relative to patron transaction events */ +export interface PaymentData { + total: number, + subtypes: PaymentDataSubtype[] +} + +/** Interface to describe a part of a paymentData */ +export interface PaymentDataSubtype { + name: string; + total: number; +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component.html b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component.html new file mode 100644 index 000000000..bddf3c0c2 --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component.html @@ -0,0 +1,33 @@ + + + + + diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component.ts b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component.ts new file mode 100644 index 000000000..1f3fe9f1b --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component.ts @@ -0,0 +1,87 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Component, ViewChild } from '@angular/core'; +import { RecordSearchComponent, RecordSearchPageComponent, SearchResult } from '@rero/ng-core'; +import { PaymentData } from './interfaces'; + +@Component({ + selector: 'admin-patron-transaction-event-search-view', + templateUrl: './patron-transaction-event-search-view.component.html', +}) +export class PatronTransactionEventSearchViewComponent extends RecordSearchPageComponent { + + @ViewChild('recordSearch') myElt: RecordSearchComponent = null; + + /** The data relative to payments transaction events */ + paymentData: PaymentData = { + total: 0, + subtypes: [] + }; + + /** The search result from search engine */ + private _searchResult: SearchResult; + /** Resource type */ + private _resourceType = 'patron_transaction_events'; + + // COMPONENT FUNCTIONS ====================================================== + /** + * Result of search with type and records (Elasticsearch) + * @param event - SearchResult + */ + recordsSearched(event: SearchResult) { + if (event && event.type === this._resourceType) { + this._searchResult = event; + const totalAgg = this._getAggregation('total'); + if (totalAgg) { + this.paymentData = {total: 0, subtypes: []}; // re-init the payment data. + this._extractPaymentInformation(totalAgg); + } + } + } + + // PRIVATE COMPONENT FUNCTIONS ============================================== + /** + * Get an aggration from search result based on aggregation name. + * @param aggName - string: the aggregation name + * @return: the corresponding aggregation data or `null` if aggregation doesn't exist. + */ + private _getAggregation(aggName: string): any | null { + if (this._searchResult && this._searchResult.records && this._searchResult.records.aggregations) { + const aggregationNames = Object.keys(this._searchResult.records.aggregations); + if (aggregationNames.includes(aggName)) { + return this._searchResult.records.aggregations[aggName]; + } + } + } + + /** + * Extract data from 'total payment' aggregation to set `paymentData` variable. + * @param agg: the search engine aggregation data. + */ + private _extractPaymentInformation(agg: any): void { + if (!agg.payment || !agg.payment.value || agg.payment?.value <= 0) { + return; + } + this.paymentData.total = agg.payment.value; + agg?.subtype.buckets.map(subtype => { + this.paymentData.subtypes.push({name: subtype.key, total: subtype.subtotal.value}); + }); + } + +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payment-data.scss b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payment-data.scss new file mode 100644 index 000000000..52db60693 --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payment-data.scss @@ -0,0 +1,31 @@ +/* You can add global styles to this file, and also import other style files */ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +@import 'node_modules/bootstrap/scss/functions'; +@import 'node_modules/bootstrap/scss/variables'; + +.card-body { + font-size: .9rem; + color: $body-color; + background-color: $card-cap-bg; +} + +button { + font-size: 12px; +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component.html b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component.html new file mode 100644 index 000000000..facfe7cfa --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component.html @@ -0,0 +1,32 @@ + +
+
+ + +
+
+ + + + +
+
+ diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component.ts b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component.ts new file mode 100644 index 000000000..391fdf960 --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/payments-data.component.ts @@ -0,0 +1,44 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Component, Input } from '@angular/core'; +import { PaymentData } from '../interfaces'; + +@Component({ + selector: 'admin-payments-data', + templateUrl: './payments-data.component.html', + styleUrls: ['./payment-data.scss'] +}) +export class PaymentsDataComponent { + + /** the payment data to display. */ + @Input() data: PaymentData; + /** How the data should be displayed. */ + @Input() mode: 'table' | 'pie' = 'table'; + + /** + * Update the display mode to switch between allowed values as a carousel. + * @param event: triggering event. + */ + updateMode(event: Event) { + switch (this.mode) { + case 'pie': this.mode = 'table'; break; + case 'table': this.mode = 'pie'; break; + } + } +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.html b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.html new file mode 100644 index 000000000..21cc47f71 --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.html @@ -0,0 +1,37 @@ + +
+
+ + + {{ model.label }} + {{ model.value | currency: org_currency : 'symbol' }} + + +
+
+ diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.scss b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.scss new file mode 100644 index 000000000..7de3566ee --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.scss @@ -0,0 +1,54 @@ +/* You can add global styles to this file, and also import other style files */ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +@import 'node_modules/bootstrap/scss/functions'; +@import 'node_modules/bootstrap/scss/variables'; + +:host { + height: 100%; + width: 100%; + + .chart-container { + padding-left: map-get($spacers, 4); + padding-right: map-get($spacers, 4); + margin-bottom: map-get($spacers, 3); + + .payment-pie-chart { + width: 230px; + margin: 0 auto; + } + } + + // HACK ngx-charts css classes to display legend as we want. + .chart-legend { + .legend-labels { + background: transparent; + } + .legend-label { + margin: 0; + } + .legend-label-color { + height: 8px; + width: 8px; + } + li { + display: block !important; + } + } +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.ts b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.ts new file mode 100644 index 000000000..2793e795e --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/pie/payment-data-pie.component.ts @@ -0,0 +1,73 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +import { LegendPosition } from '@swimlane/ngx-charts'; +import { OrganisationService } from '../../../../../service/organisation.service'; +import { PaymentData } from '../../interfaces'; + +@Component({ + selector: 'admin-payments-data-pie', + templateUrl: './payment-data-pie.component.html', + styleUrls: ['./payment-data-pie.component.scss'], + encapsulation: ViewEncapsulation.ShadowDom, +}) +export class PaymentDataPieComponent implements OnInit { + + // COMPONENT ATTRIBUTES ===================================================== + /** The payment data to display. */ + @Input() data: PaymentData; + + /** variable used to display pie-chart with ngx-charts. */ + values: any[] = []; + view: any[] = [230, 230]; + legendDisplay = true; + legendTitle = ''; + legendPosition = LegendPosition.Below; + animation = false; + + + // GETTER & SETTER ========================================================== + /** Organisation currency */ + get org_currency() { + return this._organisationService.organisation.default_currency; + } + + // CONSTRUCTOR & HOOKS ====================================================== + /** + * Constructor + * @param _organisationService: OrganisationService + * @param _translateService: TranslateService + */ + constructor( + private _organisationService: OrganisationService, + private _translateService: TranslateService + ) {} + + /** OnInit hook */ + ngOnInit() { + if (this.data.subtypes) { + this.data.subtypes.map(subtype => this.values.push({ + name: this._translateService.instant(subtype.name), + value: subtype.total + })); + } + } + +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.html b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.html new file mode 100644 index 000000000..ccb81247f --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.html @@ -0,0 +1,32 @@ + + +
    +
  • +
    + {{ subtype.name | translate }} + {{ subtype.total | currency: org_currency: 'symbol' }} +
    +
  • +
  • + Total + {{ data.total | currency: org_currency: 'symbol' }} +
  • +
+ + diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.scss b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.scss new file mode 100644 index 000000000..cf3483379 --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.scss @@ -0,0 +1,43 @@ +/* You can add global styles to this file, and also import other style files */ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +@import 'node_modules/bootstrap/scss/functions'; +@import 'node_modules/bootstrap/scss/variables'; + +ul { + padding: map-get($spacers, 3) map-get($spacers, 2) map-get($spacers, 3) map-get($spacers, 3); + + li { + .amount { + font-size: .8rem; + padding-left: map-get($spacers, 2); + color: $secondary; + } + + &.total { + border-top: 1px solid $border-color; + margin-top: map-get($spacers, 2); + padding-top: map-get($spacers, 2); + + span { + font-weight: bold; + } + } + } +} diff --git a/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.ts b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.ts new file mode 100644 index 000000000..9753477cc --- /dev/null +++ b/projects/admin/src/app/record/search-view/patron-transaction-event-search-view/payments-data/table/payments-data-table.component.ts @@ -0,0 +1,44 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Component, Input } from '@angular/core'; +import { OrganisationService } from '../../../../../service/organisation.service'; +import { PaymentData } from '../../interfaces'; + +@Component({ + selector: 'admin-payments-data-table', + templateUrl: './payments-data-table.component.html', + styleUrls: ['./payments-data-table.component.scss'] +}) +export class PaymentsDataTableComponent { + + // COMPONENT ATTRIBUTES ===================================================== + @Input() protected data: PaymentData; + + // GETTER & SETTER ========================================================== + /** Organisation currency */ + get org_currency() { + return this._organisationService.organisation.default_currency; + } + + // CONSTRUCTOR & HOOKS ====================================================== + constructor( + private _organisationService: OrganisationService + ) {} + +} diff --git a/projects/admin/src/app/routes/documents-route.ts b/projects/admin/src/app/routes/documents-route.ts index 4d6ba9966..1c1bbfa19 100644 --- a/projects/admin/src/app/routes/documents-route.ts +++ b/projects/admin/src/app/routes/documents-route.ts @@ -22,7 +22,7 @@ import { CanUpdateGuard } from '../guard/can-update.guard'; import { DocumentsBriefViewComponent } from '../record/brief-view/documents-brief-view/documents-brief-view.component'; import { DocumentEditorComponent } from '../record/custom-editor/document-editor/document-editor.component'; import { DocumentDetailViewComponent } from '../record/detail-view/document-detail-view/document-detail-view.component'; -import { DocumentRecordSearchComponent } from '../record/document-record-search/document-record-search.component'; +import { DocumentRecordSearchComponent } from '../record/search-view/document-record-search/document-record-search.component'; import { BaseRoute } from './base-route'; export class DocumentsRoute extends BaseRoute implements RouteInterface { diff --git a/projects/admin/src/app/routes/patron-transaction-events-route.ts b/projects/admin/src/app/routes/patron-transaction-events-route.ts new file mode 100644 index 000000000..4ef36e272 --- /dev/null +++ b/projects/admin/src/app/routes/patron-transaction-events-route.ts @@ -0,0 +1,99 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { RouteInterface } from '@rero/ng-core'; +import { of } from 'rxjs'; +import { + PatronTransactionEventsBriefViewComponent +} from '../record/brief-view/patron-transaction-events-brief-view/patron-transaction-events-brief-view.component'; +import { + PatronTransactionEventSearchViewComponent +} from '../record/search-view/patron-transaction-event-search-view/patron-transaction-event-search-view.component'; +import { BaseRoute } from './base-route'; + +export class PatronTransactionEventsRoute extends BaseRoute implements RouteInterface { + + /** Route name */ + readonly name = 'patron_transaction_events'; + + /** Record type */ + readonly recordType = 'patron_transaction_events'; + + /** + * Get Configuration + * @return Object + */ + getConfiguration() { + return { + matcher: (url: any) => this.routeMatcher(url, this.name), + children: [ + { path: '', component: PatronTransactionEventSearchViewComponent }, + ], + data: { + adminMode: this.DISABLED, + types: [ + { + key: this.name, + label: _('Fees'), + component: PatronTransactionEventsBriefViewComponent, + permissions: (record: any) => this._routeToolService.permissions(record, this.recordType), + canAdd: (record: any) => of({can: false}), + canUpdate: (record: any) => this._routeToolService.canUpdate(record, this.recordType), + canDelete: (record: any) => this._routeToolService.canDelete(record, this.recordType), + aggregationsBucketSize: 10, + aggregationsExpand: [ + 'owning_library', + 'transaction_date', + 'type', + ], + aggregationsHide: [ + 'total' + ], + aggregationsOrder: [ + 'total', + 'owning_library', + 'transaction_library', + 'type', + 'category', + 'transaction_date', + 'patron_type' + ], + allowEmptySearch: true, + showSearchInput: false, + listHeaders: { + Accept: 'application/rero+json' + }, + sortOptions: [ + { label: _('Amount (desc)'), value: '-amount' }, + { label: _('Amount (asc)'), value: 'amount' }, + { label: _('Transaction date (desc)'), value: '-created', defaultQuery: true }, + { label: _('Transaction date (asc)'), value: 'created'} + ], + exportFormats: [{ + label: 'CSV', + format: 'csv', + endpoint: this._routeToolService.apiService.getExportEndpointByType(this.recordType), + disableMaxRestResultsSize: true, + }], + showFacetsIfNoResults: true + } + ] + } + }; + } +} diff --git a/projects/admin/src/app/routes/route.service.ts b/projects/admin/src/app/routes/route.service.ts index f08038003..eaba9cf4c 100644 --- a/projects/admin/src/app/routes/route.service.ts +++ b/projects/admin/src/app/routes/route.service.ts @@ -41,6 +41,7 @@ import { LoansRoute } from './loans-route'; import { LocalFieldsRoute } from './local-fields-route'; import { LocationsRoute } from './locations-route'; import { OrganisationsRoute } from './organisations-route'; +import { PatronTransactionEventsRoute } from './patron-transaction-events-route'; import { PatronTypesRoute } from './patron-types-route'; import { PatronsRoute } from './patrons-route'; import { PersonsRoute } from './persons-route'; @@ -91,6 +92,7 @@ export class RouteService { .addRoute(new IllRequestsRoute(this._routeToolService)) .addRoute(new LocalFieldsRoute(this._routeToolService)) .addRoute(new LoansRoute(this._routeToolService)) + .addRoute(new PatronTransactionEventsRoute(this._routeToolService)) // Route from acquisition modules .addRoute(new AcqBudgetsRoute(this._routeToolService)) .addRoute(new AcqAccountsRoute(this._routeToolService)) diff --git a/projects/admin/src/app/service/patron-transactions.service.spec.ts b/projects/admin/src/app/service/patron-transactions.service.spec.ts new file mode 100644 index 000000000..a57bfbe3a --- /dev/null +++ b/projects/admin/src/app/service/patron-transactions.service.spec.ts @@ -0,0 +1,40 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { TestBed } from '@angular/core/testing'; +import { TranslateModule } from '@ngx-translate/core'; +import { PatronTransactionsService } from './patron-transactions.service'; + +describe('PatronTransactionsService', () => { + let service: PatronTransactionsService; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [ + HttpClientTestingModule, + TranslateModule.forRoot() + ] + }); + service = TestBed.inject(PatronTransactionsService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/projects/admin/src/app/service/patron-transactions.service.ts b/projects/admin/src/app/service/patron-transactions.service.ts new file mode 100644 index 000000000..76a0c43d4 --- /dev/null +++ b/projects/admin/src/app/service/patron-transactions.service.ts @@ -0,0 +1,58 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { Injectable } from '@angular/core'; +import { Record, RecordService } from '@rero/ng-core'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import { BaseApi } from '@rero/shared'; +import { PatronTransaction } from '../classes/patron-transaction'; + +@Injectable({ + providedIn: 'root' +}) +export class PatronTransactionsService { + + // CONSTRUCTOR ============================================================== + /** + * Constructor + * @param _recordService - RecordService + */ + constructor( + private _recordService: RecordService + ) { } + + // PUBLIC FUNCTIONS ========================================================= + /** + * Get patron transaction by pid + * @param pid: the patron transaction pid + * @return an observable on corresponding patron transaction. + */ + getPatronTransaction(pid: string): Observable { + // DEV NOTE : + // We use `getRecords` instead of `getRecord` in order to benefit of the + // records search serialization + return this._recordService + .getRecords('patron_transactions', `pid:${pid}`, 1, 1, undefined, undefined, BaseApi.reroJsonheaders) + .pipe( + map((result: Record) => this._recordService.totalHits(result.hits.total) === 0 ? [] : result.hits.hits), + map((hits: any) => hits.find(Boolean)), // Get first element of array if exists + map((hit: any) => new PatronTransaction(hit.metadata)) + ); + } +} diff --git a/projects/admin/src/app/service/patron.service.ts b/projects/admin/src/app/service/patron.service.ts index 1587f8553..bcdca852f 100644 --- a/projects/admin/src/app/service/patron.service.ts +++ b/projects/admin/src/app/service/patron.service.ts @@ -88,6 +88,17 @@ export class PatronService { ); } + /** + * Get patron by pid + * @param pid - string : the patron pid + * @return Observable on patron metadata. + */ + getPatronByPid(pid: string): Observable { + return this._recordService + .getRecord('patrons', pid) + .pipe(map((data: any) => data.metadata)) + } + /** * Get Items on loan for a patron * @param patronPid - string: the patron pid diff --git a/projects/admin/src/app/circulation/classes/patron-transaction.spec.ts b/projects/admin/src/app/shared/primeng-import/primeng-import.module.ts similarity index 71% rename from projects/admin/src/app/circulation/classes/patron-transaction.spec.ts rename to projects/admin/src/app/shared/primeng-import/primeng-import.module.ts index 9cb7d5c6b..6a13a52f1 100644 --- a/projects/admin/src/app/circulation/classes/patron-transaction.spec.ts +++ b/projects/admin/src/app/shared/primeng-import/primeng-import.module.ts @@ -1,6 +1,7 @@ /* * RERO ILS UI - * Copyright (C) 2019 RERO + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -14,10 +15,13 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { PatronTransaction } from './patron-transaction'; -describe('PatronTransaction', () => { - it('should create an instance', () => { - expect(new PatronTransaction()).toBeTruthy(); - }); -}); +import { NgModule } from '@angular/core'; +import { SkeletonModule } from 'primeng/skeleton'; + +@NgModule({ + exports: [ + SkeletonModule + ] +}) +export class PrimengImportModule { } diff --git a/projects/shared/package.json b/projects/shared/package.json index 22492d56a..e4f14a2cb 100644 --- a/projects/shared/package.json +++ b/projects/shared/package.json @@ -13,6 +13,7 @@ "@angular/common": "^14.0.0", "@angular/core": "^14.0.0", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@ngx-translate/core": "^14.0.0" + "@ngx-translate/core": "^14.0.0", + "primeng": "^14.2.2" } } diff --git a/projects/shared/src/lib/modules/prime-ng-import/prime-ng-import.module.ts b/projects/shared/src/lib/modules/prime-ng-import/prime-ng-import.module.ts new file mode 100644 index 000000000..bcab866f7 --- /dev/null +++ b/projects/shared/src/lib/modules/prime-ng-import/prime-ng-import.module.ts @@ -0,0 +1,27 @@ +/* + * RERO ILS UI + * Copyright (C) 2019-2022 RERO + * Copyright (C) 2019-2022 UCLouvain + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import { NgModule } from '@angular/core'; +import { SkeletonModule } from 'primeng/skeleton'; + +@NgModule({ + exports: [ + SkeletonModule + ] +}) +export class PrimeNgImportModule { } diff --git a/projects/shared/src/lib/shared.module.ts b/projects/shared/src/lib/shared.module.ts index 1deb53064..b2387746b 100644 --- a/projects/shared/src/lib/shared.module.ts +++ b/projects/shared/src/lib/shared.module.ts @@ -22,6 +22,7 @@ import { CoreModule, NgVarDirective, Nl2brPipe, RecordModule, TruncateTextPipe } import { PopoverModule } from 'ngx-bootstrap/popover'; import { TooltipModule } from 'ngx-bootstrap/tooltip'; import { ActionButtonComponent } from './component/action-button/action-button.component'; +import { PrimeNgImportModule } from './modules/prime-ng-import/prime-ng-import.module'; import { ShowMorePagerComponent } from './paginator/show-more-pager/show-more-pager.component'; import { ContributionFormatPipe } from './pipe/contribution-format.pipe'; import { ContributionTypePipe } from './pipe/contribution-type.pipe'; @@ -76,6 +77,7 @@ import { ContributionFilterPipe } from './pipe/contribution-filter.pipe'; ], exports: [ CommonModule, + PrimeNgImportModule, ContributionBriefComponent, ContributionSourcesComponent, OrganisationBriefComponent, diff --git a/projects/shared/src/public-api.ts b/projects/shared/src/public-api.ts index a9b95dd17..f1094031a 100644 --- a/projects/shared/src/public-api.ts +++ b/projects/shared/src/public-api.ts @@ -26,6 +26,7 @@ export * from './lib/class/item-status'; export * from './lib/class/user'; export * from './lib/class/holdings'; export * from './lib/component/action-button/action-button.component'; +export * from './lib/modules/prime-ng-import/prime-ng-import.module'; export * from './lib/paginator/paginator'; export * from './lib/paginator/show-more-pager/show-more-pager.component'; export * from './lib/pipe/contribution-filter.pipe'; diff --git a/tsconfig.json b/tsconfig.json index d393a6761..d934cf0a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,6 +28,9 @@ "@rero/shared/*": [ "dist/shared/*" ], + "@app/admin/*": [ + "projects/admin/src/app/*" + ], "moment": [ "node_modules/moment/min/moment.min.js" ] @@ -38,8 +41,8 @@ "strictInjectionParameters": true }, "paths": { - "@app/*": [ - "src/app/*" + "@app/admin/*": [ + "projects/admin/src/app/*" ] } }