-
Notifications
You must be signed in to change notification settings - Fork 265
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
Remove Go to Console
link from root organization actions and show a URL instead
#7490
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
86c42da
Support CSS flex mode instead of Grid for better responsiveness
brionmario 7caf9b7
Revamp the `Go to Console` behaviour
brionmario 2c831ff
🦋 Add changeset
brionmario c6d36fa
Rename `flex` prop
brionmario 17f22a5
Render `DangerZoneGroup` conditionally
brionmario 6e45b8f
Fix typo
brionmario 91f48a3
Link TODO issues for `Mui-readOnly` styling
brionmario File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@wso2is/admin.tenants.v1": patch | ||
"@wso2is/react-components": patch | ||
"@wso2is/i18n": patch | ||
--- | ||
|
||
Remove `Go to Console` link from root organization actions and show a URL instead | ||
|
||
**Reason**: There are issues in having a `Go to Console` link and we can't properly workaround this without first resolving https://github.com/wso2/product-is/issues/22615 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { AppState } from "@wso2is/admin.core.v1/store"; | ||
import { useSelector } from "react-redux"; | ||
import { Tenant } from "../models/tenants"; | ||
|
||
/** | ||
* Hook to generate the console URL for a given tenant. | ||
* | ||
* This hook generates the console URL for a specified tenant by replacing the | ||
* tenant domain in the client host URL. It uses the `clientHost` value from | ||
* the Redux store and replaces the existing tenant domain with the provided | ||
* tenant's domain. | ||
* | ||
* @param tenant - The tenant object containing the domain to be used in the URL. | ||
* @returns The console URL for the specified tenant, or `undefined` if the tenant domain is not provided. | ||
* | ||
* @example | ||
* ```tsx | ||
* const tenant: Tenant = { domain: "example.com" }; | ||
* const consoleURL = useTenantConsoleURL(tenant); | ||
* console.log(consoleURL); // Outputs the console URL for the specified tenant | ||
* ``` | ||
*/ | ||
const useTenantConsoleURL = (tenant: Tenant): string | undefined => { | ||
const clientHost: string = useSelector((state: AppState) => state.config?.deployment?.clientHost); | ||
const tenantPrefix: string = useSelector((state: AppState) => state.config?.deployment?.tenantPrefix); | ||
|
||
if (!tenant?.domain) { | ||
return undefined; | ||
} | ||
|
||
return clientHost.replace(new RegExp(`/${tenantPrefix}/[^/]+/`), `/${tenantPrefix}/${tenant.domain}/`); | ||
}; | ||
|
||
export default useTenantConsoleURL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
shall we use a SCSS variable for the color?
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.
This is a temporarily thing that needs to be fixed with Oxygen UI.
We should not encourage to re-use a variable. So, lets link and issue here instead.