New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate existing organizations state from StateService
→ StateProvider
#7895
Conversation
3d7c188
to
e848699
Compare
No New Or Fixed Issues Found |
e848699
to
f08a24e
Compare
3de2b40
to
b7d5776
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the desire for smaller PR's but I don't like that this will cause there to be 2 places the data is saved. The migration will delete it from the state service location but then if someone uses the application it will get saved there again. To finish this off you'd need another migration just deleting the data.
@justindbaur that makes sense. It is important to me to make incremental steps here for several reasons. Is there any good way for me to "queue" up a migration so that the migration can be written and tested without being implemented yet? I had thought of just removing it from the migration list & renaming the file without a number. Then applying the migration would just involve numbering the migration and adding it to the list. The still seems a little complicated though, so I'm wondering if you've got any better ideas? |
@addisonbeck There is no way to queue up a migration, moving the backing location of your data is kind of an all or nothing move. If you're trying to keep things small you can delete some of the type assertions in here: https://github.com/bitwarden/clients/pull/7895/files#diff-397e257f75aaf8565e7025b97bbf6d6c0830fb174aceaa38522097a74422f2dcR54-R103 If the properties aren't referenced in the migration code they don't really contribute, what's is most important are the types for the account object shape leading up to your data. Then your data can be represented with an Then, if you use the same observable names that the state service ones use you can switch over their backing data right now. Then you can have another 1 or 2 PR's that rename those observables to the new name if you want and one for deleting the state service methods and account property. With those changes I think this PR would actually be slightly smaller. |
Renaming the exposed methods & observables separately is a good idea. I'll go that route, thanks! |
b7d5776
to
8ba99c6
Compare
@justindbaur @eliykat This ended up getting bigger since many of |
d7d26e8
to
2df3c1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall!
apps/browser/src/admin-console/background/service-factories/organization-service.factory.ts
Outdated
Show resolved
Hide resolved
.../app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts
Outdated
Show resolved
Hide resolved
apps/web/src/app/admin-console/organizations/members/people.component.ts
Outdated
Show resolved
Hide resolved
apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/abstractions/organization/organization.service.abstraction.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/organization/organization.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/organization/organization.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/organization/organization.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/organization/organization.service.ts
Outdated
Show resolved
Hide resolved
libs/common/src/admin-console/services/organization/organization.service.ts
Outdated
Show resolved
Hide resolved
d1ce9f8
e6fb4f9
to
d2f9644
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SM files look good
Type of change
Objective
This PR migrates
OrganizationService
over toStateProvider
.Before you submit
References
AC-2009
: Transition OrganizationService to use StateProvider