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
No way to delete a tenant site if tenant has only one site #2250
Comments
Here is my work around -
Modified code -
The "NavigationManager.NavigateTo(NavigationManager.BaseUri, true);" is just my guess at a navigation that works. If this was left at "NavigationManager.NavigateTo(NavigateUrl("admin/sites"));" it would cause an error in SiteRouter. Could this be due to navigating to a site that was just deleted? With these changes the issue #2249 seems not to be a problem. |
The logic for validating if there is more than 1 site is intended to prevent a host user from removing all sites from an installation - as there needs to be at least 1 site in the installation to enable the framework to function properly (ie. this validation is to prevent a host user from accidentally "shooting themself in the foot"). However, as you identified above, the logic is not correct as instead of checking if there is more than 1 site in the entire installation, it is checking if there is more than 1 site in the current tenant (an installation can have many tenants). The proper fix is actually a bit different than what you suggested... it should utilize the Alias service as an Alias is the cross reference between tenants and sites. |
@sbwalker I tried it with the latest changes and now, when repeating the steps I define above, it says "Error Deleting Site". Looks like the GetAliasesAsync in AliasService.cs need to be changed to something like this
Not sure if that is the right way to get the master tenant url. Should the Alias service always use the master tenant url since it looks like Alias table is only in the host DB? |
@dkoeder the problem was with the redirect logic - it has been resolved in #2260. Oqtane's multi-tenant capability relies on Aliases to determine the appropriate mapping for the Urls in API/UI requests... so this means that when an Alias is deleted, all requests that are still utilizing that Alias will fail. As a result it is necessary to redirect the client to another valid Alias as soon as the current alias is deleted. One other concept which is not entirely obvious is that the "Master Tenant" has nothing to do with Sites or Aliases... a "tenant" in Oqtane simply refers to a database. The "Master Tenant" is the database where the global information related to Tenants, Aliases, Jobs, etc... is stored. The "Master Tenant" may contain Sites as well - however it is possible to remove all Sites from the Master Tenant and still have a functional installation - in this scenario all of your Sites would be in other Tenants (databases). |
Oqtane: current dev branch
Database: LocalDB
Hosting Model - Runtime: Blazor WebAssembly
Hosting Model – Prerender?: Yes
Oqtane.Client\Modules\Admin\Site\Index.razor
The text was updated successfully, but these errors were encountered: