forked from wso2/identity-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request wso2#5052 from brionmario/feat-org-sso-login
Enable Sub Org admins to login to Console
- Loading branch information
Showing
21 changed files
with
566 additions
and
190 deletions.
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,15 @@ | ||
--- | ||
"@wso2is/react-components": patch | ||
"@wso2is/access-control": patch | ||
"@wso2is/dynamic-forms": patch | ||
"@wso2is/identity-apps-core": patch | ||
"@wso2is/myaccount": patch | ||
"@wso2is/common": patch | ||
"@wso2is/theme": patch | ||
"@wso2is/console": patch | ||
"@wso2is/core": patch | ||
"@wso2is/form": patch | ||
"@wso2is/i18n": patch | ||
--- | ||
|
||
Enable sub org logins for Console |
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
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
55 changes: 55 additions & 0 deletions
55
apps/console/src/features/core/context/app-settings-context.tsx
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,55 @@ | ||
/** | ||
* Copyright (c) 2023, 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 { Context, createContext } from "react"; | ||
|
||
/** | ||
* Props interface of {@link AppSettingsContext} | ||
*/ | ||
export interface AppSettingsContextProps { | ||
/** | ||
* Get the local storage setting value. | ||
* @param key - Key of the setting. | ||
* @returns Value of the setting. | ||
*/ | ||
getLocalStorageSetting: (key: string) => string; | ||
/** | ||
* Remove a value from the local storage. | ||
* @param key - Key of the setting. | ||
*/ | ||
removeLocalStorageSetting: (key: string) => void; | ||
/** | ||
* Get the local storage setting value. | ||
* @param key - Key of the setting. | ||
* @param value - Value of the setting. | ||
*/ | ||
setLocalStorageSetting: (key: string, value: string) => void; | ||
} | ||
|
||
/** | ||
* Context object for managing the Application local settings. | ||
*/ | ||
const AppSettingsContext: Context<AppSettingsContextProps> = | ||
createContext<null | AppSettingsContextProps>(null); | ||
|
||
/** | ||
* Display name for the AppSettingsContext. | ||
*/ | ||
AppSettingsContext.displayName = "AppSettingsContext"; | ||
|
||
export default AppSettingsContext; |
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,41 @@ | ||
/** | ||
* Copyright (c) 2023, 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 { useContext } from "react"; | ||
import AppSettingsContext, { AppSettingsContextProps } from "../context/app-settings-context"; | ||
|
||
/** | ||
* Props interface of {@link UseAppSettings} | ||
*/ | ||
export type UseAppSettingsInterface = AppSettingsContextProps; | ||
|
||
/** | ||
* Hook that provides access to the local App settings context. | ||
* @returns An object containing the context values of {@link AppSettingsContext}. | ||
*/ | ||
const useAppSettings = (): UseAppSettingsInterface => { | ||
const context: AppSettingsContextProps = useContext(AppSettingsContext); | ||
|
||
if (context === undefined) { | ||
throw new Error("useAppSettings must be used within a AppSettingsProvider"); | ||
} | ||
|
||
return context; | ||
}; | ||
|
||
export default useAppSettings; |
Oops, something went wrong.