Closed eliykat closed 2 years ago
We should look into changing vault from depending on organizations to having organizations depend on vault at a later stage. This could allow us to lazy load the organizations module if we find the need. (As vault would always need to be loaded)
I'm not of the opinion that there is a place for an OrganizationModule
(except maybe just for routing). Modules typically align with features, and an Organization
is more of a data model that constrains a feature. I'm concerned that going down this path will lead to another slight mess like the current component structure where two pages can look almost identical and do the same things but not be near each other in the application structure or easily share properly scoped dependancies.
Not imposing here, but I would like to weigh the pros and cons of creating top level modules for everything currently being declared by the OrganizationsModule
. I think they universally make sense as Domain Modules or Routed Modules, and if we are going to move them out of LooseComponentsModule
it should be to dedicated top level modules. This allows for more... modularity π€‘
@addisonbeck That's good feedback, so you're thinking of something like this?
OssRoutingModule
ββ OrganizationRoutingModule <- routing only
ββ ManageModule <- domain/routed modules per the current folder structure
ββ PoliciesModule
ββ ServicesModule
ββ SettingsModule
ββ ToolsModule
ββ ...etc
Do you see these being moved under src/app/modules
according to functionality, like you did for the VaultModule
? I can see that you had a restructure in mind there, but I'm not sure how it fits in with what we do currently.
@Hinton I don't follow you, the changes in this PR do have the OrganizationsModule
lazy loaded (it's not imported anywhere else than in OssRoutingModule
). Except for the OrganizationVaultModule
, but that doesn't reference OrganizationsModule
.
so you're thinking of something like this?
More or less. I have a few other ideas that I think might help us isolate functionality better. I'm making a branch off of this and will try and get something concrete and functional written to share for discussion.
Update 05/26/22: there is a sentiment developing that we need to fix this sooner than later, and I haven't been able to give it enough time. It's okay with me if we move forward with this as is or with the tree structure mentioned above.
Update: after some further discussions, I'm going to adopt the structure in my comment above and I'll put this back up for review.
Closing as I will reopen in the clients
repo.
Type of change
Objective
Start to tidy up
LooseComponentsModule
by creating a separateOrganizationsModule
. Plus related refactors.We should probably hold off merging this during feature (maybe even regression) testing, so that we don't diverge too much from bugs we're fixing in
rc
. But any feedback on that question is welcome.Code changes
Main changes for
OrganizationsModule
:Org
prefixes in import statementsorganization
prefixes in some component namesSharedModule
import, it's not used in this module or re-exported, so it doesn't need to be here.OrganizationsModule
and other modules. This is likely temporary and can be cleaned up as we continue to refactor the structure of this app.src/app/organizations/vault/*
to this folder and to this module, because this is where these components are used.Changes related to
ProvidersModule
:OssModule
, which is unnecessary. Instead, just importSharedModule
and the newly createdLayoutsModule
for the components it actually needs.LayoutModule
.I suspect we're still exporting & importing too many things around the place, but I'll leave it here for now.
Screenshots
Before you submit
npm run lint
) (required)