[EC-377] Transition Policy service into providing observables
Type of change
- [ ] Bug fix
- [ ] New feature development
- [X] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
Objective
Update Policies Service to provide observable list to get/set data and add unit tests for all methods.
Code changes
- libs/common/spec/services/policy.service.spec.ts: Added unit tests for all methods in Policy service.
- libs/common/src/abstractions/policy/policy.service.abstraction.ts: Added policies observable collection and removed userId parameter from getAll method
- libs/common/src/abstractions/state.service.ts: Deprecated methods to set/get Policies
- libs/common/src/services/policy/policy.service.ts: Added Observable policies collection
- libs/common/src/services/state.service.ts: Deleted deprecated methods getDecryptedPolicies and setDecryptedPolicies
- libs/common/src/services/vaultTimeout.service.ts: Updated parameters sent to policyService.getAll
Before you submit
- [X] I have checked for **linting** errors (`npm run lint`) (required)
- [X] I have added **unit tests** where it makes sense to do so (encouraged but not required)
- [ ] This change requires a **documentation update** (notify the documentation team)
- [ ] This change has particular **deployment requirements** (notify the DevOps team)
I've changed the Policy Service to return the Policies as an Observable collection and I've updated a few methods to also return Observable data. I wasn't able to refactor everything to return an Observable because on some cases (classes that aren’t angular decorated) I can’t get around to getting the latest value from an Observable.
@r-tome Awesome, work on this 👍
@MGibson1 are you ok with this being merged? It's gone through QA and passed all tests. I can't merge it because you still have a change request.