Merge branch 'feature/ngrx' into develop

This commit is contained in:
Michał Romaszkin 2020-11-09 20:58:34 +01:00
commit 1c168ad6e5
20 changed files with 526 additions and 285 deletions

View File

@ -5,32 +5,32 @@
"requires": true,
"dependencies": {
"@angular-devkit/architect": {
"version": "0.1000.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1000.0.tgz",
"integrity": "sha512-luzBYe7t994ebq6xIfYJudxOkMBO0bywafk6sQqb+bOaBQAran4orF1R/zEx6f8TJzEoXELjUvxm/ePSqZdpKg==",
"version": "0.1002.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1002.0.tgz",
"integrity": "sha512-twM8V03ujBIGVpgV1PBlSDodUdxtUb7WakutfWafAvEHUsgwzfvQz2VtKWvjNZ9AiYjnCuwkQaclqVv0VHNo9w==",
"dev": true,
"requires": {
"@angular-devkit/core": "10.0.0",
"rxjs": "6.5.5"
"@angular-devkit/core": "10.2.0",
"rxjs": "6.6.2"
},
"dependencies": {
"@angular-devkit/core": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.0.0.tgz",
"integrity": "sha512-IvX9IMaCjDkN9vDVnYcgWbSBinlUUb7jdFhDGeTtK6rGSnjX1GoLvWneVI2hoccS07fPbnfMoYXBoZLwVxiIxw==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.2.0.tgz",
"integrity": "sha512-XAszFhSF3mZw1VjoOsYGbArr5NJLcStjOvcCGjBPl1UBM2AKpuCQXHxI9XJGYKL3B93Vp5G58d8qkHvamT53OA==",
"dev": true,
"requires": {
"ajv": "6.12.2",
"ajv": "6.12.4",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.5.5",
"rxjs": "6.6.2",
"source-map": "0.7.3"
}
},
"ajv": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
"version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@ -38,6 +38,21 @@
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"rxjs": {
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
"integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
@ -378,71 +393,72 @@
}
},
"@angular/cli": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-10.0.0.tgz",
"integrity": "sha512-I+2cltQCmThgrnHwsG5AX0hQ9z6rK/8ysRWWeiJXHtEtqupW9eNzXX1QfXWxWB3o6oIKgijvnLlp04BUlWCyXA==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-10.2.0.tgz",
"integrity": "sha512-YBzwkFBmG6CdUJk8onsPXxHX/ByU5MERBQgYhLC873e2nZlXMUu+Ttq2Wai6apyskGvsXKxZNPOQSFZTGKXzXg==",
"dev": true,
"requires": {
"@angular-devkit/architect": "0.1000.0",
"@angular-devkit/core": "10.0.0",
"@angular-devkit/schematics": "10.0.0",
"@schematics/angular": "10.0.0",
"@schematics/update": "0.1000.0",
"@angular-devkit/architect": "0.1002.0",
"@angular-devkit/core": "10.2.0",
"@angular-devkit/schematics": "10.2.0",
"@schematics/angular": "10.2.0",
"@schematics/update": "0.1002.0",
"@yarnpkg/lockfile": "1.1.0",
"ansi-colors": "4.1.1",
"debug": "4.1.1",
"ini": "1.3.5",
"inquirer": "7.1.0",
"inquirer": "7.3.3",
"npm-package-arg": "8.0.1",
"npm-pick-manifest": "6.1.0",
"open": "7.0.4",
"open": "7.2.0",
"pacote": "9.5.12",
"read-package-tree": "5.3.1",
"rimraf": "3.0.2",
"semver": "7.3.2",
"symbol-observable": "1.2.0",
"universal-analytics": "0.4.20",
"uuid": "8.1.0"
"universal-analytics": "0.4.23",
"uuid": "8.3.0"
},
"dependencies": {
"@angular-devkit/core": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.0.0.tgz",
"integrity": "sha512-IvX9IMaCjDkN9vDVnYcgWbSBinlUUb7jdFhDGeTtK6rGSnjX1GoLvWneVI2hoccS07fPbnfMoYXBoZLwVxiIxw==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.2.0.tgz",
"integrity": "sha512-XAszFhSF3mZw1VjoOsYGbArr5NJLcStjOvcCGjBPl1UBM2AKpuCQXHxI9XJGYKL3B93Vp5G58d8qkHvamT53OA==",
"dev": true,
"requires": {
"ajv": "6.12.2",
"ajv": "6.12.4",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.5.5",
"rxjs": "6.6.2",
"source-map": "0.7.3"
}
},
"@angular-devkit/schematics": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-10.0.0.tgz",
"integrity": "sha512-FJ/dY18M+cnAT9RkVjVRJ0PMFZci3ok0WoOosW25Fk68jwNSbGCeF8k8NcD6YE60+CfF4/0LxQWgFagr/wdEhw==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-10.2.0.tgz",
"integrity": "sha512-TQI5NnE6iM3ChF5gZQ9qb+lZgMWa7aLoF5ksOyT3zrmOuICiQYJhA6SsjV95q7J4M55qYymwBib8KTqU/xuQww==",
"dev": true,
"requires": {
"@angular-devkit/core": "10.0.0",
"ora": "4.0.4",
"rxjs": "6.5.5"
"@angular-devkit/core": "10.2.0",
"ora": "5.0.0",
"rxjs": "6.6.2"
}
},
"@schematics/angular": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-10.0.0.tgz",
"integrity": "sha512-m7Pxz4guAMbe7NASKCPUNxvUX/LeieDjGsXwIt09tVE4dEi9yqJP5zq8kOnZEiLKKflP7GoB65RNex4dTxsydw==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-10.2.0.tgz",
"integrity": "sha512-rJRTTTL8CMMFb3ebCvAVHKHxuNzRqy/HtbXhJ82l5Xo/jXcm74eV2Q0RBUrNo1yBKWFIR+FIwiXLJaGcC/R9Pw==",
"dev": true,
"requires": {
"@angular-devkit/core": "10.0.0",
"@angular-devkit/schematics": "10.0.0"
"@angular-devkit/core": "10.2.0",
"@angular-devkit/schematics": "10.2.0",
"jsonc-parser": "2.3.0"
}
},
"ajv": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
"version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@ -464,25 +480,30 @@
"dev": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cli-spinners": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.5.0.tgz",
"integrity": "sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==",
"dev": true
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@ -504,22 +525,40 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"ora": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/ora/-/ora-4.0.4.tgz",
"integrity": "sha512-77iGeVU1cIdRhgFzCK8aw1fbtT1B/iZAvWjS+l/o1x0RShMgxHUZaD2yDpWsNCPwXg9z1ZA78Kbdvr8kBmG/Ww==",
"log-symbols": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz",
"integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
"chalk": "^4.0.0"
}
},
"ora": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-5.0.0.tgz",
"integrity": "sha512-s26qdWqke2kjN/wC4dy+IQPBIMWBJlSU/0JZhk30ZDBLelW25rv66yutUWARMigpGPzcXHb+Nac5pNhN/WsARw==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
"cli-cursor": "^3.1.0",
"cli-spinners": "^2.2.0",
"cli-spinners": "^2.4.0",
"is-interactive": "^1.0.0",
"log-symbols": "^3.0.0",
"log-symbols": "^4.0.0",
"mute-stream": "0.0.8",
"strip-ansi": "^6.0.0",
"wcwidth": "^1.0.1"
}
},
"rxjs": {
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
"integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
@ -530,18 +569,24 @@
}
},
"supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"uuid": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.1.0.tgz",
"integrity": "sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz",
"integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==",
"dev": true
}
}
@ -2000,6 +2045,14 @@
"tslib": "^2.0.0"
}
},
"@ngrx/router-store": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/@ngrx/router-store/-/router-store-10.0.1.tgz",
"integrity": "sha512-UuTIYJWKhYv5xlhcJw3pz3C+DbLk5DzTWYJ03B7J+O2ELnKlbMDdjoejzNVDGOGKKWjzg/irNvkC/Opu2Zspqg==",
"requires": {
"tslib": "^2.0.0"
}
},
"@ngrx/store": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/@ngrx/store/-/store-10.0.1.tgz",
@ -2123,50 +2176,49 @@
}
},
"@schematics/update": {
"version": "0.1000.0",
"resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.1000.0.tgz",
"integrity": "sha512-snjz7sQCOn4Xi66XQREXZx9K6R/vAnUfdyO5nXekls8+E+MIowlP+gqHM0whi8qJDwCLd9maYmeVsD6XZaGImQ==",
"version": "0.1002.0",
"resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.1002.0.tgz",
"integrity": "sha512-g2bfJSAj3x/YL0GNhnHsDSQmO6DoxSnLxoFLqNN5+ukxK5jq7OZNDwMJGxZ3X6RcSMWKEkIKL/wlq9yhj2T/kw==",
"dev": true,
"requires": {
"@angular-devkit/core": "10.0.0",
"@angular-devkit/schematics": "10.0.0",
"@angular-devkit/core": "10.2.0",
"@angular-devkit/schematics": "10.2.0",
"@yarnpkg/lockfile": "1.1.0",
"ini": "1.3.5",
"npm-package-arg": "^8.0.0",
"pacote": "9.5.12",
"rxjs": "6.5.5",
"semver": "7.3.2",
"semver-intersect": "1.4.0"
},
"dependencies": {
"@angular-devkit/core": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.0.0.tgz",
"integrity": "sha512-IvX9IMaCjDkN9vDVnYcgWbSBinlUUb7jdFhDGeTtK6rGSnjX1GoLvWneVI2hoccS07fPbnfMoYXBoZLwVxiIxw==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.2.0.tgz",
"integrity": "sha512-XAszFhSF3mZw1VjoOsYGbArr5NJLcStjOvcCGjBPl1UBM2AKpuCQXHxI9XJGYKL3B93Vp5G58d8qkHvamT53OA==",
"dev": true,
"requires": {
"ajv": "6.12.2",
"ajv": "6.12.4",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.5.5",
"rxjs": "6.6.2",
"source-map": "0.7.3"
}
},
"@angular-devkit/schematics": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-10.0.0.tgz",
"integrity": "sha512-FJ/dY18M+cnAT9RkVjVRJ0PMFZci3ok0WoOosW25Fk68jwNSbGCeF8k8NcD6YE60+CfF4/0LxQWgFagr/wdEhw==",
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-10.2.0.tgz",
"integrity": "sha512-TQI5NnE6iM3ChF5gZQ9qb+lZgMWa7aLoF5ksOyT3zrmOuICiQYJhA6SsjV95q7J4M55qYymwBib8KTqU/xuQww==",
"dev": true,
"requires": {
"@angular-devkit/core": "10.0.0",
"ora": "4.0.4",
"rxjs": "6.5.5"
"@angular-devkit/core": "10.2.0",
"ora": "5.0.0",
"rxjs": "6.6.2"
}
},
"ajv": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
"version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@ -2182,25 +2234,30 @@
"dev": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cli-spinners": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.5.0.tgz",
"integrity": "sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==",
"dev": true
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@ -2222,22 +2279,40 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"ora": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/ora/-/ora-4.0.4.tgz",
"integrity": "sha512-77iGeVU1cIdRhgFzCK8aw1fbtT1B/iZAvWjS+l/o1x0RShMgxHUZaD2yDpWsNCPwXg9z1ZA78Kbdvr8kBmG/Ww==",
"log-symbols": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz",
"integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
"chalk": "^4.0.0"
}
},
"ora": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ora/-/ora-5.0.0.tgz",
"integrity": "sha512-s26qdWqke2kjN/wC4dy+IQPBIMWBJlSU/0JZhk30ZDBLelW25rv66yutUWARMigpGPzcXHb+Nac5pNhN/WsARw==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
"cli-cursor": "^3.1.0",
"cli-spinners": "^2.2.0",
"cli-spinners": "^2.4.0",
"is-interactive": "^1.0.0",
"log-symbols": "^3.0.0",
"log-symbols": "^4.0.0",
"mute-stream": "0.0.8",
"strip-ansi": "^6.0.0",
"wcwidth": "^1.0.1"
}
},
"rxjs": {
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
"integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
@ -2248,13 +2323,19 @@
}
},
"supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
@ -3949,9 +4030,9 @@
"dev": true
},
"cli-width": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz",
"integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz",
"integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==",
"dev": true
},
"cliui": {
@ -5456,12 +5537,23 @@
"dev": true
},
"encoding": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
"dev": true,
"requires": {
"iconv-lite": "~0.4.13"
"iconv-lite": "^0.6.2"
},
"dependencies": {
"iconv-lite": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",
"integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
}
}
},
"end-of-stream": {
@ -6669,12 +6761,23 @@
}
},
"hosted-git-info": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.4.tgz",
"integrity": "sha512-4oT62d2jwSDBbLLFLZE+1vPuQ1h8p9wjrJ8Mqx5TjsyWmBMV5B13eJqn8pvluqubLf3cJPTfiYCIwNwDNmzScQ==",
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz",
"integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==",
"dev": true,
"requires": {
"lru-cache": "^5.1.1"
"lru-cache": "^6.0.0"
},
"dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
}
}
},
"hpack.js": {
@ -7102,21 +7205,21 @@
"dev": true
},
"inquirer": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz",
"integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==",
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz",
"integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==",
"dev": true,
"requires": {
"ansi-escapes": "^4.2.1",
"chalk": "^3.0.0",
"chalk": "^4.1.0",
"cli-cursor": "^3.1.0",
"cli-width": "^2.0.0",
"cli-width": "^3.0.0",
"external-editor": "^3.0.3",
"figures": "^3.0.0",
"lodash": "^4.17.15",
"lodash": "^4.17.19",
"mute-stream": "0.0.8",
"run-async": "^2.4.0",
"rxjs": "^6.5.3",
"rxjs": "^6.6.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0",
"through": "^2.3.6"
@ -7129,19 +7232,18 @@
"dev": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
@ -7169,6 +7271,15 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"rxjs": {
"version": "6.6.3",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz",
"integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
@ -7179,13 +7290,19 @@
}
},
"supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
@ -7758,6 +7875,12 @@
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
"dev": true
},
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
@ -7791,6 +7914,12 @@
"minimist": "^1.2.5"
}
},
"jsonc-parser": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.0.tgz",
"integrity": "sha512-b0EBt8SWFNnixVdvoR2ZtEGa9ZqLhbJnOjezn+WP+8kspFm+PFYDN8Z4Bc7pRlDjvuVcADSUkroIuTWWn/YiIA==",
"dev": true
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
@ -9290,9 +9419,9 @@
}
},
"open": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/open/-/open-7.0.4.tgz",
"integrity": "sha512-brSA+/yq+b08Hsr4c8fsEW2CRzk1BmfN3SAK/5VCHQ9bdoZJ4qa/+AfR0xHjlbbZUyPkUHs1b8x1RqdyZdkVqQ==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/open/-/open-7.2.0.tgz",
"integrity": "sha512-4HeyhxCvBTI5uBePsAdi55C5fmqnWZ2e2MlmvWi5KW5tdH5rxoiv/aMtbeVxKZc3eWkT1GymMnLG8XC4Rq4TDQ==",
"dev": true,
"requires": {
"is-docker": "^2.0.0",
@ -10939,14 +11068,13 @@
}
},
"read-package-json": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.1.tgz",
"integrity": "sha512-dAiqGtVc/q5doFz6096CcnXhpYk0ZN8dEKVkGLU0CsASt8SrgF6SF7OTKAYubfvFhWaqofl+Y8HK19GR8jwW+A==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz",
"integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==",
"dev": true,
"requires": {
"glob": "^7.1.1",
"graceful-fs": "^4.1.2",
"json-parse-better-errors": "^1.0.1",
"json-parse-even-better-errors": "^2.3.0",
"normalize-package-data": "^2.0.0",
"npm-normalize-package-bin": "^1.0.0"
}
@ -12235,9 +12363,9 @@
}
},
"spdx-license-ids": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz",
"integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==",
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz",
"integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==",
"dev": true
},
"spdy": {
@ -13095,25 +13223,14 @@
}
},
"universal-analytics": {
"version": "0.4.20",
"resolved": "https://registry.npmjs.org/universal-analytics/-/universal-analytics-0.4.20.tgz",
"integrity": "sha512-gE91dtMvNkjO+kWsPstHRtSwHXz0l2axqptGYp5ceg4MsuurloM0PU3pdOfpb5zBXUvyjT4PwhWK2m39uczZuw==",
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/universal-analytics/-/universal-analytics-0.4.23.tgz",
"integrity": "sha512-lgMIH7XBI6OgYn1woDEmxhGdj8yDefMKg7GkWdeATAlQZFrMrNyxSkpDzY57iY0/6fdlzTbBV03OawvvzG+q7A==",
"dev": true,
"requires": {
"debug": "^3.0.0",
"request": "^2.88.0",
"debug": "^4.1.1",
"request": "^2.88.2",
"uuid": "^3.0.0"
},
"dependencies": {
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"dev": true,
"requires": {
"ms": "^2.1.1"
}
}
}
},
"universalify": {

View File

@ -21,6 +21,7 @@
"@nebular/eva-icons": "5.0.0",
"@nebular/theme": "^5.0.0",
"@ngrx/effects": "^10.0.1",
"@ngrx/router-store": "^10.0.1",
"@ngrx/store": "^10.0.1",
"@ngrx/store-devtools": "^10.0.1",
"@types/papaparse": "^5.0.3",

View File

@ -0,0 +1,6 @@
import { createAction, props } from '@ngrx/store';
export const setDiscussion = createAction(
'[DiscussionChoser Component] Set Discussions ID',
props<{ id: number }>()
);

View File

@ -0,0 +1,10 @@
import { createAction, props } from '@ngrx/store';
export const getDiscussion = createAction(
'[DiscussionViewer Component] Load Discussion'
);
export const discussionSuccess = createAction(
'[DiscussionViewer Component] Load Discussion Success',
props<{ payload: any }>()
);

View File

@ -1,5 +1,6 @@
import { HttpErrorResponse } from '@angular/common/http';
import { createAction, props } from '@ngrx/store';
import { CustomForumData } from '../_interfaces/customforumdata';
export const fetchFile = createAction(
'[FrontPage Component] Fetch File',
@ -14,5 +15,5 @@ export const sendFileError = createAction(
export const sendFileSuccess = createAction(
'[FrontPage Component] Send Success',
props<{ data: string }>()
props<{ data: CustomForumData }>()
);

View File

@ -27,6 +27,7 @@ import { StoreModule } from '@ngrx/store';
import { reducers, metaReducers } from './reducers';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { EffectsModule } from '@ngrx/effects';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
@NgModule({
declarations: [AppComponent],
@ -77,6 +78,7 @@ import { EffectsModule } from '@ngrx/effects';
}),
StoreDevtoolsModule.instrument({ maxAge: 25 }),
EffectsModule.forRoot([]),
StoreRouterConnectingModule.forRoot(),
],
bootstrap: [AppComponent],
providers: [SharedDataService, NbSidebarService, SidebarItemsService],

View File

@ -0,0 +1,61 @@
import { Store } from '@ngrx/store';
import { Actions, createEffect, ofType } from '@ngrx/effects';
import { Injectable } from '@angular/core';
import {
getDiscussion,
discussionSuccess,
} from '../actions/discussion.actions';
import { selectRouteParam, State } from '../reducers';
import {
concatMap,
tap,
withLatestFrom,
map,
catchError,
flatMap,
} from 'rxjs/operators';
import { EMPTY, of } from 'rxjs';
import { GetDiscussionService } from '../services/get-discussion.service';
import { ROUTER_NAVIGATED } from '@ngrx/router-store';
import { Router } from '@angular/router';
@Injectable()
export class DiscussionEffects {
constructor(
private actions$: Actions,
private store$: Store<State>,
private getDiscussionService: GetDiscussionService,
private router: Router
) {}
get$ = createEffect(() =>
this.actions$.pipe(
ofType(getDiscussion),
concatMap((action) =>
of(action).pipe(
withLatestFrom(this.store$.select(selectRouteParam('id')))
)
),
flatMap(([_, id]) =>
this.getDiscussionService.getDiscussion(parseInt(id!)).pipe(
map((discussions) =>
discussionSuccess({ payload: discussions.posts })
),
catchError(() => EMPTY)
)
)
)
);
load$ = createEffect(
() =>
this.actions$.pipe(
ofType(ROUTER_NAVIGATED),
tap(() => {
if (this.router.url.includes('/view/forum/')) {
this.store$.dispatch(getDiscussion());
}
})
),
{ dispatch: false }
);
}

View File

@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { SendDataService } from '../services/send-data.service';
import * as FrontPageActions from '../actions/front-page.actions';
import * as FrontPageSelectors from '../selectors/front-page.selectors';
import * as DataActions from '../actions/data.actions';
import { Actions, ofType, createEffect } from '@ngrx/effects';
import { State as AppState } from '../reducers/index';
import { Store } from '@ngrx/store';
@ -16,6 +17,7 @@ import {
import { of } from 'rxjs';
import { NbToastrService } from '@nebular/theme';
import { Router } from '@angular/router';
import { CustomForumData } from '../_interfaces/customforumdata';
@Injectable()
export class FrontPageEffect {
@ -37,7 +39,18 @@ export class FrontPageEffect {
),
flatMap(([_, file]) =>
this.sendDataService.postFile(file).pipe(
map((result) => FrontPageActions.sendFileSuccess({ data: result })),
tap((result) => {
const parsedObj: CustomForumData = JSON.parse(result as string);
parsedObj.discussions.forEach((discussion) => {
this.store$.dispatch(
DataActions.setDiscussion({ id: discussion.id })
);
});
}),
map((result) => {
const parsedObj: CustomForumData = JSON.parse(result as string);
return FrontPageActions.sendFileSuccess({ data: parsedObj });
}),
catchError((error) => of(FrontPageActions.sendFileError({ error })))
)
)

View File

@ -1,9 +1,9 @@
<div class="picker-container" *ngIf="data">
<div class="picker-container" *ngIf="data$ | async">
<h1>
Wybierz dyskusję z <i>{{ data.name }}:</i>
Wybierz dyskusję z <i>{{ (data$ | async)?.name }}:</i>
</h1>
<nb-card
*ngFor="let item of data.discussions"
*ngFor="let item of (data$ | async)?.discussions"
class="picker-container__discussion"
[accent]="getRandomColor()"
(click)="onDiscussionClick(item.id)"

View File

@ -1,27 +1,15 @@
import {
Component,
OnInit,
OnDestroy,
ChangeDetectionStrategy,
} from '@angular/core';
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { SharedDataService } from '../../services/shared-data.service';
import { Colors } from '../../_types/color';
import { CustomForumData } from '../../_interfaces/customforumdata';
import { Subscription } from 'rxjs';
import { Observable, Subscription } from 'rxjs';
import { NbMenuItem } from '@nebular/theme';
import { Router } from '@angular/router';
import { MapIdService } from 'src/app/services/map-id.service';
// interface CustomForumData {
// id: string;
// name: string;
// discussions: [
// {
// title: string;
// id: string;
// }
// ];
// }
import { Store } from '@ngrx/store';
import { State } from 'src/app/reducers';
import { selectData } from '../../selectors/data.selectors';
import { setDiscussion } from '../../actions/data.actions';
@Component({
selector: 'app-discussion-chooser',
@ -29,31 +17,20 @@ import { MapIdService } from 'src/app/services/map-id.service';
templateUrl: './discussion-chooser.component.html',
styleUrls: ['./discussion-chooser.component.scss'],
})
export class DiscussionChooserComponent implements OnInit, OnDestroy {
export class DiscussionChooserComponent implements OnInit {
public data: CustomForumData;
colors: Colors[] = ['primary', 'danger', 'info', 'success', 'warning'];
private dataSub: Subscription;
data$: Observable<CustomForumData>;
constructor(
private sharedDataService: SharedDataService,
private router: Router,
private mapIdService: MapIdService
private mapIdService: MapIdService,
private store: Store<State>
) {}
ngOnInit(): void {
this.dataSub = this.sharedDataService.getData().subscribe((res) => {
if (res) {
const parsedObj = JSON.parse(res as string);
this.data = parsedObj as CustomForumData;
this.data.discussions.forEach((discussion) => {
this.mapIdService.initDiscussionMode(discussion.id);
});
}
});
}
ngOnDestroy(): void {
this.dataSub.unsubscribe();
this.data$ = this.store.select(selectData);
}
getRandomColor(): Colors {

View File

@ -43,7 +43,7 @@
<input id="input-for-id" type="file" (change)="fetchFile($event)" />
</div>
<div class="discussion-viewer__posts-container">
<nb-card *ngFor="let item of data">
<nb-card *ngFor="let item of discussion$ | async">
<nb-card-header>
{{ item.author | idToName: displayNamesMode:parsedNames }}
</nb-card-header>

View File

@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { GetDiscussionService } from '../../services/get-discussion.service';
import { PredictedPost } from '../../_interfaces/predictedposts';
import { Subscription } from 'rxjs';
import { Observable, Subject, Subscription } from 'rxjs';
import { concatMap, defaultIfEmpty, map } from 'rxjs/operators';
import { ParagraphService } from 'src/app/services/paragraph.service';
import {
@ -11,13 +11,15 @@ import {
NbScrollPosition,
} from '@nebular/theme';
import { parse } from 'papaparse';
import { selectRouteParam, State } from 'src/app/reducers';
import { Store } from '@ngrx/store';
@Component({
selector: 'app-discussion-viewer',
templateUrl: './discussion-viewer.component.html',
styleUrls: ['./discussion-viewer.component.scss'],
})
export class DiscussionViewerComponent implements OnInit, OnDestroy {
export class DiscussionViewerComponent implements OnInit {
data: PredictedPost[];
id: number;
subscriptionData: Subscription;
@ -29,25 +31,25 @@ export class DiscussionViewerComponent implements OnInit, OnDestroy {
constructor(
private getDiscussionService: GetDiscussionService,
private paragraphService: ParagraphService,
private activatedRouter: ActivatedRoute,
private router: Router,
private toastService: NbToastrService,
private scrollService: NbLayoutScrollService
private scrollService: NbLayoutScrollService,
private store: Store<State>
) {
this.scrollPosition = { x: 0, y: 0 };
}
discussion$: Observable<PredictedPost[]> = this.store.select((state) => {
return state.currentDiscussion;
});
ngOnInit(): void {
this.subscriptionData = this.activatedRouter.params
.pipe(
concatMap((params) => {
this.id = params.id;
return this.getDiscussionService.getDiscussion(this.id);
})
)
.subscribe((result) => {
this.data = result.posts;
});
this.store.dispatch({
type: '[DiscussionViewer Component] Load Discussion',
});
this.store.select(selectRouteParam('id')).subscribe((id) => {
this.id = parseInt(id!);
});
this.scrollService
.onScroll()
.pipe(concatMap(() => this.scrollService.getPosition()))
@ -56,10 +58,6 @@ export class DiscussionViewerComponent implements OnInit, OnDestroy {
});
}
ngOnDestroy(): void {
this.subscriptionData.unsubscribe();
}
onBackButtonClick() {
this.router.navigate(['/view/discussions/']);
}

View File

@ -1,28 +1,25 @@
import { Component, OnInit, AfterContentInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { SharedDataService } from '../services/shared-data.service';
import { NbSidebarService, NbMenuItem } from '@nebular/theme';
import { Subscription } from 'rxjs';
import { SidebarItemsService } from '../services/sidebar-items.service';
import { CustomForumData } from '../_interfaces/customforumdata';
import { Observable, Subscription } from 'rxjs';
import { Store } from '@ngrx/store';
import { State } from '../reducers';
import { selectDiscussions } from '../selectors/data.selectors';
@Component({
selector: 'app-main-view',
templateUrl: './main-view.component.html',
styleUrls: ['./main-view.component.scss'],
})
export class MainViewComponent implements OnInit, AfterContentInit {
export class MainViewComponent implements OnInit {
items: NbMenuItem[];
menuItemsSub: Subscription;
dataSub: Subscription;
discussions$: Observable<{ id: number; title: string }[]>;
constructor(
private sidebarService: NbSidebarService,
private sharedDataService: SharedDataService,
private router: Router,
private menuItemsService: SidebarItemsService
private store: Store<State>
) {}
toggleSidebar() {
@ -34,34 +31,36 @@ export class MainViewComponent implements OnInit, AfterContentInit {
}
ngOnInit(): void {
this.dataSub = this.sharedDataService.getData().subscribe((result) => {
if (result) {
const parsedObj = JSON.parse(result as string) as CustomForumData;
const fetchedDiscussions = parsedObj.discussions.map(
(element): NbMenuItem => {
return {
title: element.title,
link: `/view/forum/${element.id}`,
};
}
);
const fetchedVisualizations = parsedObj.discussions.map(
(element): NbMenuItem => {
return {
title: element.title,
link: `/view/visualize/${element.id}`,
};
}
);
this.menuItemsService.addMenuItem(fetchedDiscussions, 0);
this.menuItemsService.addMenuItem(fetchedVisualizations, 1);
}
});
}
ngAfterContentInit(): void {
this.menuItemsService.getMenuItems().subscribe((result) => {
this.items = result;
this.store.select(selectDiscussions).subscribe((discussions) => {
const availableDiscussions = discussions.map(
(discussion): NbMenuItem => ({
title: discussion.title,
link: `/view/forum/${discussion.id}`,
})
);
const availableVisualizations = discussions.map(
(discussion): NbMenuItem => ({
title: discussion.title,
link: `/view/visualize/${discussion.id}`,
})
);
this.items = [
{
title: 'Dyskusje',
link: '/view/discussions',
icon: {
icon: 'message-square',
},
children: availableDiscussions,
},
{
title: 'Wizualizacje',
icon: {
icon: 'trending-up',
},
children: availableVisualizations,
},
];
});
}
}

View File

@ -11,6 +11,7 @@ import { ParagraphService } from '../services/paragraph.service';
import { MapIdService } from '../services/map-id.service';
import { StyledParagraphComponent } from './styled-paragraph/styled-paragraph.component';
import { IdToNamePipe } from '../_pipes/id-to-name.pipe';
import { DiscussionEffects } from '../effects/discussion.effect';
import {
NbLayoutModule,
@ -23,6 +24,7 @@ import {
NbSelectModule,
NbIconModule,
} from '@nebular/theme';
import { EffectsModule } from '@ngrx/effects';
@NgModule({
declarations: [
@ -44,6 +46,7 @@ import {
NbButtonModule,
NbSelectModule,
NbIconModule,
EffectsModule.forFeature([DiscussionEffects]),
],
providers: [GetDiscussionService, ParagraphService, MapIdService],
})

View File

@ -0,0 +1,20 @@
import { Action, createReducer, on } from '@ngrx/store';
import * as Actions from '../actions/front-page.actions';
import { CustomForumData } from '../_interfaces/customforumdata';
export interface DataState {
data: CustomForumData;
}
export const initialDataState: DataState = {
data: {} as CustomForumData,
};
const _dataReducer = createReducer(
initialDataState,
on(Actions.sendFileSuccess, (_, data) => data)
);
export function dataReducer(state: DataState | undefined, action: Action) {
return _dataReducer(state, action);
}

View File

@ -0,0 +1,18 @@
import { Action, createReducer, on } from '@ngrx/store';
import { Discussion as DiscussionState } from '../_interfaces/discussion';
import { discussionSuccess } from '../actions/discussion.actions';
import { PredictedPost } from '../_interfaces/predictedposts';
export const initialState: PredictedPost[] = [];
const _discussionReducer = createReducer(
initialState,
on(discussionSuccess, (state, { payload }) => payload)
);
export function discussionReducer(
state: PredictedPost[] | undefined,
action: Action
) {
return _discussionReducer(state, action);
}

View File

@ -1,26 +1,18 @@
import { Action, createReducer, on } from '@ngrx/store';
import * as Actions from '../actions/front-page.actions';
export interface State {
export interface FileState {
file: File;
fileName: string;
isFileFetched: boolean;
}
export interface DataState {
data: any;
}
export const initialState: State = {
export const initialState: FileState = {
file: {} as File,
fileName: '',
isFileFetched: false,
};
export const initialDataState: DataState = {
data: '',
};
const _fileReducer = createReducer(
initialState,
on(Actions.fetchFile, (_, { file }) => ({
@ -30,17 +22,6 @@ const _fileReducer = createReducer(
}))
);
const _dataReducer = createReducer(
initialDataState,
on(Actions.sendFileSuccess, (_, { data }) => {
return { data: data };
})
);
export function fileReducer(state: State | undefined, action: Action) {
export function fileReducer(state: FileState | undefined, action: Action) {
return _fileReducer(state, action);
}
export function dataReducer(state: DataState | undefined, action: Action) {
return _dataReducer(state, action);
}

View File

@ -1,11 +1,16 @@
import { ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store';
import { environment } from '../../environments/environment';
import {
fileReducer,
State as FileState,
DataState,
dataReducer,
} from './front-page.reducers';
ActionReducer,
ActionReducerMap,
MetaReducer,
createFeatureSelector,
createReducer,
} from '@ngrx/store';
import { environment } from '../../environments/environment';
import { fileReducer, FileState } from './front-page.reducers';
import { dataReducer, DataState } from './data.reducers';
import * as fromRouter from '@ngrx/router-store';
import { PredictedPost } from '../_interfaces/predictedposts';
import { discussionReducer } from './discussion.reducers';
export function debug(reducer: ActionReducer<any>): ActionReducer<any> {
return function (state, action) {
@ -18,14 +23,25 @@ export function debug(reducer: ActionReducer<any>): ActionReducer<any> {
export interface State {
fileState: FileState;
data: DataState;
dataState: DataState;
router: fromRouter.RouterReducerState<any>;
currentDiscussion: PredictedPost[];
}
export const reducers: ActionReducerMap<State> = {
fileState: fileReducer,
data: dataReducer,
dataState: dataReducer,
router: fromRouter.routerReducer,
currentDiscussion: discussionReducer,
};
export const metaReducers: MetaReducer<State>[] = !environment.production
? [debug]
: [];
export const selectRouter = createFeatureSelector<
State,
fromRouter.RouterReducerState<any>
>('router');
export const { selectRouteParam } = fromRouter.getSelectors(selectRouter);

View File

@ -0,0 +1,18 @@
import { createSelector, createFeatureSelector } from '@ngrx/store';
import { DataState } from '../reducers/data.reducers';
import { State as AppState } from '../reducers/index';
import { CustomForumData } from '../_interfaces/customforumdata';
export const selectFeature = createFeatureSelector<AppState, DataState>(
'dataState'
);
export const selectData = createSelector(
selectFeature,
(state: DataState) => state.data
);
export const selectDiscussions = createSelector(
selectFeature,
(state: DataState) => state.data.discussions
);

View File

@ -1,6 +1,6 @@
import { createSelector, createFeatureSelector } from '@ngrx/store';
import { State as AppState } from '../reducers/index';
import { State as FileState } from '../reducers/front-page.reducers';
import { FileState } from '../reducers/front-page.reducers';
export const selectFeature = createFeatureSelector<AppState, FileState>(
'fileState'